@furo/open-models 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,13 @@ import { FieldNode } from './FieldNode.js';
6
6
  export declare class Registry {
7
7
  static register(type: string, clazz: any): void;
8
8
  private static get;
9
+ /**
10
+ * Checks whether a given type is registered.
11
+ *
12
+ * @param {string} type - The name of the type to check for registration.
13
+ * @returns {boolean} `true` if the specified type is registered; otherwise, `false`.
14
+ */
15
+ static isRegistered(type: string): boolean;
9
16
  /**
10
17
  * Internal method to create instances for Any
11
18
  * @param typename
package/dist/Registry.js CHANGED
@@ -12,6 +12,15 @@ export class Registry {
12
12
  }
13
13
  throw new Error(`Cannot find type ${typename}, ${typename} is not in the registry`);
14
14
  }
15
+ /**
16
+ * Checks whether a given type is registered.
17
+ *
18
+ * @param {string} type - The name of the type to check for registration.
19
+ * @returns {boolean} `true` if the specified type is registered; otherwise, `false`.
20
+ */
21
+ static isRegistered(type) {
22
+ return registry.has(type);
23
+ }
15
24
  /**
16
25
  * Internal method to create instances for Any
17
26
  * @param typename
@@ -1 +1 @@
1
- {"version":3,"file":"Registry.js","sourceRoot":"","sources":["../src/Registry.ts"],"names":[],"mappings":"AAMA,MAAM,QAAQ,GAA2B,IAAI,GAAG,EAAqB,CAAC;AAEtE,MAAM,OAAO,QAAQ;IACnB,8DAA8D;IAC9D,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,KAAU;QACtC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,GAAG,CAChB,QAAgB;QAMhB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,8DAA8D;YAC9D,OAAO,KAAY,CAAC;QACtB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oBAAoB,QAAQ,KAAK,QAAQ,yBAAyB,CACnE,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,wBAAwB,CAC7B,QAAgB;IAChB,8DAA8D;IAC9D,QAAc,EACd,MAAkB,EAClB,aAAsB;QAEtB,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,OAAO,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/**\n * notes:\n * primitives are also registered\n */\nimport { FieldNode } from './FieldNode';\n\nconst registry: Map<string, FieldNode> = new Map<string, FieldNode>();\n\nexport class Registry {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static register(type: string, clazz: any) {\n registry.set(type, clazz);\n }\n\n private static get(\n typename: string,\n ): new (\n initData?: object,\n parent?: FieldNode | undefined,\n attributeName?: string | undefined,\n ) => FieldNode {\n const clazz = registry.get(typename);\n if (clazz !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n }\n throw new Error(\n `Cannot find type ${typename}, ${typename} is not in the registry`,\n );\n }\n\n /**\n * Internal method to create instances for Any\n * @param typename\n * @param initData\n * @param parent\n * @param attributeName\n */\n static createInstanceByTypeName(\n typename: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initData?: any,\n parent?: FieldNode,\n attributeName?: string,\n ): FieldNode {\n const ConstructorName = Registry.get(typename);\n return new ConstructorName(initData, parent, attributeName);\n }\n}\n"]}
1
+ {"version":3,"file":"Registry.js","sourceRoot":"","sources":["../src/Registry.ts"],"names":[],"mappings":"AAMA,MAAM,QAAQ,GAA2B,IAAI,GAAG,EAAqB,CAAC;AAEtE,MAAM,OAAO,QAAQ;IACnB,8DAA8D;IAC9D,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,KAAU;QACtC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,GAAG,CAChB,QAAgB;QAMhB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,8DAA8D;YAC9D,OAAO,KAAY,CAAC;QACtB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oBAAoB,QAAQ,KAAK,QAAQ,yBAAyB,CACnE,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,YAAY,CAAC,IAAW;QACpC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,wBAAwB,CAC7B,QAAgB;IAChB,8DAA8D;IAC9D,QAAc,EACd,MAAkB,EAClB,aAAsB;QAEtB,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,OAAO,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/**\n * notes:\n * primitives are also registered\n */\nimport { FieldNode } from './FieldNode';\n\nconst registry: Map<string, FieldNode> = new Map<string, FieldNode>();\n\nexport class Registry {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static register(type: string, clazz: any) {\n registry.set(type, clazz);\n }\n\n private static get(\n typename: string,\n ): new (\n initData?: object,\n parent?: FieldNode | undefined,\n attributeName?: string | undefined,\n ) => FieldNode {\n const clazz = registry.get(typename);\n if (clazz !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n }\n throw new Error(\n `Cannot find type ${typename}, ${typename} is not in the registry`,\n );\n }\n\n /**\n * Checks whether a given type is registered.\n *\n * @param {string} type - The name of the type to check for registration.\n * @returns {boolean} `true` if the specified type is registered; otherwise, `false`.\n */\n public static isRegistered(type:string): boolean {\n return registry.has(type);\n }\n\n /**\n * Internal method to create instances for Any\n * @param typename\n * @param initData\n * @param parent\n * @param attributeName\n */\n static createInstanceByTypeName(\n typename: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initData?: any,\n parent?: FieldNode,\n attributeName?: string,\n ): FieldNode {\n const ConstructorName = Registry.get(typename);\n return new ConstructorName(initData, parent, attributeName);\n }\n}\n"]}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "url": "git+ssh://git@github.com/eclipse/eclipsefuro-web.git"
9
9
  },
10
10
  "author": "eclipse furo",
11
- "version": "1.13.0",
11
+ "version": "1.14.0",
12
12
  "type": "module",
13
13
  "main": "dist/index.js",
14
14
  "module": "dist/index.js",