@solana/codecs-data-structures 2.0.0-experimental.ffeddf6 → 2.0.0-preview.1
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/README.md +482 -4
- package/dist/index.browser.cjs +401 -488
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +403 -486
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +403 -486
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +401 -488
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +403 -486
- package/dist/index.node.js.map +1 -1
- package/dist/types/array.d.ts +39 -10
- package/dist/types/array.d.ts.map +1 -0
- package/dist/types/assertions.d.ts +1 -1
- package/dist/types/assertions.d.ts.map +1 -0
- package/dist/types/bit-array.d.ts +9 -9
- package/dist/types/bit-array.d.ts.map +1 -0
- package/dist/types/boolean.d.ts +22 -10
- package/dist/types/boolean.d.ts.map +1 -0
- package/dist/types/bytes.d.ts +18 -9
- package/dist/types/bytes.d.ts.map +1 -0
- package/dist/types/data-enum.d.ts +22 -24
- package/dist/types/data-enum.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -14
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/map.d.ts +28 -10
- package/dist/types/map.d.ts.map +1 -0
- package/dist/types/nullable.d.ts +33 -15
- package/dist/types/nullable.d.ts.map +1 -0
- package/dist/types/scalar-enum.d.ts +46 -15
- package/dist/types/scalar-enum.d.ts.map +1 -0
- package/dist/types/set.d.ts +28 -10
- package/dist/types/set.d.ts.map +1 -0
- package/dist/types/struct.d.ts +16 -21
- package/dist/types/struct.d.ts.map +1 -0
- package/dist/types/tuple.d.ts +22 -15
- package/dist/types/tuple.d.ts.map +1 -0
- package/dist/types/unit.d.ts +4 -12
- package/dist/types/unit.d.ts.map +1 -0
- package/dist/types/utils.d.ts +10 -2
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +13 -34
- package/dist/index.development.js +0 -865
- package/dist/index.development.js.map +0 -1
- package/dist/index.production.min.js +0 -51
- package/dist/types/array-like-codec-size.d.ts +0 -20
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
/** Returns the max size or null if at least one size is null. */
|
|
2
1
|
export declare function maxCodecSizes(sizes: (number | null)[]): number | null;
|
|
3
|
-
/** Returns the sum of all sizes or null if at least one size is null. */
|
|
4
2
|
export declare function sumCodecSizes(sizes: (number | null)[]): number | null;
|
|
3
|
+
export declare function getFixedSize(codec: {
|
|
4
|
+
fixedSize: number;
|
|
5
|
+
} | {
|
|
6
|
+
maxSize?: number;
|
|
7
|
+
}): number | null;
|
|
8
|
+
export declare function getMaxSize(codec: {
|
|
9
|
+
fixedSize: number;
|
|
10
|
+
} | {
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
}): number | null;
|
|
5
13
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,CAKrE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,CAErE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAE/F;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAE7F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/codecs-data-structures",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-preview.1",
|
|
4
4
|
"description": "Codecs for various data structures",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -49,31 +49,9 @@
|
|
|
49
49
|
"node": ">=17.4"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@solana/codecs-core": "2.0.0-
|
|
53
|
-
"@solana/codecs-numbers": "2.0.0-
|
|
54
|
-
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@solana/eslint-config-solana": "^1.0.2",
|
|
57
|
-
"@swc/jest": "^0.2.29",
|
|
58
|
-
"@types/jest": "^29.5.6",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
60
|
-
"@typescript-eslint/parser": "^6.3.0",
|
|
61
|
-
"agadoo": "^3.0.0",
|
|
62
|
-
"eslint": "^8.45.0",
|
|
63
|
-
"eslint-plugin-jest": "^27.4.2",
|
|
64
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
65
|
-
"jest": "^29.7.0",
|
|
66
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
67
|
-
"jest-runner-eslint": "^2.1.2",
|
|
68
|
-
"jest-runner-prettier": "^1.0.0",
|
|
69
|
-
"prettier": "^2.8",
|
|
70
|
-
"tsup": "7.2.0",
|
|
71
|
-
"typescript": "^5.2.2",
|
|
72
|
-
"version-from-git": "^1.1.1",
|
|
73
|
-
"@solana/codecs-strings": "2.0.0-experimental.ffeddf6",
|
|
74
|
-
"build-scripts": "0.0.0",
|
|
75
|
-
"test-config": "0.0.0",
|
|
76
|
-
"tsconfig": "0.0.0"
|
|
52
|
+
"@solana/codecs-core": "2.0.0-preview.1",
|
|
53
|
+
"@solana/codecs-numbers": "2.0.0-preview.1",
|
|
54
|
+
"@solana/errors": "2.0.0-preview.1"
|
|
77
55
|
},
|
|
78
56
|
"bundlewatch": {
|
|
79
57
|
"defaultCompression": "gzip",
|
|
@@ -84,18 +62,19 @@
|
|
|
84
62
|
]
|
|
85
63
|
},
|
|
86
64
|
"scripts": {
|
|
87
|
-
"compile:js": "tsup --config build-scripts/tsup.config.
|
|
88
|
-
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
89
|
-
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
90
|
-
"publish-
|
|
65
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
66
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node ../../node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
|
|
67
|
+
"dev": "jest -c ../../node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
68
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag preview --access public --no-git-checks",
|
|
69
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
91
70
|
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|
|
92
|
-
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
93
|
-
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
71
|
+
"test:lint": "jest -c ../../node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
72
|
+
"test:prettier": "jest -c ../../node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
94
73
|
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
95
74
|
"test:treeshakability:native": "agadoo dist/index.native.js",
|
|
96
75
|
"test:treeshakability:node": "agadoo dist/index.node.js",
|
|
97
76
|
"test:typecheck": "tsc --noEmit",
|
|
98
|
-
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
99
|
-
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
77
|
+
"test:unit:browser": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
78
|
+
"test:unit:node": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
100
79
|
}
|
|
101
80
|
}
|