@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/no-case.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, N as NoCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, N as NoCase } 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 noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
|
package/dist/case/no-case.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, N as NoCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, N as NoCase } 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 noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
|
package/dist/case/no-case.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, N as NoCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, N as NoCase } 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 noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
|
package/dist/case/no-case.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { kebabCase } from './kebab-case.mjs';
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
7
|
-
const noCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: " " }), "noCase");
|
|
8
|
-
|
|
9
|
-
export { noCase as default };
|
|
1
|
+
var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var i=Object.defineProperty,s=o((e,r)=>i(e,"name",{value:r,configurable:!0}),"o");const c=new t(1e3),p=s((e,r)=>n(e,{cacheStore:c,...r,joiner:" "}),"noCase");export{p as default};
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const constants = require('../packem_shared/constants-CKuHriHc.cjs');
|
|
4
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
5
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
6
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
7
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
8
|
-
const joinSegments = require('../packem_shared/joinSegments-B_7bxy5J.cjs');
|
|
9
|
-
const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
|
|
10
|
-
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
14
|
-
const pascalCase = /* @__PURE__ */ __name((value, options) => {
|
|
15
|
-
if (typeof value !== "string" || !value) {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
const shouldCache = options?.cache ?? false;
|
|
19
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
20
|
-
let cacheKey;
|
|
21
|
-
if (shouldCache) {
|
|
22
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
23
|
-
}
|
|
24
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
25
|
-
return cacheStore.get(cacheKey);
|
|
26
|
-
}
|
|
27
|
-
const result = joinSegments(
|
|
28
|
-
case_splitByCase.splitByCase(value, {
|
|
29
|
-
handleAnsi: options?.handleAnsi,
|
|
30
|
-
handleEmoji: options?.handleEmoji,
|
|
31
|
-
knownAcronyms: options?.knownAcronyms,
|
|
32
|
-
locale: options?.locale,
|
|
33
|
-
normalize: options?.normalize,
|
|
34
|
-
separators: void 0,
|
|
35
|
-
stripAnsi: options?.stripAnsi,
|
|
36
|
-
stripEmoji: options?.stripEmoji
|
|
37
|
-
}).map((word) => {
|
|
38
|
-
if (options?.handleAnsi && constants.RE_FAST_ANSI.test(word)) {
|
|
39
|
-
return word;
|
|
40
|
-
}
|
|
41
|
-
const split = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
|
|
42
|
-
return case_upperFirst(options?.locale ? split.toLocaleLowerCase(options.locale) : split.toLowerCase(), { locale: options?.locale });
|
|
43
|
-
}),
|
|
44
|
-
""
|
|
45
|
-
);
|
|
46
|
-
if (shouldCache && cacheKey) {
|
|
47
|
-
cacheStore.set(cacheKey, result);
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}, "pascalCase");
|
|
51
|
-
|
|
52
|
-
module.exports = pascalCase;
|
|
1
|
+
"use strict";var c=Object.defineProperty;var l=(r,e)=>c(r,"name",{value:e,configurable:!0});const u=require("../packem_shared/constants-D3K8u3G8.cjs"),m=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),p=require("./split-by-case.cjs"),h=require("./upper-first.cjs"),d=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),A=require("../packem_shared/joinSegments-CDHNMXsF.cjs"),f=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var q=Object.defineProperty,y=l((r,e)=>q(r,"name",{value:e,configurable:!0}),"i");const C=new m(1e3),j=y((r,e)=>{if(typeof r!="string"||!r)return"";const n=e?.cache??!1,s=e?.cacheStore??C;let t;if(n&&(t=d.a(r,e)),n&&t&&s.has(t))return s.get(t);const i=A(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(a=>{if(e?.handleAnsi&&u.R.test(a))return a;const o=e?.locale?.startsWith("de")?f.l(a):a;return h(e?.locale?o.toLocaleLowerCase(e.locale):o.toLowerCase(),{locale:e?.locale})}),"");return n&&t&&s.set(t,i),i},"pascalCase");module.exports=j;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, P as PascalCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, P as PascalCase } 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 pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, P as PascalCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, P as PascalCase } 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 pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, P as PascalCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, P as PascalCase } 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 pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
|
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
|
|
3
|
-
import { splitByCase } from './split-by-case.mjs';
|
|
4
|
-
import upperFirst from './upper-first.mjs';
|
|
5
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
6
|
-
import joinSegments from '../packem_shared/joinSegments-BovQ2h_P.mjs';
|
|
7
|
-
import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
|
|
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 pascalCase = /* @__PURE__ */ __name((value, options) => {
|
|
13
|
-
if (typeof value !== "string" || !value) {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
const shouldCache = options?.cache ?? false;
|
|
17
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
18
|
-
let cacheKey;
|
|
19
|
-
if (shouldCache) {
|
|
20
|
-
cacheKey = generateCacheKey(value, options);
|
|
21
|
-
}
|
|
22
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
23
|
-
return cacheStore.get(cacheKey);
|
|
24
|
-
}
|
|
25
|
-
const result = joinSegments(
|
|
26
|
-
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((word) => {
|
|
36
|
-
if (options?.handleAnsi && RE_FAST_ANSI.test(word)) {
|
|
37
|
-
return word;
|
|
38
|
-
}
|
|
39
|
-
const split = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
|
|
40
|
-
return upperFirst(options?.locale ? split.toLocaleLowerCase(options.locale) : split.toLowerCase(), { locale: options?.locale });
|
|
41
|
-
}),
|
|
42
|
-
""
|
|
43
|
-
);
|
|
44
|
-
if (shouldCache && cacheKey) {
|
|
45
|
-
cacheStore.set(cacheKey, result);
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
}, "pascalCase");
|
|
49
|
-
|
|
50
|
-
export { pascalCase as default };
|
|
1
|
+
var m=Object.defineProperty;var s=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as c}from"../packem_shared/constants-Cd17VNEv.mjs";import p from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as f}from"./split-by-case.mjs";import u from"./upper-first.mjs";import{a as A}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import d from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";import{l as h}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var j=Object.defineProperty,w=s((r,o)=>j(r,"name",{value:o,configurable:!0}),"i");const y=new p(1e3),z=w((r,o)=>{if(typeof r!="string"||!r)return"";const e=o?.cache??!1,n=o?.cacheStore??y;let t;if(e&&(t=A(r,o)),e&&t&&n.has(t))return n.get(t);const i=d(f(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(a=>{if(o?.handleAnsi&&c.test(a))return a;const l=o?.locale?.startsWith("de")?h(a):a;return u(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}),"");return e&&t&&n.set(t,i),i},"pascalCase");export{z as default};
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
4
|
-
const case_noCase = require('./no-case.cjs');
|
|
5
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
6
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
7
|
-
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
11
|
-
const pascalSnakeCase = /* @__PURE__ */ __name((value, options) => {
|
|
12
|
-
if (typeof value !== "string") {
|
|
13
|
-
return "";
|
|
14
|
-
}
|
|
15
|
-
const shouldCache = options?.cache ?? false;
|
|
16
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
17
|
-
let cacheKey;
|
|
18
|
-
if (shouldCache) {
|
|
19
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
20
|
-
}
|
|
21
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
22
|
-
return cacheStore.get(cacheKey);
|
|
23
|
-
}
|
|
24
|
-
const words = case_noCase(value, { ...options, cache: false }).split(" ");
|
|
25
|
-
const result = words.map((word) => case_upperFirst(word, { locale: options?.locale })).join("_");
|
|
26
|
-
if (shouldCache && cacheKey) {
|
|
27
|
-
cacheStore.set(cacheKey, result);
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}, "pascalSnakeCase");
|
|
31
|
-
|
|
32
|
-
module.exports = pascalSnakeCase;
|
|
1
|
+
"use strict";var o=Object.defineProperty;var s=(r,e)=>o(r,"name",{value:e,configurable:!0});const u=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),l=require("./no-case.cjs"),p=require("./upper-first.cjs"),f=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs");var h=Object.defineProperty,g=s((r,e)=>h(r,"name",{value:e,configurable:!0}),"n");const q=new u(1e3),C=g((r,e)=>{if(typeof r!="string")return"";const t=e?.cache??!1,c=e?.cacheStore??q;let a;if(t&&(a=f.a(r,e)),t&&a&&c.has(a))return c.get(a);const n=l(r,{...e,cache:!1}).split(" ").map(i=>p(i,{locale:e?.locale})).join("_");return t&&a&&c.set(a,n),n},"pascalSnakeCase");module.exports=C;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, f as PascalSnakeCase } 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 pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, f as PascalSnakeCase } 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 pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, f as PascalSnakeCase } 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 pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import LRUCache from
|
|
2
|
-
import noCase from './no-case.mjs';
|
|
3
|
-
import upperFirst from './upper-first.mjs';
|
|
4
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
9
|
-
const pascalSnakeCase = /* @__PURE__ */ __name((value, options) => {
|
|
10
|
-
if (typeof value !== "string") {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
const shouldCache = options?.cache ?? false;
|
|
14
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
15
|
-
let cacheKey;
|
|
16
|
-
if (shouldCache) {
|
|
17
|
-
cacheKey = generateCacheKey(value, options);
|
|
18
|
-
}
|
|
19
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
20
|
-
return cacheStore.get(cacheKey);
|
|
21
|
-
}
|
|
22
|
-
const words = noCase(value, { ...options, cache: false }).split(" ");
|
|
23
|
-
const result = words.map((word) => upperFirst(word, { locale: options?.locale })).join("_");
|
|
24
|
-
if (shouldCache && cacheKey) {
|
|
25
|
-
cacheStore.set(cacheKey, result);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}, "pascalSnakeCase");
|
|
29
|
-
|
|
30
|
-
export { pascalSnakeCase as default };
|
|
1
|
+
var f=Object.defineProperty;var n=(r,e)=>f(r,"name",{value:e,configurable:!0});import l from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import m from"./no-case.mjs";import p from"./upper-first.mjs";import{a as s}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";var u=Object.defineProperty,h=n((r,e)=>u(r,"name",{value:e,configurable:!0}),"n");const g=new l(1e3),S=h((r,e)=>{if(typeof r!="string")return"";const a=e?.cache??!1,o=e?.cacheStore??g;let t;if(a&&(t=s(r,e)),a&&t&&o.has(t))return o.get(t);const c=m(r,{...e,cache:!1}).split(" ").map(i=>p(i,{locale:e?.locale})).join("_");return a&&t&&o.set(t,c),c},"pascalSnakeCase");export{S as default};
|
package/dist/case/path-case.cjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
4
|
-
const case_kebabCase = require('./kebab-case.cjs');
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
9
|
-
const pathCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "/" }), "pathCase");
|
|
10
|
-
|
|
11
|
-
module.exports = pathCase;
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(e,a)=>s(e,"name",{value:a,configurable:!0});const t=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),c=require("./kebab-case.cjs");var n=Object.defineProperty,i=r((e,a)=>n(e,"name",{value:a,configurable:!0}),"a");const o=new t(1e3),b=i((e,a)=>c.kebabCase(e,{cacheStore:o,...a,joiner:"/"}),"pathCase");module.exports=b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, g as PathCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, g as PathCase } 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 pathCase: <T extends string = string>(value?: T, options?: CaseOptions) => PathCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, g as PathCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, g as PathCase } 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 pathCase: <T extends string = string>(value?: T, options?: CaseOptions) => PathCase<T>;
|
package/dist/case/path-case.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, g as PathCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, g as PathCase } 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 pathCase: <T extends string = string>(value?: T, options?: CaseOptions) => PathCase<T>;
|
package/dist/case/path-case.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { kebabCase } from './kebab-case.mjs';
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
7
|
-
const pathCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "/" }), "pathCase");
|
|
8
|
-
|
|
9
|
-
export { pathCase as default };
|
|
1
|
+
var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var i=Object.defineProperty,s=r((e,a)=>i(e,"name",{value:a,configurable:!0}),"a");const c=new t(1e3),b=s((e,a)=>n(e,{cacheStore:c,...a,joiner:"/"}),"pathCase");export{b as default};
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const constants = require('../packem_shared/constants-CKuHriHc.cjs');
|
|
4
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
5
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
6
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
7
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
8
|
-
const joinSegments = require('../packem_shared/joinSegments-B_7bxy5J.cjs');
|
|
9
|
-
const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
|
|
10
|
-
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
14
|
-
const sentenceCase = /* @__PURE__ */ __name((value, options) => {
|
|
15
|
-
if (typeof value !== "string") {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
const shouldCache = options?.cache ?? false;
|
|
19
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
20
|
-
let cacheKey;
|
|
21
|
-
if (shouldCache) {
|
|
22
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
23
|
-
}
|
|
24
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
25
|
-
return cacheStore.get(cacheKey);
|
|
26
|
-
}
|
|
27
|
-
let firstWord = true;
|
|
28
|
-
const result = joinSegments(
|
|
29
|
-
case_splitByCase.splitByCase(value, {
|
|
30
|
-
handleAnsi: options?.handleAnsi,
|
|
31
|
-
handleEmoji: options?.handleEmoji,
|
|
32
|
-
knownAcronyms: options?.knownAcronyms,
|
|
33
|
-
locale: options?.locale,
|
|
34
|
-
normalize: options?.normalize,
|
|
35
|
-
separators: void 0,
|
|
36
|
-
stripAnsi: options?.stripAnsi,
|
|
37
|
-
stripEmoji: options?.stripEmoji
|
|
38
|
-
}).map((word) => {
|
|
39
|
-
if (options?.handleAnsi && constants.RE_FAST_ANSI.test(word)) {
|
|
40
|
-
return word;
|
|
41
|
-
}
|
|
42
|
-
word = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
|
|
43
|
-
word = options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase();
|
|
44
|
-
if (firstWord) {
|
|
45
|
-
firstWord = false;
|
|
46
|
-
return case_upperFirst(word, options);
|
|
47
|
-
}
|
|
48
|
-
return word;
|
|
49
|
-
}),
|
|
50
|
-
" "
|
|
51
|
-
);
|
|
52
|
-
if (shouldCache && cacheKey) {
|
|
53
|
-
cacheStore.set(cacheKey, result);
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}, "sentenceCase");
|
|
57
|
-
|
|
58
|
-
module.exports = sentenceCase;
|
|
1
|
+
"use strict";var c=Object.defineProperty;var l=(s,e)=>c(s,"name",{value:e,configurable:!0});const u=require("../packem_shared/constants-D3K8u3G8.cjs"),m=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),p=require("./split-by-case.cjs"),h=require("./upper-first.cjs"),d=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),A=require("../packem_shared/joinSegments-CDHNMXsF.cjs"),f=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var q=Object.defineProperty,y=l((s,e)=>q(s,"name",{value:e,configurable:!0}),"m");const C=new m(1e3),j=y((s,e)=>{if(typeof s!="string")return"";const n=e?.cache??!1,i=e?.cacheStore??C;let a;if(n&&(a=d.a(s,e)),n&&a&&i.has(a))return i.get(a);let o=!0;const t=A(p.splitByCase(s,{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(r=>e?.handleAnsi&&u.R.test(r)?r:(r=e?.locale?.startsWith("de")?f.l(r):r,r=e?.locale?r.toLocaleLowerCase(e.locale):r.toLowerCase(),o?(o=!1,h(r,e)):r))," ");return n&&a&&i.set(a,t),t},"sentenceCase");module.exports=j;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, S as SentenceCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, S as SentenceCase } 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 sentenceCase: <T extends string = string>(value?: T, options?: CaseOptions) => SentenceCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, S as SentenceCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, S as SentenceCase } 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 sentenceCase: <T extends string = string>(value?: T, options?: CaseOptions) => SentenceCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, S as SentenceCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, S as SentenceCase } 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 sentenceCase: <T extends string = string>(value?: T, options?: CaseOptions) => SentenceCase<T>;
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
|
|
3
|
-
import { splitByCase } from './split-by-case.mjs';
|
|
4
|
-
import upperFirst from './upper-first.mjs';
|
|
5
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
6
|
-
import joinSegments from '../packem_shared/joinSegments-BovQ2h_P.mjs';
|
|
7
|
-
import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
|
|
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 sentenceCase = /* @__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(value, options);
|
|
21
|
-
}
|
|
22
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
23
|
-
return cacheStore.get(cacheKey);
|
|
24
|
-
}
|
|
25
|
-
let firstWord = true;
|
|
26
|
-
const result = joinSegments(
|
|
27
|
-
splitByCase(value, {
|
|
28
|
-
handleAnsi: options?.handleAnsi,
|
|
29
|
-
handleEmoji: options?.handleEmoji,
|
|
30
|
-
knownAcronyms: options?.knownAcronyms,
|
|
31
|
-
locale: options?.locale,
|
|
32
|
-
normalize: options?.normalize,
|
|
33
|
-
separators: void 0,
|
|
34
|
-
stripAnsi: options?.stripAnsi,
|
|
35
|
-
stripEmoji: options?.stripEmoji
|
|
36
|
-
}).map((word) => {
|
|
37
|
-
if (options?.handleAnsi && RE_FAST_ANSI.test(word)) {
|
|
38
|
-
return word;
|
|
39
|
-
}
|
|
40
|
-
word = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
|
|
41
|
-
word = options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase();
|
|
42
|
-
if (firstWord) {
|
|
43
|
-
firstWord = false;
|
|
44
|
-
return upperFirst(word, options);
|
|
45
|
-
}
|
|
46
|
-
return word;
|
|
47
|
-
}),
|
|
48
|
-
" "
|
|
49
|
-
);
|
|
50
|
-
if (shouldCache && cacheKey) {
|
|
51
|
-
cacheStore.set(cacheKey, result);
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}, "sentenceCase");
|
|
55
|
-
|
|
56
|
-
export { sentenceCase as default };
|
|
1
|
+
var m=Object.defineProperty;var n=(a,o)=>m(a,"name",{value:o,configurable:!0});import{R as c}from"../packem_shared/constants-Cd17VNEv.mjs";import p from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as f}from"./split-by-case.mjs";import A from"./upper-first.mjs";import{a as d}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import h from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";import{l as u}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var j=Object.defineProperty,w=n((a,o)=>j(a,"name",{value:o,configurable:!0}),"m");const y=new p(1e3),k=w((a,o)=>{if(typeof a!="string")return"";const s=o?.cache??!1,i=o?.cacheStore??y;let e;if(s&&(e=d(a,o)),s&&e&&i.has(e))return i.get(e);let t=!0;const l=h(f(a,{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(r=>o?.handleAnsi&&c.test(r)?r:(r=o?.locale?.startsWith("de")?u(r):r,r=o?.locale?r.toLocaleLowerCase(o.locale):r.toLowerCase(),t?(t=!1,A(r,o)):r))," ");return s&&e&&i.set(e,l),l},"sentenceCase");export{k as default};
|
package/dist/case/snake-case.cjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
4
|
-
const case_kebabCase = require('./kebab-case.cjs');
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
9
|
-
const snakeCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "_" }), "snakeCase");
|
|
10
|
-
|
|
11
|
-
module.exports = snakeCase;
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(e,a)=>s(e,"name",{value:a,configurable:!0});const t=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),c=require("./kebab-case.cjs");var n=Object.defineProperty,i=r((e,a)=>n(e,"name",{value:a,configurable:!0}),"t");const o=new t(1e3),b=i((e,a)=>c.kebabCase(e,{cacheStore:o,...a,joiner:"_"}),"snakeCase");module.exports=b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, h as SnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, h as SnakeCase } 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 snakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => SnakeCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, h as SnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, h as SnakeCase } 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 snakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => SnakeCase<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaseOptions, h as SnakeCase } from '../packem_shared/types-
|
|
2
|
-
import '../packem_shared/types-
|
|
1
|
+
import { C as CaseOptions, h as SnakeCase } 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 snakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => SnakeCase<T>;
|
package/dist/case/snake-case.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { kebabCase } from './kebab-case.mjs';
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
7
|
-
const snakeCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "_" }), "snakeCase");
|
|
8
|
-
|
|
9
|
-
export { snakeCase as default };
|
|
1
|
+
var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var i=Object.defineProperty,s=a((e,r)=>i(e,"name",{value:r,configurable:!0}),"t");const c=new t(1e3),p=s((e,r)=>n(e,{cacheStore:c,...r,joiner:"_"}),"snakeCase");export{p as default};
|