@icazemier/gibbons 5.0.2 → 5.0.3

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * A Gibbon
4
3
  * @param {ArrayBuffer} arrayBuffer - allocate this Gibbon with some working memory
@@ -386,7 +386,10 @@ class Gibbon {
386
386
  if (data instanceof Buffer) {
387
387
  return Gibbon.fromBuffer(data);
388
388
  }
389
- return Gibbon.fromString(data);
389
+ if (typeof data === "string") {
390
+ return Gibbon.fromString(data);
391
+ }
392
+ throw new TypeError(`Expected a string or Buffer for decoding, but received a: ${typeof data}`);
390
393
  }
391
394
  /**
392
395
  * Depending on the GIBBONS_ENCODE_FROM_TO_STRING environment variable if converts this
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  /**
3
2
  * A Gibbon
4
3
  * @param {ArrayBuffer} arrayBuffer - allocate this Gibbon with some working memory
@@ -385,7 +385,10 @@ export class Gibbon {
385
385
  if (data instanceof Buffer) {
386
386
  return Gibbon.fromBuffer(data);
387
387
  }
388
- return Gibbon.fromString(data);
388
+ if (typeof data === "string") {
389
+ return Gibbon.fromString(data);
390
+ }
391
+ throw new TypeError(`Expected a string or Buffer for decoding, but received a: ${typeof data}`);
389
392
  }
390
393
  /**
391
394
  * Depending on the GIBBONS_ENCODE_FROM_TO_STRING environment variable if converts this
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@icazemier/gibbons",
3
3
  "type": "module",
4
4
  "private": false,
5
- "version": "5.0.2",
5
+ "version": "5.0.3",
6
6
  "description": "Gibbons is a Node.js module which helps in managing user groups and user permissions with `bitwise` effiency.",
7
7
  "contributors": [
8
8
  {
@@ -17,7 +17,9 @@
17
17
  "bitwise"
18
18
  ],
19
19
  "files": [
20
- "build/"
20
+ "build/",
21
+ "README.md",
22
+ "LICENSE"
21
23
  ],
22
24
  "main": "./build/cjs/index.js",
23
25
  "module": "./build/esm/index.js",
@@ -29,7 +31,7 @@
29
31
  },
30
32
  "types": "./build/esm/index.d.ts",
31
33
  "engines": {
32
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
34
+ "node": "^16.0.0 || ^18.0.0 || >=20.0.0"
33
35
  },
34
36
  "os": [
35
37
  "darwin",
@@ -37,9 +39,9 @@
37
39
  "win32"
38
40
  ],
39
41
  "scripts": {
40
- "test": "cross-env NODE_ENV=test c8 ava",
41
- "build:esm": "tsc -p tsconfig.json",
42
- "build:cjs": "tsc -p tsconfig-cjs.json",
42
+ "test": "cross-env NODE_ENV=test vitest run --coverage",
43
+ "build:esm": "tsc -p tsconfig-build-esm.json",
44
+ "build:cjs": "tsc -p tsconfig-build-cjs.json",
43
45
  "build": "rimraf build && npm run build:esm && npm run build:cjs && node ./fixup.mjs",
44
46
  "lint": "eslint . --ext .ts",
45
47
  "lint:fix": "eslint . --ext .ts --fix",
@@ -54,16 +56,17 @@
54
56
  "homepage": "https://icazemier.github.io/gibbons/",
55
57
  "license": "MIT",
56
58
  "devDependencies": {
57
- "@types/node": "^18.13.0",
58
- "@typescript-eslint/eslint-plugin": "^5.51.0",
59
- "@typescript-eslint/parser": "^5.51.0",
60
- "ava": "^5.2.0",
61
- "c8": "^7.12.0",
59
+ "@eslint/js": "^9.26.0",
60
+ "@types/node": "^22.15.3",
61
+ "@vitest/coverage-v8": "^3.1.2",
62
+ "@vitest/ui": "^3.1.2",
62
63
  "cross-env": "^7.0.3",
63
- "eslint": "^8.34.0",
64
- "rimraf": "^4.1.2",
65
- "ts-node": "^10.9.1",
66
- "typedoc": "^0.23.25",
67
- "typescript": "^4.9.5"
64
+ "eslint": "^9.26.0",
65
+ "rimraf": "^6.0.1",
66
+ "ts-node": "^10.9.2",
67
+ "typedoc": "^0.28.3",
68
+ "typescript": "^5.8.3",
69
+ "typescript-eslint": "^8.31.1",
70
+ "vitest": "^3.1.2"
68
71
  }
69
72
  }