@xyo-network/module-model 5.1.21 → 5.1.23

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.
@@ -18,9 +18,7 @@ export declare class ResolveHelper extends ResolveHelperStatic {
18
18
  static resolve<T extends ModuleInstance = ModuleInstance>(config: ResolveHelperConfig, all: '*', options?: ModuleFilterOptions<T>): Promise<T[]>;
19
19
  static resolve<T extends ModuleInstance = ModuleInstance>(config: ResolveHelperConfig, id: ModuleIdentifier, options?: ModuleFilterOptions<T>): Promise<T | undefined>;
20
20
  static resolveModuleIdentifier<T extends ModuleInstance = ModuleInstance>(resolver: ModuleResolver, path: ModuleIdentifier, required?: boolean): Promise<T | undefined>;
21
- static traceModuleIdentifier(resolver: ModuleResolver, path: ModuleIdentifier): Promise<import("@xylabs/typeof").Brand<import("@xylabs/hex").Hex, {
22
- readonly __address: true;
23
- }>[]>;
21
+ static traceModuleIdentifier(resolver: ModuleResolver, path: ModuleIdentifier): Promise<Address[]>;
24
22
  static transformModuleIdentifier(identifier: ModuleIdentifier, transformers?: ModuleIdentifierTransformer[]): Promise<ModuleIdentifier | undefined>;
25
23
  static validateRequiredResolve(required: boolean | 'warn' | 'log', result: ModuleInstance[] | ModuleInstance | undefined, id: ModuleIdentifier, logger?: Logger | undefined): void;
26
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ResolveHelper.d.ts","sourceRoot":"","sources":["../../../src/ResolveHelper/ResolveHelper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAO5C,OAAO,KAAK,EACV,mBAAmB,EAAE,cAAc,EAAE,cAAc,EACpD,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,m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mB,CAAC,CAAC,CAAC,GAC/B,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;WAiFZ,uBAAuB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,EAC5E,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,gBAAgB,EACtB,QAAQ,CAAC,EAAE,OAAO,GACjB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAazB,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB;IAI7E,MAAM,CAAC,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,EAAE,YAAY,GAAE,2BAA2B,EAA+B;IAIvI,MAAM,CAAC,uBAAuB,CAC5B,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,EAClC,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,GAAG,SAAS,EACrD,EAAE,EAAE,gBAAgB,EACpB,MAAM,qBAAqB;CAmB9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/module-model",
3
- "version": "5.1.21",
3
+ "version": "5.1.23",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,30 +30,33 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src"
33
+ "src",
34
+ "!**/*.bench.*",
35
+ "!**/*.spec.*",
36
+ "!**/*.test.*"
34
37
  ],
35
38
  "dependencies": {
36
- "@xylabs/assert": "~5.0.24",
37
- "@xylabs/creatable": "~5.0.24",
38
- "@xylabs/events": "~5.0.24",
39
- "@xylabs/exists": "~5.0.24",
40
- "@xylabs/hex": "~5.0.24",
41
- "@xylabs/logger": "~5.0.24",
42
- "@xylabs/object": "~5.0.24",
43
- "@xylabs/promise": "~5.0.24",
44
- "@xylabs/retry": "~5.0.24",
45
- "@xylabs/typeof": "~5.0.24",
46
- "@xyo-network/account-model": "~5.1.21",
47
- "@xyo-network/boundwitness-model": "~5.1.21",
48
- "@xyo-network/manifest-model": "~5.1.21",
49
- "@xyo-network/payload-model": "~5.1.21"
39
+ "@xylabs/assert": "~5.0.33",
40
+ "@xylabs/creatable": "~5.0.33",
41
+ "@xylabs/events": "~5.0.33",
42
+ "@xylabs/exists": "~5.0.33",
43
+ "@xylabs/hex": "~5.0.33",
44
+ "@xylabs/logger": "~5.0.33",
45
+ "@xylabs/object": "~5.0.33",
46
+ "@xylabs/promise": "~5.0.33",
47
+ "@xylabs/retry": "~5.0.33",
48
+ "@xylabs/typeof": "~5.0.33",
49
+ "@xyo-network/account-model": "~5.1.23",
50
+ "@xyo-network/boundwitness-model": "~5.1.23",
51
+ "@xyo-network/manifest-model": "~5.1.23",
52
+ "@xyo-network/payload-model": "~5.1.23"
50
53
  },
51
54
  "devDependencies": {
52
55
  "@xylabs/ts-scripts-yarn3": "~7.2.8",
53
56
  "@xylabs/tsconfig": "~7.2.8",
54
- "@xylabs/vitest-extended": "~5.0.24",
57
+ "@xylabs/vitest-extended": "~5.0.33",
55
58
  "typescript": "~5.9.3",
56
- "vitest": "~4.0.8"
59
+ "vitest": "~4.0.9"
57
60
  },
