nodelistparser 0.1.3 → 0.1.4

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/cjs/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ var guard = require('foxts/guard');
2
+
1
3
  const boolean = (text)=>text === 'true';
2
4
  const number = Number;
3
5
  const comma = (text)=>text.split(',').map((piece)=>piece.trim());
@@ -198,9 +200,6 @@ function decode$1(raw) {
198
200
  // name, type, server, port, restDetails
199
201
  // });
200
202
  }
201
- function assertNever(value, msg) {
202
- throw new TypeError(`Unsupported type: ${msg}`);
203
- }
204
203
  const joinString = (arr)=>arr.filter(Boolean).join(', ');
205
204
  function encode$1(config) {
206
205
  const shared = [
@@ -272,7 +271,7 @@ function encode$1(config) {
272
271
  ...shared
273
272
  ]);
274
273
  default:
275
- assertNever(config, `Unsupported type: ${config.type} (clash encode)`);
274
+ guard.never(config, 'type (clash encode)');
276
275
  }
277
276
  }
278
277
 
package/dist/es/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { never } from 'foxts/guard';
2
+
1
3
  const boolean = (text)=>text === 'true';
2
4
  const number = Number;
3
5
  const comma = (text)=>text.split(',').map((piece)=>piece.trim());
@@ -198,9 +200,6 @@ function decode$1(raw) {
198
200
  // name, type, server, port, restDetails
199
201
  // });
200
202
  }
201
- function assertNever(value, msg) {
202
- throw new TypeError(`Unsupported type: ${msg}`);
203
- }
204
203
  const joinString = (arr)=>arr.filter(Boolean).join(', ');
205
204
  function encode$1(config) {
206
205
  const shared = [
@@ -272,7 +271,7 @@ function encode$1(config) {
272
271
  ...shared
273
272
  ]);
274
273
  default:
275
- assertNever(config, `Unsupported type: ${config.type} (clash encode)`);
274
+ never(config, 'type (clash encode)');
276
275
  }
277
276
  }
278
277
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodelistparser",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Surge / Mihomo (Clash.Meta) nodelist / proxy provider parser and generator.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,19 +33,23 @@
33
33
  ],
34
34
  "author": "Sukka <https://skk.moe>",
35
35
  "license": "MIT",
36
+ "dependencies": {
37
+ "foxts": "^1.5.1"
38
+ },
36
39
  "devDependencies": {
37
- "@eslint-sukka/node": "^6.8.1",
40
+ "@eslint-sukka/node": "^6.14.0",
38
41
  "@swc-node/register": "^1.10.9",
39
- "@types/mocha": "^10.0.9",
40
- "@types/node": "^22.8.1",
41
- "bumpp": "^9.7.1",
42
- "bunchee": "^5.5.1",
43
- "eslint": "^9.13.0",
44
- "eslint-config-sukka": "^6.8.1",
45
- "eslint-formatter-sukka": "^6.8.1",
42
+ "@swc/core": "^1.10.16",
43
+ "@types/mocha": "^10.0.10",
44
+ "@types/node": "^22.13.4",
45
+ "bumpp": "^10.0.3",
46
+ "bunchee": "^6.3.4",
47
+ "eslint": "^9.20.1",
48
+ "eslint-config-sukka": "^6.14.0",
49
+ "eslint-formatter-sukka": "^6.14.0",
46
50
  "expect": "^29.7.0",
47
- "mocha": "^10.7.3",
48
- "typescript": "^5.6.3"
51
+ "mocha": "^11.1.0",
52
+ "typescript": "^5.7.3"
49
53
  },
50
54
  "scripts": {
51
55
  "lint": "eslint --format=sukka .",