* of the `TagSystem` associated with this constructor.
*
* ※ If the I·R·I is not recognized, this function returns
- * `null`.
+ * `undefined`.
*/
fromIRI(iri) {
const system = this.#system;
try {
// Attempt to resolve the identifier.
const instance = storage.get(identifier);
- return Tag.getSystem(instance) == system ? instance : null;
+ return Tag.getSystem(instance) == system
+ ? instance
+ : undefined;
} catch {
// Do not throw for bad identifiers.
- return null;
+ return undefined;
}
}
}
* ☡ This function throws if the identifier is invalid.
*
* ※ If the identifier is valid but not recognized, this
- * function returns `null`.
+ * function returns `undefined`.
*/
fromIdentifier(identifier) {
const system = this.#system;
const storage = this.#storage;
const instance = storage.get(identifier);
- return Tag.getSystem(instance) == system ? instance : null;
+ return Tag.getSystem(instance) == system
+ ? instance
+ : undefined;
}
/**
* match the tagging entity of this constructor’s `TagSystem`.
*
* ※ If the specific component of the Tag U·R·I is not
- * recognized, this function returns `null`.
+ * recognized, this function returns `undefined`.
*/
fromTagURI(tagURI) {
const system = this.#system;
try {
// Attempt to resolve the identifier.
const instance = storage.get(identifier);
- return Tag.getSystem(instance) == system ? instance : null;
+ return Tag.getSystem(instance) == system
+ ? instance
+ : undefined;
} catch {
// Do not throw for bad identifiers.
- return null;
+ return undefined;
}
}
}