mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 05:01:08 +01:00
REFACTOR: prettier format
This commit is contained in:
parent
d18141bb65
commit
4fbd2fb15c
3 changed files with 18 additions and 19 deletions
|
|
@ -1,3 +1,3 @@
|
||||||
export { default as FormulaField } from './formulaField.mjs';
|
export { default as FormulaField } from './formulaField.mjs';
|
||||||
export { default as ForeignDocumentUUIDField } from './foreignDocumentUUIDField.mjs';
|
export { default as ForeignDocumentUUIDField } from './foreignDocumentUUIDField.mjs';
|
||||||
export { default as ForeignDocumentUUIDArrayField } from "./foreignDocumentUUIDArrayField.mjs";
|
export { default as ForeignDocumentUUIDArrayField } from './foreignDocumentUUIDArrayField.mjs';
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
import ForeignDocumentUUIDField from "./foreignDocumentUUIDField.mjs";
|
import ForeignDocumentUUIDField from './foreignDocumentUUIDField.mjs';
|
||||||
/**
|
/**
|
||||||
* A subclass of {@link foundry.data.fields.ArrayField} that defines an array of foreign document UUID references.
|
* A subclass of {@link foundry.data.fields.ArrayField} that defines an array of foreign document UUID references.
|
||||||
*/
|
*/
|
||||||
export default class ForeignDocumentUUIDArrayField extends foundry.data.fields.ArrayField {
|
export default class ForeignDocumentUUIDArrayField extends foundry.data.fields.ArrayField {
|
||||||
/**
|
/**
|
||||||
* @param {foundry.data.types.DocumentUUIDFieldOptions} [fieldOption] - Options to configure each individual ForeignDocumentUUIDField.
|
* @param {foundry.data.types.DocumentUUIDFieldOptions} [fieldOption] - Options to configure each individual ForeignDocumentUUIDField.
|
||||||
* @param {foundry.data.types.ArrayFieldOptions} [options] - Options to configure the array behavior
|
* @param {foundry.data.types.ArrayFieldOptions} [options] - Options to configure the array behavior
|
||||||
* @param {foundry.data.types.DataFieldContext} [context] - Optional context for schema processing
|
* @param {foundry.data.types.DataFieldContext} [context] - Optional context for schema processing
|
||||||
*/
|
*/
|
||||||
constructor(fieldOption = {}, options = {}, context = {}) {
|
constructor(fieldOption = {}, options = {}, context = {}) {
|
||||||
super(new ForeignDocumentUUIDField(fieldOption), options, context);
|
super(new ForeignDocumentUUIDField(fieldOption), options, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
initialize(value, model, options = {}) {
|
initialize(value, model, options = {}) {
|
||||||
const v = super.initialize(value, model, options);
|
const v = super.initialize(value, model, options);
|
||||||
return () => v.map(entry => typeof entry === 'function' ? entry() : entry);
|
return () => v.map(entry => (typeof entry === 'function' ? entry() : entry));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export default class ForeignDocumentUUIDField extends foundry.data.fields.Docume
|
||||||
/**@override */
|
/**@override */
|
||||||
initialize(value, _model, _options = {}) {
|
initialize(value, _model, _options = {}) {
|
||||||
if (this.idOnly) return value;
|
if (this.idOnly) return value;
|
||||||
return (() => {
|
return () => {
|
||||||
try {
|
try {
|
||||||
const doc = fromUuidSync(value);
|
const doc = fromUuidSync(value);
|
||||||
return doc;
|
return doc;
|
||||||
|
|
@ -31,7 +31,7 @@ export default class ForeignDocumentUUIDField extends foundry.data.fields.Docume
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return value ?? null;
|
return value ?? null;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**@override */
|
/**@override */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue