@nivinjoseph/n-sec 5.0.5 → 6.0.2

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.
Files changed (83) hide show
  1. package/.vscode/settings.json +111 -0
  2. package/.yarn/releases/yarn-4.0.2.cjs +893 -0
  3. package/.yarnrc.yml +3 -0
  4. package/dist/api-security/alg-type.d.ts +1 -0
  5. package/dist/api-security/alg-type.d.ts.map +1 -0
  6. package/dist/api-security/alg-type.js +2 -5
  7. package/dist/api-security/alg-type.js.map +1 -1
  8. package/dist/api-security/claim.d.ts +1 -0
  9. package/dist/api-security/claim.d.ts.map +1 -0
  10. package/dist/api-security/claim.js +5 -9
  11. package/dist/api-security/claim.js.map +1 -1
  12. package/dist/api-security/claims-identity.d.ts +2 -1
  13. package/dist/api-security/claims-identity.d.ts.map +1 -0
  14. package/dist/api-security/claims-identity.js +4 -8
  15. package/dist/api-security/claims-identity.js.map +1 -1
  16. package/dist/api-security/expired-token-exception.d.ts +1 -0
  17. package/dist/api-security/expired-token-exception.d.ts.map +1 -0
  18. package/dist/api-security/expired-token-exception.js +5 -9
  19. package/dist/api-security/expired-token-exception.js.map +1 -1
  20. package/dist/api-security/invalid-token-exception.d.ts +1 -0
  21. package/dist/api-security/invalid-token-exception.d.ts.map +1 -0
  22. package/dist/api-security/invalid-token-exception.js +7 -11
  23. package/dist/api-security/invalid-token-exception.js.map +1 -1
  24. package/dist/api-security/json-web-token.d.ts +3 -2
  25. package/dist/api-security/json-web-token.d.ts.map +1 -0
  26. package/dist/api-security/json-web-token.js +39 -43
  27. package/dist/api-security/json-web-token.js.map +1 -1
  28. package/dist/api-security/security-token.d.ts +1 -0
  29. package/dist/api-security/security-token.d.ts.map +1 -0
  30. package/dist/api-security/security-token.js +6 -10
  31. package/dist/api-security/security-token.js.map +1 -1
  32. package/dist/bin.d.ts +1 -0
  33. package/dist/bin.d.ts.map +1 -0
  34. package/dist/bin.js +16 -20
  35. package/dist/bin.js.map +1 -1
  36. package/dist/crypto/asymmetric-encryption.d.ts +2 -0
  37. package/dist/crypto/asymmetric-encryption.d.ts.map +1 -0
  38. package/dist/crypto/asymmetric-encryption.js +1 -1
  39. package/dist/crypto/asymmetric-encryption.js.map +1 -1
  40. package/dist/crypto/crypto-exception.d.ts +1 -0
  41. package/dist/crypto/crypto-exception.d.ts.map +1 -0
  42. package/dist/crypto/crypto-exception.js +2 -6
  43. package/dist/crypto/crypto-exception.js.map +1 -1
  44. package/dist/crypto/digital-signature.d.ts +2 -0
  45. package/dist/crypto/digital-signature.d.ts.map +1 -0
  46. package/dist/crypto/digital-signature.js +1 -1
  47. package/dist/crypto/digital-signature.js.map +1 -1
  48. package/dist/crypto/hash.d.ts +1 -0
  49. package/dist/crypto/hash.d.ts.map +1 -0
  50. package/dist/crypto/hash.js +7 -11
  51. package/dist/crypto/hash.js.map +1 -1
  52. package/dist/crypto/hmac.d.ts +1 -0
  53. package/dist/crypto/hmac.d.ts.map +1 -0
  54. package/dist/crypto/hmac.js +6 -10
  55. package/dist/crypto/hmac.js.map +1 -1
  56. package/dist/crypto/symmetric-encryption.d.ts +1 -0
  57. package/dist/crypto/symmetric-encryption.d.ts.map +1 -0
  58. package/dist/crypto/symmetric-encryption.js +13 -17
  59. package/dist/crypto/symmetric-encryption.js.map +1 -1
  60. package/dist/index.d.ts +13 -12
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +17 -28
  63. package/dist/index.js.map +1 -1
  64. package/dist/tsconfig.json +2 -1
  65. package/eslint.config.js +591 -0
  66. package/package.json +24 -24
  67. package/src/api-security/claims-identity.ts +1 -1
  68. package/src/api-security/json-web-token.ts +21 -21
  69. package/src/bin.ts +2 -1
  70. package/src/crypto/hash.ts +9 -9
  71. package/src/crypto/hmac.ts +7 -7
  72. package/src/crypto/symmetric-encryption.ts +11 -11
  73. package/src/index.ts +17 -18
  74. package/test/asymmetric-encryption.test.ts +37 -37
  75. package/test/digital-signature.test.ts +22 -22
  76. package/test/hash.test.ts +109 -109
  77. package/test/hmac.test.ts +56 -55
  78. package/test/json-web-token.test.ts +95 -95
  79. package/test/other.test.ts +8 -7
  80. package/test/symmetric-encryption.test.ts +49 -48
  81. package/tsconfig.json +8 -5
  82. package/.eslintignore +0 -2
  83. package/.eslintrc +0 -335
