@chainflip/utils 0.1.0
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/dist/assertion.cjs +86 -0
- package/dist/assertion.d.cts +11 -0
- package/dist/assertion.d.ts +11 -0
- package/dist/assertion.js +23 -0
- package/dist/async.cjs +89 -0
- package/dist/async.d.cts +29 -0
- package/dist/async.d.ts +29 -0
- package/dist/async.js +61 -0
- package/dist/base58.cjs +75 -0
- package/dist/base58.d.cts +4 -0
- package/dist/base58.d.ts +4 -0
- package/dist/base58.js +11 -0
- package/dist/bytes.cjs +94 -0
- package/dist/bytes.d.cts +8 -0
- package/dist/bytes.d.ts +8 -0
- package/dist/bytes.js +14 -0
- package/dist/chunk-CZNX6EUV.js +23 -0
- package/dist/chunk-DGVZ5UDU.js +52 -0
- package/dist/chunk-MORKFLN4.js +14 -0
- package/dist/chunk-NYJKCZRI.js +52 -0
- package/dist/guard.cjs +55 -0
- package/dist/guard.d.cts +20 -0
- package/dist/guard.d.ts +20 -0
- package/dist/guard.js +22 -0
- package/dist/ss58.cjs +756 -0
- package/dist/ss58.d.cts +12 -0
- package/dist/ss58.d.ts +12 -0
- package/dist/ss58.js +680 -0
- package/dist/string.cjs +42 -0
- package/dist/string.d.cts +8 -0
- package/dist/string.d.ts +8 -0
- package/dist/string.js +13 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +3 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +0 -0
- package/package.json +32 -0
package/dist/string.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/string.ts
|
|
21
|
+
var string_exports = {};
|
|
22
|
+
__export(string_exports, {
|
|
23
|
+
capitalize: () => capitalize,
|
|
24
|
+
split: () => split,
|
|
25
|
+
toLowerCase: () => toLowerCase,
|
|
26
|
+
toUpperCase: () => toUpperCase,
|
|
27
|
+
uncapitalize: () => uncapitalize
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(string_exports);
|
|
30
|
+
var toUpperCase = (str) => str.toUpperCase();
|
|
31
|
+
var toLowerCase = (str) => str.toLowerCase();
|
|
32
|
+
var split = (str, delimiter) => str.split(delimiter);
|
|
33
|
+
var capitalize = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
|
|
34
|
+
var uncapitalize = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
capitalize,
|
|
38
|
+
split,
|
|
39
|
+
toLowerCase,
|
|
40
|
+
toUpperCase,
|
|
41
|
+
uncapitalize
|
|
42
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const toUpperCase: <const T extends string>(str: T) => Uppercase<T>;
|
|
2
|
+
declare const toLowerCase: <const T extends string>(str: T) => Lowercase<T>;
|
|
3
|
+
type Split<T extends string, D extends string> = T extends `${infer L}${D}${infer R}` ? [L, ...Split<R, D>] : [T];
|
|
4
|
+
declare const split: <const T extends string, D extends string>(str: T, delimiter: D) => Split<T, D>;
|
|
5
|
+
declare const capitalize: <const T extends string>(str: T) => Capitalize<T>;
|
|
6
|
+
declare const uncapitalize: <const T extends string>(str: T) => Uncapitalize<T>;
|
|
7
|
+
|
|
8
|
+
export { capitalize, split, toLowerCase, toUpperCase, uncapitalize };
|
package/dist/string.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const toUpperCase: <const T extends string>(str: T) => Uppercase<T>;
|
|
2
|
+
declare const toLowerCase: <const T extends string>(str: T) => Lowercase<T>;
|
|
3
|
+
type Split<T extends string, D extends string> = T extends `${infer L}${D}${infer R}` ? [L, ...Split<R, D>] : [T];
|
|
4
|
+
declare const split: <const T extends string, D extends string>(str: T, delimiter: D) => Split<T, D>;
|
|
5
|
+
declare const capitalize: <const T extends string>(str: T) => Capitalize<T>;
|
|
6
|
+
declare const uncapitalize: <const T extends string>(str: T) => Uncapitalize<T>;
|
|
7
|
+
|
|
8
|
+
export { capitalize, split, toLowerCase, toUpperCase, uncapitalize };
|
package/dist/string.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/string.ts
|
|
2
|
+
var toUpperCase = (str) => str.toUpperCase();
|
|
3
|
+
var toLowerCase = (str) => str.toLowerCase();
|
|
4
|
+
var split = (str, delimiter) => str.split(delimiter);
|
|
5
|
+
var capitalize = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
|
|
6
|
+
var uncapitalize = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;
|
|
7
|
+
export {
|
|
8
|
+
capitalize,
|
|
9
|
+
split,
|
|
10
|
+
toLowerCase,
|
|
11
|
+
toUpperCase,
|
|
12
|
+
uncapitalize
|
|
13
|
+
};
|
package/dist/types.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/types.d.cts
ADDED
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chainflip/utils",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"README.md"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
"./*": {
|
|
11
|
+
"require": {
|
|
12
|
+
"default": "./dist/*.cjs",
|
|
13
|
+
"types": "./dist/*.d.cts"
|
|
14
|
+
},
|
|
15
|
+
"import": {
|
|
16
|
+
"default": "./dist/*.js",
|
|
17
|
+
"types": "./dist/*.d.ts"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@noble/hashes": "^1.4.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"clean": "rm -rf dist",
|
|
26
|
+
"prepublish": "pnpm test run && pnpm build:clean",
|
|
27
|
+
"build": "tsup",
|
|
28
|
+
"build:clean": "pnpm clean && pnpm build",
|
|
29
|
+
"test": "vitest",
|
|
30
|
+
"coverage": "vitest run --coverage"
|
|
31
|
+
}
|
|
32
|
+
}
|