@visulima/string 3.0.0 → 3.1.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 +7 -0
- package/dist/align-text.d.ts +29 -29
- package/dist/case/camel-case.d.ts +16 -16
- package/dist/case/camel-case.js +1 -1
- package/dist/case/capital-case.d.ts +13 -13
- package/dist/case/capital-case.js +1 -1
- package/dist/case/constant-case.d.ts +13 -13
- package/dist/case/dot-case.d.ts +13 -13
- package/dist/case/flat-case.d.ts +11 -11
- package/dist/case/flip-case.d.ts +14 -14
- package/dist/case/flip-case.js +1 -1
- package/dist/case/identify-case.d.ts +14 -14
- package/dist/case/index.d.ts +7 -7
- package/dist/case/kebab-case.d.ts +22 -22
- package/dist/case/kebab-case.js +1 -1
- package/dist/case/lower-first.d.ts +12 -12
- package/dist/case/no-case.d.ts +13 -13
- package/dist/case/pascal-case.d.ts +16 -16
- package/dist/case/pascal-case.js +1 -1
- package/dist/case/pascal-snake-case.d.ts +13 -13
- package/dist/case/pascal-snake-case.js +1 -1
- package/dist/case/path-case.d.ts +13 -13
- package/dist/case/sentence-case.d.ts +13 -13
- package/dist/case/sentence-case.js +1 -1
- package/dist/case/snake-case.d.ts +13 -13
- package/dist/case/split-by-case.d.ts +20 -20
- package/dist/case/split-by-case.js +1 -1
- package/dist/case/title-case.d.ts +11 -11
- package/dist/case/title-case.js +1 -1
- package/dist/case/train-case.d.ts +13 -13
- package/dist/case/train-case.js +1 -1
- package/dist/case/upper-first.d.ts +12 -12
- package/dist/closest-string.d.ts +28 -28
- package/dist/compare-similarity.d.ts +33 -33
- package/dist/count-occurrences.d.ts +6 -6
- package/dist/direction.d.ts +4 -4
- package/dist/east-asian-width.d.ts +20 -14
- package/dist/excerpt.d.ts +18 -18
- package/dist/get-string-truncated-width.d.ts +131 -131
- package/dist/get-string-truncated-width.js +1 -1
- package/dist/get-string-width.d.ts +56 -56
- package/dist/indent.d.ts +8 -7
- package/dist/index.d.ts +2 -2
- package/dist/is-fullwidth-code-point.d.ts +4 -4
- package/dist/levenshtein.d.ts +19 -19
- package/dist/native-string-types.d.ts +212 -228
- package/dist/outdent.d.ts +64 -64
- package/dist/packem_shared/generate-cache-key-B_0X7MKm.js +1 -0
- package/dist/packem_shared/strip-vt-control-characters-BW1RglLp.js +1 -0
- package/dist/packem_shared/types.d-CMNqA5bi.d.ts +402 -0
- package/dist/packem_shared/types.d-LgsTR37y.d.ts +360 -0
- package/dist/replace-string.d.ts +7 -7
- package/dist/slice.d.ts +38 -38
- package/dist/slice.js +1 -1
- package/dist/slugify.d.ts +9 -9
- package/dist/test/utils.d.ts +14 -14
- package/dist/test/utils.js +11 -11
- package/dist/test/vitest.d.ts +2 -2
- package/dist/transliterate.d.ts +7 -7
- package/dist/transliterate.js +2 -2
- package/dist/truncate.d.ts +37 -37
- package/dist/utilities.d.ts +23 -23
- package/dist/word-similarity-sort.d.ts +32 -32
- package/dist/word-wrap.d.ts +33 -33
- package/dist/word-wrap.js +7 -7
- package/package.json +1 -1
- package/dist/packem_shared/generate-cache-key-BqU1Cqwm.js +0 -1
- package/dist/packem_shared/types.d-CmNvyl4l.d.ts +0 -360
- package/dist/packem_shared/types.d-fhe030jX.d.ts +0 -402
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## @visulima/string [3.1.0](https://github.com/visulima/visulima/compare/%40visulima%2Fstring%403.0.0...%40visulima%2Fstring%403.1.0) (2026-08-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Dependencies
|
|
5
|
+
|
|
6
|
+
* **@visulima/colorize:** upgraded to 2.1.0
|
|
7
|
+
|
|
1
8
|
## @visulima/string [3.0.0](https://github.com/visulima/visulima/compare/@visulima/string@2.0.6...@visulima/string@3.0.0) (2026-07-03)
|
|
2
9
|
|
|
3
10
|
### ⚠ BREAKING CHANGES
|
package/dist/align-text.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { StringWidthOptions } from "./get-string-width.js";
|
|
2
2
|
import "./get-string-truncated-width.js";
|
|
3
3
|
/**
|
|
4
|
-
* Options for controlling the text alignment.
|
|
5
|
-
*/
|
|
4
|
+
* Options for controlling the text alignment.
|
|
5
|
+
*/
|
|
6
6
|
type AlignTextOptions = {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
* The alignment direction.
|
|
9
|
+
* @default "center"
|
|
10
|
+
*/
|
|
11
11
|
align?: "center" | "left" | "right";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
* Character used for padding when aligning text.
|
|
14
|
+
* @default " "
|
|
15
|
+
*/
|
|
16
16
|
pad?: string;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* The character to split the input string by, if it's a single string.
|
|
19
|
+
* @default "\n"
|
|
20
|
+
*/
|
|
21
21
|
split?: string;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
* Options to pass to `getStringWidth` for calculating the width of each line.
|
|
24
|
+
*/
|
|
25
25
|
stringWidthOptions?: StringWidthOptions;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
-
* Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* alignText("Hello\nWorld!", { align: "right" });
|
|
32
|
-
* // => " Hello\nWorld!"
|
|
33
|
-
*
|
|
34
|
-
* alignText(["Beep", "Boop\nBop"], { align: "center" });
|
|
35
|
-
* // => [
|
|
36
|
-
* // " Beep",
|
|
37
|
-
* // "Boop\n Bop"
|
|
38
|
-
* // ]
|
|
39
|
-
* ```
|
|
40
|
-
* @param text The string or array of strings to align.
|
|
41
|
-
* @param options Options for controlling the alignment.
|
|
42
|
-
* @returns The aligned string or array of strings, matching the input type.
|
|
43
|
-
*/
|
|
28
|
+
* Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* alignText("Hello\nWorld!", { align: "right" });
|
|
32
|
+
* // => " Hello\nWorld!"
|
|
33
|
+
*
|
|
34
|
+
* alignText(["Beep", "Boop\nBop"], { align: "center" });
|
|
35
|
+
* // => [
|
|
36
|
+
* // " Beep",
|
|
37
|
+
* // "Boop\n Bop"
|
|
38
|
+
* // ]
|
|
39
|
+
* ```
|
|
40
|
+
* @param text The string or array of strings to align.
|
|
41
|
+
* @param options Options for controlling the alignment.
|
|
42
|
+
* @returns The aligned string or array of strings, matching the input type.
|
|
43
|
+
*/
|
|
44
44
|
declare const alignText: (text: string[] | string, options?: AlignTextOptions) => string[] | string;
|
|
45
45
|
export { AlignTextOptions, alignText };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to camelCase.
|
|
5
|
-
* @param value The string to convert.
|
|
6
|
-
* @param options Options for case conversion.
|
|
7
|
-
* @returns The string in camelCase.
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* camelCase('foo bar') // 'fooBar'
|
|
11
|
-
* camelCase('foo-bar') // 'fooBar'
|
|
12
|
-
* camelCase('foo_bar') // 'fooBar'
|
|
13
|
-
* camelCase('XMLHttpRequest') // 'xmlHttpRequest'
|
|
14
|
-
* camelCase('AJAXRequest') // 'ajaxRequest'
|
|
15
|
-
* camelCase('QueryXML123String') // 'queryXml123String'
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
4
|
+
* Converts a string to camelCase.
|
|
5
|
+
* @param value The string to convert.
|
|
6
|
+
* @param options Options for case conversion.
|
|
7
|
+
* @returns The string in camelCase.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* camelCase('foo bar') // 'fooBar'
|
|
11
|
+
* camelCase('foo-bar') // 'fooBar'
|
|
12
|
+
* camelCase('foo_bar') // 'fooBar'
|
|
13
|
+
* camelCase('XMLHttpRequest') // 'xmlHttpRequest'
|
|
14
|
+
* camelCase('AJAXRequest') // 'ajaxRequest'
|
|
15
|
+
* camelCase('QueryXML123String') // 'queryXml123String'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
18
|
declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
|
|
19
19
|
export { camelCase as default };
|
package/dist/case/camel-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import f from"./lower-first.js";import{splitByCase as A}from"./split-by-case.js";import h from"./upper-first.js";import{
|
|
1
|
+
import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import f from"./lower-first.js";import{splitByCase as A}from"./split-by-case.js";import h from"./upper-first.js";import{a as d}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import u from"../packem_shared/joinSegments-CaHT-45s.js";import{a as w}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const y=new p(1e3),z=(t,o)=>{if(typeof t!="string"||!t)return"";const i=o?.cache??!1,n=o?.cacheStore??y;let r;if(i&&(r=d(t,o)),i&&r&&n.has(r))return n.get(r);let a=!0;const e=u(A(t,{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(s=>{if(o?.handleAnsi&&c.test(s))return s;const m=o?.locale?.startsWith("de")?w(s):s,l=o?.locale?m.toLocaleLowerCase(o.locale):m.toLowerCase();return a?(a=!1,f(l,o)):h(l,o)}),"");return i&&r&&n.set(r,e),e};export{z as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to Capital Case.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* capitalCase("foo bar") // => "Foo Bar"
|
|
8
|
-
* capitalCase("foo-bar") // => "Foo Bar"
|
|
9
|
-
* capitalCase("foo_bar") // => "Foo Bar"
|
|
10
|
-
* capitalCase("XMLHttpRequest") // => "Xml Http Request"
|
|
11
|
-
* capitalCase("AJAXRequest") // => "Ajax Request"
|
|
12
|
-
* capitalCase("QueryXML123String") // => "Query Xml 123 String"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to Capital Case.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* capitalCase("foo bar") // => "Foo Bar"
|
|
8
|
+
* capitalCase("foo-bar") // => "Foo Bar"
|
|
9
|
+
* capitalCase("foo_bar") // => "Foo Bar"
|
|
10
|
+
* capitalCase("XMLHttpRequest") // => "Xml Http Request"
|
|
11
|
+
* capitalCase("AJAXRequest") // => "Ajax Request"
|
|
12
|
+
* capitalCase("QueryXML123String") // => "Query Xml 123 String"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
|
|
16
16
|
export { capitalCase as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"../packem_shared/constants-aPzGW29R.js";import{i as c}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{
|
|
1
|
+
import{c as m}from"../packem_shared/constants-aPzGW29R.js";import{i as c}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{a as h}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import A from"../packem_shared/joinSegments-CaHT-45s.js";import{a as d}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const u=new c(1e3),S=(a,o)=>{if(typeof a!="string")return"";const s=o?.cache??!1,i=o?.cacheStore??u;let r;if(s&&(r=h(a,o)),s&&r&&i.has(r))return i.get(r);const l=p(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(t=>{if(m.test(t))return t;const e=o?.locale?.startsWith("de")?d(t):t;return f(o?.locale?e.toLocaleLowerCase(o.locale):e.toLocaleLowerCase(),o)}),n=A(l," ");return s&&r&&i.set(r,n),n};export{S as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to CONSTANT_CASE.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* constantCase("foo bar") // => "FOO_BAR"
|
|
8
|
-
* constantCase("foo-bar") // => "FOO_BAR"
|
|
9
|
-
* constantCase("foo_bar") // => "FOO_BAR"
|
|
10
|
-
* constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
|
|
11
|
-
* constantCase("AJAXRequest") // => "AJAX_REQUEST"
|
|
12
|
-
* constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to CONSTANT_CASE.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* constantCase("foo bar") // => "FOO_BAR"
|
|
8
|
+
* constantCase("foo-bar") // => "FOO_BAR"
|
|
9
|
+
* constantCase("foo_bar") // => "FOO_BAR"
|
|
10
|
+
* constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
|
|
11
|
+
* constantCase("AJAXRequest") // => "AJAX_REQUEST"
|
|
12
|
+
* constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
|
|
16
16
|
export { constantCase as default };
|
package/dist/case/dot-case.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to dot.case.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* dotCase("foo bar") // => "foo.bar"
|
|
8
|
-
* dotCase("foo-bar") // => "foo.bar"
|
|
9
|
-
* dotCase("foo_bar") // => "foo.bar"
|
|
10
|
-
* dotCase("XMLHttpRequest") // => "xml.http.request"
|
|
11
|
-
* dotCase("AJAXRequest") // => "ajax.request"
|
|
12
|
-
* dotCase("QueryXML123String") // => "query.xml.123.string"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to dot.case.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* dotCase("foo bar") // => "foo.bar"
|
|
8
|
+
* dotCase("foo-bar") // => "foo.bar"
|
|
9
|
+
* dotCase("foo_bar") // => "foo.bar"
|
|
10
|
+
* dotCase("XMLHttpRequest") // => "xml.http.request"
|
|
11
|
+
* dotCase("AJAXRequest") // => "ajax.request"
|
|
12
|
+
* dotCase("QueryXML123String") // => "query.xml.123.string"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
|
|
16
16
|
export { dotCase as default };
|
package/dist/case/flat-case.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to flat case (all lowercase, no separators).
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* flatCase("foo-barBaz") // => "foobarbaz"
|
|
8
|
-
* flatCase("XMLHttpRequest") // => "xmlhttprequest"
|
|
9
|
-
* flatCase("AJAXRequest") // => "ajaxrequest"
|
|
10
|
-
* flatCase("QueryXML123String") // => "queryxml123string"
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
4
|
+
* Converts a string to flat case (all lowercase, no separators).
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* flatCase("foo-barBaz") // => "foobarbaz"
|
|
8
|
+
* flatCase("XMLHttpRequest") // => "xmlhttprequest"
|
|
9
|
+
* flatCase("AJAXRequest") // => "ajaxrequest"
|
|
10
|
+
* flatCase("QueryXML123String") // => "queryxml123string"
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
13
|
declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
|
|
14
14
|
export { flatCase as default };
|
package/dist/case/flip-case.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Options specific to flip case operations.
|
|
5
|
-
* Note: handleEmoji is not needed as the function preserves emojis by default
|
|
6
|
-
*/
|
|
4
|
+
* Options specific to flip case operations.
|
|
5
|
+
* Note: handleEmoji is not needed as the function preserves emojis by default
|
|
6
|
+
*/
|
|
7
7
|
type FlipOptions = Omit<CaseOptions, "handleEmoji">;
|
|
8
8
|
/**
|
|
9
|
-
* Flips the case of each character in a string.
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* flipCase("FooBar") // => "fOObAR"
|
|
13
|
-
* flipCase("foobar") // => "FOOBAR"
|
|
14
|
-
* flipCase("FOOBAR") // => "foobar"
|
|
15
|
-
* flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
9
|
+
* Flips the case of each character in a string.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* flipCase("FooBar") // => "fOObAR"
|
|
13
|
+
* flipCase("foobar") // => "FOOBAR"
|
|
14
|
+
* flipCase("FOOBAR") // => "foobar"
|
|
15
|
+
* flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
18
|
declare const flipCase: <T extends string = string>(value?: T, options?: FlipOptions) => FlipCase<T>;
|
|
19
19
|
export { FlipOptions, flipCase };
|
package/dist/case/flip-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as m}from"../packem_shared/constants-aPzGW29R.js";import{i as h}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{r as g}from"../packem_shared/strip-vt-control-characters-BW1RglLp.js";import{a as C}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const u=new h(1e3),x=(i,o)=>{if(typeof i!="string"||i.length===0)return"";const r=o?.cache??!1,c=o?.cacheStore??u;let l;if(r&&(l=C(i,o)),r&&l&&c.has(l))return c.get(l);let e=i;o?.stripEmoji&&(e=m(e)),o?.stripAnsi&&(e=g(e));let n="",t=0;for(;t<e.length;){if(o?.handleAnsi&&e[t]==="\x1B"){let p=e[t];for(t+=1;t<e.length&&e[t]!=="m";)p+=e[t],t+=1;t<e.length&&(p+=e[t],n+=p),t+=1;continue}const s=e[t],f=o?.locale?s.toLocaleLowerCase(o.locale):s.toLowerCase();let a;s===f?a=o?.locale?s.toLocaleUpperCase(o.locale):s.toUpperCase():a=f,n+=a,t+=1}return r&&l&&c.set(l,n),n};export{x as flipCase};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { I as IdentifyCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { I as IdentifyCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Identifies the case style of a string.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* identifyCase("fooBar") // => "camel"
|
|
8
|
-
* identifyCase("FooBar") // => "pascal"
|
|
9
|
-
* identifyCase("foo_bar") // => "snake"
|
|
10
|
-
* identifyCase("foo-bar") // => "kebab"
|
|
11
|
-
* identifyCase("foo") // => "lower"
|
|
12
|
-
* identifyCase("FOO") // => "upper"
|
|
13
|
-
* identifyCase("FooBAR") // => "mixed"
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
4
|
+
* Identifies the case style of a string.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* identifyCase("fooBar") // => "camel"
|
|
8
|
+
* identifyCase("FooBar") // => "pascal"
|
|
9
|
+
* identifyCase("foo_bar") // => "snake"
|
|
10
|
+
* identifyCase("foo-bar") // => "kebab"
|
|
11
|
+
* identifyCase("foo") // => "lower"
|
|
12
|
+
* identifyCase("FOO") // => "upper"
|
|
13
|
+
* identifyCase("FooBAR") // => "mixed"
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
16
|
declare const identifyCase: <T extends string = string>(value?: T) => IdentifyCase<T>;
|
|
17
17
|
export { identifyCase as default };
|
package/dist/case/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { N as NodeLocale } from "../packem_shared/types.d-
|
|
1
|
+
export type { N as NodeLocale } from "../packem_shared/types.d-LgsTR37y.js";
|
|
2
2
|
export { default as camelCase } from "./camel-case.js";
|
|
3
3
|
export { default as capitalCase } from "./capital-case.js";
|
|
4
4
|
export { default as constantCase } from "./constant-case.js";
|
|
@@ -17,13 +17,13 @@ export { default as snakeCase } from "./snake-case.js";
|
|
|
17
17
|
export { type SplitOptions, splitByCase } from "./split-by-case.js";
|
|
18
18
|
export { default as titleCase } from "./title-case.js";
|
|
19
19
|
export { default as trainCase } from "./train-case.js";
|
|
20
|
-
export type { C as CamelCase, a as CapitalCase, b as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from "../packem_shared/types.d-
|
|
20
|
+
export type { C as CamelCase, a as CapitalCase, b as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
21
21
|
export { default as upperFirst } from "./upper-first.js";
|
|
22
22
|
/**
|
|
23
|
-
* Joins segments with a joiner, handling ANSI sequences and emojis correctly.
|
|
24
|
-
* @param segments Array of segments to join
|
|
25
|
-
* @param joiner String used to join segments together
|
|
26
|
-
* @returns Joined string with proper handling of ANSI and emoji sequences
|
|
27
|
-
*/
|
|
23
|
+
* Joins segments with a joiner, handling ANSI sequences and emojis correctly.
|
|
24
|
+
* @param segments Array of segments to join
|
|
25
|
+
* @param joiner String used to join segments together
|
|
26
|
+
* @returns Joined string with proper handling of ANSI and emoji sequences
|
|
27
|
+
*/
|
|
28
28
|
declare const joinSegments: (segments: string[], joiner: string) => string;
|
|
29
29
|
export { joinSegments };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { b as CaseOptions, K as KebabCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, K as KebabCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
interface KebabCaseOptions extends CaseOptions {
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
* String used to join words together in kebab case format.
|
|
6
|
+
* @default "-"
|
|
7
|
+
*/
|
|
8
8
|
joiner?: string;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
* Whether to convert the result to uppercase.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
13
|
toUpperCase?: boolean;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Converts a string to kebab-case.
|
|
17
|
-
* @param value The string to convert to kebab-case.
|
|
18
|
-
* @param options Configuration options for kebab-case conversion.
|
|
19
|
-
* @returns The converted kebab-case string.
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* kebabCase("fooBar") // => "foo-bar"
|
|
23
|
-
* kebabCase("foo bar") // => "foo-bar"
|
|
24
|
-
* kebabCase("foo_bar") // => "foo-bar"
|
|
25
|
-
* kebabCase("XMLHttpRequest") // => "xml-http-request"
|
|
26
|
-
* kebabCase("AJAXRequest") // => "ajax-request"
|
|
27
|
-
* kebabCase("QueryXML123String") // => "query-xml-123-string"
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
16
|
+
* Converts a string to kebab-case.
|
|
17
|
+
* @param value The string to convert to kebab-case.
|
|
18
|
+
* @param options Configuration options for kebab-case conversion.
|
|
19
|
+
* @returns The converted kebab-case string.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* kebabCase("fooBar") // => "foo-bar"
|
|
23
|
+
* kebabCase("foo bar") // => "foo-bar"
|
|
24
|
+
* kebabCase("foo_bar") // => "foo-bar"
|
|
25
|
+
* kebabCase("XMLHttpRequest") // => "xml-http-request"
|
|
26
|
+
* kebabCase("AJAXRequest") // => "ajax-request"
|
|
27
|
+
* kebabCase("QueryXML123String") // => "query-xml-123-string"
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
30
|
declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
|
|
31
31
|
export { KebabCaseOptions, kebabCase };
|
package/dist/case/kebab-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import{
|
|
1
|
+
import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(s,o)=>{if(typeof s!="string")return"";const e=o?.cache??!1,n=o?.cacheStore??d;let r;if(e&&(r=f(s,o)),e&&r&&n.has(r))return n.get(r);const l=p(s,{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&&c.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?A(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),a=h(l,o?.joiner??"-");return e&&r&&n.set(r,a),a};export{L as kebabCase};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts first character to lower case.
|
|
5
|
-
* @param value The string to convert.
|
|
6
|
-
* @param options Options for case conversion.
|
|
7
|
-
* @returns The string with its first character converted to lowercase.
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* lowerFirst("Hello world!") // => "hello world!"
|
|
11
|
-
* lowerFirst("İSTANBUL", { locale: "tr" }) // => "istanbul"
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
4
|
+
* Converts first character to lower case.
|
|
5
|
+
* @param value The string to convert.
|
|
6
|
+
* @param options Options for case conversion.
|
|
7
|
+
* @returns The string with its first character converted to lowercase.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* lowerFirst("Hello world!") // => "hello world!"
|
|
11
|
+
* lowerFirst("İSTANBUL", { locale: "tr" }) // => "istanbul"
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
14
|
declare const lowerFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => LowerFirst<T>;
|
|
15
15
|
export { lowerFirst as default };
|
package/dist/case/no-case.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, N as NoCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, N as NoCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to no case (space separated words).
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* noCase("foo bar") // => "foo bar"
|
|
8
|
-
* noCase("foo-bar") // => "foo bar"
|
|
9
|
-
* noCase("foo_bar") // => "foo bar"
|
|
10
|
-
* noCase("XMLHttpRequest") // => "xml http request"
|
|
11
|
-
* noCase("AJAXRequest") // => "ajax request"
|
|
12
|
-
* noCase("QueryXML123String") // => "query xml 123 string"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to no case (space separated words).
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* noCase("foo bar") // => "foo bar"
|
|
8
|
+
* noCase("foo-bar") // => "foo bar"
|
|
9
|
+
* noCase("foo_bar") // => "foo bar"
|
|
10
|
+
* noCase("XMLHttpRequest") // => "xml http request"
|
|
11
|
+
* noCase("AJAXRequest") // => "ajax request"
|
|
12
|
+
* noCase("QueryXML123String") // => "query xml 123 string"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
|
|
16
16
|
export { noCase as default };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { b as CaseOptions, P as PascalCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, P as PascalCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to PascalCase.
|
|
5
|
-
* @param value The string to convert.
|
|
6
|
-
* @param options Options for case conversion.
|
|
7
|
-
* @returns The string in PascalCase.
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* pascalCase('foo bar') // 'FooBar'
|
|
11
|
-
* pascalCase('foo-bar') // 'FooBar'
|
|
12
|
-
* pascalCase('foo_bar') // 'FooBar'
|
|
13
|
-
* pascalCase('XMLHttpRequest') // 'XmlHttpRequest'
|
|
14
|
-
* pascalCase('AJAXRequest') // 'AjaxRequest'
|
|
15
|
-
* pascalCase('QueryXML123String') // 'QueryXml123String'
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
4
|
+
* Converts a string to PascalCase.
|
|
5
|
+
* @param value The string to convert.
|
|
6
|
+
* @param options Options for case conversion.
|
|
7
|
+
* @returns The string in PascalCase.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* pascalCase('foo bar') // 'FooBar'
|
|
11
|
+
* pascalCase('foo-bar') // 'FooBar'
|
|
12
|
+
* pascalCase('foo_bar') // 'FooBar'
|
|
13
|
+
* pascalCase('XMLHttpRequest') // 'XmlHttpRequest'
|
|
14
|
+
* pascalCase('AJAXRequest') // 'AjaxRequest'
|
|
15
|
+
* pascalCase('QueryXML123String') // 'QueryXml123String'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
18
|
declare const pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
|
|
19
19
|
export { pascalCase as default };
|
package/dist/case/pascal-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import p from"./upper-first.js";import{
|
|
1
|
+
import{c as e}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import p from"./upper-first.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(t,o)=>{if(typeof t!="string"||!t)return"";const a=o?.cache??!1,i=o?.cacheStore??d;let r;if(a&&(r=f(t,o)),a&&r&&i.has(r))return i.get(r);const n=h(c(t,{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(s=>{if(o?.handleAnsi&&e.test(s))return s;const l=o?.locale?.startsWith("de")?A(s):s;return p(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}),"");return a&&r&&i.set(r,n),n};export{L as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to Pascal_Snake_Case.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* pascalSnakeCase("foo bar") // => "Foo_Bar"
|
|
8
|
-
* pascalSnakeCase("foo-bar") // => "Foo_Bar"
|
|
9
|
-
* pascalSnakeCase("foo_bar") // => "Foo_Bar"
|
|
10
|
-
* pascalSnakeCase("XMLHttpRequest") // => "Xml_Http_Request"
|
|
11
|
-
* pascalSnakeCase("AJAXRequest") // => "Ajax_Request"
|
|
12
|
-
* pascalSnakeCase("QueryXML123String") // => "Query_Xml_123_String"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to Pascal_Snake_Case.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* pascalSnakeCase("foo bar") // => "Foo_Bar"
|
|
8
|
+
* pascalSnakeCase("foo-bar") // => "Foo_Bar"
|
|
9
|
+
* pascalSnakeCase("foo_bar") // => "Foo_Bar"
|
|
10
|
+
* pascalSnakeCase("XMLHttpRequest") // => "Xml_Http_Request"
|
|
11
|
+
* pascalSnakeCase("AJAXRequest") // => "Ajax_Request"
|
|
12
|
+
* pascalSnakeCase("QueryXML123String") // => "Query_Xml_123_String"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
|
|
16
16
|
export { pascalSnakeCase as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as
|
|
1
|
+
import{i as l}from"../packem_shared/lru-cache-BtMSrYQJ.js";import m from"./no-case.js";import n from"./upper-first.js";import{a as p}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const s=new l(1e3),d=(r,t)=>{if(typeof r!="string")return"";const o=t?.cache??!1,c=t?.cacheStore??s;let e;if(o&&(e=p(r,t)),o&&e&&c.has(e))return c.get(e);const f=m(r,{...t,cache:!1}).split(" ").map(i=>n(i,{locale:t?.locale})).join("_");return o&&e&&c.set(e,f),f};export{d as default};
|
package/dist/case/path-case.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { b as CaseOptions, g as PathCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, g as PathCase } from "../packem_shared/types.d-CMNqA5bi.js";
|
|
2
|
+
import "../packem_shared/types.d-LgsTR37y.js";
|
|
3
3
|
/**
|
|
4
|
-
* Converts a string to path/case.
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* pathCase("foo bar") // => "foo/bar"
|
|
8
|
-
* pathCase("foo-bar") // => "foo/bar"
|
|
9
|
-
* pathCase("foo_bar") // => "foo/bar"
|
|
10
|
-
* pathCase("XMLHttpRequest") // => "xml/http/request"
|
|
11
|
-
* pathCase("AJAXRequest") // => "ajax/request"
|
|
12
|
-
* pathCase("QueryXML123String") // => "query/xml/123/string"
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
4
|
+
* Converts a string to path/case.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* pathCase("foo bar") // => "foo/bar"
|
|
8
|
+
* pathCase("foo-bar") // => "foo/bar"
|
|
9
|
+
* pathCase("foo_bar") // => "foo/bar"
|
|
10
|
+
* pathCase("XMLHttpRequest") // => "xml/http/request"
|
|
11
|
+
* pathCase("AJAXRequest") // => "ajax/request"
|
|
12
|
+
* pathCase("QueryXML123String") // => "query/xml/123/string"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
15
|
declare const pathCase: <T extends string = string>(value?: T, options?: CaseOptions) => PathCase<T>;
|
|
16
16
|
export { pathCase as default };
|