Gathering detailed insights and metrics for @acdibble/lazy-range
Gathering detailed insights and metrics for @acdibble/lazy-range
Gathering detailed insights and metrics for @acdibble/lazy-range
Gathering detailed insights and metrics for @acdibble/lazy-range
npm install @acdibble/lazy-range
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
107 Commits
1 Watchers
12 Branches
1 Contributors
Updated on Jan 27, 2023
Latest Version
0.4.0
Package Id
@acdibble/lazy-range@0.4.0
Unpacked Size
11.64 kB
Size
3.68 kB
File Count
5
NPM Version
6.14.1
Node Version
12.14.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
range()
in JSThis is a memory-efficient range class. It only stores the start, stop, step,
and length for a range. The values are generated as necessary via
Symbol.iterator
. It works with any ES2015 compliant browsers.
Additionally, it's been adapted to match expected JavaScript behavior, e.g.
using LazyRange#at
to look up an out of bounds index will return undefined, rather
than throwing an error.
1const LazyRange = require('@acdibble/lazy-range');
or with modules:
1import LazyRange from '@acdibble/lazy-range';
1>>> list(range(10)) 2[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1> [...new LazyRange(10)]; 2[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] 3> Array.from(new LazyRange(10)); 4[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
1>>> list(range(-10, 0)) 2[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]
1> [...new LazyRange(-10, 0)]; 2[ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1 ]
1>>> list(range(1, 100, 25)) 2[1, 26, 51, 76]
1> [...new LazyRange(1, 100, 25)]; 2[ 1, 26, 51, 76 ]
1>>> sum = 0 2>>> for x in range(10): 3... sum += x 4... 5>>> sum 645
1> let sum = 0; 2undefined 3> for (const x of new LazyRange(10)) { 4... sum += x; 5... } 645
or
1> [...new LazyRange(10)].reduce((acc, num) => acc + num, 0); 245
1range(0, 3, 2) == range(0, 4, 2) 2True
1> new LazyRange(0, 3, 2).equals(new LazyRange(0, 4, 2)) 2true
1>>> range(0, 20, 2)[4:-3:2] 2range(8, 14, 4)
1> new LazyRange(0, 20, 2).slice(4, -3, 2); 2LazyRange { start: 8, step: 4, stop: 14, length: 2 }
1>>> len(range(10)) 210
1> new LazyRange(10).length; 210
1>>> 10 in range(0, 20, 2) 2True
1> new LazyRange(0, 20, 2).has(10); 2true
1>>> range(1, 19, 3)[5] 216
1> new LazyRange(1, 19, 3).at(5); 216
1>>> range(1, 19, 3).index(13) 24
1> new LazyRange(1, 19, 3).indexOf(13); 24
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More