@alextheman/utility 2.1.1 → 2.2.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/index.cjs CHANGED
@@ -48,6 +48,7 @@ __export(index_exports, {
48
48
  APIError: () => APIError_default,
49
49
  addDaysToDate: () => addDaysToDate_default,
50
50
  appendSemicolon: () => appendSemicolon_default,
51
+ camelToKebab: () => camelToKebab_default,
51
52
  convertFileToBase64: () => convertFileToBase64_default,
52
53
  fillArray: () => fillArray_default,
53
54
  formatDateAndTime: () => formatDateAndTime_default,
@@ -91,6 +92,12 @@ function appendSemicolon(stringToAppendTo) {
91
92
  }
92
93
  var appendSemicolon_default = appendSemicolon;
93
94
 
95
+ // src/functions/camelToKebab.ts
96
+ function camelToKebab(string) {
97
+ return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
98
+ }
99
+ var camelToKebab_default = camelToKebab;
100
+
94
101
  // src/functions/convertFileToBase64.ts
95
102
  function convertFileToBase64(file) {
96
103
  return new Promise((resolve, reject) => {
@@ -374,6 +381,7 @@ var UUID_default = parseUUID;
374
381
  APIError,
375
382
  addDaysToDate,
376
383
  appendSemicolon,
384
+ camelToKebab,
377
385
  convertFileToBase64,
378
386
  fillArray,
379
387
  formatDateAndTime,
package/dist/index.d.cts CHANGED
@@ -4,6 +4,8 @@ declare function addDaysToDate(currentDate?: Date, dayIncrement?: number): Date;
4
4
 
5
5
  declare function appendSemicolon(stringToAppendTo: string): string;
6
6
 
7
+ declare function camelToKebab(string: string): string;
8
+
7
9
  declare function convertFileToBase64(file: File): Promise<string>;
8
10
 
9
11
  declare function fillArray<T>(callback: (index: number) => T | Promise<T>, length?: number): T[] | Promise<T[]>;
@@ -62,4 +64,4 @@ type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot i
62
64
 
63
65
  type NonUndefined<T> = T extends undefined ? never : T;
64
66
 
65
- export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, stringToBoolean, truncate, wait };
67
+ export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, stringToBoolean, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ declare function addDaysToDate(currentDate?: Date, dayIncrement?: number): Date;
4
4
 
5
5
  declare function appendSemicolon(stringToAppendTo: string): string;
6
6
 
7
+ declare function camelToKebab(string: string): string;
8
+
7
9
  declare function convertFileToBase64(file: File): Promise<string>;
8
10
 
9
11
  declare function fillArray<T>(callback: (index: number) => T | Promise<T>, length?: number): T[] | Promise<T[]>;
@@ -62,4 +64,4 @@ type DisallowUndefined<T> = undefined extends T ? ["Error: Generic type cannot i
62
64
 
63
65
  type NonUndefined<T> = T extends undefined ? never : T;
64
66
 
65
- export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, stringToBoolean, truncate, wait };
67
+ export { APIError, type DisallowUndefined, type Email, type Env, type HTTPErrorCodes, type NonUndefined, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, stringToBoolean, truncate, wait };
package/dist/index.js CHANGED
@@ -37,6 +37,12 @@ function appendSemicolon(stringToAppendTo) {
37
37
  }
38
38
  var appendSemicolon_default = appendSemicolon;
39
39
 
40
+ // src/functions/camelToKebab.ts
41
+ function camelToKebab(string) {
42
+ return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
43
+ }
44
+ var camelToKebab_default = camelToKebab;
45
+
40
46
  // src/functions/convertFileToBase64.ts
41
47
  function convertFileToBase64(file) {
42
48
  return new Promise((resolve, reject) => {
@@ -319,6 +325,7 @@ export {
319
325
  APIError_default as APIError,
320
326
  addDaysToDate_default as addDaysToDate,
321
327
  appendSemicolon_default as appendSemicolon,
328
+ camelToKebab_default as camelToKebab,
322
329
  convertFileToBase64_default as convertFileToBase64,
323
330
  fillArray_default as fillArray,
324
331
  formatDateAndTime_default as formatDateAndTime,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Helpful utility functions",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",