diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-03-04 18:10:10 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-01 07:06:05 -0300 |
commit | ed480d6b4dc489fa26f673d820f7f8bdd999c828 (patch) | |
tree | bf4449e288f59fba32dac3ba126a16dc5ce74061 /src/data/thing.js | |
parent | 262673f149f2b4ae8bc87d0e4fc507b7335609f4 (diff) |
validators: optimize validateWikiData, support no-referenceType
Diffstat (limited to 'src/data/thing.js')
-rw-r--r-- | src/data/thing.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data/thing.js b/src/data/thing.js index 706e893d..9a8cec91 100644 --- a/src/data/thing.js +++ b/src/data/thing.js @@ -17,6 +17,22 @@ export default class Thing extends CacheableObject { static yamlDocumentSpec = Symbol.for('Thing.yamlDocumentSpec'); static getYamlLoadingSpec = Symbol.for('Thing.getYamlLoadingSpec'); + static isThingConstructor = Symbol.for('Thing.isThingConstructor'); + static isThing = Symbol.for('Thing.isThing'); + + // To detect: + // Symbol.for('Thing.isThingConstructor') in constructor + static [Symbol.for('Thing.isThingConstructor')] = NaN; + + static [CacheableObject.propertyDescriptors] = { + // To detect: + // Object.hasOwn(object, Symbol.for('Thing.isThing')) + [Symbol.for('Thing.isThing')]: { + flags: {expose: true}, + expose: {compute: () => NaN}, + }, + }; + // Default custom inspect function, which may be overridden by Thing // subclasses. This will be used when displaying aggregate errors and other // command-line logging - it's the place to provide information useful in |