@febin52/in-range-fast 1.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 ADDED
@@ -0,0 +1 @@
1
+ MIT License
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # 🎯 @febin52/in-range-fast
2
+
3
+ > Fast utility to check if a number is within a range.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@febin52/in-range-fast.svg)](https://www.npmjs.com/package/@febin52/in-range-fast)
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @febin52/in-range-fast
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { inRange } from '@febin52/in-range-fast';
17
+
18
+ inRange(3, 1, 5); // true
19
+ inRange(10, 1, 5); // false
20
+ ```
21
+
22
+ ## License
23
+
24
+ MIT © Febin Francis
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.Pkg={}))})(this,function(e){"use strict";function n(o,i,t){t===void 0&&(t=i,i=0);const f=Math.min(i,t),d=Math.max(i,t);return o>=f&&o<=d}e.inRange=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,3 @@
1
+ export declare function inRange(num: number, a: number, b?: number): boolean;
2
+
3
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ function e(i, n, t) {
2
+ t === void 0 && (t = n, n = 0);
3
+ const o = Math.min(n, t), c = Math.max(n, t);
4
+ return i >= o && i <= c;
5
+ }
6
+ export {
7
+ e as inRange
8
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@febin52/in-range-fast",
3
+ "version": "1.0.0",
4
+ "description": "Fast utility to check if a number is within a given numeric range.",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc && vite build",
22
+ "test": "vitest run"
23
+ },
24
+ "keywords": [
25
+ "in-range",
26
+ "range",
27
+ "between",
28
+ "math",
29
+ "number",
30
+ "bounds"
31
+ ],
32
+ "author": "Febin Francis",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/febin52/in-range-fast.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/febin52/in-range-fast/issues"
40
+ },
41
+ "homepage": "https://github.com/febin52/in-range-fast#readme"
42
+ }