is-odd-ts 1.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jovan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # is-odd-ts
2
+
3
+ **A strict TypeScript utility to check if a number is odd, with modern type safety and support for edge cases.**
4
+
5
+ ---
6
+
7
+ Welcome to **`is-odd-ts`**, a lightweight utility for checking if a number is odd, built specifically with strict TypeScript settings. Whether you're working with everyday integers or hitting edge cases like `NaN`, `Infinity`, or very large numbers, this package has you covered.
8
+
9
+
10
+
11
+ ## Why use `is-odd-ts`?
12
+
13
+ - **Type Safety**: Written in TypeScript with the strictest settings, so you get full type safety in your projects.
14
+ - **Handles Edge Cases**: Checks for non-integers, `NaN`, `Infinity`, and numbers beyond JavaScript’s safe integer range.
15
+ - **No Dependencies**: It's small, fast, and doesn’t add bloat to your project.
16
+ - **Modern ESM**: Fully compatible with modern JavaScript (ESM) and TypeScript setups.
17
+ - **Formatted and Linted**: This package is formatted and linted using [Biome.js](https://biomejs.org/), ensuring clean and consistent code.
18
+
19
+ ## Installation
20
+
21
+ You can install it with `npm`:
22
+
23
+ ```bash
24
+ npm install is-odd-ts
25
+ ```
26
+ Or with yarn:
27
+
28
+ ```bash
29
+ yarn add is-odd-ts
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```typescript
35
+ import { isOdd } from 'is-odd-ts';
36
+
37
+ console.log(isOdd(1)); // true
38
+ console.log(isOdd(2)); // false
39
+ console.log(isOdd(-3)); // true
40
+ console.log(isOdd(0)); // false
41
+ ```
42
+
43
+ ## Common Edge Cases
44
+
45
+ ```typescript
46
+ isOdd(NaN); // Throws: "Expected a finite number"
47
+ isOdd(Infinity); // Throws: "Expected a finite number"
48
+ isOdd(-Infinity); // Throws: "Expected a finite number"
49
+ isOdd(1.5); // Throws: "Expected an integer"
50
+ isOdd(Number.MAX_SAFE_INTEGER); // true
51
+ isOdd(Number.MIN_SAFE_INTEGER); // true
52
+ ```
53
+
54
+ ## Features
55
+
56
+ - ***Zero and Negative Zero***: Both return false (since zero is even).
57
+ - ***Floats***: Throws an error if you try passing in a float.
58
+ - ***`Infinity` & `NaN`***: Throws errors for invalid inputs like `NaN`, `Infinity`, and -`Infinity`.
59
+ - ***Handles large numbers***: Safely checks numbers up to and including JavaScript’s `Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER`.
60
+
61
+ ## Testing & Reliability
62
+ I've put effort into testing this utility across a variety of scenarios to make sure it behaves consistently and handles edge cases properly. The tests cover:
63
+
64
+ - Regular odd and even integers (both positive and negative).
65
+ - Handling of zero and negative zero.
66
+ - Large numbers, including `Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER``.
67
+ - Proper error handling for invalid inputs like `NaN`, `Infinity`, floats, and values beyond safe integer limits.
68
+
69
+ Tests have been written using Node's native test runner.
70
+ Run the tests locally with:
71
+
72
+ ```bash
73
+ npm run test
74
+ ```
75
+
76
+ ## Contributing
77
+ If you find something missing or think the utility could be improved, feel free to contribute. Open an issue or submit a pull request, and let's keep it simple and efficient.
78
+
79
+ ## License
80
+ This project is licensed under the MIT License, so feel free to use it in your own projects.
81
+
82
+ Links:
83
+
84
+ - [GitHub Repository](https://github.com/JovanDj/is-odd-ts)
85
+ - [Issue Tracker](https://github.com/JovanDj/is-odd-ts/issues)
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * is-odd-ts <https://github.com/JovanDj/is-odd-ts>
3
+ *
4
+ * Copyright (c) 2024, Jovan Djukic.
5
+ * Released under the MIT License.
6
+ */
7
+ /**
8
+ * Checks if a given number is odd.
9
+ *
10
+ * This function validates that the input is a finite, safe integer before determining
11
+ * if it's odd. It works with both positive and negative numbers. If the input is invalid,
12
+ * such as a float, NaN, Infinity, or a number outside the safe integer range, the function
13
+ * throws an appropriate error.
14
+ *
15
+ * @param {number} num - The number to check if it's odd.
16
+ * @returns {boolean} - Returns `true` if the number is odd, `false` if it's even.
17
+ * @throws {TypeError} - Throws if the input is not a finite number.
18
+ * @throws {Error} - Throws if the input is not an integer or exceeds the safe integer limit.
19
+ */
20
+ export declare const isOdd: (num: number) => boolean;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /*!
3
+ * is-odd-ts <https://github.com/JovanDj/is-odd-ts>
4
+ *
5
+ * Copyright (c) 2024, Jovan Djukic.
6
+ * Released under the MIT License.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.isOdd = void 0;
10
+ /**
11
+ * Checks if a given number is odd.
12
+ *
13
+ * This function validates that the input is a finite, safe integer before determining
14
+ * if it's odd. It works with both positive and negative numbers. If the input is invalid,
15
+ * such as a float, NaN, Infinity, or a number outside the safe integer range, the function
16
+ * throws an appropriate error.
17
+ *
18
+ * @param {number} num - The number to check if it's odd.
19
+ * @returns {boolean} - Returns `true` if the number is odd, `false` if it's even.
20
+ * @throws {TypeError} - Throws if the input is not a finite number.
21
+ * @throws {Error} - Throws if the input is not an integer or exceeds the safe integer limit.
22
+ */
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;
34
+ };
35
+ exports.isOdd = isOdd;
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;;;;;;;;;;GAYG;AACI,MAAM,KAAK,GAAG,CAAC,GAAW,EAAW,EAAE;IAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC,CAAC;AAdW,QAAA,KAAK,SAchB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
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
+ });
42
+ });
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
+ });
87
+ });
88
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,yCAAiC;AAEjC,yCAAmC;AAEnC,IAAA,gBAAI,EAAC,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAChD,MAAM,CAAC,CAAC,IAAI,CACX,8DAA8D,EAC9D,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACnC,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,8DAA8D,EAC9D,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACpC,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,gEAAgE,EAChE,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACpC,gBAAM,CAAC,WA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EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,wFAAwF,EACxF,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,uFAAuF,EACvF,GAAG,EAAE;QACJ,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,gBAAK,EAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE;YACvD,OAAO,EAAE,oCAAoC;SAC7C,CAAC,CAAC;IACJ,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,uFAAuF,EACvF,GAAG,EAAE;QACJ,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,gBAAK,EAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE;YACvD,OAAO,EAAE,oCAAoC;SAC7C,CAAC,CAAC;IACJ,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,qEAAqE,EACrE,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC,CACD,CAAC;IAEF,MAAM,CAAC,CAAC,IAAI,CACX,mEAAmE,EACnE,GAAG,EAAE;QACJ,gBAAM,CAAC,WAAW,CAAC,IAAA,gBAAK,EAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,57 @@
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
+ }
57
+ }