document-drive 1.29.1-dev.0 → 1.29.2-dev.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/dist/src/utils/misc.d.ts
CHANGED
|
@@ -8,4 +8,16 @@ export declare function mergeOperations<TDocument extends PHDocument>(currentOpe
|
|
|
8
8
|
export declare function generateUUID(): string;
|
|
9
9
|
export declare function isNoopUpdate(operation: Operation, latestOperation?: Operation): boolean;
|
|
10
10
|
export declare function isBefore(dateA: Date | string, dateB: Date | string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a string to PascalCase
|
|
13
|
+
* @param {string} str - The input string to convert
|
|
14
|
+
* @returns {string} The string in PascalCase format
|
|
15
|
+
*
|
|
16
|
+
* Examples:
|
|
17
|
+
* "hello world" -> "HelloWorld"
|
|
18
|
+
* "hello-world" -> "HelloWorld"
|
|
19
|
+
* "hello_world" -> "HelloWorld"
|
|
20
|
+
* "helloWorld" -> "HelloWorld"
|
|
21
|
+
*/
|
|
22
|
+
export declare function toPascalCase(str: string): string;
|
|
11
23
|
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,OAAO,wBAAkB,CAAC;AACvC,eAAO,MAAM,YAAY,6BAAuB,CAAC;AAEjD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,UAAU,GACnB,QAAQ,IAAI,qBAAqB,CAEnC;AAED,wBAAgB,eAAe,CAAC,SAAS,SAAS,UAAU,EAC1D,iBAAiB,EAAE,sBAAsB,CAAC,SAAS,CAAC,EACpD,aAAa,EAAE,qBAAqB,CAAC,SAAS,CAAC,EAAE,GAChD,sBAAsB,CAAC,SAAS,CAAC,CA0BnC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,EACpB,eAAe,CAAC,EAAE,SAAS,WAc5B;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,WAElE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAUvC"}
|
package/dist/src/utils/misc.js
CHANGED
|
@@ -41,3 +41,23 @@ export function isNoopUpdate(operation, latestOperation) {
|
|
|
41
41
|
export function isBefore(dateA, dateB) {
|
|
42
42
|
return new Date(dateA) < new Date(dateB);
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Converts a string to PascalCase
|
|
46
|
+
* @param {string} str - The input string to convert
|
|
47
|
+
* @returns {string} The string in PascalCase format
|
|
48
|
+
*
|
|
49
|
+
* Examples:
|
|
50
|
+
* "hello world" -> "HelloWorld"
|
|
51
|
+
* "hello-world" -> "HelloWorld"
|
|
52
|
+
* "hello_world" -> "HelloWorld"
|
|
53
|
+
* "helloWorld" -> "HelloWorld"
|
|
54
|
+
*/
|
|
55
|
+
export function toPascalCase(str) {
|
|
56
|
+
return (str
|
|
57
|
+
// Split by common separators (space, hyphen, underscore)
|
|
58
|
+
.split(/[\s-_]+/)
|
|
59
|
+
// Capitalize first letter of each word
|
|
60
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
61
|
+
// Join words together
|
|
62
|
+
.join(""));
|
|
63
|
+
}
|