@layerzerolabs/dependency-graph
Advanced tools
+6
-6
| { | ||
| "name": "@layerzerolabs/dependency-graph", | ||
| "version": "0.2.90", | ||
| "version": "0.2.91", | ||
| "private": false, | ||
@@ -9,7 +9,6 @@ "license": "MIT", | ||
| "types": "./dist/index.d.ts", | ||
| "require": "./dist/index.cjs", | ||
| "import": "./dist/index.js", | ||
| "default": "./dist/index.cjs" | ||
| "default": "./dist/index.js" | ||
| }, | ||
| "main": "./dist/index.cjs", | ||
| "main": "./dist/index.js", | ||
| "module": "./dist/index.js", | ||
@@ -22,4 +21,4 @@ "types": "./dist/index.d.ts", | ||
| "tsup": "^8.4.0", | ||
| "@layerzerolabs/tsup-configuration": "0.2.90", | ||
| "@layerzerolabs/typescript-configuration": "0.2.90" | ||
| "@layerzerolabs/tsup-configuration": "0.2.91", | ||
| "@layerzerolabs/typescript-configuration": "0.2.91" | ||
| }, | ||
@@ -32,2 +31,3 @@ "publishConfig": { | ||
| "targets": [ | ||
| "console-pen-test", | ||
| "onesig-client" | ||
@@ -34,0 +34,0 @@ ] |
| 'use strict'; | ||
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| // src/dependencyNode.ts | ||
| var DependencyNode = class { | ||
| static { | ||
| __name(this, "DependencyNode"); | ||
| } | ||
| name; | ||
| dependencies; | ||
| constructor({ name, dependencies = {} }) { | ||
| this.name = name; | ||
| this.dependencies = dependencies; | ||
| } | ||
| }; | ||
| var withDependencies = /* @__PURE__ */ __name((node, extraDeps) => { | ||
| const mergedDeps = { | ||
| ...node.dependencies, | ||
| ...Object.fromEntries(extraDeps.map((dep, i) => [ | ||
| `__extra${i}`, | ||
| dep | ||
| ])) | ||
| }; | ||
| const descriptors = Object.getOwnPropertyDescriptors(node); | ||
| descriptors.dependencies = { | ||
| ...descriptors.dependencies, | ||
| value: mergedDeps | ||
| }; | ||
| return Object.create(Object.getPrototypeOf(node), descriptors); | ||
| }, "withDependencies"); | ||
| exports.DependencyNode = DependencyNode; | ||
| exports.withDependencies = withDependencies; | ||
| //# sourceMappingURL=4LBVNANM.cjs.map | ||
| //# sourceMappingURL=4LBVNANM.cjs.map |
| {"version":3,"sources":["../src/dependencyNode.ts"],"names":["DependencyNode","name","dependencies","withDependencies","node","extraDeps","mergedDeps","Object","fromEntries","map","dep","i","descriptors","getOwnPropertyDescriptors","value","create","getPrototypeOf"],"mappings":";;;;;;AAUO,IAAeA,iBAAf,MAAeA;EAVtB;;;AAcoBC,EAAAA,IAAAA;AACAC,EAAAA,YAAAA;AAChB,EAAA,WAAA,CAAY,EACRD,IAAAA,EACAC,YAAAA,GAAe,IAAmB,EAInC;AACC,IAAA,IAAA,CAAKD,IAAAA,GAAOA,IAAAA;AACZ,IAAA,IAAA,CAAKC,YAAAA,GAAeA,YAAAA;AACxB,EAAA;AACJ;AAQO,IAAMC,gBAAAA,mBAAmB,MAAA,CAAA,CAI5BC,IAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,UAAAA,GAAa;AACf,IAAA,GAAGF,IAAAA,CAAKF,YAAAA;AACR,IAAA,GAAGK,OAAOC,WAAAA,CAAYH,SAAAA,CAAUI,GAAAA,CAAI,CAACC,KAAKC,CAAAA,KAAM;AAAC,MAAA,CAAA,OAAA,EAAUA,CAAAA,CAAAA,CAAAA;AAAKD,MAAAA;KAAI,CAAA;AACxE,GAAA;AACA,EAAA,MAAME,WAAAA,GAAqCL,MAAAA,CAAOM,yBAAAA,CAA0BT,IAAAA,CAAAA;AAC5EQ,EAAAA,WAAAA,CAAYV,YAAAA,GAAe;AAAE,IAAA,GAAGU,WAAAA,CAAYV,YAAAA;IAAcY,KAAAA,EAAOR;AAAW,GAAA;AAC5E,EAAA,OAAOC,OAAOQ,MAAAA,CAAOR,MAAAA,CAAOS,cAAAA,CAAeZ,IAAAA,GAAOQ,WAAAA,CAAAA;AACtD,CAAA,EAdgC,kBAAA","file":"4LBVNANM.cjs","sourcesContent":["/**\n * <!-- anchor:DependencyNode -->\n * Dependency nodes are abstract nodes in the dependency graph. They're used to build the graph,\n * but as an abstract class, lacks the required information to actually be resolved to anything.\n * If you want to implement a new dependency node, see ObjectDefinition or FactoryDefinition\n * @param name the name of this node. It should be unique across the entire graph.\n * @param dependencies a map of other nodes that this node depends on. These children will be resolved first.\n * The key of the dependencies map should be some arbitrary name within the context of *this* node. It does\n * not have to be unique.\n */\nexport abstract class DependencyNode<\n Name extends string = string,\n _Dependencies extends Dependencies = Dependencies,\n> {\n public readonly name: Name;\n public readonly dependencies: _Dependencies;\n constructor({\n name,\n dependencies = {} as _Dependencies,\n }: {\n name: Name;\n dependencies?: _Dependencies;\n }) {\n this.name = name;\n this.dependencies = dependencies;\n }\n}\n\nexport type Dependencies = { [key: string]: DependencyNode<any, any> };\n\ntype IndexedDeps<Extra extends readonly DependencyNode[]> = {\n [K in keyof Extra as K extends `${number}` ? `__extra${K}` : never]: Extra[K];\n};\n\nexport const withDependencies = <\n N extends DependencyNode,\n const Extra extends readonly DependencyNode[],\n>(\n node: N,\n extraDeps: Extra,\n): N & { dependencies: N['dependencies'] & IndexedDeps<Extra> } => {\n const mergedDeps = {\n ...node.dependencies,\n ...Object.fromEntries(extraDeps.map((dep, i) => [`__extra${i}`, dep])),\n };\n const descriptors: PropertyDescriptorMap = Object.getOwnPropertyDescriptors(node);\n descriptors.dependencies = { ...descriptors.dependencies, value: mergedDeps };\n return Object.create(Object.getPrototypeOf(node), descriptors);\n};\n"]} |
| 'use strict'; | ||
| var _4LBVNANM_cjs = require('./4LBVNANM.cjs'); | ||
| Object.defineProperty(exports, "DependencyNode", { | ||
| enumerable: true, | ||
| get: function () { return _4LBVNANM_cjs.DependencyNode; } | ||
| }); | ||
| Object.defineProperty(exports, "withDependencies", { | ||
| enumerable: true, | ||
| get: function () { return _4LBVNANM_cjs.withDependencies; } | ||
| }); | ||
| //# sourceMappingURL=dependencyNode.cjs.map | ||
| //# sourceMappingURL=dependencyNode.cjs.map |
| {"version":3,"sources":[],"names":[],"mappings":"","file":"dependencyNode.cjs"} |
| 'use strict'; | ||
| var _4LBVNANM_cjs = require('./4LBVNANM.cjs'); | ||
| Object.defineProperty(exports, "DependencyNode", { | ||
| enumerable: true, | ||
| get: function () { return _4LBVNANM_cjs.DependencyNode; } | ||
| }); | ||
| Object.defineProperty(exports, "withDependencies", { | ||
| enumerable: true, | ||
| get: function () { return _4LBVNANM_cjs.withDependencies; } | ||
| }); | ||
| //# sourceMappingURL=index.cjs.map | ||
| //# sourceMappingURL=index.cjs.map |
| {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"} |
8893
-36.37%12
-33.33%64
-46.22%