@@ -0,0 +1,591 @@
1
+ import eslint from "@eslint/js";
2
+ import tsEslint from "typescript-eslint";
3
+ import { defineConfig } from "eslint/config";
4
+ import importPlugin from "eslint-plugin-import";
5
+ import tsParser from "@typescript-eslint/parser";
6
+
7
+ import stylistic from "@stylistic/eslint-plugin";
8
+
9
+ export default defineConfig(
10
+ eslint.configs.recommended,
11
+ tsEslint.configs.recommended,
12
+ importPlugin.flatConfigs.recommended,
13
+ {
14
+ ignores: ["dist/**", "node_modules/**", "**/*.js", "**/*.map", "**/*d.ts"]
15
+ },
16
+ {
17
+ files: ["**/*.ts"],
18
+ extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript],
19
+ languageOptions: {
20
+ parser: tsParser,
21
+ ecmaVersion: "latest",
22
+ sourceType: "module"
23
+ },
24
+ settings: {
25
+ "import/parsers": {
26
+ "@typescript-eslint/parser": [".ts", ".tsx"]
27
+ },
28
+ // "import/resolver": {
29
+ // "node": {
30
+ // "extensions": [".js", ".jsx"],
31
+ // "moduleDirectory": ["node_modules"]
32
+ // }
33
+ // },
34
+ "import/resolver": {
35
+ node: {
36
+ extensions: [".js", ".jsx", ".ts", ".tsx"]
37
+ },
38
+ typescript: {
39
+ // Point to your tsconfig if needed:
40
+ project: "./tsconfig.json"
41
+ }
42
+ },
43
+ },
44
+ rules: {
45
+ // "import/no-unresolved": "off",
46
+ "import/no-extraneous-dependencies": ["error"]
47
+ }
48
+ },
49
+ {
50
+ files: ["**/*.ts"],
51
+ languageOptions: {
52
+ parserOptions: {
53
+ project: [
54
+ "./tsconfig.json"
55
+ ],
56
+ tsconfigRootDir: import.meta.dirname,
57
+ projectService: true
58
+ }
59
+ },
60
+ plugins: {
61
+ "@stylistic/ts": stylistic
62
+ },
63
+ "rules": {
64
+ "import/extensions": [
65
+ "error",
66
+ "always",
67
+ {
68
+ "ts": "never",
69
+ "js": "always"
70
+ }
71
+ ],
72
+ // "quotes": "off",
73
+ "quotes": [
74
+ "error",
75
+ "double",
76
+ {
77
+ "allowTemplateLiterals": true
78
+ }
79
+ ],
80
+ "no-eval": "error",
81
+ "no-void": "error",
82
+ "no-with": "error",
83
+ "@typescript-eslint/adjacent-overload-signatures": "error",
84
+ "@typescript-eslint/array-type": [
85
+ "error",
86
+ {
87
+ "default": "generic",
88
+ "readonly": "generic"
89
+ }
90
+ ],
91
+ // "@typescript-eslint/consistent-type-assertions": ["error", {
92
+ // assertionStyle: "as",
93
+ // objectLiteralTypeAssertions: "allow-as-parameter"
94
+ // }],
95
+ "@typescript-eslint/await-thenable": "error",
96
+ "@typescript-eslint/ban-ts-comment": [
97
+ "error",
98
+ {
99
+ "ts-expect-error": "allow-with-description",
100
+ "ts-ignore": "allow-with-description",
101
+ "ts-nocheck": true,
102
+ "ts-check": true
103
+ }
104
+ ],
105
+ "@typescript-eslint/ban-tslint-comment": "error",
106
+ "@typescript-eslint/no-empty-object-type": "error",
107
+ "@typescript-eslint/no-unsafe-function-type": "error",
108
+ "@typescript-eslint/no-wrapper-object-types": "off",
109
+ "@typescript-eslint/no-restricted-types": [
110
+ "error",
111
+ {
112
+ "types": {
113
+ "String": {
114
+ "message": "Use string instead",
115
+ "fixWith": "string"
116
+ },
117
+ "Boolean": {
118
+ "message": "Use boolean instead",
119
+ "fixWith": "boolean"
120
+ },
121
+ "Number": {
122
+ "message": "Use number instead",
123
+ "fixWith": "number"
124
+ },
125
+ "Symbol": {
126
+ "message": "Use symbol instead",
127
+ "fixWith": "symbol"
128
+ }
129
+ }
130
+ }
131
+ ],
132
+ "brace-style": "off",
133
+ "@stylistic/ts/brace-style": [
134
+ "error",
135
+ "allman",
136
+ {
137
+ "allowSingleLine": true
138
+ }
139
+ ],
140
+ "@typescript-eslint/class-literal-property-style": [
141
+ "off",
142
+ "getters"
143
+ ],
144
+ "comma-dangle": "off",
145
+ "@stylistic/ts/comma-dangle": [
146
+ "error",
147
+ {
148
+ "arrays": "never",
149
+ "objects": "only-multiline",
150
+ "imports": "never",
151
+ "exports": "never",
152
+ "functions": "never",
153
+ "enums": "only-multiline"
154
+ }
155
+ ],
156
+ "default-param-last": "off",
157
+ "@typescript-eslint/default-param-last": "error",
158
+ "@typescript-eslint/explicit-function-return-type": "error",
159
+ "@typescript-eslint/explicit-member-accessibility": "error",
160
+ "@typescript-eslint/explicit-module-boundary-types": "error",
161
+ "func-call-spacing": "off",
162
+ "@stylistic/ts/function-call-spacing": [
163
+ "error",
164
+ "never"
165
+ ],
166
+ "@stylistic/ts/member-delimiter-style": [
167
+ "error",
168
+ {
169
+ "multiline": {
170
+ "delimiter": "semi",
171
+ "requireLast": true
172
+ },
173
+ "singleline": {
174
+ "delimiter": "semi",
175
+ "requireLast": true
176
+ },
177
+ "multilineDetection": "brackets"
178
+ }
179
+ ],
180
+ "@typescript-eslint/member-ordering": [
181
+ "error",
182
+ {
183
+ "default": [
184
+ // Index signature
185
+ "signature",
186
+ // Fields
187
+ "private-static-field",
188
+ "protected-static-field",
189
+ "public-static-field",
190
+ // "private-decorated-field",
191
+ // "protected-decorated-field",
192
+ // "public-decorated-field",
193
+ "private-instance-field",
194
+ "protected-instance-field",
195
+ "public-instance-field",
196
+ // "public-abstract-field",
197
+ // "protected-abstract-field",
198
+ // "private-abstract-field",
199
+ // "private-field",
200
+ // "protected-field",
201
+ // "public-field",
202
+ // "static-field",
203
+ // "instance-field",
204
+ // "abstract-field",
205
+ // "decorated-field",
206
+ // "field",
207
+ // Getters
208
+ // "public-static-get",
209
+ // "protected-static-get",
210
+ // "private-static-get",
211
+ // "public-decorated-get",
212
+ // "protected-decorated-get",
213
+ // "private-decorated-get",
214
+ // "public-instance-get",
215
+ // "protected-instance-get",
216
+ // "private-instance-get",
217
+ // "public-abstract-get",
218
+ // "protected-abstract-get",
219
+ // "private-abstract-get",
220
+ // "public-get",
221
+ // "protected-get",
222
+ // "private-get",
223
+ // "static-get",
224
+ // "instance-get",
225
+ // "abstract-get",
226
+ // "decorated-get",
227
+ // "get",
228
+ // Setters
229
+ // "public-static-set",
230
+ // "protected-static-set",
231
+ // "private-static-set",
232
+ // "public-decorated-set",
233
+ // "protected-decorated-set",
234
+ // "private-decorated-set",
235
+ // "public-instance-set",
236
+ // "protected-instance-set",
237
+ // "private-instance-set",
238
+ // "public-abstract-set",
239
+ // "protected-abstract-set",
240
+ // "private-abstract-set",
241
+ // "public-set",
242
+ // "protected-set",
243
+ // "private-set",
244
+ // "static-set",
245
+ // "instance-set",
246
+ // "abstract-set",
247
+ // "decorated-set",
248
+ // "set",
249
+ // [
250
+ // "get",
251
+ // "set"
252
+ // ],
253
+ [
254
+ "private-static-get",
255
+ "private-static-set"
256
+ ],
257
+ [
258
+ "protected-static-get",
259
+ "protected-static-set"
260
+ ],
261
+ [
262
+ "public-static-get",
263
+ "public-static-set"
264
+ ],
265
+ [
266
+ "private-instance-get",
267
+ "private-instance-set"
268
+ ],
269
+ [
270
+ "protected-instance-get",
271
+ "protected-instance-set"
272
+ ],
273
+ [
274
+ "public-instance-get",
275
+ "public-instance-set"
276
+ ],
277
+ // Constructors
278
+ "public-constructor",
279
+ "protected-constructor",
280
+ "private-constructor",
281
+ // "constructor",
282
+ // Methods
283
+ "public-static-method",
284
+ "protected-static-method",
285
+ "private-static-method",
286
+ // "public-decorated-method",
287
+ // "protected-decorated-method",
288
+ // "private-decorated-method",
289
+ "public-instance-method",
290
+ "protected-instance-method",
291
+ "private-instance-method"
292
+ // "public-abstract-method",
293
+ // "protected-abstract-method",
294
+ // "private-abstract-method",
295
+ // "public-method",
296
+ // "protected-method",
297
+ // "private-method",
298
+ // "static-method",
299
+ // "instance-method",
300
+ // "abstract-method",
301
+ // "decorated-method",
302
+ // "method"
303
+ ]
304
+ }
305
+ ],
306
+ "@typescript-eslint/method-signature-style": [
307
+ "error",
308
+ "method"
309
+ ],
310
+ "@typescript-eslint/naming-convention": [
311
+ "error",
312
+ {
313
+ "selector": "memberLike",
314
+ "modifiers": [
315
+ "private"
316
+ ],
317
+ "format": [
318
+ "camelCase"
319
+ ],
320
+ "leadingUnderscore": "require"
321
+ }
322
+ ],
323
+ "@typescript-eslint/no-confusing-non-null-assertion": "error",
324
+ "@typescript-eslint/no-confusing-void-expression": [
325
+ "error",
326
+ {
327
+ "ignoreArrowShorthand": true
328
+ }
329
+ ],
330
+ "no-dupe-class-members": "off",
331
+ "@typescript-eslint/no-dupe-class-members": "error",
332
+ "@typescript-eslint/no-duplicate-enum-values": "error",
333
+ "no-duplicate-imports": "error",
334
+ "no-empty-function": "off",
335
+ "@typescript-eslint/no-empty-function": [
336
+ "error",
337
+ {
338
+ "allow": [
339
+ "private-constructors"
340
+ ]
341
+ }
342
+ ],
343
+ "@typescript-eslint/no-explicit-any": "off",
344
+ "@typescript-eslint/no-extra-non-null-assertion": "error",
345
+ "no-extra-parens": "off",
346
+ "@stylistic/ts/no-extra-parens": [
347
+ "error",
348
+ "all",
349
+ {
350
+ "nestedBinaryExpressions": false
351
+ }
352
+ ],
353
+ "no-extra-semi": "off",
354
+ "@stylistic/ts/no-extra-semi": "error",
355
+ "@typescript-eslint/no-floating-promises": "error",
356
+ "@typescript-eslint/no-for-in-array": "error",
357
+ "no-implied-eval": "off",
358
+ "@typescript-eslint/no-implied-eval": "error",
359
+ "no-invalid-this": "off",
360
+ "@typescript-eslint/no-invalid-this": "error",
361
+ "@typescript-eslint/no-invalid-void-type": "error",
362
+ "no-loop-func": "off",
363
+ "@typescript-eslint/no-loop-func": "error",
364
+ "no-loss-of-precision": "off",
365
+ "@typescript-eslint/no-loss-of-precision": "error",
366
+ "@typescript-eslint/no-meaningless-void-operator": "error",
367
+ "@typescript-eslint/no-misused-new": "error",
368
+ "@typescript-eslint/no-misused-promises": "error",
369
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
370
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
371
+ "@typescript-eslint/no-non-null-assertion": "off",
372
+ "no-redeclare": "off",
373
+ "@typescript-eslint/no-redeclare": "error",
374
+ "@typescript-eslint/no-this-alias": "error",
375
+ "no-throw-literal": "error",
376
+ "@typescript-eslint/no-unnecessary-condition": [
377
+ "error",
378
+ {
379
+ "allowConstantLoopConditions": true
380
+ }
381
+ ],
382
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
383
+ "@typescript-eslint/no-unnecessary-type-constraint": "error",
384
+ "@typescript-eslint/no-unsafe-call": "error",
385
+ "@typescript-eslint/no-unsafe-return": "error",
386
+ "no-unused-expressions": "off",
387
+ "@typescript-eslint/no-unused-expressions": "error",
388
+ "no-unused-vars": "off",
389
+ "@typescript-eslint/no-unused-vars": "off",
390
+ "no-use-before-define": "off",
391
+ "@typescript-eslint/no-use-before-define": "off",
392
+ "no-useless-constructor": "off",
393
+ "@typescript-eslint/no-useless-constructor": "error",
394
+ "@typescript-eslint/no-useless-empty-export": "error",
395
+ "@typescript-eslint/no-var-requires": "off",
396
+ "@typescript-eslint/parameter-properties": "error",
397
+ "@typescript-eslint/prefer-enum-initializers": "error",
398
+ "@typescript-eslint/prefer-includes": "error",
399
+ "@typescript-eslint/prefer-literal-enum-member": "error",
400
+ "@typescript-eslint/prefer-readonly": "error",
401
+ "@typescript-eslint/prefer-reduce-type-parameter": "error",
402
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
403
+ "@typescript-eslint/prefer-ts-expect-error": "error",
404
+ "@typescript-eslint/require-array-sort-compare": "error",
405
+ "no-return-await": "off",
406
+ "@typescript-eslint/return-await": "error",
407
+ "semi": "off",
408
+ "@stylistic/ts/semi": "error",
409
+ "@typescript-eslint/unbound-method": "error",
410
+ "@typescript-eslint/no-require-imports": [
411
+ "error",
412
+ {
413
+ allow: ["/.*-view.html$"]
414
+ }
415
+ ]
416
+ }
417
+ }
418
+ );
419
+
420
+
421
+
422
+ // export default [
423
+ // {
424
+ // ignores: ["dist/**", "node_modules/**", "**/*.js", "**/*.map"]
425
+ // },
426
+ // {
427
+ // files: ["**/*.ts"],
428
+ // languageOptions: {
429
+ // parser: tsParser,
430
+ // parserOptions: {
431
+ // project: "./tsconfig.json",
432
+ // ecmaVersion: "latest",
433
+ // sourceType: "module"
434
+ // }
435
+ // },
436
+ // plugins: {
437
+ // "@typescript-eslint": tsEslint,
438
+ // "require-extensions": requireExtensions
439
+ // },
440
+ // rules: {
441
+ // // Base ESLint recommended rules
442
+ // ...js.configs.recommended.rules,
443
+ // // TypeScript ESLint recommended rules
444
+ // ...tsEslint.configs.recommended.rules,
445
+ // ...tsEslint.configs["eslint-recommended"].overrides[0].rules,
446
+ // // Require extensions recommended rules
447
+ // ...requireExtensions.configs.recommended.rules,
448
+
449
+ // // Your custom rules
450
+ // "quotes": "off",
451
+ // "@typescript-eslint/quotes": ["error", "double", { allowTemplateLiterals: true }],
452
+ // "no-eval": "error",
453
+ // "no-void": "error",
454
+ // "no-with": "error",
455
+ // "@typescript-eslint/adjacent-overload-signatures": "error",
456
+ // "@typescript-eslint/array-type": ["error", { default: "generic", readonly: "generic" }],
457
+ // "@typescript-eslint/await-thenable": "error",
458
+ // "@typescript-eslint/ban-ts-comment": ["error", {
459
+ // "ts-expect-error": "allow-with-description",
460
+ // "ts-ignore": "allow-with-description",
461
+ // "ts-nocheck": true,
462
+ // "ts-check": true
463
+ // }],
464
+ // "@typescript-eslint/ban-tslint-comment": "error",
465
+ // "@typescript-eslint/ban-types": ["error", {
466
+ // extendDefaults: false,
467
+ // types: {
468
+ // "String": { message: "Use string instead", fixWith: "string" },
469
+ // "Boolean": { message: "Use boolean instead", fixWith: "boolean" },
470
+ // "Number": { message: "Use number instead", fixWith: "number" },
471
+ // "Symbol": { message: "Use symbol instead", fixWith: "symbol" }
472
+ // }
473
+ // }],
474
+ // "brace-style": "off",
475
+ // "@typescript-eslint/brace-style": ["error", "allman", { allowSingleLine: true }],
476
+ // "@typescript-eslint/class-literal-property-style": ["off", "getters"],
477
+ // "comma-dangle": "off",
478
+ // "@typescript-eslint/comma-dangle": ["error", "never"],
479
+ // "default-param-last": "off",
480
+ // "@typescript-eslint/default-param-last": "error",
481
+ // "@typescript-eslint/explicit-function-return-type": "error",
482
+ // "@typescript-eslint/explicit-member-accessibility": "error",
483
+ // "@typescript-eslint/explicit-module-boundary-types": "error",
484
+ // "func-call-spacing": "off",
485
+ // "@typescript-eslint/func-call-spacing": ["error", "never"],
486
+ // "@typescript-eslint/member-delimiter-style": ["error", {
487
+ // multiline: { delimiter: "semi", requireLast: true },
488
+ // singleline: { delimiter: "semi", requireLast: true },
489
+ // multilineDetection: "brackets"
490
+ // }],
491
+ // "@typescript-eslint/member-ordering": ["error", {
492
+ // default: [
493
+ // "signature",
494
+ // "private-static-field",
495
+ // "protected-static-field",
496
+ // "public-static-field",
497
+ // "private-instance-field",
498
+ // "protected-instance-field",
499
+ // "public-instance-field",
500
+ // ["private-static-get", "private-static-set"],
501
+ // ["protected-static-get", "protected-static-set"],
502
+ // ["public-static-get", "public-static-set"],
503
+ // ["private-instance-get", "private-instance-set"],
504
+ // ["protected-instance-get", "protected-instance-set"],
505
+ // ["public-instance-get", "public-instance-set"],
506
+ // "public-constructor",
507
+ // "protected-constructor",
508
+ // "private-constructor",
509
+ // "public-static-method",
510
+ // "protected-static-method",
511
+ // "private-static-method",
512
+ // "public-instance-method",
513
+ // "protected-instance-method",
514
+ // "private-instance-method"
515
+ // ]
516
+ // }],
517
+ // "@typescript-eslint/method-signature-style": ["error", "method"],
518
+ // "@typescript-eslint/naming-convention": ["error", {
519
+ // selector: "memberLike",
520
+ // modifiers: ["private"],
521
+ // format: ["camelCase"],
522
+ // leadingUnderscore: "require"
523
+ // }],
524
+ // "@typescript-eslint/no-confusing-non-null-assertion": "error",
525
+ // "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
526
+ // "no-dupe-class-members": "off",
527
+ // "@typescript-eslint/no-dupe-class-members": "error",
528
+ // "@typescript-eslint/no-duplicate-enum-values": "error",
529
+ // "no-duplicate-imports": "error",
530
+ // "no-empty-function": "off",
531
+ // "@typescript-eslint/no-empty-function": ["error", { allow: ["private-constructors"] }],
532
+ // "@typescript-eslint/no-explicit-any": "off",
533
+ // "@typescript-eslint/no-extra-non-null-assertion": "error",
534
+ // "no-extra-parens": "off",
535
+ // "@typescript-eslint/no-extra-parens": ["error", "all", { nestedBinaryExpressions: false }],
536
+ // "no-extra-semi": "off",
537
+ // "@typescript-eslint/no-extra-semi": "error",
538
+ // "@typescript-eslint/no-floating-promises": "error",
539
+ // "@typescript-eslint/no-for-in-array": "error",
540
+ // "no-implied-eval": "off",
541
+ // "@typescript-eslint/no-implied-eval": "error",
542
+ // "no-invalid-this": "off",
543
+ // "@typescript-eslint/no-invalid-this": "error",
544
+ // "@typescript-eslint/no-invalid-void-type": "error",
545
+ // "no-loop-func": "off",
546
+ // "@typescript-eslint/no-loop-func": "error",
547
+ // "no-loss-of-precision": "off",
548
+ // "@typescript-eslint/no-loss-of-precision": "error",
549
+ // "@typescript-eslint/no-meaningless-void-operator": "error",
550
+ // "@typescript-eslint/no-misused-new": "error",
551
+ // "@typescript-eslint/no-misused-promises": "error",
552
+ // "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
553
+ // "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
554
+ // "@typescript-eslint/no-non-null-assertion": "off",
555
+ // "no-redeclare": "off",
556
+ // "@typescript-eslint/no-redeclare": "error",
557
+ // "@typescript-eslint/no-this-alias": "error",
558
+ // "@typescript-eslint/no-throw-literal": "error",
559
+ // "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
560
+ // "@typescript-eslint/no-unnecessary-type-assertion": "error",
561
+ // "@typescript-eslint/no-unnecessary-type-constraint": "error",
562
+ // "@typescript-eslint/no-unsafe-call": "error",
563
+ // "@typescript-eslint/no-unsafe-return": "error",
564
+ // "no-unused-expressions": "off",
565
+ // "@typescript-eslint/no-unused-expressions": "error",
566
+ // "no-unused-vars": "off",
567
+ // "@typescript-eslint/no-unused-vars": "off",
568
+ // "no-use-before-define": "off",
569
+ // "@typescript-eslint/no-use-before-define": "off",
570
+ // "no-useless-constructor": "off",
571
+ // "@typescript-eslint/no-useless-constructor": "error",
572
+ // "@typescript-eslint/no-useless-empty-export": "error",
573
+ // "@typescript-eslint/no-var-requires": "off",
574
+ // "@typescript-eslint/parameter-properties": "error",
575
+ // "@typescript-eslint/prefer-enum-initializers": "error",
576
+ // "@typescript-eslint/prefer-includes": "error",
577
+ // "@typescript-eslint/prefer-literal-enum-member": "error",
578
+ // "@typescript-eslint/prefer-readonly": "error",
579
+ // "@typescript-eslint/prefer-reduce-type-parameter": "error",
580
+ // "@typescript-eslint/prefer-string-starts-ends-with": "error",
581
+ // "@typescript-eslint/prefer-ts-expect-error": "error",
582
+ // "@typescript-eslint/require-array-sort-compare": "error",
583
+ // "no-return-await": "off",
584
+ // "@typescript-eslint/return-await": "error",
585
+ // "semi": "off",
586
+ // "@typescript-eslint/semi": "error",
587
+ // "@typescript-eslint/unbound-method": "error"
588
+ // }
589
+ // }
590
+ // ];
591
+
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@nivinjoseph/n-sec",
3
- "version": "5.0.5",
3
+ "version": "6.0.2",
4
4
  "description": "Security library",
