@xyo-network/module-model 2.64.4 → 2.64.6

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.
package/dist/cjs/index.js CHANGED
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./Config"), exports);
5
5
  tslib_1.__exportStar(require("./CreatableModule"), exports);
6
6
  tslib_1.__exportStar(require("./Error"), exports);
7
+ tslib_1.__exportStar(require("./isModule"), exports);
7
8
  tslib_1.__exportStar(require("./Module"), exports);
8
9
  tslib_1.__exportStar(require("./ModuleDescription"), exports);
9
10
  tslib_1.__exportStar(require("./ModuleFilter"), exports);
@@ -12,4 +13,5 @@ tslib_1.__exportStar(require("./ModuleQueryResult"), exports);
12
13
  tslib_1.__exportStar(require("./ModuleRepository"), exports);
13
14
  tslib_1.__exportStar(require("./Queries"), exports);
14
15
  tslib_1.__exportStar(require("./Query"), exports);
16
+ tslib_1.__exportStar(require("./withModule"), exports);
15
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,4DAAiC;AACjC,kDAAuB;AACvB,mDAAwB;AACxB,8DAAmC;AACnC,yDAA8B;AAC9B,yDAA8B;AAC9B,8DAAmC;AACnC,6DAAkC;AAClC,oDAAyB;AACzB,kDAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,4DAAiC;AACjC,kDAAuB;AACvB,qDAA0B;AAC1B,mDAAwB;AACxB,8DAAmC;AACnC,yDAA8B;AAC9B,yDAA8B;AAC9B,8DAAmC;AACnC,6DAAkC;AAClC,oDAAyB;AACzB,kDAAuB;AACvB,uDAA4B"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isModule = exports.IsModuleFactory = void 0;
4
+ exports.IsModuleFactory = {
5
+ create: (baseCheck, expectedFunctions,
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ additionalCheck) => {
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ return (module) => {
10
+ var _a, _b;
11
+ return (((baseCheck === null || baseCheck === void 0 ? void 0 : baseCheck(module)) || true) &&
12
+ ((_a = additionalCheck === null || additionalCheck === void 0 ? void 0 : additionalCheck(module)) !== null && _a !== void 0 ? _a : true) &&
13
+ ((_b = expectedFunctions === null || expectedFunctions === void 0 ? void 0 : expectedFunctions.reduce((prev, value) => prev && typeof module[value] === 'function', true)) !== null && _b !== void 0 ? _b : true));
14
+ };
15
+ },
16
+ };
17
+ exports.isModule = exports.IsModuleFactory.create(undefined, ['query'], (module) => typeof module.config === 'object');
18
+ //# sourceMappingURL=isModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isModule.js","sourceRoot":"","sources":["../../src/isModule.ts"],"names":[],"mappings":";;;AAKa,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,CACN,SAA2B,EAC3B,iBAA4B;IAC5B,8DAA8D;IAC9D,eAA0C,EACtB,EAAE;QACtB,8DAA8D;QAC9D,OAAO,CAAC,MAAW,EAAe,EAAE;;YAClC,OAAO,CACL,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,MAAM,CAAC,KAAI,IAAI,CAAC;gBAC7B,CAAC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,MAAM,CAAC,mCAAI,IAAI,CAAC;gBACnC,CAAC,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,UAAU,EAAE,IAAI,CAAC,mCAAI,IAAI,CAAC,CACxG,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAA;AAEY,QAAA,QAAQ,GAA4B,uBAAe,CAAC,MAAM,CAAS,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withModule = exports.WithModuleFactory = void 0;
4
+ const isModule_1 = require("./isModule");
5
+ exports.WithModuleFactory = {
6
+ create: (typeCheck) => {
7
+ return (
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ module,
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ closure) => {
12
+ return typeCheck(module) ? closure(module) : undefined;
13
+ };
14
+ },
15
+ };
16
+ exports.withModule = exports.WithModuleFactory.create(isModule_1.isModule);
17
+ //# sourceMappingURL=withModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withModule.js","sourceRoot":"","sources":["../../src/withModule.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AAGzC,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,CAA4B,SAA6B,EAAE,EAAE;QACnE,OAAO;QACL,8DAA8D;QAC9D,MAAW;QACX,8DAA8D;QAC9D,OAA2B,EACZ,EAAE;YACjB,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxD,CAAC,CAAA;IACH,CAAC;CACF,CAAA;AAEY,QAAA,UAAU,GAAG,yBAAiB,CAAC,MAAM,CAAC,mBAAQ,CAAC,CAAA"}