enterprise-number-classification-sdk 1.0.0-enterprise.stable
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/.prettierrc.json +7 -0
- package/CODE_OF_CONDUCT.MD +77 -0
- package/LICENSE +30 -0
- package/README.md +1828 -0
- package/eslint.config.mjs +161 -0
- package/index.d.ts +50 -0
- package/index.js +475 -0
- package/package.json +543 -0
- package/test/tests.js +40 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config"
|
|
2
|
+
import globals from "globals"
|
|
3
|
+
|
|
4
|
+
export default defineConfig([
|
|
5
|
+
{
|
|
6
|
+
languageOptions: {
|
|
7
|
+
globals: {
|
|
8
|
+
...globals.browser,
|
|
9
|
+
...globals.node
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
ecmaVersion: 2022,
|
|
13
|
+
sourceType: "module"
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
"array-callback-return": "error",
|
|
18
|
+
"constructor-super": "error",
|
|
19
|
+
"for-direction": "error",
|
|
20
|
+
"getter-return": "error",
|
|
21
|
+
"no-async-promise-executor": "error",
|
|
22
|
+
"no-await-in-loop": "error",
|
|
23
|
+
"no-class-assign": "error",
|
|
24
|
+
"no-compare-neg-zero": "error",
|
|
25
|
+
"no-cond-assign": "error",
|
|
26
|
+
"no-const-assign": "error",
|
|
27
|
+
"no-constant-binary-expression": "error",
|
|
28
|
+
"no-constant-condition": "error",
|
|
29
|
+
"no-constructor-return": "error",
|
|
30
|
+
"no-control-regex": "error",
|
|
31
|
+
"no-debugger": "error",
|
|
32
|
+
"no-dupe-args": "error",
|
|
33
|
+
"no-dupe-class-members": "error",
|
|
34
|
+
"no-dupe-else-if": "error",
|
|
35
|
+
"no-dupe-keys": "error",
|
|
36
|
+
"no-duplicate-case": "error",
|
|
37
|
+
"no-duplicate-imports": "error",
|
|
38
|
+
"no-empty-character-class": "error",
|
|
39
|
+
"no-empty-pattern": "error",
|
|
40
|
+
"no-ex-assign": "error",
|
|
41
|
+
"no-fallthrough": "error",
|
|
42
|
+
"no-func-assign": "error",
|
|
43
|
+
"no-import-assign": "error",
|
|
44
|
+
"no-inner-declarations": "error",
|
|
45
|
+
"no-invalid-regexp": "error",
|
|
46
|
+
"no-irregular-whitespace": "error",
|
|
47
|
+
"no-loss-of-precision": "error",
|
|
48
|
+
"no-misleading-character-class": "error",
|
|
49
|
+
"no-new-native-nonconstructor": "error",
|
|
50
|
+
"no-obj-calls": "error",
|
|
51
|
+
"no-promise-executor-return": "error",
|
|
52
|
+
"no-prototype-builtins": "error",
|
|
53
|
+
"no-self-assign": "error",
|
|
54
|
+
"no-self-compare": "error",
|
|
55
|
+
"no-setter-return": "error",
|
|
56
|
+
"no-sparse-arrays": "error",
|
|
57
|
+
"no-template-curly-in-string": "error",
|
|
58
|
+
"no-this-before-super": "error",
|
|
59
|
+
"no-unassigned-vars": "error",
|
|
60
|
+
"no-undef": "error",
|
|
61
|
+
"no-unexpected-multiline": "error",
|
|
62
|
+
"no-unmodified-loop-condition": "error",
|
|
63
|
+
"no-unreachable": "error",
|
|
64
|
+
"no-unreachable-loop": "error",
|
|
65
|
+
"no-unsafe-finally": "error",
|
|
66
|
+
"no-unsafe-negation": "error",
|
|
67
|
+
"no-unsafe-optional-chaining": "error",
|
|
68
|
+
"no-unused-private-class-members": "error",
|
|
69
|
+
"no-unused-vars": "error",
|
|
70
|
+
"no-use-before-define": "error",
|
|
71
|
+
"no-useless-assignment": "error",
|
|
72
|
+
"no-useless-backreference": "error",
|
|
73
|
+
"require-atomic-updates": "error",
|
|
74
|
+
"use-isnan": "error",
|
|
75
|
+
"valid-typeof": "error",
|
|
76
|
+
"accessor-pairs": "error",
|
|
77
|
+
"block-scoped-var": "error",
|
|
78
|
+
"class-methods-use-this": "error",
|
|
79
|
+
"complexity": "error",
|
|
80
|
+
"consistent-return": "error",
|
|
81
|
+
"default-case": "error",
|
|
82
|
+
"default-case-last": "error",
|
|
83
|
+
"eqeqeq": "error",
|
|
84
|
+
"func-names": "error",
|
|
85
|
+
"grouped-accessor-pairs": "error",
|
|
86
|
+
"guard-for-in": "error",
|
|
87
|
+
"max-classes-per-file": "error",
|
|
88
|
+
"max-depth": "error",
|
|
89
|
+
"max-nested-callbacks": "error",
|
|
90
|
+
"max-params": "error",
|
|
91
|
+
"new-cap": "error",
|
|
92
|
+
"no-alert": "error",
|
|
93
|
+
"no-array-constructor": "error",
|
|
94
|
+
"no-bitwise": "error",
|
|
95
|
+
"no-caller": "error",
|
|
96
|
+
"no-case-declarations": "error",
|
|
97
|
+
"no-console": "error",
|
|
98
|
+
"no-delete-var": "error",
|
|
99
|
+
"no-empty": "error",
|
|
100
|
+
"no-empty-function": "error",
|
|
101
|
+
"no-empty-static-block": "error",
|
|
102
|
+
"no-eq-null": "error",
|
|
103
|
+
"no-eval": "error",
|
|
104
|
+
"no-extend-native": "error",
|
|
105
|
+
"no-extra-bind": "error",
|
|
106
|
+
"no-global-assign": "error",
|
|
107
|
+
"no-implicit-globals": "error",
|
|
108
|
+
"no-implied-eval": "error",
|
|
109
|
+
"no-invalid-this": "error",
|
|
110
|
+
"no-iterator": "error",
|
|
111
|
+
"no-lone-blocks": "error",
|
|
112
|
+
"no-loop-func": "error",
|
|
113
|
+
"no-multi-assign": "error",
|
|
114
|
+
"no-new": "error",
|
|
115
|
+
"no-new-func": "error",
|
|
116
|
+
"no-new-wrappers": "error",
|
|
117
|
+
"no-nonoctal-decimal-escape": "error",
|
|
118
|
+
"no-object-constructor": "error",
|
|
119
|
+
"no-octal": "error",
|
|
120
|
+
"no-octal-escape": "error",
|
|
121
|
+
"no-param-reassign": "error",
|
|
122
|
+
"no-proto": "error",
|
|
123
|
+
"no-redeclare": "error",
|
|
124
|
+
"no-regex-spaces": "error",
|
|
125
|
+
"no-restricted-exports": "error",
|
|
126
|
+
"no-restricted-globals": "error",
|
|
127
|
+
"no-restricted-imports": "error",
|
|
128
|
+
"no-restricted-properties": "error",
|
|
129
|
+
"no-restricted-syntax": "error",
|
|
130
|
+
"no-return-assign": "error",
|
|
131
|
+
"no-script-url": "error",
|
|
132
|
+
"no-sequences": "error",
|
|
133
|
+
"no-shadow": "error",
|
|
134
|
+
"no-throw-literal": "error",
|
|
135
|
+
"no-unused-expressions": "error",
|
|
136
|
+
"no-unused-labels": "error",
|
|
137
|
+
"no-useless-call": "error",
|
|
138
|
+
"no-useless-catch": "error",
|
|
139
|
+
"no-useless-constructor": "error",
|
|
140
|
+
"no-useless-escape": "error",
|
|
141
|
+
"no-useless-rename": "error",
|
|
142
|
+
"no-useless-return": "error",
|
|
143
|
+
"no-var": "error",
|
|
144
|
+
"no-with": "error",
|
|
145
|
+
"prefer-const": "error",
|
|
146
|
+
"prefer-named-capture-group": "error",
|
|
147
|
+
"prefer-object-has-own": "error",
|
|
148
|
+
"prefer-promise-reject-errors": "error",
|
|
149
|
+
"prefer-regex-literals": "error",
|
|
150
|
+
"prefer-rest-params": "error",
|
|
151
|
+
"preserve-caught-error": "error",
|
|
152
|
+
"radix": "error",
|
|
153
|
+
"require-await": "error",
|
|
154
|
+
"require-unicode-regexp": "error",
|
|
155
|
+
"require-yield": "error",
|
|
156
|
+
"strict": "error",
|
|
157
|
+
"symbol-description": "error",
|
|
158
|
+
"unicode-bom": "error"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
])
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaration file for the Enterprise Number Classification SDK.
|
|
3
|
+
* Engineered for maximum type safety and corporate compliance.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module "enterprise-number-classification-sdk" {
|
|
7
|
+
/**
|
|
8
|
+
* Configuration manifest for numeric classification operations.
|
|
9
|
+
*/
|
|
10
|
+
export interface ClassificationOptions {
|
|
11
|
+
/** Suppress non-numeric errors and return falseValue. */
|
|
12
|
+
throwOnNonNumber?: boolean
|
|
13
|
+
/** Suppress non-integer errors and return falseValue. */
|
|
14
|
+
throwOnNonInteger?: boolean
|
|
15
|
+
/** Suppress non-finite errors and return falseValue. */
|
|
16
|
+
throwOnNonFinite?: boolean
|
|
17
|
+
/** Suppress NaN-state errors and return falseValue. */
|
|
18
|
+
throwOnNaN?: boolean
|
|
19
|
+
/** * Permits the intake of stringified numeric nodes.
|
|
20
|
+
* Note: Enabling this triggers intrinsic casting logic.
|
|
21
|
+
*/
|
|
22
|
+
allowNumberStrings?: boolean
|
|
23
|
+
/** Activates chromatic telemetry emission to the enterprise console. */
|
|
24
|
+
enableDebug?: boolean
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Evaluates the parity state of a numeric node to determine evenness.
|
|
29
|
+
* Utilizes a dual-path execution strategy (Recursive + String-Parsing Fallback).
|
|
30
|
+
* * @param number The numeric entity to be classified.
|
|
31
|
+
* @param options The enterprise configuration manifest.
|
|
32
|
+
* @returns A boolean representing the evenness classification.
|
|
33
|
+
*/
|
|
34
|
+
export function checkEven(
|
|
35
|
+
number: number | string | any,
|
|
36
|
+
options?: ClassificationOptions
|
|
37
|
+
): boolean
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Evaluates the parity state of a numeric node to determine oddity.
|
|
41
|
+
* Utilizes a dual-path execution strategy (Recursive + String-Parsing Fallback).
|
|
42
|
+
* * @param number The numeric entity to be classified.
|
|
43
|
+
* @param options The enterprise configuration manifest.
|
|
44
|
+
* @returns A boolean representing the oddity classification.
|
|
45
|
+
*/
|
|
46
|
+
export function checkOdd(
|
|
47
|
+
number: number | string | any,
|
|
48
|
+
options?: ClassificationOptions
|
|
49
|
+
): boolean
|
|
50
|
+
}
|