5
- "main": "./dist/index.js",
5
+ "packageManager": "yarn@4.0.2",
6
+ "type": "module",
7
+ "exports": "./dist/index.js",
6
8
  "types": "./dist/index.d.ts",
9
+ "bin": "./dist/bin.js",
7
10
  "scripts": {
8
11
  "ts-compile": "tsc -p .",
9
12
  "ts-lint": "eslint . --ext .ts",
10
- "ts-build": "npm run ts-compile && npm run ts-lint",
11
- "ts-build-dist": "npm run ts-build && tsc -p ./dist",
12
- "clean-src": "find ./src -name '*.js' -delete -o -name '*.map' -delete",
13
- "clean-test": "find ./test -name '*.js' -delete -o -name '*.map' -delete",
14
- "pretest": "npm run ts-build",
15
- "test": "mocha --timeout 5000 --reporter spec --ui tdd --require ts-node/register './test/**/*.test.js' || true",
16
- "pretest-ci": "npm run pretest",
17
- "test-ci": "mocha --timeout 5000 --reporter spec --ui tdd --require ts-node/register './test/**/*.test.js'",
18
- "publish-package": "npm run ts-build-dist && git add . && git commit -m 'preparing to publish new version' && npm version patch && git push && npm publish --access=public"
13
+ "ts-build": "yarn ts-compile && yarn ts-lint",
14
+ "ts-build-dist": "yarn ts-build && tsc -p ./dist",
15
+ "test": "yarn ts-build && node --test --enable-source-maps ./test/**/*.test.js",
16
+ "publish-package": "yarn ts-build-dist && git add . && git commit -m 'preparing to publish new version' && npm version patch && git push && npm publish --access=public"
19
17
  },
