bigint-base 0.2.0 → 0.2.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/lib/utils.js +2 -0
- package/lib/utils.js.map +1 -1
- package/package.json +3 -4
- package/src/utils.ts +2 -0
package/lib/utils.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { assert } from '@blackglory/prelude';
|
|
2
|
+
import { toSet } from 'iterable-operator';
|
|
2
3
|
export function validateAlphabet(alphabet) {
|
|
3
4
|
assert(alphabet.length >= 2, 'The alphabet must have at least two characters');
|
|
5
|
+
assert(toSet(alphabet).size === alphabet.length, 'The alphabet must contain only unique characters');
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,gDAAgD,CAAC,CAAA;IAC9E,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,EAAE,kDAAkD,CAAC,CAAA;AACtG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bigint-base",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Yet another base conversion library, but using BigInt.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bigint",
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
"@commitlint/config-conventional": "^20.4.1",
|
|
42
42
|
"@eslint/js": "^10.0.1",
|
|
43
43
|
"@types/node": "22",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
45
|
-
"@typescript-eslint/parser": "^8.55.0",
|
|
46
44
|
"eslint": "^10.0.0",
|
|
47
45
|
"extra-benchmark": "^0.2.5",
|
|
48
46
|
"extra-generator": "^0.5.9",
|
|
@@ -63,6 +61,7 @@
|
|
|
63
61
|
"vitest": "^4.0.18"
|
|
64
62
|
},
|
|
65
63
|
"dependencies": {
|
|
66
|
-
"@blackglory/prelude": "^0.4.0"
|
|
64
|
+
"@blackglory/prelude": "^0.4.0",
|
|
65
|
+
"iterable-operator": "^5.1.0"
|
|
67
66
|
}
|
|
68
67
|
}
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { assert } from '@blackglory/prelude'
|
|
2
|
+
import { toSet } from 'iterable-operator'
|
|
2
3
|
|
|
3
4
|
export function validateAlphabet(alphabet: string): void {
|
|
4
5
|
assert(alphabet.length >= 2, 'The alphabet must have at least two characters')
|
|
6
|
+
assert(toSet(alphabet).size === alphabet.length, 'The alphabet must contain only unique characters')
|
|
5
7
|
}
|