@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/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.1",
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.1",
23
- "@leather.io/models": "0.50.0"
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
- "tsup": "8.4.0",
29
- "typescript": "5.8.3",
28
+ "tsdown": "0.16.5",
29
+ "typescript": "5.9.3",
30
30
  "vitest": "2.1.9",
31
- "@leather.io/tsconfig-config": "0.11.0",
32
- "@leather.io/prettier-config": "0.9.0"
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": "tsup",
45
- "build:watch": "tsup --watch --onSuccess 'tsup --dts-only'",
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
- // eslint-disable-next-line @typescript-eslint/no-empty-function
76
- export function noop() {}
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 = `${getLetters(name, 3)}`;
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": ["**/*", ".*.ts"],
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 'tsup';
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 '../../config/vitest-configs';
3
+ import { defaultVitestUnitTestingConfig } from '@leather.io/test-config';
4
4
 
5
5
  export default defineProject({ ...defaultVitestUnitTestingConfig });