20
- "bin": "./dist/bin.js",
21
18
  "repository": {
22
19
  "type": "git",
23
20
  "url": "git+https://github.com/nivinjoseph/n-sec.git"
@@ -33,19 +30,22 @@
33
30
  },
34
31
  "homepage": "https://github.com/nivinjoseph/n-sec#readme",
35
32
  "devDependencies": {
36
- "@types/mocha": "^9.1.1",
37
- "@types/node": "^18.11.17",
38
- "@typescript-eslint/eslint-plugin": "^5.25.0",
39
- "@typescript-eslint/parser": "^5.25.0",
40
- "eslint": "^8.15.0",
41
- "mocha": "^10.0.0",
42
- "ts-node": "^10.7.0",
43
- "typescript": "^4.6.4"
33
+ "@eslint/js": "^9.39.1",
34
+ "@stylistic/eslint-plugin": "^5.5.0",
35
+ "@types/node": "^24.10",
36
+ "eslint": "^9.39.1",
37
+ "eslint-import-resolver-typescript": "^4.4.4",
38
+ "eslint-plugin-import": "^2.32.0",
39
+ "typescript": "^5.9.3",
40
+ "typescript-eslint": "^8.46.3"
44
41
  },
45
42
  "dependencies": {
46
- "@nivinjoseph/n-defensive": "^1.0.41",
47
- "@nivinjoseph/n-exception": "^1.0.26",
48
- "@nivinjoseph/n-ext": "^1.1.36",
49
- "@nivinjoseph/n-util": "^1.0.81"
43
+ "@nivinjoseph/n-defensive": "^2.0.2",
44
+ "@nivinjoseph/n-exception": "^2.0.2",
45
+ "@nivinjoseph/n-ext": "^2.0.2",
46
+ "@nivinjoseph/n-util": "^3.0.2"
47
+ },
48
+ "engines": {
49
+ "node": ">=24.10"
50
50
  }
51
51
  }