@rowsncolumns/utils 9.2.38 → 9.2.40
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/dist/cjs/excel-number-format.d.ts +128 -0
- package/dist/cjs/excel-number-format.d.ts.map +1 -0
- package/dist/cjs/excel-number-format.js +659 -0
- package/dist/cjs/formatter.d.ts +8 -0
- package/dist/cjs/formatter.d.ts.map +1 -1
- package/dist/cjs/formatter.js +151 -2
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/keyboard.d.ts +28 -0
- package/dist/cjs/keyboard.d.ts.map +1 -0
- package/dist/cjs/keyboard.js +67 -0
- package/dist/cjs/sheet-span.d.ts +13 -0
- package/dist/cjs/sheet-span.d.ts.map +1 -0
- package/dist/cjs/sheet-span.js +24 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/excel-number-format.d.ts +128 -0
- package/dist/esm/excel-number-format.d.ts.map +1 -0
- package/dist/esm/excel-number-format.js +640 -0
- package/dist/esm/formatter.d.ts +8 -0
- package/dist/esm/formatter.d.ts.map +1 -1
- package/dist/esm/formatter.js +135 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/keyboard.d.ts +28 -0
- package/dist/esm/keyboard.d.ts.map +1 -0
- package/dist/esm/keyboard.js +62 -0
- package/dist/esm/sheet-span.d.ts +13 -0
- package/dist/esm/sheet-span.d.ts.map +1 -0
- package/dist/esm/sheet-span.js +20 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/esm/formatter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addLocale, format, formatColor, getFormatDateInfo, getLocale, isDateFormat, isTextFormat, } from "numfmt";
|
|
2
2
|
import { IndexedColors } from "./colors";
|
|
3
|
+
import { excelNumberPrePass } from "./excel-number-format";
|
|
3
4
|
/**
|
|
4
5
|
* Pattern-based type inference (Excel parity). xlsx files routinely carry
|
|
5
6
|
* a `numberFormat.pattern` without an accompanying `type` field — these
|
|
@@ -177,12 +178,145 @@ const localeForPattern = (pattern, locale) => {
|
|
|
177
178
|
}
|
|
178
179
|
return standalone ? (getStandaloneMonthLocale(locale) ?? locale) : locale;
|
|
179
180
|
};
|
|
181
|
+
const shortAmPmLocales = new Map();
|
|
182
|
+
/**
|
|
183
|
+
* Excel's `A/P` renders one letter (`6:00 P`) in every locale, but numfmt
|
|
184
|
+
* honours the short form only when no locale is passed — under a locale it
|
|
185
|
+
* emits that locale's full designator (`6:00 PM`). Patterns with `A/P` render
|
|
186
|
+
* under a companion locale whose AM/PM designators are `A`/`P`. `locale` is a
|
|
187
|
+
* BCP 47 tag or an Excel LCID (`409`), as numfmt accepts both.
|
|
188
|
+
*/
|
|
189
|
+
const getShortAmPmLocale = (locale) => {
|
|
190
|
+
const cached = shortAmPmLocales.get(locale);
|
|
191
|
+
if (cached !== undefined)
|
|
192
|
+
return cached;
|
|
193
|
+
let overlay = locale;
|
|
194
|
+
try {
|
|
195
|
+
overlay = `ampm_${locale.replace(/[^a-z\d]/gi, "")}`;
|
|
196
|
+
addLocale({ ...(getLocale(locale) ?? {}), ampm: ["A", "P"] }, overlay);
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
overlay = locale;
|
|
200
|
+
}
|
|
201
|
+
shortAmPmLocales.set(locale, overlay);
|
|
202
|
+
return overlay;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* An Excel `[$-LCID]` / `[$symbol-LCID]` token pins the section's locale, and
|
|
206
|
+
* numfmt resolves it to that LCID's own table — ahead of the companion locale
|
|
207
|
+
* `ssfFormat` passes, so `[$-409]h:mm A/P` would still render `6:00 PM`.
|
|
208
|
+
* Re-point a known LCID or tag at its companion (`$-409` → `$-ampm_409`); an
|
|
209
|
+
* LCID numfmt does not know (`F400`) or one carrying calendar bits stays as
|
|
210
|
+
* written.
|
|
211
|
+
*/
|
|
212
|
+
const shortAmPmLocaleToken = (token) => {
|
|
213
|
+
const dash = token.indexOf("-");
|
|
214
|
+
if (dash < 0)
|
|
215
|
+
return token;
|
|
216
|
+
const code = token.slice(dash + 1);
|
|
217
|
+
const wincode = Number.parseInt(code, 16);
|
|
218
|
+
if (Number.isFinite(wincode) && wincode & 0xff0000)
|
|
219
|
+
return token;
|
|
220
|
+
if (!getLocale(code))
|
|
221
|
+
return token;
|
|
222
|
+
return `${token.slice(0, dash + 1)}${getShortAmPmLocale(code)}`;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Does the pattern carry Excel's short `A/P` marker outside quoted literals,
|
|
226
|
+
* bracket directives and escapes? Returns the pattern with the marker
|
|
227
|
+
* upper-cased (Excel accepts `a/p` and renders it `A`/`P`; numfmt only
|
|
228
|
+
* tokenizes `A/P`) and its `[$-LCID]` tokens re-pointed at the companion
|
|
229
|
+
* `A`/`P` locale, or `undefined` when there is none.
|
|
230
|
+
*/
|
|
231
|
+
export const withShortAmPmMarker = (pattern) => {
|
|
232
|
+
const chunks = [];
|
|
233
|
+
const localeChunks = [];
|
|
234
|
+
let found = false;
|
|
235
|
+
let inQuotes = false;
|
|
236
|
+
let inBrackets = false;
|
|
237
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
238
|
+
const char = pattern[i];
|
|
239
|
+
if (inQuotes) {
|
|
240
|
+
inQuotes = char !== '"';
|
|
241
|
+
}
|
|
242
|
+
else if (inBrackets) {
|
|
243
|
+
inBrackets = char !== "]";
|
|
244
|
+
}
|
|
245
|
+
else if (char === '"') {
|
|
246
|
+
inQuotes = true;
|
|
247
|
+
}
|
|
248
|
+
else if (char === "[") {
|
|
249
|
+
const end = pattern[i + 1] === "$" ? pattern.indexOf("]", i) : -1;
|
|
250
|
+
if (end > 0) {
|
|
251
|
+
localeChunks.push(chunks.length);
|
|
252
|
+
chunks.push(pattern.slice(i + 1, end));
|
|
253
|
+
i = end;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
inBrackets = true;
|
|
257
|
+
}
|
|
258
|
+
else if (char === "\\" || char === "_" || char === "*") {
|
|
259
|
+
chunks.push(char + (pattern[i + 1] ?? ""));
|
|
260
|
+
i++;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
else if ((char === "A" || char === "a") &&
|
|
264
|
+
pattern[i + 1] === "/" &&
|
|
265
|
+
(pattern[i + 2] === "P" || pattern[i + 2] === "p")) {
|
|
266
|
+
chunks.push("A/P");
|
|
267
|
+
found = true;
|
|
268
|
+
i += 2;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
chunks.push(char);
|
|
272
|
+
}
|
|
273
|
+
if (!found)
|
|
274
|
+
return undefined;
|
|
275
|
+
for (const index of localeChunks) {
|
|
276
|
+
chunks[index] = `[${shortAmPmLocaleToken(chunks[index])}]`;
|
|
277
|
+
}
|
|
278
|
+
return chunks.join("");
|
|
279
|
+
};
|
|
280
|
+
const shortAmPmPatternCache = new Map();
|
|
281
|
+
const DEFAULT_SEPARATORS = { decimal: ".", group: "," };
|
|
282
|
+
const separatorsFor = (locale) => {
|
|
283
|
+
if (!locale)
|
|
284
|
+
return DEFAULT_SEPARATORS;
|
|
285
|
+
const l10n = getLocale(locale);
|
|
286
|
+
if (!l10n)
|
|
287
|
+
return DEFAULT_SEPARATORS;
|
|
288
|
+
return {
|
|
289
|
+
decimal: l10n.decimal ?? ".",
|
|
290
|
+
group: l10n.group ?? ",",
|
|
291
|
+
};
|
|
292
|
+
};
|
|
180
293
|
export const ssfFormat = (pattern, value, locale) => {
|
|
181
294
|
try {
|
|
295
|
+
let shortAmPm = shortAmPmPatternCache.get(pattern);
|
|
296
|
+
if (shortAmPm === undefined && !shortAmPmPatternCache.has(pattern)) {
|
|
297
|
+
shortAmPm = withShortAmPmMarker(pattern);
|
|
298
|
+
shortAmPmPatternCache.set(pattern, shortAmPm);
|
|
299
|
+
}
|
|
300
|
+
const code = shortAmPm ?? pattern;
|
|
301
|
+
let patternLocale = localeForPattern(pattern, locale);
|
|
302
|
+
if (shortAmPm !== undefined && patternLocale) {
|
|
303
|
+
patternLocale = getShortAmPmLocale(patternLocale);
|
|
304
|
+
}
|
|
305
|
+
const options = { locale: patternLocale };
|
|
306
|
+
if (typeof value === "number") {
|
|
307
|
+
// Excel decides rounding, `General`, huge magnitudes and conditional
|
|
308
|
+
// sections from the 15-significant-digit decimal, not the binary
|
|
309
|
+
// double (#546 U8 / U21).
|
|
310
|
+
const pre = excelNumberPrePass(code, value, separatorsFor(locale), (section, sectionValue) => format(section, sectionValue, options));
|
|
311
|
+
if (pre.text !== undefined) {
|
|
312
|
+
return pre.text;
|
|
313
|
+
}
|
|
314
|
+
value = pre.value;
|
|
315
|
+
}
|
|
182
316
|
const isNegativeElapsedTime = typeof value === "number" &&
|
|
183
317
|
value < 0 &&
|
|
184
318
|
isSingleSectionElapsedTimePattern(pattern);
|
|
185
|
-
const formatted = format(
|
|
319
|
+
const formatted = format(code, isNegativeElapsedTime ? Math.abs(value) : value, options);
|
|
186
320
|
return isNegativeElapsedTime ? `-${formatted}` : formatted;
|
|
187
321
|
}
|
|
188
322
|
catch (err) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./locale";
|
|
|
9
9
|
export * from "./date";
|
|
10
10
|
export * from "./log";
|
|
11
11
|
export * from "./array";
|
|
12
|
+
export * from "./excel-number-format";
|
|
12
13
|
export * from "./formatter";
|
|
13
14
|
export * from "./memoize";
|
|
14
15
|
export * from "./cell-data-helpers";
|
|
@@ -21,4 +22,6 @@ export * from "./conditional-format";
|
|
|
21
22
|
export * from "./data-validation";
|
|
22
23
|
export * from "./content-hash";
|
|
23
24
|
export * from "./shared-string-canonical";
|
|
25
|
+
export * from "./keyboard";
|
|
26
|
+
export * from "./sheet-span";
|
|
24
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./locale";
|
|
|
9
9
|
export * from "./date";
|
|
10
10
|
export * from "./log";
|
|
11
11
|
export * from "./array";
|
|
12
|
+
export * from "./excel-number-format";
|
|
12
13
|
export * from "./formatter";
|
|
13
14
|
export * from "./memoize";
|
|
14
15
|
export * from "./cell-data-helpers";
|
|
@@ -21,3 +22,5 @@ export * from "./conditional-format";
|
|
|
21
22
|
export * from "./data-validation";
|
|
22
23
|
export * from "./content-hash";
|
|
23
24
|
export * from "./shared-string-canonical";
|
|
25
|
+
export * from "./keyboard";
|
|
26
|
+
export * from "./sheet-span";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type HotkeyEventLike = {
|
|
2
|
+
key: string;
|
|
3
|
+
code?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Map a physical key code (`KeyboardEvent.code`) to the character that key
|
|
7
|
+
* produces on a US layout: `KeyB` → `b`, `Digit1` → `1`, `Semicolon` → `;`.
|
|
8
|
+
* Returns undefined for codes that are not a letter, digit or punctuation key.
|
|
9
|
+
* @param code
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const hotkeyKeyFromCode: (code: string | undefined) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Layout-independent key to match keyboard shortcuts against.
|
|
15
|
+
*
|
|
16
|
+
* - A printable ASCII `event.key` wins, lowercased, so Dvorak/AZERTY users
|
|
17
|
+
* keep the shortcut printed on their keys (Excel / Google Sheets parity)
|
|
18
|
+
* and Shift no longer changes the letter (`Ctrl+Shift+X` → `x`).
|
|
19
|
+
* - When the layout produces a non-ASCII character (Cyrillic `и`, Greek `β`,
|
|
20
|
+
* Hebrew, or a macOS Option dead character such as `†`), the character is
|
|
21
|
+
* derived from the physical key instead: `event.code` `KeyB` → `b`.
|
|
22
|
+
* - Named keys (`Enter`, `Escape`, `F4`, `ArrowUp`, …) are returned as-is.
|
|
23
|
+
* @param event
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const getHotkeyKey: (event: HotkeyEventLike) => string;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../keyboard.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAqBF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,GAAG,SAAS,uBAWzD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,eAAe,WAYlD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const PUNCTUATION_BY_CODE = {
|
|
2
|
+
Backquote: "`",
|
|
3
|
+
Backslash: "\\",
|
|
4
|
+
BracketLeft: "[",
|
|
5
|
+
BracketRight: "]",
|
|
6
|
+
Comma: ",",
|
|
7
|
+
Equal: "=",
|
|
8
|
+
Minus: "-",
|
|
9
|
+
Period: ".",
|
|
10
|
+
Quote: "'",
|
|
11
|
+
Semicolon: ";",
|
|
12
|
+
Slash: "/",
|
|
13
|
+
};
|
|
14
|
+
const isPrintableAscii = (key) => {
|
|
15
|
+
const charCode = key.charCodeAt(0);
|
|
16
|
+
return charCode >= 0x20 && charCode <= 0x7e;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Map a physical key code (`KeyboardEvent.code`) to the character that key
|
|
20
|
+
* produces on a US layout: `KeyB` → `b`, `Digit1` → `1`, `Semicolon` → `;`.
|
|
21
|
+
* Returns undefined for codes that are not a letter, digit or punctuation key.
|
|
22
|
+
* @param code
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export const hotkeyKeyFromCode = (code) => {
|
|
26
|
+
if (!code) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (/^Key[A-Z]$/.test(code)) {
|
|
30
|
+
return code.charAt(3).toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
if (/^Digit[0-9]$/.test(code)) {
|
|
33
|
+
return code.charAt(5);
|
|
34
|
+
}
|
|
35
|
+
return PUNCTUATION_BY_CODE[code];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Layout-independent key to match keyboard shortcuts against.
|
|
39
|
+
*
|
|
40
|
+
* - A printable ASCII `event.key` wins, lowercased, so Dvorak/AZERTY users
|
|
41
|
+
* keep the shortcut printed on their keys (Excel / Google Sheets parity)
|
|
42
|
+
* and Shift no longer changes the letter (`Ctrl+Shift+X` → `x`).
|
|
43
|
+
* - When the layout produces a non-ASCII character (Cyrillic `и`, Greek `β`,
|
|
44
|
+
* Hebrew, or a macOS Option dead character such as `†`), the character is
|
|
45
|
+
* derived from the physical key instead: `event.code` `KeyB` → `b`.
|
|
46
|
+
* - Named keys (`Enter`, `Escape`, `F4`, `ArrowUp`, …) are returned as-is.
|
|
47
|
+
* @param event
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
export const getHotkeyKey = (event) => {
|
|
51
|
+
const { key, code } = event;
|
|
52
|
+
if (key.length === 1) {
|
|
53
|
+
if (isPrintableAscii(key)) {
|
|
54
|
+
return key.toLowerCase();
|
|
55
|
+
}
|
|
56
|
+
const keyFromCode = hotkeyKeyFromCode(code);
|
|
57
|
+
if (keyFromCode !== undefined) {
|
|
58
|
+
return keyFromCode;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return key;
|
|
62
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sheets covered by a 3-D reference span `first:last` (`Sheet1:Sheet3!A1`):
|
|
3
|
+
* every name between the two endpoints in tab order, inclusive. Excel spans
|
|
4
|
+
* the tabs between the endpoints whichever one is written first and matches
|
|
5
|
+
* sheet names case-insensitively. Returns undefined when an endpoint is not a
|
|
6
|
+
* sheet (the caller reports #REF!).
|
|
7
|
+
* @param sheetNames sheet names in tab order
|
|
8
|
+
* @param first
|
|
9
|
+
* @param last
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const resolveSheetSpan: (sheetNames: readonly string[], first: string, last: string) => string[] | undefined;
|
|
13
|
+
//# sourceMappingURL=sheet-span.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-span.d.ts","sourceRoot":"","sources":["../../sheet-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,SAAS,MAAM,EAAE,EAC7B,OAAO,MAAM,EACb,MAAM,MAAM,KACX,MAAM,EAAE,GAAG,SAQb,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sheets covered by a 3-D reference span `first:last` (`Sheet1:Sheet3!A1`):
|
|
3
|
+
* every name between the two endpoints in tab order, inclusive. Excel spans
|
|
4
|
+
* the tabs between the endpoints whichever one is written first and matches
|
|
5
|
+
* sheet names case-insensitively. Returns undefined when an endpoint is not a
|
|
6
|
+
* sheet (the caller reports #REF!).
|
|
7
|
+
* @param sheetNames sheet names in tab order
|
|
8
|
+
* @param first
|
|
9
|
+
* @param last
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export const resolveSheetSpan = (sheetNames, first, last) => {
|
|
13
|
+
const lower = sheetNames.map((name) => name.toLowerCase());
|
|
14
|
+
const start = lower.indexOf(first.toLowerCase());
|
|
15
|
+
const end = lower.indexOf(last.toLowerCase());
|
|
16
|
+
if (start === -1 || end === -1) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return sheetNames.slice(Math.min(start, end), Math.max(start, end) + 1);
|
|
20
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../array.ts","../../cell-data-helpers.ts","../../color.ts","../../colors.ts","../../conditional-format.ts","../../content-hash.ts","../../data-validation.ts","../../date.ts","../../dom.ts","../../formatter.ts","../../formula-refs.ts","../../formula.ts","../../index.ts","../../locale.ts","../../log.ts","../../memoize.ts","../../numbers.ts","../../selection.ts","../../shared-string-canonical.ts","../../sort.ts","../../string.ts","../../table-styles.ts","../../typeguards.ts","../../uuid.ts","../../vitest.config.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../../array.ts","../../cell-data-helpers.ts","../../color.ts","../../colors.ts","../../conditional-format.ts","../../content-hash.ts","../../data-validation.ts","../../date.ts","../../dom.ts","../../excel-number-format.ts","../../formatter.ts","../../formula-refs.ts","../../formula.ts","../../index.ts","../../keyboard.ts","../../locale.ts","../../log.ts","../../memoize.ts","../../numbers.ts","../../selection.ts","../../shared-string-canonical.ts","../../sheet-span.ts","../../sort.ts","../../string.ts","../../table-styles.ts","../../typeguards.ts","../../uuid.ts","../../vitest.config.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/utils",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.40",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"numfmt": "^3.2.2",
|
|
45
|
-
"@rowsncolumns/common-types": ">=5.2.
|
|
45
|
+
"@rowsncolumns/common-types": ">=5.2.31"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {},
|
|
48
48
|
"peerDependencies": {}
|