is-odd-ts 1.0.1 → 2.0.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Jovan
3
+ Copyright (c) 2025 Jovan Djukic
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -28,6 +28,7 @@ Or with yarn:
28
28
  ```bash
29
29
  yarn add is-odd-ts
30
30
  ```
31
+ This package is ESM-only and requires Node 22+.
31
32
 
32
33
  ## Usage
33
34
 
@@ -63,7 +64,7 @@ I've put effort into testing this utility across a variety of scenarios to make
63
64
 
64
65
  - Regular odd and even integers (both positive and negative).
65
66
  - Handling of zero and negative zero.
66
- - Large numbers, including `Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER``.
67
+ - Large numbers, including `Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER`.
67
68
  - Proper error handling for invalid inputs like `NaN`, `Infinity`, floats, and values beyond safe integer limits.
68
69
 
69
70
  Tests have been written using Node's native test runner.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * is-odd-ts <https://github.com/JovanDj/is-odd-ts>
3
3
  *
4
- * Copyright (c) 2024, Jovan Djukic.
4
+ * Copyright (c) 2025, Jovan Djukic.
5
5
  * Released under the MIT License.
6
6
  */
7
7
  /**
@@ -18,4 +18,4 @@
18
18
  * @throws {Error} - Throws if the input is not an integer or exceeds the safe integer limit.
19
19
  */
20
20
  export declare const isOdd: (num: number) => boolean;
21
- //# sourceMappingURL=index.d.ts.map
21
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,QAAS,MAAM,KAAG,OAcnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,KAAG,OAcnC,CAAC"}
package/dist/index.js CHANGED
@@ -1,12 +1,9 @@
1
- "use strict";
2
1
  /*!
3
2
  * is-odd-ts <https://github.com/JovanDj/is-odd-ts>
4
3
  *
5
- * Copyright (c) 2024, Jovan Djukic.
4
+ * Copyright (c) 2025, Jovan Djukic.
6
5
  * Released under the MIT License.
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.isOdd = void 0;
10
7
  /**
11
8
  * Checks if a given number is odd.
12
9
  *
@@ -20,17 +17,16 @@ exports.isOdd = void 0;
20
17
  * @throws {TypeError} - Throws if the input is not a finite number.
21
18
  * @throws {Error} - Throws if the input is not an integer or exceeds the safe integer limit.
22
19
  */
23
- const isOdd = (num) => {
24
- if (!Number.isFinite(num)) {
25
- throw new TypeError("Expected a finite number");
26
- }
27
- if (!Number.isInteger(num)) {
28
- throw new Error("Expected an integer");
29
- }
30
- if (!Number.isSafeInteger(num)) {
31
- throw new Error("Value exceeds maximum safe integer");
32
- }
33
- return num % 2 !== 0;
20
+ export const isOdd = (num) => {
21
+ if (!Number.isFinite(num)) {
22
+ throw new TypeError("Expected a finite number");
23
+ }
24
+ if (!Number.isInteger(num)) {
25
+ throw new Error("Expected an integer");
26
+ }
27
+ if (!Number.isSafeInteger(num)) {
28
+ throw new Error("Value exceeds maximum safe integer");
29
+ }
30
+ return num % 2 !== 0;
34
31
  };
35
- exports.isOdd = isOdd;
36
- //# sourceMappingURL=index.js.map
32
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA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L=index.test.d.ts.map
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -1,88 +1,126 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const strict_1 = __importDefault(require("node:assert/strict"));
7
- const node_test_1 = require("node:test");
8
- const index_js_1 = require("./index.js");
9
- (0, node_test_1.test)("isOdd function with integers", async (t) => {
10
- await t.test("should return true when the input is an odd positive integer", () => {
11
- strict_1.default.strictEqual((0, index_js_1.isOdd)(1), true);
12
- strict_1.default.strictEqual((0, index_js_1.isOdd)(3), true);
13
- });
14
- await t.test("should return true when the input is an odd negative integer", () => {
15
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-1), true);
16
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-3), true);
17
- });
18
- await t.test("should return false when the input is an even positive integer", () => {
19
- strict_1.default.strictEqual((0, index_js_1.isOdd)(2), false);
20
- strict_1.default.strictEqual((0, index_js_1.isOdd)(4), false);
21
- });
22
- await t.test("should return false when the input is an even negative integer", () => {
23
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-2), false);
24
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-4), false);
25
- });
26
- await t.test("should return false when the input is zero", () => {
27
- strict_1.default.strictEqual((0, index_js_1.isOdd)(0), false);
28
- });
29
- await t.test("should return false when the input is negative zero", () => {
30
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-0), false);
31
- });
32
- await t.test("should throw an error when the input is a positive float", () => {
33
- strict_1.default.throws(() => (0, index_js_1.isOdd)(1.5), {
34
- message: "Expected an integer",
35
- });
36
- });
37
- await t.test("should throw an error when the input is a negative float", () => {
38
- strict_1.default.throws(() => (0, index_js_1.isOdd)(-1.5), {
39
- message: "Expected an integer",
40
- });
41
- });
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import { isOdd } from "./index.js";
4
+
5
+ test("isOdd function with integers", { concurrency: true }, async (t) => {
6
+ await t.test(
7
+ "should return true when the input is an odd positive integer",
8
+ () => {
9
+ assert.deepStrictEqual(isOdd(1), true);
10
+ assert.deepStrictEqual(isOdd(3), true);
11
+ },
12
+ );
13
+ await t.test(
14
+ "should return true when the input is an odd negative integer",
15
+ () => {
16
+ assert.deepStrictEqual(isOdd(-1), true);
17
+ assert.deepStrictEqual(isOdd(-3), true);
18
+ },
19
+ );
20
+ await t.test(
21
+ "should return false when the input is an even positive integer",
22
+ () => {
23
+ assert.deepStrictEqual(isOdd(2), false);
24
+ assert.deepStrictEqual(isOdd(4), false);
25
+ },
26
+ );
27
+ await t.test(
28
+ "should return false when the input is an even negative integer",
29
+ () => {
30
+ assert.deepStrictEqual(isOdd(-2), false);
31
+ assert.deepStrictEqual(isOdd(-4), false);
32
+ },
33
+ );
34
+ await t.test("should return false when the input is zero", () => {
35
+ assert.deepStrictEqual(isOdd(0), false);
36
+ });
37
+ await t.test("should return false when the input is negative zero", () => {
38
+ assert.deepStrictEqual(isOdd(-0), false);
39
+ });
40
+ await t.test(
41
+ "should throw an error when the input is a positive float",
42
+ () => {
43
+ assert.throws(() => isOdd(1.5), {
44
+ message: "Expected an integer",
45
+ });
46
+ },
47
+ );
48
+ await t.test(
49
+ "should throw an error when the input is a negative float",
50
+ () => {
51
+ assert.throws(() => isOdd(-1.5), {
52
+ message: "Expected an integer",
53
+ });
54
+ },
55
+ );
42
56
  });
43
- (0, node_test_1.test)("isOdd function with special constants and edge cases", async (t) => {
44
- await t.test("should throw an error when the input is NaN", () => {
45
- strict_1.default.throws(() => (0, index_js_1.isOdd)(Number.NaN), {
46
- message: "Expected a finite number",
47
- });
48
- });
49
- await t.test("should throw an error when the input is Infinity", () => {
50
- strict_1.default.throws(() => (0, index_js_1.isOdd)(Number.POSITIVE_INFINITY), {
51
- message: "Expected a finite number",
52
- });
53
- });
54
- await t.test("should throw an error when the input is -Infinity", () => {
55
- strict_1.default.throws(() => (0, index_js_1.isOdd)(Number.NEGATIVE_INFINITY), {
56
- message: "Expected a finite number",
57
- });
58
- });
59
- await t.test("should return true when the input is Number.MAX_SAFE_INTEGER (positive)", () => {
60
- strict_1.default.strictEqual((0, index_js_1.isOdd)(Number.MAX_SAFE_INTEGER), true);
61
- });
62
- await t.test("should return false when the input is the largest even safe integer (positive)", () => {
63
- strict_1.default.strictEqual((0, index_js_1.isOdd)(Number.MAX_SAFE_INTEGER - 1), false);
64
- });
65
- await t.test("should return true when the input is Number.MIN_SAFE_INTEGER (negative)", () => {
66
- strict_1.default.strictEqual((0, index_js_1.isOdd)(Number.MIN_SAFE_INTEGER), true);
67
- });
68
- await t.test("should return false when the input is the smallest even integer below MIN_SAFE_INTEGER", () => {
69
- strict_1.default.strictEqual((0, index_js_1.isOdd)(Number.MIN_SAFE_INTEGER + 1), false);
70
- });
71
- await t.test("should throw an error when the input is exactly one more than Number.MAX_SAFE_INTEGER", () => {
72
- strict_1.default.throws(() => (0, index_js_1.isOdd)(Number.MAX_SAFE_INTEGER + 1), {
73
- message: "Value exceeds maximum safe integer",
74
- });
75
- });
76
- await t.test("should throw an error when the input is exactly one less than Number.MIN_SAFE_INTEGER", () => {
77
- strict_1.default.throws(() => (0, index_js_1.isOdd)(Number.MIN_SAFE_INTEGER - 1), {
78
- message: "Value exceeds maximum safe integer",
79
- });
80
- });
81
- await t.test("should return false when the input is a large even negative integer", () => {
82
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-9007199254740990), false);
83
- });
84
- await t.test("should return true when the input is a large odd negative integer", () => {
85
- strict_1.default.strictEqual((0, index_js_1.isOdd)(-9007199254740991), true);
86
- });
57
+ test("isOdd function with special constants and edge cases", async (t) => {
58
+ await t.test("should throw an error when the input is NaN", () => {
59
+ assert.throws(() => isOdd(Number.NaN), {
60
+ message: "Expected a finite number",
61
+ });
62
+ });
63
+ await t.test("should throw an error when the input is Infinity", () => {
64
+ assert.throws(() => isOdd(Number.POSITIVE_INFINITY), {
65
+ message: "Expected a finite number",
66
+ });
67
+ });
68
+ await t.test("should throw an error when the input is -Infinity", () => {
69
+ assert.throws(() => isOdd(Number.NEGATIVE_INFINITY), {
70
+ message: "Expected a finite number",
71
+ });
72
+ });
73
+ await t.test(
74
+ "should return true when the input is Number.MAX_SAFE_INTEGER (positive)",
75
+ () => {
76
+ assert.deepStrictEqual(isOdd(Number.MAX_SAFE_INTEGER), true);
77
+ },
78
+ );
79
+ await t.test(
80
+ "should return false when the input is the largest even safe integer (positive)",
81
+ () => {
82
+ assert.deepStrictEqual(isOdd(Number.MAX_SAFE_INTEGER - 1), false);
83
+ },
84
+ );
85
+ await t.test(
86
+ "should return true when the input is Number.MIN_SAFE_INTEGER (negative)",
87
+ () => {
88
+ assert.deepStrictEqual(isOdd(Number.MIN_SAFE_INTEGER), true);
89
+ },
90
+ );
91
+ await t.test(
92
+ "should return false when the input is the smallest even integer below MIN_SAFE_INTEGER",
93
+ () => {
94
+ assert.deepStrictEqual(isOdd(Number.MIN_SAFE_INTEGER + 1), false);
95
+ },
96
+ );
97
+ await t.test(
98
+ "should throw an error when the input is exactly one more than Number.MAX_SAFE_INTEGER",
99
+ () => {
100
+ assert.throws(() => isOdd(Number.MAX_SAFE_INTEGER + 1), {
101
+ message: "Value exceeds maximum safe integer",
102
+ });
103
+ },
104
+ );
105
+ await t.test(
106
+ "should throw an error when the input is exactly one less than Number.MIN_SAFE_INTEGER",
107
+ () => {
108
+ assert.throws(() => isOdd(Number.MIN_SAFE_INTEGER - 1), {
109
+ message: "Value exceeds maximum safe integer",
110
+ });
111
+ },
112
+ );
113
+ await t.test(
114
+ "should return false when the input is a large even negative integer",
115
+ () => {
116
+ assert.deepStrictEqual(isOdd(-9007199254740990), false);
117
+ },
118
+ );
119
+ await t.test(
120
+ "should return true when the input is a large odd negative integer",
121
+ () => {
122
+ assert.deepStrictEqual(isOdd(-9007199254740991), true);
123
+ },
124
+ );
87
125
  });
88
- //# sourceMappingURL=index.test.js.map
126
+ //# sourceMappingURL=index.test.js.map
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,CAAC;IAClE,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,mEAAmE,EACnE,GAAG,EAAE;QACJ,MAAM,CAAC,eAAe,CAAU,KAAK,CAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,57 +1,65 @@
1
1
  {
2
- "name": "is-odd-ts",
3
- "version": "1.0.1",
4
- "description": "A strict TypeScript-only utility to check if a number is odd, with modern type safety.",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc",
9
- "typecheck": "tsc --noEmit",
10
- "lint": "biome check --write",
11
- "lint:fix": "biome check --unsafe --write",
12
- "test": "npm run build && node --test dist"
13
- },
14
- "files": [
15
- "dist"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/JovanDj/is-odd-ts.git"
20
- },
21
- "bugs": {
22
- "url": "https://github.com/JovanDj/is-odd-ts/issues"
23
- },
24
- "homepage": "https://github.com/JovanDj/is-odd-ts#readme",
25
- "keywords": [
26
- "odd",
27
- "is-odd",
28
- "number",
29
- "typescript",
30
- "ts",
31
- "strict",
32
- "type-safe",
33
- "utility",
34
- "ESM",
35
- "modern-js"
36
- ],
37
- "author": {
38
- "name": "Jovan Djukic",
39
- "email": "jovandjukic2@gmail.com",
40
- "url": "https://jovandjukic.com"
41
- },
42
- "license": "MIT",
43
- "volta": {
44
- "node": "20.17.0"
45
- },
46
- "engines": {
47
- "node": ">=20"
48
- },
49
- "devDependencies": {
50
- "@biomejs/biome": "1.9.2",
51
- "@tsconfig/node20": "^20.1.4",
52
- "@tsconfig/recommended": "^1.0.7",
53
- "@tsconfig/strictest": "^2.0.5",
54
- "@types/node": "^22.7.4",
55
- "typescript": "^5.6.2"
56
- }
2
+ "name": "is-odd-ts",
3
+ "version": "2.0.0",
4
+ "description": "A strict TypeScript-only utility to check if a number is odd, with modern type safety.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "type": "module",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "typecheck": "tsc --noEmit",
11
+ "lint": "biome check --write",
12
+ "lint:fix": "biome check --unsafe --write",
13
+ "test": "npm run build && node --test dist"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/JovanDj/is-odd-ts.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/JovanDj/is-odd-ts/issues"
30
+ },
31
+ "homepage": "https://github.com/JovanDj/is-odd-ts#readme",
32
+ "keywords": [
33
+ "odd",
34
+ "is-odd",
35
+ "number",
36
+ "typescript",
37
+ "ts",
38
+ "strict",
39
+ "type-safe",
40
+ "utility",
41
+ "ESM",
42
+ "modern-js"
43
+ ],
44
+ "author": {
45
+ "name": "Jovan Djukic",
46
+ "email": "jovandjukic2@gmail.com",
47
+ "url": "https://jovandjukic.com"
48
+ },
49
+ "license": "MIT",
50
+ "volta": {
51
+ "node": "22.17.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=22"
55
+ },
56
+ "devDependencies": {
57
+ "@biomejs/biome": "^2.1.0",
58
+ "@tsconfig/node-ts": "^23.6.1",
59
+ "@tsconfig/node22": "^22.0.2",
60
+ "@tsconfig/recommended": "^1.0.10",
61
+ "@tsconfig/strictest": "^2.0.5",
62
+ "@types/node": "^22.16.0",
63
+ "typescript": "^5.8.3"
64
+ }
57
65
  }