this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

improve range performance

+16 -7
+4
changelog.md
··· 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 7 8 + ## [Unreleased](https://github.com/patrik-csak/BB26/compare/v5.1.1...HEAD) 9 + 10 + - Improve `range` performance 11 + 8 12 ## [5.1.1](https://github.com/patrik-csak/BB26/compare/v5.1.0...v5.1.1) – 2026-04-20 9 13 10 14 ### Fixed
+12 -7
source/range.ts
··· 1 - import increment from './increment.js'; 1 + import toBb26 from './to-bb26.js'; 2 2 import toDecimal from './to-decimal.js'; 3 3 4 4 /** ··· 13 13 export default function range(end: string): string[]; 14 14 export default function range(start: string, end: string): string[]; 15 15 export default function range(start: string, end?: string): string[] { 16 - const _range: string[] = []; 17 - const _end = end ?? start; 18 - const _start = end ? start : 'A'; 16 + if (!end) { 17 + end = start; 18 + start = 'A'; 19 + } 20 + 21 + const range: string[] = []; 22 + const startDecimal = toDecimal(start); 23 + const endDecimal = toDecimal(end); 19 24 20 - for (let i = _start; toDecimal(i) < toDecimal(_end); i = increment(i)) { 21 - _range.push(i); 25 + for (let decimal = startDecimal; decimal < endDecimal; decimal++) { 26 + range.push(toBb26(decimal)); 22 27 } 23 28 24 - return _range; 29 + return range; 25 30 }