@visulima/string 1.2.2 → 1.3.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/CHANGELOG.md +32 -0
- package/LICENSE.md +1 -1
- package/README.md +46 -0
- package/dist/case/camel-case.cjs +1 -59
- package/dist/case/camel-case.d.cts +2 -2
- package/dist/case/camel-case.d.mts +2 -2
- package/dist/case/camel-case.d.ts +2 -2
- package/dist/case/camel-case.mjs +1 -57
- package/dist/case/capital-case.cjs +1 -51
- package/dist/case/capital-case.d.cts +2 -2
- package/dist/case/capital-case.d.mts +2 -2
- package/dist/case/capital-case.d.ts +2 -2
- package/dist/case/capital-case.mjs +1 -49
- package/dist/case/constant-case.cjs +1 -11
- package/dist/case/constant-case.d.cts +2 -2
- package/dist/case/constant-case.d.mts +2 -2
- package/dist/case/constant-case.d.ts +2 -2
- package/dist/case/constant-case.mjs +1 -9
- package/dist/case/dot-case.cjs +1 -11
- package/dist/case/dot-case.d.cts +2 -2
- package/dist/case/dot-case.d.mts +2 -2
- package/dist/case/dot-case.d.ts +2 -2
- package/dist/case/dot-case.mjs +1 -9
- package/dist/case/flat-case.cjs +1 -11
- package/dist/case/flat-case.d.cts +2 -2
- package/dist/case/flat-case.d.mts +2 -2
- package/dist/case/flat-case.d.ts +2 -2
- package/dist/case/flat-case.mjs +1 -9
- package/dist/case/flip-case.cjs +1 -61
- package/dist/case/flip-case.d.cts +4 -3
- package/dist/case/flip-case.d.mts +4 -3
- package/dist/case/flip-case.d.ts +4 -3
- package/dist/case/flip-case.mjs +1 -57
- package/dist/case/identify-case.cjs +1 -69
- package/dist/case/identify-case.d.cts +2 -2
- package/dist/case/identify-case.d.mts +2 -2
- package/dist/case/identify-case.d.ts +2 -2
- package/dist/case/identify-case.mjs +1 -67
- package/dist/case/index.cjs +1 -47
- package/dist/case/index.d.cts +2 -2
- package/dist/case/index.d.mts +2 -2
- package/dist/case/index.d.ts +2 -2
- package/dist/case/index.mjs +1 -20
- package/dist/case/kebab-case.cjs +1 -61
- package/dist/case/kebab-case.d.cts +4 -3
- package/dist/case/kebab-case.d.mts +4 -3
- package/dist/case/kebab-case.d.ts +4 -3
- package/dist/case/kebab-case.mjs +1 -57
- package/dist/case/lower-first.cjs +1 -13
- package/dist/case/lower-first.d.cts +2 -2
- package/dist/case/lower-first.d.mts +2 -2
- package/dist/case/lower-first.d.ts +2 -2
- package/dist/case/lower-first.mjs +1 -11
- package/dist/case/no-case.cjs +1 -11
- package/dist/case/no-case.d.cts +2 -2
- package/dist/case/no-case.d.mts +2 -2
- package/dist/case/no-case.d.ts +2 -2
- package/dist/case/no-case.mjs +1 -9
- package/dist/case/pascal-case.cjs +1 -52
- package/dist/case/pascal-case.d.cts +2 -2
- package/dist/case/pascal-case.d.mts +2 -2
- package/dist/case/pascal-case.d.ts +2 -2
- package/dist/case/pascal-case.mjs +1 -50
- package/dist/case/pascal-snake-case.cjs +1 -32
- package/dist/case/pascal-snake-case.d.cts +2 -2
- package/dist/case/pascal-snake-case.d.mts +2 -2
- package/dist/case/pascal-snake-case.d.ts +2 -2
- package/dist/case/pascal-snake-case.mjs +1 -30
- package/dist/case/path-case.cjs +1 -11
- package/dist/case/path-case.d.cts +2 -2
- package/dist/case/path-case.d.mts +2 -2
- package/dist/case/path-case.d.ts +2 -2
- package/dist/case/path-case.mjs +1 -9
- package/dist/case/sentence-case.cjs +1 -58
- package/dist/case/sentence-case.d.cts +2 -2
- package/dist/case/sentence-case.d.mts +2 -2
- package/dist/case/sentence-case.d.ts +2 -2
- package/dist/case/sentence-case.mjs +1 -56
- package/dist/case/snake-case.cjs +1 -11
- package/dist/case/snake-case.d.cts +2 -2
- package/dist/case/snake-case.d.mts +2 -2
- package/dist/case/snake-case.d.ts +2 -2
- package/dist/case/snake-case.mjs +1 -9
- package/dist/case/split-by-case.cjs +1 -641
- package/dist/case/split-by-case.d.cts +4 -3
- package/dist/case/split-by-case.d.mts +4 -3
- package/dist/case/split-by-case.d.ts +4 -3
- package/dist/case/split-by-case.mjs +1 -637
- package/dist/case/title-case.cjs +1 -47
- package/dist/case/title-case.d.cts +2 -2
- package/dist/case/title-case.d.mts +2 -2
- package/dist/case/title-case.d.ts +2 -2
- package/dist/case/title-case.mjs +1 -45
- package/dist/case/train-case.cjs +1 -44
- package/dist/case/train-case.d.cts +2 -2
- package/dist/case/train-case.d.mts +2 -2
- package/dist/case/train-case.d.ts +2 -2
- package/dist/case/train-case.mjs +1 -42
- package/dist/case/upper-first.cjs +1 -13
- package/dist/case/upper-first.d.cts +2 -2
- package/dist/case/upper-first.d.mts +2 -2
- package/dist/case/upper-first.d.ts +2 -2
- package/dist/case/upper-first.mjs +1 -11
- package/dist/get-string-truncated-width.cjs +1 -422
- package/dist/get-string-truncated-width.d.cts +2 -1
- package/dist/get-string-truncated-width.d.mts +2 -1
- package/dist/get-string-truncated-width.d.ts +2 -1
- package/dist/get-string-truncated-width.mjs +1 -418
- package/dist/get-string-width.cjs +1 -11
- package/dist/get-string-width.d.cts +2 -1
- package/dist/get-string-width.d.mts +2 -1
- package/dist/get-string-width.d.ts +2 -1
- package/dist/get-string-width.mjs +1 -7
- package/dist/index.cjs +1 -66
- package/dist/index.d.cts +15 -5
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.mjs +1 -29
- package/dist/native-string-types.d.cts +1 -1
- package/dist/native-string-types.d.mts +1 -1
- package/dist/native-string-types.d.ts +1 -1
- package/dist/outdent.cjs +1 -125
- package/dist/outdent.d.cts +2 -1
- package/dist/outdent.d.mts +2 -1
- package/dist/outdent.d.ts +2 -1
- package/dist/outdent.mjs +1 -121
- package/dist/packem_shared/LRUCache-Bjo6gsbC.mjs +1 -0
- package/dist/packem_shared/LRUCache-TYqfUYE5.cjs +1 -0
- package/dist/packem_shared/WrapMode-BL2dnSc8.cjs +8 -0
- package/dist/packem_shared/WrapMode-DxH5g69E.mjs +8 -0
- package/dist/packem_shared/alignText-BCKbnqhC.mjs +2 -0
- package/dist/packem_shared/alignText-CLZJuPP6.cjs +2 -0
- package/dist/packem_shared/constants-Cd17VNEv.mjs +1 -0
- package/dist/packem_shared/constants-D3K8u3G8.cjs +1 -0
- package/dist/packem_shared/generate-cache-key-BZf0GiMs.cjs +1 -0
- package/dist/packem_shared/generate-cache-key-DPByFaMH.mjs +1 -0
- package/dist/packem_shared/joinSegments-CDHNMXsF.cjs +1 -0
- package/dist/packem_shared/joinSegments-H7QJ7rwJ.mjs +1 -0
- package/dist/packem_shared/normalize-german-eszett-4k1qRtEP.mjs +1 -0
- package/dist/packem_shared/normalize-german-eszett-Bop4wOp9.cjs +1 -0
- package/dist/packem_shared/replaceString-Ce8TI_-L.cjs +1 -0
- package/dist/packem_shared/replaceString-D7R-5VFX.mjs +1 -0
- package/dist/packem_shared/slugify-B1vlQQO1.mjs +1 -0
- package/dist/packem_shared/slugify-CH3GI7E5.cjs +1 -0
- package/dist/packem_shared/transliterate-BXaP38Sh.mjs +5 -0
- package/dist/packem_shared/transliterate-CToQ-aeM.cjs +5 -0
- package/dist/packem_shared/{types-DmfKbIaI.d.ts → types-BSdIWVzn.d.cts} +2 -1
- package/dist/packem_shared/{types-DmfKbIaI.d.cts → types-BSdIWVzn.d.mts} +2 -1
- package/dist/packem_shared/{types-DmfKbIaI.d.mts → types-BSdIWVzn.d.ts} +2 -1
- package/dist/packem_shared/{types-DcGtApe2.d.ts → types-BfGNLD2K.d.ts} +1 -1
- package/dist/packem_shared/{types-C5Pk8B8Q.d.cts → types-DrtiqNkK.d.cts} +1 -1
- package/dist/packem_shared/{types-_jqW_ZOt.d.mts → types-mlwFVBiS.d.mts} +1 -1
- package/dist/slice.cjs +1 -419
- package/dist/slice.d.cts +2 -1
- package/dist/slice.d.mts +2 -1
- package/dist/slice.d.ts +2 -1
- package/dist/slice.mjs +1 -415
- package/dist/test/utils.cjs +13 -74
- package/dist/test/utils.d.cts +2 -1
- package/dist/test/utils.d.mts +2 -1
- package/dist/test/utils.d.ts +2 -1
- package/dist/test/utils.mjs +14 -69
- package/dist/test/vitest.cjs +1 -11
- package/dist/test/vitest.d.cts +2 -1
- package/dist/test/vitest.d.mts +2 -1
- package/dist/test/vitest.d.ts +2 -1
- package/dist/test/vitest.mjs +1 -7
- package/dist/truncate.cjs +1 -101
- package/dist/truncate.d.cts +2 -1
- package/dist/truncate.d.mts +2 -1
- package/dist/truncate.d.ts +2 -1
- package/dist/truncate.mjs +1 -97
- package/dist/utils.cjs +1 -65
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +1 -56
- package/package.json +9 -6
- package/dist/packem_shared/LRUCache-Crb-m7cw.cjs +0 -53
- package/dist/packem_shared/LRUCache-udNErhWw.mjs +0 -51
- package/dist/packem_shared/WrapMode-B-WBY1mj.mjs +0 -545
- package/dist/packem_shared/WrapMode-Dsqu9BaX.cjs +0 -550
- package/dist/packem_shared/constants-CKuHriHc.cjs +0 -151
- package/dist/packem_shared/constants-CsGLUb4U.mjs +0 -100
- package/dist/packem_shared/generate-cache-key-D8f1auDB.cjs +0 -10
- package/dist/packem_shared/generate-cache-key-YSju5pj2.mjs +0 -8
- package/dist/packem_shared/joinSegments-B_7bxy5J.cjs +0 -48
- package/dist/packem_shared/joinSegments-BovQ2h_P.mjs +0 -46
- package/dist/packem_shared/normalize-german-eszett-DJK0S2qj.cjs +0 -11
- package/dist/packem_shared/normalize-german-eszett-fpJ4lZL6.mjs +0 -9
- package/dist/packem_shared/replaceString-C7Dp5vAg.mjs +0 -200
- package/dist/packem_shared/replaceString-iYo1cDfZ.cjs +0 -202
- package/dist/packem_shared/slugify-DhE59J2A.mjs +0 -48
- package/dist/packem_shared/slugify-jh6PftAT.cjs +0 -50
- package/dist/packem_shared/transliterate-BEci5RC8.cjs +0 -47782
- package/dist/packem_shared/transliterate-DwSldp0o.mjs +0 -47780
package/dist/case/title-case.cjs
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
4
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
5
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
6
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
7
|
-
const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
12
|
-
function titleCase(value, options) {
|
|
13
|
-
if (typeof value !== "string") {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
const shouldCache = options?.cache ?? false;
|
|
17
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
18
|
-
let cacheKey;
|
|
19
|
-
if (shouldCache) {
|
|
20
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
21
|
-
}
|
|
22
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
23
|
-
return cacheStore.get(cacheKey);
|
|
24
|
-
}
|
|
25
|
-
const result = case_splitByCase.splitByCase(value, {
|
|
26
|
-
handleAnsi: options?.handleAnsi,
|
|
27
|
-
handleEmoji: options?.handleEmoji,
|
|
28
|
-
knownAcronyms: options?.knownAcronyms,
|
|
29
|
-
locale: options?.locale,
|
|
30
|
-
normalize: options?.normalize,
|
|
31
|
-
separators: void 0,
|
|
32
|
-
stripAnsi: options?.stripAnsi,
|
|
33
|
-
stripEmoji: options?.stripEmoji
|
|
34
|
-
}).map((word) => {
|
|
35
|
-
if (options?.locale?.startsWith("de")) {
|
|
36
|
-
word = normalizeGermanEszett.normalizeGermanEszett(word);
|
|
37
|
-
}
|
|
38
|
-
return case_upperFirst(options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase(), { locale: options?.locale });
|
|
39
|
-
}).join(" ");
|
|
40
|
-
if (shouldCache && cacheKey) {
|
|
41
|
-
cacheStore.set(cacheKey, result);
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
__name(titleCase, "titleCase");
|
|
46
|
-
|
|
47
|
-
module.exports = titleCase;
|
|
1
|
+
"use strict";var c=Object.defineProperty;var i=(r,e)=>c(r,"name",{value:e,configurable:!0});const u=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),p=require("./split-by-case.cjs"),m=require("./upper-first.cjs"),h=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),d=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var f=Object.defineProperty,y=i((r,e)=>f(r,"name",{value:e,configurable:!0}),"n");const C=new u(1e3);function l(r,e){if(typeof r!="string")return"";const o=e?.cache??!1,t=e?.cacheStore??C;let a;if(o&&(a=h.a(r,e)),o&&a&&t.has(a))return t.get(a);const n=p.splitByCase(r,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(s=>(e?.locale?.startsWith("de")&&(s=d.l(s)),m(e?.locale?s.toLocaleLowerCase(e.locale):s.toLowerCase(),{locale:e?.locale}))).join(" ");return o&&a&&t.set(a,n),n}i(l,"d");y(l,"titleCase");module.exports=l;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-DrtiqNkK.cjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.cjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.cjs';
|
|
4
4
|
|
|
5
5
|
declare function titleCase<T extends string = string>(value?: T, options?: CaseOptions): TitleCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-mlwFVBiS.mjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.mjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.mjs';
|
|
4
4
|
|
|
5
5
|
declare function titleCase<T extends string = string>(value?: T, options?: CaseOptions): TitleCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, T as TitleCase } from '../packem_shared/types-BfGNLD2K.js';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.js';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.js';
|
|
4
4
|
|
|
5
5
|
declare function titleCase<T extends string = string>(value?: T, options?: CaseOptions): TitleCase<T>;
|
package/dist/case/title-case.mjs
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
import LRUCache from
|
|
2
|
-
import { splitByCase } from './split-by-case.mjs';
|
|
3
|
-
import upperFirst from './upper-first.mjs';
|
|
4
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
5
|
-
import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
10
|
-
function titleCase(value, options) {
|
|
11
|
-
if (typeof value !== "string") {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
const shouldCache = options?.cache ?? false;
|
|
15
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
16
|
-
let cacheKey;
|
|
17
|
-
if (shouldCache) {
|
|
18
|
-
cacheKey = generateCacheKey(value, options);
|
|
19
|
-
}
|
|
20
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
21
|
-
return cacheStore.get(cacheKey);
|
|
22
|
-
}
|
|
23
|
-
const result = splitByCase(value, {
|
|
24
|
-
handleAnsi: options?.handleAnsi,
|
|
25
|
-
handleEmoji: options?.handleEmoji,
|
|
26
|
-
knownAcronyms: options?.knownAcronyms,
|
|
27
|
-
locale: options?.locale,
|
|
28
|
-
normalize: options?.normalize,
|
|
29
|
-
separators: void 0,
|
|
30
|
-
stripAnsi: options?.stripAnsi,
|
|
31
|
-
stripEmoji: options?.stripEmoji
|
|
32
|
-
}).map((word) => {
|
|
33
|
-
if (options?.locale?.startsWith("de")) {
|
|
34
|
-
word = normalizeGermanEszett(word);
|
|
35
|
-
}
|
|
36
|
-
return upperFirst(options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase(), { locale: options?.locale });
|
|
37
|
-
}).join(" ");
|
|
38
|
-
if (shouldCache && cacheKey) {
|
|
39
|
-
cacheStore.set(cacheKey, result);
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
__name(titleCase, "titleCase");
|
|
44
|
-
|
|
45
|
-
export { titleCase as default };
|
|
1
|
+
var s=Object.defineProperty;var n=(r,o)=>s(r,"name",{value:o,configurable:!0});import c from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as m}from"./split-by-case.mjs";import p from"./upper-first.mjs";import{a as f}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import{l as d}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var h=Object.defineProperty,u=n((r,o)=>h(r,"name",{value:o,configurable:!0}),"n");const j=new c(1e3);function A(r,o){if(typeof r!="string")return"";const a=o?.cache??!1,i=o?.cacheStore??j;let t;if(a&&(t=f(r,o)),a&&t&&i.has(t))return i.get(t);const l=m(r,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(e=>(o?.locale?.startsWith("de")&&(e=d(e)),p(o?.locale?e.toLocaleLowerCase(o.locale):e.toLowerCase(),{locale:o?.locale}))).join(" ");return a&&t&&i.set(t,l),l}n(A,"d");u(A,"titleCase");export{A as default};
|
package/dist/case/train-case.cjs
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
4
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
5
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
6
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
7
|
-
const joinSegments = require('../packem_shared/joinSegments-B_7bxy5J.cjs');
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
12
|
-
const trainCase = /* @__PURE__ */ __name((value, options) => {
|
|
13
|
-
if (typeof value !== "string") {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
const shouldCache = options?.cache ?? false;
|
|
17
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
18
|
-
let cacheKey;
|
|
19
|
-
if (shouldCache) {
|
|
20
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
21
|
-
}
|
|
22
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
23
|
-
return cacheStore.get(cacheKey);
|
|
24
|
-
}
|
|
25
|
-
const result = joinSegments(
|
|
26
|
-
case_splitByCase.splitByCase(value, {
|
|
27
|
-
handleAnsi: options?.handleAnsi,
|
|
28
|
-
handleEmoji: options?.handleEmoji,
|
|
29
|
-
knownAcronyms: options?.knownAcronyms,
|
|
30
|
-
locale: options?.locale,
|
|
31
|
-
normalize: options?.normalize,
|
|
32
|
-
separators: void 0,
|
|
33
|
-
stripAnsi: options?.stripAnsi,
|
|
34
|
-
stripEmoji: options?.stripEmoji
|
|
35
|
-
}).map((p) => case_upperFirst(p, { locale: options?.locale })),
|
|
36
|
-
"-"
|
|
37
|
-
);
|
|
38
|
-
if (shouldCache && cacheKey) {
|
|
39
|
-
cacheStore.set(cacheKey, result);
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}, "trainCase");
|
|
43
|
-
|
|
44
|
-
module.exports = trainCase;
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,e)=>c(r,"name",{value:e,configurable:!0});const l=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),p=require("./split-by-case.cjs"),u=require("./upper-first.cjs"),m=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),h=require("../packem_shared/joinSegments-CDHNMXsF.cjs");var d=Object.defineProperty,y=a((r,e)=>d(r,"name",{value:e,configurable:!0}),"i");const f=new l(1e3),j=y((r,e)=>{if(typeof r!="string")return"";const s=e?.cache??!1,i=e?.cacheStore??f;let n;if(s&&(n=m.a(r,e)),s&&n&&i.has(n))return i.get(n);const t=h(p.splitByCase(r,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(o=>u(o,{locale:e?.locale})),"-");return s&&n&&i.set(n,t),t},"trainCase");module.exports=j;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-DrtiqNkK.cjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.cjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.cjs';
|
|
4
4
|
|
|
5
5
|
declare const trainCase: <T extends string = string>(value?: T, options?: CaseOptions) => TrainCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-mlwFVBiS.mjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.mjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.mjs';
|
|
4
4
|
|
|
5
5
|
declare const trainCase: <T extends string = string>(value?: T, options?: CaseOptions) => TrainCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, j as TrainCase } from '../packem_shared/types-BfGNLD2K.js';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.js';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.js';
|
|
4
4
|
|
|
5
5
|
declare const trainCase: <T extends string = string>(value?: T, options?: CaseOptions) => TrainCase<T>;
|
package/dist/case/train-case.mjs
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
import LRUCache from
|
|
2
|
-
import { splitByCase } from './split-by-case.mjs';
|
|
3
|
-
import upperFirst from './upper-first.mjs';
|
|
4
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
5
|
-
import joinSegments from '../packem_shared/joinSegments-BovQ2h_P.mjs';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
10
|
-
const trainCase = /* @__PURE__ */ __name((value, options) => {
|
|
11
|
-
if (typeof value !== "string") {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
const shouldCache = options?.cache ?? false;
|
|
15
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
16
|
-
let cacheKey;
|
|
17
|
-
if (shouldCache) {
|
|
18
|
-
cacheKey = generateCacheKey(value, options);
|
|
19
|
-
}
|
|
20
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
21
|
-
return cacheStore.get(cacheKey);
|
|
22
|
-
}
|
|
23
|
-
const result = joinSegments(
|
|
24
|
-
splitByCase(value, {
|
|
25
|
-
handleAnsi: options?.handleAnsi,
|
|
26
|
-
handleEmoji: options?.handleEmoji,
|
|
27
|
-
knownAcronyms: options?.knownAcronyms,
|
|
28
|
-
locale: options?.locale,
|
|
29
|
-
normalize: options?.normalize,
|
|
30
|
-
separators: void 0,
|
|
31
|
-
stripAnsi: options?.stripAnsi,
|
|
32
|
-
stripEmoji: options?.stripEmoji
|
|
33
|
-
}).map((p) => upperFirst(p, { locale: options?.locale })),
|
|
34
|
-
"-"
|
|
35
|
-
);
|
|
36
|
-
if (shouldCache && cacheKey) {
|
|
37
|
-
cacheStore.set(cacheKey, result);
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}, "trainCase");
|
|
41
|
-
|
|
42
|
-
export { trainCase as default };
|
|
1
|
+
var m=Object.defineProperty;var e=(o,r)=>m(o,"name",{value:r,configurable:!0});import l from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as p}from"./split-by-case.mjs";import c from"./upper-first.mjs";import{a as f}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import d from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";var h=Object.defineProperty,u=e((o,r)=>h(o,"name",{value:r,configurable:!0}),"i");const A=new l(1e3),b=u((o,r)=>{if(typeof o!="string")return"";const n=r?.cache??!1,i=r?.cacheStore??A;let t;if(n&&(t=f(o,r)),n&&t&&i.has(t))return i.get(t);const a=d(p(o,{handleAnsi:r?.handleAnsi,handleEmoji:r?.handleEmoji,knownAcronyms:r?.knownAcronyms,locale:r?.locale,normalize:r?.normalize,separators:void 0,stripAnsi:r?.stripAnsi,stripEmoji:r?.stripEmoji}).map(s=>c(s,{locale:r?.locale})),"-");return n&&t&&i.set(t,a),a},"trainCase");export{b as default};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
const upperFirst = /* @__PURE__ */ __name((value, options) => {
|
|
6
|
-
if (typeof value !== "string" || value === "") {
|
|
7
|
-
return "";
|
|
8
|
-
}
|
|
9
|
-
const firstChar = options?.locale ? value[0].toLocaleUpperCase(options.locale) : value[0].toUpperCase();
|
|
10
|
-
return firstChar + value.slice(1);
|
|
11
|
-
}, "upperFirst");
|
|
12
|
-
|
|
13
|
-
module.exports = upperFirst;
|
|
1
|
+
"use strict";var o=Object.defineProperty;var a=(e,t)=>o(e,"name",{value:t,configurable:!0});var p=Object.defineProperty,s=a((e,t)=>p(e,"name",{value:t,configurable:!0}),"s");const r=s((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");module.exports=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-DrtiqNkK.cjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.cjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.cjs';
|
|
4
4
|
|
|
5
5
|
declare const upperFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => UpperFirst<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-mlwFVBiS.mjs';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.mjs';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.mjs';
|
|
4
4
|
|
|
5
5
|
declare const upperFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => UpperFirst<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { L as LocaleOptions, U as UpperFirst } from '../packem_shared/types-BfGNLD2K.js';
|
|
2
|
+
import '../packem_shared/types-BSdIWVzn.js';
|
|
3
3
|
import '../packem_shared/lru-cache-B_t27XwI.js';
|
|
4
4
|
|
|
5
5
|
declare const upperFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => UpperFirst<T>;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const upperFirst = /* @__PURE__ */ __name((value, options) => {
|
|
4
|
-
if (typeof value !== "string" || value === "") {
|
|
5
|
-
return "";
|
|
6
|
-
}
|
|
7
|
-
const firstChar = options?.locale ? value[0].toLocaleUpperCase(options.locale) : value[0].toUpperCase();
|
|
8
|
-
return firstChar + value.slice(1);
|
|
9
|
-
}, "upperFirst");
|
|
10
|
-
|
|
11
|
-
export { upperFirst as default };
|
|
1
|
+
var p=Object.defineProperty;var o=(e,a)=>p(e,"name",{value:a,configurable:!0});var t=Object.defineProperty,l=o((e,a)=>t(e,"name",{value:a,configurable:!0}),"s");const s=l((e,a)=>typeof e!="string"||e===""?"":(a?.locale?e[0].toLocaleUpperCase(a.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");export{s as default};
|