fast-boolean-array 1.4.6 → 1.4.7
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 +15 -22
- package/package.json +51 -51
package/README.md
CHANGED
|
@@ -15,25 +15,7 @@ For detailed benchmark results, see below.
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
- **Easy to Use**: Familiar `Map` and `Set` like API for minimal learning curve.
|
|
21
|
-
- **Scalable**: Suitable for high-performance, memory-sensitive projects.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
Install the package via npm:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install fast-boolean-array --save-dev
|
|
31
|
-
pnpm install fast-boolean-array --save-dev
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
18
|
+
## Usage example:
|
|
37
19
|
|
|
38
20
|
Here's how to use the Fast Boolean Array:
|
|
39
21
|
|
|
@@ -41,21 +23,32 @@ Here's how to use the Fast Boolean Array:
|
|
|
41
23
|
import BooleanArray from "fast-boolean-array";
|
|
42
24
|
// const BooleanArray = require('fast-boolean-array'); commonjs works too.
|
|
43
25
|
|
|
44
|
-
// Create a new BooleanArray with the desired
|
|
26
|
+
// Create a new BooleanArray with the desired length
|
|
45
27
|
const booleans = new BooleanArray(2);
|
|
46
28
|
|
|
47
29
|
// Set a value at a specific index
|
|
48
30
|
booleans.set(0, true);
|
|
49
31
|
booleans.set(1, false);
|
|
50
32
|
|
|
51
|
-
// Retrieve
|
|
33
|
+
// Retrieve a value at a specific index
|
|
52
34
|
console.log(booleans.get(0)); // Output: true
|
|
53
35
|
console.log(booleans.get(1)); // Output: false
|
|
54
36
|
|
|
55
37
|
booleans.set(3, true); // will not throw, but returns false as the boolean is not found
|
|
56
38
|
console.log(booleans.get(3)); // Output: false
|
|
57
39
|
|
|
58
|
-
booleans.setSafe(3, true); // will throw RangeError
|
|
40
|
+
booleans.setSafe(3, true); // will throw RangeError because the array has a length of 2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Install the package:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install fast-boolean-array
|
|
51
|
+
pnpm install fast-boolean-array
|
|
59
52
|
```
|
|
60
53
|
|
|
61
54
|
---
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fast-boolean-array",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"homepage": "https://github.com/UltraCakeBakery/FastBooleanArray",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/UltraCakeBakery/FastBooleanArray.git"
|
|
8
|
-
},
|
|
9
|
-
"bugs": {
|
|
10
|
-
"url": "https://github.com/UltraCakeBakery/FastBooleanArray/issues",
|
|
11
|
-
"email": "fast-boolean-array@managing.software"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"main": "./dist/index.cjs",
|
|
15
|
-
"module": "./dist/index.js",
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"exports": {
|
|
18
|
-
"import": {
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
|
-
"import": "./dist/index.js"
|
|
21
|
-
},
|
|
22
|
-
"require": {
|
|
23
|
-
"types": "./dist/index.d.cts",
|
|
24
|
-
"require": "./dist/index.cjs"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"test": "vitest",
|
|
29
|
-
"check-types": "npx --yes @arethetypeswrong/cli --pack .",
|
|
30
|
-
"build": "tsup src/index.ts --dts --format cjs,esm --clean --sourcemap --minify",
|
|
31
|
-
"publish": "npm publish"
|
|
32
|
-
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"boolean",
|
|
35
|
-
"array",
|
|
36
|
-
"fast",
|
|
37
|
-
"efficient",
|
|
38
|
-
"map"
|
|
39
|
-
],
|
|
40
|
-
"author": "Jack van der Bil <jack@managing.software> (https://jackvanderbilt.nl)",
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"description": "",
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=0.10.3"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/node": "^22.10.
|
|
48
|
-
"tsup": "^8.3.5",
|
|
49
|
-
"typescript": "^5.7.
|
|
50
|
-
"vitest": "^
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "fast-boolean-array",
|
|
3
|
+
"version": "1.4.7",
|
|
4
|
+
"homepage": "https://github.com/UltraCakeBakery/FastBooleanArray",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/UltraCakeBakery/FastBooleanArray.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/UltraCakeBakery/FastBooleanArray/issues",
|
|
11
|
+
"email": "fast-boolean-array@managing.software"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/index.d.cts",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "vitest",
|
|
29
|
+
"check-types": "npx --yes @arethetypeswrong/cli --pack .",
|
|
30
|
+
"build": "tsup src/index.ts --dts --format cjs,esm --clean --sourcemap --minify",
|
|
31
|
+
"publish": "npm publish"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"boolean",
|
|
35
|
+
"array",
|
|
36
|
+
"fast",
|
|
37
|
+
"efficient",
|
|
38
|
+
"map"
|
|
39
|
+
],
|
|
40
|
+
"author": "Jack van der Bil <jack@managing.software> (https://jackvanderbilt.nl)",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"description": "",
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=0.10.3"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^22.10.7",
|
|
48
|
+
"tsup": "^8.3.5",
|
|
49
|
+
"typescript": "^5.7.3",
|
|
50
|
+
"vitest": "^3.0.2"
|
|
51
|
+
}
|
|
52
52
|
}
|