@leather.io/utils 0.49.1 → 0.49.2
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/.turbo/turbo-build.log +13 -14
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +141 -98
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3279 -3513
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/src/index.ts +5 -4
- package/tsconfig.json +3 -3
- package/{tsup.config.ts → tsdown.config.ts} +2 -4
- package/vitest.config.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@leather.io/utils",
|
|
3
3
|
"author": "Leather.io contact@leather.io",
|
|
4
4
|
"description": "Shared bitcoin utilities",
|
|
5
|
-
"version": "0.49.
|
|
5
|
+
"version": "0.49.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/leather-io/mono/tree/dev/packages/utils",
|
|
8
8
|
"repository": {
|
|
@@ -19,17 +19,18 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"bignumber.js": "9.1.2",
|
|
21
21
|
"dompurify": "3.2.4",
|
|
22
|
-
"@leather.io/constants": "0.28.
|
|
23
|
-
"@leather.io/models": "0.50.
|
|
22
|
+
"@leather.io/constants": "0.28.2",
|
|
23
|
+
"@leather.io/models": "0.50.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/dompurify": "3.0.5",
|
|
27
27
|
"prettier": "3.5.1",
|
|
28
|
-
"
|
|
29
|
-
"typescript": "5.
|
|
28
|
+
"tsdown": "0.16.5",
|
|
29
|
+
"typescript": "5.9.3",
|
|
30
30
|
"vitest": "2.1.9",
|
|
31
|
-
"@leather.io/
|
|
32
|
-
"@leather.io/
|
|
31
|
+
"@leather.io/prettier-config": "0.9.0",
|
|
32
|
+
"@leather.io/tsconfig-config": "0.11.1",
|
|
33
|
+
"@leather.io/test-config": "0.1.1"
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|
|
35
36
|
"leather",
|
|
@@ -41,8 +42,8 @@
|
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|
|
43
44
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"build:watch": "
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"build:watch": "tsdown --watch",
|
|
46
47
|
"format": "prettier . --write --ignore-path ../../.prettierignore",
|
|
47
48
|
"format:check": "prettier . --check --ignore-path ../../.prettierignore",
|
|
48
49
|
"test:coverage": "vitest run --coverage",
|
package/src/index.ts
CHANGED
|
@@ -72,8 +72,9 @@ export function isTypedArray(val: unknown): val is Uint8Array {
|
|
|
72
72
|
return val instanceof TypedArray;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
export function noop() {
|
|
76
|
+
// expected to be empty
|
|
77
|
+
}
|
|
77
78
|
|
|
78
79
|
export function ensureArray<T>(value: T | T[]): T[] {
|
|
79
80
|
return Array.isArray(value) ? value : [value];
|
|
@@ -98,7 +99,7 @@ export const defaultWalletKeyId = 'default';
|
|
|
98
99
|
|
|
99
100
|
export function reverseBytes(bytes: Buffer): Buffer;
|
|
100
101
|
export function reverseBytes(bytes: Uint8Array): Uint8Array;
|
|
101
|
-
export function reverseBytes(bytes: Buffer | Uint8Array) {
|
|
102
|
+
export function reverseBytes(bytes: Buffer | Uint8Array): Buffer | Uint8Array {
|
|
102
103
|
if (Buffer.isBuffer(bytes)) return Buffer.from(bytes).reverse();
|
|
103
104
|
return new Uint8Array(bytes.slice().reverse());
|
|
104
105
|
}
|
|
@@ -159,7 +160,7 @@ export function getTicker(value: string) {
|
|
|
159
160
|
name = `${getLetters(words[0])}${getLetters(words[1], 2)}`;
|
|
160
161
|
}
|
|
161
162
|
} else if (name.length >= 3) {
|
|
162
|
-
name =
|
|
163
|
+
name = getLetters(name, 3);
|
|
163
164
|
}
|
|
164
165
|
return name.toUpperCase();
|
|
165
166
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": ["@leather.io/tsconfig-config/tsconfig.base.json"],
|
|
3
|
-
"include": ["
|
|
4
|
-
"exclude": ["./dist/"],
|
|
3
|
+
"include": ["src/**/*"],
|
|
5
4
|
"compilerOptions": {
|
|
6
|
-
"baseUrl": "src",
|
|
5
|
+
"baseUrl": "./src",
|
|
6
|
+
"rootDir": "./src",
|
|
7
7
|
"types": ["vitest/globals"],
|
|
8
8
|
"outDir": "./dist"
|
|
9
9
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { defineConfig } from '
|
|
1
|
+
import { defineConfig } from 'tsdown';
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
entry: ['src/index.ts'],
|
|
5
|
-
sourcemap: true,
|
|
6
|
-
clean: false,
|
|
7
5
|
dts: true,
|
|
8
|
-
format: 'esm',
|
|
9
6
|
external: ['dompurify'],
|
|
7
|
+
fixedExtension: false,
|
|
10
8
|
});
|
package/vitest.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineProject } from 'vitest/config';
|
|
2
2
|
|
|
3
|
-
import { defaultVitestUnitTestingConfig } from '
|
|
3
|
+
import { defaultVitestUnitTestingConfig } from '@leather.io/test-config';
|
|
4
4
|
|
|
5
5
|
export default defineProject({ ...defaultVitestUnitTestingConfig });
|