@visulima/string 1.2.3 → 1.4.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 +17 -0
- package/README.md +46 -0
- package/dist/case/camel-case.cjs +1 -59
- package/dist/case/camel-case.mjs +1 -57
- package/dist/case/capital-case.cjs +1 -51
- package/dist/case/capital-case.mjs +1 -49
- package/dist/case/constant-case.cjs +1 -11
- package/dist/case/constant-case.mjs +1 -9
- package/dist/case/dot-case.cjs +1 -11
- package/dist/case/dot-case.mjs +1 -9
- package/dist/case/flat-case.cjs +1 -11
- package/dist/case/flat-case.mjs +1 -9
- package/dist/case/flip-case.cjs +1 -61
- package/dist/case/flip-case.mjs +1 -57
- package/dist/case/identify-case.cjs +1 -69
- package/dist/case/identify-case.mjs +1 -67
- package/dist/case/index.cjs +1 -47
- package/dist/case/index.mjs +1 -20
- package/dist/case/kebab-case.cjs +1 -61
- package/dist/case/kebab-case.mjs +1 -57
- package/dist/case/lower-first.cjs +1 -13
- package/dist/case/lower-first.mjs +1 -11
- package/dist/case/no-case.cjs +1 -11
- package/dist/case/no-case.mjs +1 -9
- package/dist/case/pascal-case.cjs +1 -52
- package/dist/case/pascal-case.mjs +1 -50
- package/dist/case/pascal-snake-case.cjs +1 -32
- package/dist/case/pascal-snake-case.mjs +1 -30
- package/dist/case/path-case.cjs +1 -11
- package/dist/case/path-case.mjs +1 -9
- package/dist/case/sentence-case.cjs +1 -58
- package/dist/case/sentence-case.mjs +1 -56
- package/dist/case/snake-case.cjs +1 -11
- package/dist/case/snake-case.mjs +1 -9
- package/dist/case/split-by-case.cjs +1 -641
- package/dist/case/split-by-case.mjs +1 -637
- package/dist/case/title-case.cjs +1 -47
- package/dist/case/title-case.mjs +1 -45
- package/dist/case/train-case.cjs +1 -44
- package/dist/case/train-case.mjs +1 -42
- package/dist/case/upper-first.cjs +1 -13
- package/dist/case/upper-first.mjs +1 -11
- package/dist/get-string-truncated-width.cjs +1 -422
- package/dist/get-string-truncated-width.mjs +1 -418
- package/dist/get-string-width.cjs +1 -11
- package/dist/get-string-width.mjs +1 -7
- package/dist/index.cjs +1 -66
- package/dist/index.d.cts +13 -3
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.mjs +1 -29
- package/dist/outdent.cjs +1 -125
- 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-BZ3jkEf1.mjs +8 -0
- package/dist/packem_shared/WrapMode-DR7vv3px.cjs +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/slice.cjs +1 -419
- package/dist/slice.mjs +1 -415
- package/dist/test/utils.cjs +13 -74
- package/dist/test/utils.mjs +14 -69
- package/dist/test/vitest.cjs +1 -11
- package/dist/test/vitest.mjs +1 -7
- package/dist/truncate.cjs +1 -101
- package/dist/truncate.mjs +1 -97
- package/dist/utils.cjs +1 -65
- package/dist/utils.mjs +1 -56
- package/package.json +8 -1
- package/dist/packem_shared/LRUCache-Crb-m7cw.cjs +0 -53
- package/dist/packem_shared/LRUCache-udNErhWw.mjs +0 -51
- package/dist/packem_shared/WrapMode-BCVbMqYK.mjs +0 -545
- package/dist/packem_shared/WrapMode-DebG_Nll.cjs +0 -550
- package/dist/packem_shared/constants-6-GJ6zA-.cjs +0 -150
- package/dist/packem_shared/constants-CKdlkHVU.mjs +0 -99
- 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-BfSDBmPF.mjs +0 -46
- package/dist/packem_shared/joinSegments-HYXurfoq.cjs +0 -48
- 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-SKjCL8DF.cjs +0 -50
- package/dist/packem_shared/slugify-pbxTlzeQ.mjs +0 -48
- package/dist/packem_shared/transliterate-4P32b49d.mjs +0 -47780
- package/dist/packem_shared/transliterate-CtOTNpLs.cjs +0 -47782
|
@@ -1,67 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const IS_PASCAL_CASE = /^([A-Z][a-z]*)+$/;
|
|
4
|
-
const CONTAINS_LETTER_CASE_INSENSITIVE = /[a-z]/i;
|
|
5
|
-
const IS_UPPER_SNAKE_CASE = /^[A-Z0-9_]+$/;
|
|
6
|
-
const IS_LOWER_SNAKE_CASE = /^[a-z0-9_]+$/;
|
|
7
|
-
const IS_KEBAB_CASE = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
8
|
-
const IS_LOWERCASE_WITH_SPACE = /^[a-z ]+$/;
|
|
9
|
-
const IS_UPPERCASE = /^[A-Z][A-Z0-9]*$/;
|
|
10
|
-
const WHITESPACE_REGEX = /\s+/;
|
|
11
|
-
const IS_NUMERIC = /^\d+$/;
|
|
12
|
-
const IS_CAMEL_CASE_LIKE = /^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)+$/;
|
|
13
|
-
const CONTAINS_PUNCTUATION_MID_WORD = /[.!?;:,](?!\s|$)/;
|
|
14
|
-
const identifyCase = /* @__PURE__ */ __name((value) => {
|
|
15
|
-
if (typeof value !== "string") {
|
|
16
|
-
throw new TypeError("Expected input to be a string");
|
|
17
|
-
}
|
|
18
|
-
if (!value) {
|
|
19
|
-
return "unknown";
|
|
20
|
-
}
|
|
21
|
-
if (!CONTAINS_LETTER_CASE_INSENSITIVE.test(value)) {
|
|
22
|
-
return "unknown";
|
|
23
|
-
}
|
|
24
|
-
if (value.includes("_")) {
|
|
25
|
-
if (IS_UPPER_SNAKE_CASE.test(value)) {
|
|
26
|
-
return "upper_snake";
|
|
27
|
-
}
|
|
28
|
-
if (IS_LOWER_SNAKE_CASE.test(value)) {
|
|
29
|
-
return "snake";
|
|
30
|
-
}
|
|
31
|
-
return "mixed";
|
|
32
|
-
}
|
|
33
|
-
if (value.includes("-")) {
|
|
34
|
-
if (IS_KEBAB_CASE.test(value)) {
|
|
35
|
-
return "kebab";
|
|
36
|
-
}
|
|
37
|
-
return "mixed";
|
|
38
|
-
}
|
|
39
|
-
if (IS_LOWERCASE_WITH_SPACE.test(value)) {
|
|
40
|
-
return "lower";
|
|
41
|
-
}
|
|
42
|
-
if (IS_UPPERCASE.test(value)) {
|
|
43
|
-
return "upper";
|
|
44
|
-
}
|
|
45
|
-
const words = value.split(WHITESPACE_REGEX);
|
|
46
|
-
if (words.length > 1 && words.every((word) => IS_PASCAL_CASE.test(word))) {
|
|
47
|
-
return "title";
|
|
48
|
-
}
|
|
49
|
-
if (words.length > 1 && IS_NUMERIC.test(words[0]) && IS_PASCAL_CASE.test(words[1])) {
|
|
50
|
-
return "title";
|
|
51
|
-
}
|
|
52
|
-
if (words.length > 1 && IS_PASCAL_CASE.test(words[0]) && /^[a-z]/.test(words[1])) {
|
|
53
|
-
return "sentence";
|
|
54
|
-
}
|
|
55
|
-
if (IS_PASCAL_CASE.test(value)) {
|
|
56
|
-
return "pascal";
|
|
57
|
-
}
|
|
58
|
-
if (IS_CAMEL_CASE_LIKE.test(value)) {
|
|
59
|
-
return "camel";
|
|
60
|
-
}
|
|
61
|
-
if (CONTAINS_PUNCTUATION_MID_WORD.test(value)) {
|
|
62
|
-
return "unknown";
|
|
63
|
-
}
|
|
64
|
-
return "mixed";
|
|
65
|
-
}, "identifyCase");
|
|
66
|
-
|
|
67
|
-
export { identifyCase as default };
|
|
1
|
+
var a=Object.defineProperty;var s=(e,t)=>a(e,"name",{value:t,configurable:!0});var i=Object.defineProperty,u=s((e,t)=>i(e,"name",{value:t,configurable:!0}),"s");const n=/^([A-Z][a-z]*)+$/,l=/[a-z]/i,o=/^[A-Z0-9_]+$/,p=/^[a-z0-9_]+$/,f=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,c=/^[a-z ]+$/,z=/^[A-Z][A-Z0-9]*$/,d=/\s+/,$=/^\d+$/,g=/^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)+$/,A=/[.!?;:,](?!\s|$)/,k=u(e=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(!e||!l.test(e))return"unknown";if(e.includes("_"))return o.test(e)?"upper_snake":p.test(e)?"snake":"mixed";if(e.includes("-"))return f.test(e)?"kebab":"mixed";if(c.test(e))return"lower";if(z.test(e))return"upper";const t=e.split(d);return t.length>1&&t.every(r=>n.test(r))||t.length>1&&$.test(t[0])&&n.test(t[1])?"title":t.length>1&&n.test(t[0])&&/^[a-z]/.test(t[1])?"sentence":n.test(e)?"pascal":g.test(e)?"camel":A.test(e)?"unknown":"mixed"},"identifyCase");export{k as default};
|
package/dist/case/index.cjs
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const case_camelCase = require('./camel-case.cjs');
|
|
6
|
-
const case_capitalCase = require('./capital-case.cjs');
|
|
7
|
-
const case_constantCase = require('./constant-case.cjs');
|
|
8
|
-
const case_dotCase = require('./dot-case.cjs');
|
|
9
|
-
const case_flatCase = require('./flat-case.cjs');
|
|
10
|
-
const case_flipCase = require('./flip-case.cjs');
|
|
11
|
-
const case_identifyCase = require('./identify-case.cjs');
|
|
12
|
-
const case_kebabCase = require('./kebab-case.cjs');
|
|
13
|
-
const case_lowerFirst = require('./lower-first.cjs');
|
|
14
|
-
const case_noCase = require('./no-case.cjs');
|
|
15
|
-
const case_pascalCase = require('./pascal-case.cjs');
|
|
16
|
-
const case_pascalSnakeCase = require('./pascal-snake-case.cjs');
|
|
17
|
-
const case_pathCase = require('./path-case.cjs');
|
|
18
|
-
const case_sentenceCase = require('./sentence-case.cjs');
|
|
19
|
-
const case_snakeCase = require('./snake-case.cjs');
|
|
20
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
21
|
-
const case_titleCase = require('./title-case.cjs');
|
|
22
|
-
const case_trainCase = require('./train-case.cjs');
|
|
23
|
-
const case_upperFirst = require('./upper-first.cjs');
|
|
24
|
-
const joinSegments = require('../packem_shared/joinSegments-HYXurfoq.cjs');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.camelCase = case_camelCase;
|
|
29
|
-
exports.capitalCase = case_capitalCase;
|
|
30
|
-
exports.constantCase = case_constantCase;
|
|
31
|
-
exports.dotCase = case_dotCase;
|
|
32
|
-
exports.flatCase = case_flatCase;
|
|
33
|
-
exports.flipCase = case_flipCase.flipCase;
|
|
34
|
-
exports.identifyCase = case_identifyCase;
|
|
35
|
-
exports.kebabCase = case_kebabCase.kebabCase;
|
|
36
|
-
exports.lowerFirst = case_lowerFirst;
|
|
37
|
-
exports.noCase = case_noCase;
|
|
38
|
-
exports.pascalCase = case_pascalCase;
|
|
39
|
-
exports.pascalSnakeCase = case_pascalSnakeCase;
|
|
40
|
-
exports.pathCase = case_pathCase;
|
|
41
|
-
exports.sentenceCase = case_sentenceCase;
|
|
42
|
-
exports.snakeCase = case_snakeCase;
|
|
43
|
-
exports.splitByCase = case_splitByCase.splitByCase;
|
|
44
|
-
exports.titleCase = case_titleCase;
|
|
45
|
-
exports.trainCase = case_trainCase;
|
|
46
|
-
exports.upperFirst = case_upperFirst;
|
|
47
|
-
exports.joinSegments = joinSegments;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./camel-case.cjs"),a=require("./capital-case.cjs"),s=require("./constant-case.cjs"),r=require("./dot-case.cjs"),i=require("./flat-case.cjs"),t=require("./flip-case.cjs"),C=require("./identify-case.cjs"),c=require("./kebab-case.cjs"),u=require("./lower-first.cjs"),l=require("./no-case.cjs"),n=require("./pascal-case.cjs"),_=require("./pascal-snake-case.cjs"),q=require("./path-case.cjs"),p=require("./sentence-case.cjs"),o=require("./snake-case.cjs"),b=require("./split-by-case.cjs"),f=require("./title-case.cjs"),d=require("./train-case.cjs"),k=require("./upper-first.cjs"),y=require("../packem_shared/joinSegments-CDHNMXsF.cjs");exports.camelCase=e;exports.capitalCase=a;exports.constantCase=s;exports.dotCase=r;exports.flatCase=i;exports.flipCase=t.flipCase;exports.identifyCase=C;exports.kebabCase=c.kebabCase;exports.lowerFirst=u;exports.noCase=l;exports.pascalCase=n;exports.pascalSnakeCase=_;exports.pathCase=q;exports.sentenceCase=p;exports.snakeCase=o;exports.splitByCase=b.splitByCase;exports.titleCase=f;exports.trainCase=d;exports.upperFirst=k;exports.joinSegments=y;
|
package/dist/case/index.mjs
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as capitalCase } from './capital-case.mjs';
|
|
3
|
-
export { default as constantCase } from './constant-case.mjs';
|
|
4
|
-
export { default as dotCase } from './dot-case.mjs';
|
|
5
|
-
export { default as flatCase } from './flat-case.mjs';
|
|
6
|
-
export { flipCase } from './flip-case.mjs';
|
|
7
|
-
export { default as identifyCase } from './identify-case.mjs';
|
|
8
|
-
export { kebabCase } from './kebab-case.mjs';
|
|
9
|
-
export { default as lowerFirst } from './lower-first.mjs';
|
|
10
|
-
export { default as noCase } from './no-case.mjs';
|
|
11
|
-
export { default as pascalCase } from './pascal-case.mjs';
|
|
12
|
-
export { default as pascalSnakeCase } from './pascal-snake-case.mjs';
|
|
13
|
-
export { default as pathCase } from './path-case.mjs';
|
|
14
|
-
export { default as sentenceCase } from './sentence-case.mjs';
|
|
15
|
-
export { default as snakeCase } from './snake-case.mjs';
|
|
16
|
-
export { splitByCase } from './split-by-case.mjs';
|
|
17
|
-
export { default as titleCase } from './title-case.mjs';
|
|
18
|
-
export { default as trainCase } from './train-case.mjs';
|
|
19
|
-
export { default as upperFirst } from './upper-first.mjs';
|
|
20
|
-
export { default as joinSegments } from '../packem_shared/joinSegments-BfSDBmPF.mjs';
|
|
1
|
+
import{default as t}from"./camel-case.mjs";import{default as r}from"./capital-case.mjs";import{default as f}from"./constant-case.mjs";import{default as l}from"./dot-case.mjs";import{default as x}from"./flat-case.mjs";import{flipCase as u}from"./flip-case.mjs";import{default as n}from"./identify-case.mjs";import{kebabCase as c}from"./kebab-case.mjs";import{default as b}from"./lower-first.mjs";import{default as F}from"./no-case.mjs";import{default as g}from"./pascal-case.mjs";import{default as j}from"./pascal-snake-case.mjs";import{default as B}from"./path-case.mjs";import{default as v}from"./sentence-case.mjs";import{default as A}from"./snake-case.mjs";import{splitByCase as E}from"./split-by-case.mjs";import{default as H}from"./title-case.mjs";import{default as J}from"./train-case.mjs";import{default as L}from"./upper-first.mjs";import{default as N}from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";export{t as camelCase,r as capitalCase,f as constantCase,l as dotCase,x as flatCase,u as flipCase,n as identifyCase,N as joinSegments,c as kebabCase,b as lowerFirst,F as noCase,g as pascalCase,j as pascalSnakeCase,B as pathCase,v as sentenceCase,A as snakeCase,E as splitByCase,H as titleCase,J as trainCase,L as upperFirst};
|
package/dist/case/kebab-case.cjs
CHANGED
|
@@ -1,61 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const constants = require('../packem_shared/constants-6-GJ6zA-.cjs');
|
|
6
|
-
const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
|
|
7
|
-
const case_splitByCase = require('./split-by-case.cjs');
|
|
8
|
-
const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
|
|
9
|
-
const joinSegments = require('../packem_shared/joinSegments-HYXurfoq.cjs');
|
|
10
|
-
const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
|
|
11
|
-
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
-
const defaultCacheStore = new LRUCache(1e3);
|
|
15
|
-
const kebabCase = /* @__PURE__ */ __name((value, options) => {
|
|
16
|
-
if (typeof value !== "string") {
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
const shouldCache = options?.cache ?? false;
|
|
20
|
-
const cacheStore = options?.cacheStore ?? defaultCacheStore;
|
|
21
|
-
let cacheKey;
|
|
22
|
-
if (shouldCache) {
|
|
23
|
-
cacheKey = generateCacheKey.generateCacheKey(value, options);
|
|
24
|
-
}
|
|
25
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
26
|
-
return cacheStore.get(cacheKey);
|
|
27
|
-
}
|
|
28
|
-
const words = 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
|
-
});
|
|
38
|
-
const processed = words.map((word) => {
|
|
39
|
-
if (options?.handleAnsi && constants.RE_FAST_ANSI.test(word)) {
|
|
40
|
-
return word;
|
|
41
|
-
}
|
|
42
|
-
if (options?.toUpperCase) {
|
|
43
|
-
if (options.locale) {
|
|
44
|
-
return word.toLocaleUpperCase(options.locale);
|
|
45
|
-
}
|
|
46
|
-
return word.toUpperCase();
|
|
47
|
-
}
|
|
48
|
-
const split = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
|
|
49
|
-
if (options?.locale) {
|
|
50
|
-
return split.toLocaleLowerCase(options.locale);
|
|
51
|
-
}
|
|
52
|
-
return split.toLowerCase();
|
|
53
|
-
});
|
|
54
|
-
const result = joinSegments(processed, options?.joiner ?? "-");
|
|
55
|
-
if (shouldCache && cacheKey) {
|
|
56
|
-
cacheStore.set(cacheKey, result);
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}, "kebabCase");
|
|
60
|
-
|
|
61
|
-
exports.kebabCase = kebabCase;
|
|
1
|
+
"use strict";var u=Object.defineProperty;var l=(r,e)=>u(r,"name",{value:e,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("../packem_shared/constants-D3K8u3G8.cjs"),m=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),C=require("./split-by-case.cjs"),d=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),h=require("../packem_shared/joinSegments-CDHNMXsF.cjs"),b=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var f=Object.defineProperty,j=l((r,e)=>f(r,"name",{value:e,configurable:!0}),"o");const y=new m(1e3),g=j((r,e)=>{if(typeof r!="string")return"";const o=e?.cache??!1,s=e?.cacheStore??y;let t;if(o&&(t=d.a(r,e)),o&&t&&s.has(t))return s.get(t);const c=C.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&&p.R.test(a))return a;if(e?.toUpperCase)return e.locale?a.toLocaleUpperCase(e.locale):a.toUpperCase();const i=e?.locale?.startsWith("de")?b.l(a):a;return e?.locale?i.toLocaleLowerCase(e.locale):i.toLowerCase()}),n=h(c,e?.joiner??"-");return o&&t&&s.set(t,n),n},"kebabCase");exports.kebabCase=g;
|
package/dist/case/kebab-case.mjs
CHANGED
|
@@ -1,57 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
|
|
3
|
-
import { splitByCase } from './split-by-case.mjs';
|
|
4
|
-
import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
|
|
5
|
-
import joinSegments from '../packem_shared/joinSegments-BfSDBmPF.mjs';
|
|
6
|
-
import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
|
|
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 kebabCase = /* @__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(value, options);
|
|
20
|
-
}
|
|
21
|
-
if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
|
|
22
|
-
return cacheStore.get(cacheKey);
|
|
23
|
-
}
|
|
24
|
-
const words = 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
|
-
});
|
|
34
|
-
const processed = words.map((word) => {
|
|
35
|
-
if (options?.handleAnsi && RE_FAST_ANSI.test(word)) {
|
|
36
|
-
return word;
|
|
37
|
-
}
|
|
38
|
-
if (options?.toUpperCase) {
|
|
39
|
-
if (options.locale) {
|
|
40
|
-
return word.toLocaleUpperCase(options.locale);
|
|
41
|
-
}
|
|
42
|
-
return word.toUpperCase();
|
|
43
|
-
}
|
|
44
|
-
const split = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
|
|
45
|
-
if (options?.locale) {
|
|
46
|
-
return split.toLocaleLowerCase(options.locale);
|
|
47
|
-
}
|
|
48
|
-
return split.toLowerCase();
|
|
49
|
-
});
|
|
50
|
-
const result = joinSegments(processed, options?.joiner ?? "-");
|
|
51
|
-
if (shouldCache && cacheKey) {
|
|
52
|
-
cacheStore.set(cacheKey, result);
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}, "kebabCase");
|
|
56
|
-
|
|
57
|
-
export { kebabCase };
|
|
1
|
+
var m=Object.defineProperty;var l=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as p}from"../packem_shared/constants-Cd17VNEv.mjs";import f from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as u}from"./split-by-case.mjs";import{a as h}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import A from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";import{l as d}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var C=Object.defineProperty,b=l((r,o)=>C(r,"name",{value:o,configurable:!0}),"o");const j=new f(1e3),S=b((r,o)=>{if(typeof r!="string")return"";const a=o?.cache??!1,s=o?.cacheStore??j;let e;if(a&&(e=h(r,o)),a&&e&&s.has(e))return s.get(e);const c=u(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(t=>{if(o?.handleAnsi&&p.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?d(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),n=A(c,o?.joiner??"-");return a&&e&&s.set(e,n),n},"kebabCase");export{S as kebabCase};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
const lowerFirst = /* @__PURE__ */ __name((value, options) => {
|
|
6
|
-
if (typeof value !== "string" || value === "") {
|
|
7
|
-
return "";
|
|
8
|
-
}
|
|
9
|
-
const firstChar = options?.locale ? value[0].toLocaleLowerCase(options.locale) : value[0].toLowerCase();
|
|
10
|
-
return firstChar + value.slice(1);
|
|
11
|
-
}, "lowerFirst");
|
|
12
|
-
|
|
13
|
-
module.exports = lowerFirst;
|
|
1
|
+
"use strict";var a=Object.defineProperty;var t=(e,o)=>a(e,"name",{value:o,configurable:!0});var s=Object.defineProperty,l=t((e,o)=>s(e,"name",{value:o,configurable:!0}),"s");const r=l((e,o)=>typeof e!="string"||e===""?"":(o?.locale?e[0].toLocaleLowerCase(o.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");module.exports=r;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const lowerFirst = /* @__PURE__ */ __name((value, options) => {
|
|
4
|
-
if (typeof value !== "string" || value === "") {
|
|
5
|
-
return "";
|
|
6
|
-
}
|
|
7
|
-
const firstChar = options?.locale ? value[0].toLocaleLowerCase(options.locale) : value[0].toLowerCase();
|
|
8
|
-
return firstChar + value.slice(1);
|
|
9
|
-
}, "lowerFirst");
|
|
10
|
-
|
|
11
|
-
export { lowerFirst as default };
|
|
1
|
+
var l=Object.defineProperty;var a=(e,o)=>l(e,"name",{value:o,configurable:!0});var t=Object.defineProperty,r=a((e,o)=>t(e,"name",{value:o,configurable:!0}),"s");const c=r((e,o)=>typeof e!="string"||e===""?"":(o?.locale?e[0].toLocaleLowerCase(o.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");export{c as default};
|
package/dist/case/no-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 noCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: " " }), "noCase");
|
|
10
|
-
|
|
11
|
-
module.exports = noCase;
|
|
1
|
+
"use strict";var s=Object.defineProperty;var a=(e,r)=>s(e,"name",{value:r,configurable:!0});const c=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),n=require("./kebab-case.cjs");var o=Object.defineProperty,t=a((e,r)=>o(e,"name",{value:r,configurable:!0}),"o");const i=new c(1e3),b=t((e,r)=>n.kebabCase(e,{cacheStore:i,...r,joiner:" "}),"noCase");module.exports=b;
|
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-6-GJ6zA-.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-HYXurfoq.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,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-BfSDBmPF.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,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;
|
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-6-GJ6zA-.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-HYXurfoq.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;
|