enterprise-number-classification-sdk 1.0.1-enterprise.stable → 1.0.2-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/README.md +38 -1785
- package/index.d.ts +16 -21
- package/index.js +8 -7
- package/package.json +3 -4
package/index.d.ts
CHANGED
|
@@ -4,26 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
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
7
|
/**
|
|
28
8
|
* Evaluates the parity state of a numeric node to determine evenness.
|
|
29
9
|
* Utilizes a dual-path execution strategy (Recursive + String-Parsing Fallback).
|
|
@@ -33,7 +13,22 @@ declare module "enterprise-number-classification-sdk" {
|
|
|
33
13
|
*/
|
|
34
14
|
export function checkEven(
|
|
35
15
|
number: number | string | any,
|
|
36
|
-
options?:
|
|
16
|
+
options?: {
|
|
17
|
+
/** Suppress non-numeric errors and return falseValue. */
|
|
18
|
+
throwOnNonNumber?: boolean
|
|
19
|
+
/** Suppress non-integer errors and return falseValue. */
|
|
20
|
+
throwOnNonInteger?: boolean
|
|
21
|
+
/** Suppress non-finite errors and return falseValue. */
|
|
22
|
+
throwOnNonFinite?: boolean
|
|
23
|
+
/** Suppress NaN-state errors and return falseValue. */
|
|
24
|
+
throwOnNaN?: boolean
|
|
25
|
+
/** * Permits the intake of stringified numeric nodes.
|
|
26
|
+
* Note: Enabling this triggers intrinsic casting logic.
|
|
27
|
+
*/
|
|
28
|
+
allowNumberStrings?: boolean
|
|
29
|
+
/** Activates chromatic telemetry emission to the enterprise console. */
|
|
30
|
+
enableDebug?: boolean
|
|
31
|
+
}
|
|
37
32
|
): boolean
|
|
38
33
|
|
|
39
34
|
/**
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Enterprise Number Classification SDK
|
|
3
3
|
* @module enterprise-number-classification-sdk
|
|
4
|
-
* @version
|
|
4
|
+
* @version v1.0.2-enterprise.stable
|
|
5
5
|
* @license EGPSL10X-1.0
|
|
6
6
|
* @author 10x'ly Made Software
|
|
7
7
|
* @copyright 2025 10x'ly Made Software Ventures AB. All Rights Reserved.
|
|
@@ -64,7 +64,8 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
64
64
|
const isNumber = require("is-actual-number") // Accessing the rigorous numeric type-checking engine.
|
|
65
65
|
const numberOddOrEven = require("is-number-odd-or-even") // Validating odd-or-even state for a given numeric node.
|
|
66
66
|
const subtract = require("subtract") // Functional subtraction module for stack-safe arithmetic.
|
|
67
|
-
const or = require("es-logical-or-operator") // Functional implementation of the OR gate (or ||).
|
|
67
|
+
const or = require("es-logical-or-operator") // Functional implementation of the OR logic gate (or ||).
|
|
68
|
+
const logicalNot = require("es-logical-not-operator") // JavaScript ! operator as a function.
|
|
68
69
|
const is0 = require("is-eq-zero") // Specific utility for zero-value identification.
|
|
69
70
|
const isNegativeZero = require("is-x").isNegativeZero // Specialized check for the negative zero edge case.
|
|
70
71
|
const is1 = require("is-eq-one") // Specific utility for unity-value identification.
|
|
@@ -131,7 +132,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
131
132
|
// Checking for debug mode activation state.
|
|
132
133
|
logToConsole(
|
|
133
134
|
// Emitting validation telemetry to the console.
|
|
134
|
-
chalkbox.yellow(
|
|
135
|
+
chalkbox.yellow(`[ENTERPRISE NUMBER CLASSIFICATION SDK] Validating Input: ${number}`) // Emitting a yellow-styled debug header.
|
|
135
136
|
) // Concluding the telemetry emission.
|
|
136
137
|
} // Terminating the debug conditional.
|
|
137
138
|
|
|
@@ -217,7 +218,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
217
218
|
return falseValue() // Returning false if the value is not a valid numeric node.
|
|
218
219
|
} // Terminating safety check.
|
|
219
220
|
|
|
220
|
-
if (
|
|
221
|
+
if (logicalNot(numberOddOrEven(_number, falseValue()))) {
|
|
221
222
|
// Verifying if the number possesses a parity property.
|
|
222
223
|
return falseValue() // Returning false if parity is undefined.
|
|
223
224
|
} // Terminating parity check.
|
|
@@ -325,7 +326,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
325
326
|
return falseValue() // Returning false for non-numeric states.
|
|
326
327
|
} // Terminating safety check.
|
|
327
328
|
|
|
328
|
-
if (
|
|
329
|
+
if (logicalNot(numberOddOrEven(_number, falseValue()))) {
|
|
329
330
|
// Verifying parity validity.
|
|
330
331
|
return falseValue() // Returning false if parity is invalid.
|
|
331
332
|
} // Terminating parity check.
|
|
@@ -432,7 +433,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
432
433
|
number = $Number(number) // Explicitly casting the string to a numeric node via intrinsic.
|
|
433
434
|
} // Terminating string-casting logic.
|
|
434
435
|
|
|
435
|
-
if (
|
|
436
|
+
if (logicalNot(validateInput(number, mergedOptions))) return falseValue() // Executing the validation firewall check.
|
|
436
437
|
|
|
437
438
|
let result // Final parity storage.
|
|
438
439
|
attempt(() => {
|
|
@@ -451,7 +452,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
451
452
|
function checkOdd(number, options) {
|
|
452
453
|
// Defining the public-facing oddity classification API.
|
|
453
454
|
const mergedOptions = $ObjectAssign({}, DEFAULT_OPTIONS, options) // Merging incoming options with defaults.
|
|
454
|
-
if (
|
|
455
|
+
if (logicalNot(validateInput(number, mergedOptions))) return falseValue() // Executing the validation firewall check.
|
|
455
456
|
|
|
456
457
|
if (mergedOptions.allowNumberStrings) {
|
|
457
458
|
// Handling the stringified numeric input override.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enterprise-number-classification-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2-enterprise.stable",
|
|
4
4
|
"description": "A robust, scalable, framework-agnostic solution for mathemetical even/odd checking in distributed systems. Battle-tested in production.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iterate",
|
|
@@ -511,6 +511,7 @@
|
|
|
511
511
|
"chalkbox": "^1.0.0",
|
|
512
512
|
"construct-new": "^2.0.4",
|
|
513
513
|
"empty-string": "^1.1.1",
|
|
514
|
+
"es-logical-not-operator": "^1.0.0",
|
|
514
515
|
"es-logical-or-operator": "^1.0.0",
|
|
515
516
|
"false-value": "^2.0.6",
|
|
516
517
|
"get-intrinsic": "^1.3.1",
|
|
@@ -535,10 +536,8 @@
|
|
|
535
536
|
"yanoop": "^1.0.0"
|
|
536
537
|
},
|
|
537
538
|
"devDependencies": {
|
|
538
|
-
"@biomejs/biome": "^2.3.10",
|
|
539
539
|
"enterprise-10x-testing-framework-js": "^1.0.0",
|
|
540
540
|
"eslint": "^9.39.2",
|
|
541
|
-
"globals": "^16.5.0"
|
|
542
|
-
"jshint": "^2.13.6"
|
|
541
|
+
"globals": "^16.5.0"
|
|
543
542
|
}
|
|
544
543
|
}
|