58
61
  "publishConfig": {
59
62
  "access": "public"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=serializable.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serializable.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/serializable.spec.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /**
2
- * @group module
3
- */
4
- import '@xylabs/vitest-extended';
5
- //# sourceMappingURL=ModuleInstance.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModuleInstance.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/ModuleInstance.spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,yBAAyB,CAAA"}
@@ -1,115 +0,0 @@
1
- import {
2
- describe, expect, it,
3
- } from 'vitest'
4
-
5
- import { isSerializable } from '../serializable.ts'
6
-
7
- /**
8
- * @group module
9
- */
10
-
11
- describe('isSerializable', () => {
12
- it('string', () => {
13
- expect(isSerializable('HI')).toBe(true)
14
- })
15
-
16
- it('number', () => {
17
- expect(isSerializable(23_454)).toBe(true)
18
- })
19
-
20
- it('null', () => {
21
- expect(isSerializable(null)).toBe(true)
22
- })
23
-
24
- it('undefined', () => {
25
- // eslint-disable-next-line unicorn/no-useless-undefined
26
- expect(isSerializable(undefined)).toBe(false)
27
- })
28
-
29
- it('Class', () => {
30
- class TestClass {
31
- foo = 'foo'
32
- }
33
- expect(isSerializable(new TestClass())).toBe(true)
34
- })
35
-
36
- it('Class', () => {
37
- class TestClass {
38
- foo = 'foo'
39
- fooFunc = () => 10
40
- }
41
- expect(isSerializable(new TestClass())).toBe(false)
42
- })
43
-
44
- it('Map', () => {
45
- expect(isSerializable(new Map())).toBe(false)
46
- })
47
-
48
- it('Symbol', () => {
49
- expect(isSerializable(Symbol())).toBe(false)
50
- })
51
-
52
- it('Set', () => {
53
- expect(isSerializable(new Set())).toBe(false)
54
- })
55
-
56
- it('plain obj', () => {
57
- expect(isSerializable({ p: 1, p2: 'hi' })).toBe(true)
58
- })
59
- })
60
-
61
- describe('serializable', () => {
62
- it('plain obj with func', () => {
63
- expect(
64
- isSerializable({
65
- p: 1,
66
- p2: () => {
67
- return
68
- },
69
- }),
70
- ).toBe(false)
71
- })
72
-
73
- it('nested obj with func', () => {
74
- expect(
75
- isSerializable({
76
- n: {
77
- nn: {
78
- nnm: () => {
79
- return
80
- },
81
- nnn: 1,
82
- },
83
- },
84
- p: 1,
85
- p2: 'hi',
86
- }),
87
- ).toBe(false)
88
- })
89
-
90
- it('array with func', () => {
91
- expect(isSerializable([1, 2, 3, () => false])).toBe(false)
92
- })
93
-
94
- it('array with nested obj', () => {
95
- expect(isSerializable([1, 2, 3, { nn: { nnm: 'Hi', nnn: 1 } }])).toBe(true)
96
- })
97
-
98
- it('array with nested obj with func', () => {
99
- expect(
100
- isSerializable([
101
- 1,
102
- 2,
103
- 3,
104
- {
105
- nn: {
106
- nnm: () => {
107
- return
108
- },
109
- nnn: 1,
110
- },
111
- },
112
- ]),
113
- ).toBe(false)
114
- })
115
- })
@@ -1,28 +0,0 @@
1
- /**
2
- * @group module
3
- */
4
-
5
- import '@xylabs/vitest-extended'
6
-
7
- import {
8
- describe, expect, it,
9
- } from 'vitest'
10
-
11
- import { includesReservedModuleIdentifierCharacter, isModuleIdentifierPart } from '../ModuleIdentifier.ts'
12
-
13
- describe('ModuleInstance', () => {
14
- it('isReservedModuleIdentifierCharacter', () => {
15
- expect(includesReservedModuleIdentifierCharacter(':')).toBeTrue()
16
- expect(includesReservedModuleIdentifierCharacter('?')).toBeTrue()
17
- expect(includesReservedModuleIdentifierCharacter('&')).toBeTrue()
18
- expect(includesReservedModuleIdentifierCharacter('&&')).toBeTrue()
19
- expect(includesReservedModuleIdentifierCharacter('a')).toBeFalse()
20
- })
21
- it('isModuleIdentifierPart', () => {
22
- expect(isModuleIdentifierPart('module-a')).toBeTrue()
23
- expect(isModuleIdentifierPart('module:a')).toBeFalse()
24
- expect(isModuleIdentifierPart('module&a')).toBeFalse()
25
- expect(isModuleIdentifierPart('module?a')).toBeFalse()
26
- expect(isModuleIdentifierPart('module:&?a')).toBeFalse()
27
- })
28
- })