enterprise-number-classification-sdk 1.0.0-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 +9 -7
- package/package.json +4 -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,6 +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 logic gate (or ||).
|
|
68
|
+
const logicalNot = require("es-logical-not-operator") // JavaScript ! operator as a function.
|
|
67
69
|
const is0 = require("is-eq-zero") // Specific utility for zero-value identification.
|
|
68
70
|
const isNegativeZero = require("is-x").isNegativeZero // Specialized check for the negative zero edge case.
|
|
69
71
|
const is1 = require("is-eq-one") // Specific utility for unity-value identification.
|
|
@@ -73,7 +75,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
73
75
|
const isNotInteger2 = not(require("util-x").Number.isInteger) // Secondary fallback integer validation via negation.
|
|
74
76
|
function isNotInteger(value) {
|
|
75
77
|
// Hybrid orchestrator for integer integrity verification.
|
|
76
|
-
if (isNegativeZero(value)
|
|
78
|
+
if (or(isNegativeZero(value), or(is0(value), doop(not(literally(value)))))) {
|
|
77
79
|
// Checking for zero-like or falsy edge cases.
|
|
78
80
|
return isNotInteger1(value) // Routing to the primary integer checker for edge cases.
|
|
79
81
|
} else {
|
|
@@ -130,7 +132,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
130
132
|
// Checking for debug mode activation state.
|
|
131
133
|
logToConsole(
|
|
132
134
|
// Emitting validation telemetry to the console.
|
|
133
|
-
chalkbox.yellow(
|
|
135
|
+
chalkbox.yellow(`[ENTERPRISE NUMBER CLASSIFICATION SDK] Validating Input: ${number}`) // Emitting a yellow-styled debug header.
|
|
134
136
|
) // Concluding the telemetry emission.
|
|
135
137
|
} // Terminating the debug conditional.
|
|
136
138
|
|
|
@@ -216,7 +218,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
216
218
|
return falseValue() // Returning false if the value is not a valid numeric node.
|
|
217
219
|
} // Terminating safety check.
|
|
218
220
|
|
|
219
|
-
if (
|
|
221
|
+
if (logicalNot(numberOddOrEven(_number, falseValue()))) {
|
|
220
222
|
// Verifying if the number possesses a parity property.
|
|
221
223
|
return falseValue() // Returning false if parity is undefined.
|
|
222
224
|
} // Terminating parity check.
|
|
@@ -324,7 +326,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
324
326
|
return falseValue() // Returning false for non-numeric states.
|
|
325
327
|
} // Terminating safety check.
|
|
326
328
|
|
|
327
|
-
if (
|
|
329
|
+
if (logicalNot(numberOddOrEven(_number, falseValue()))) {
|
|
328
330
|
// Verifying parity validity.
|
|
329
331
|
return falseValue() // Returning false if parity is invalid.
|
|
330
332
|
} // Terminating parity check.
|
|
@@ -431,7 +433,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
431
433
|
number = $Number(number) // Explicitly casting the string to a numeric node via intrinsic.
|
|
432
434
|
} // Terminating string-casting logic.
|
|
433
435
|
|
|
434
|
-
if (
|
|
436
|
+
if (logicalNot(validateInput(number, mergedOptions))) return falseValue() // Executing the validation firewall check.
|
|
435
437
|
|
|
436
438
|
let result // Final parity storage.
|
|
437
439
|
attempt(() => {
|
|
@@ -450,7 +452,7 @@ require("none/dist/none")() // This is the line that was being talked about in t
|
|
|
450
452
|
function checkOdd(number, options) {
|
|
451
453
|
// Defining the public-facing oddity classification API.
|
|
452
454
|
const mergedOptions = $ObjectAssign({}, DEFAULT_OPTIONS, options) // Merging incoming options with defaults.
|
|
453
|
-
if (
|
|
455
|
+
if (logicalNot(validateInput(number, mergedOptions))) return falseValue() // Executing the validation firewall check.
|
|
454
456
|
|
|
455
457
|
if (mergedOptions.allowNumberStrings) {
|
|
456
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,8 @@
|
|
|
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",
|
|
515
|
+
"es-logical-or-operator": "^1.0.0",
|
|
514
516
|
"false-value": "^2.0.6",
|
|
515
517
|
"get-intrinsic": "^1.3.1",
|
|
516
518
|
"immediate-error": "^7.1.0",
|
|
@@ -534,10 +536,8 @@
|
|
|
534
536
|
"yanoop": "^1.0.0"
|
|
535
537
|
},
|
|
536
538
|
"devDependencies": {
|
|
537
|
-
"@biomejs/biome": "^2.3.10",
|
|
538
539
|
"enterprise-10x-testing-framework-js": "^1.0.0",
|
|
539
540
|
"eslint": "^9.39.2",
|
|
540
|
-
"globals": "^16.5.0"
|
|
541
|
-
"jshint": "^2.13.6"
|
|
541
|
+
"globals": "^16.5.0"
|
|
542
542
|
}
|
|
543
543
|
}
|