@bccampus/utils 0.2.3 → 0.3.1

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.
Files changed (164) hide show
  1. package/README.md +3 -8
  2. package/dist/array/chunk.cjs +13 -5
  3. package/dist/array/chunk.d.ts +7 -0
  4. package/dist/array/chunk.js +14 -7
  5. package/dist/array/chunk.test.d.ts +1 -0
  6. package/dist/date/iso-date-time/constants.cjs +27 -0
  7. package/dist/date/iso-date-time/constants.d.ts +9 -0
  8. package/dist/date/iso-date-time/constants.js +19 -0
  9. package/dist/date/iso-date-time/index.cjs +8 -0
  10. package/dist/date/iso-date-time/index.d.ts +5 -0
  11. package/dist/date/iso-date-time/index.js +3 -0
  12. package/dist/date/iso-date-time/iso-date-time.arithmetic.test.d.ts +1 -0
  13. package/dist/date/iso-date-time/iso-date-time.cjs +232 -0
  14. package/dist/date/{iso-date-time.d.ts → iso-date-time/iso-date-time.d.ts} +3 -32
  15. package/dist/date/iso-date-time/iso-date-time.format.test.d.ts +1 -0
  16. package/dist/date/iso-date-time/iso-date-time.js +231 -0
  17. package/dist/date/iso-date-time/iso-date-time.test.d.ts +1 -0
  18. package/dist/date/iso-date-time/types.cjs +0 -0
  19. package/dist/date/iso-date-time/types.d.ts +25 -0
  20. package/dist/date/iso-date-time/types.js +0 -0
  21. package/dist/duration/add-durations.cjs +5 -8
  22. package/dist/duration/add-durations.js +5 -9
  23. package/dist/duration/duration.test.d.ts +1 -0
  24. package/dist/duration/is-duration.cjs +4 -3
  25. package/dist/duration/is-duration.js +5 -5
  26. package/dist/duration/to-number.cjs +11 -10
  27. package/dist/duration/to-number.d.ts +1 -1
  28. package/dist/duration/to-number.js +11 -11
  29. package/dist/format/formatter.cjs +31 -31
  30. package/dist/format/formatter.d.ts +4 -4
  31. package/dist/format/formatter.js +32 -37
  32. package/dist/format/formatter.test.d.ts +1 -0
  33. package/dist/format/stringfy.test.d.ts +1 -0
  34. package/dist/format/stringify.cjs +34 -40
  35. package/dist/format/stringify.d.ts +1 -1
  36. package/dist/format/stringify.js +35 -42
  37. package/dist/format/template.cjs +25 -32
  38. package/dist/format/template.d.ts +3 -3
  39. package/dist/format/template.js +24 -33
  40. package/dist/format/template.test.d.ts +1 -0
  41. package/dist/index.cjs +0 -1
  42. package/dist/index.js +0 -1
  43. package/dist/object/get.cjs +5 -5
  44. package/dist/object/get.d.ts +1 -1
  45. package/dist/object/get.js +6 -7
  46. package/dist/object/get.test.d.ts +1 -0
  47. package/dist/object/is-object.cjs +5 -2
  48. package/dist/object/is-object.d.ts +1 -1
  49. package/dist/object/is-object.js +6 -4
  50. package/dist/object/is-object.test.d.ts +1 -0
  51. package/dist/object/omit.cjs +14 -16
  52. package/dist/object/omit.d.ts +1 -1
  53. package/dist/object/omit.js +15 -18
  54. package/dist/object/omit.test.d.ts +1 -0
  55. package/dist/object/pick.cjs +10 -9
  56. package/dist/object/pick.d.ts +1 -1
  57. package/dist/object/pick.js +9 -9
  58. package/dist/object/pick.test.d.ts +1 -0
  59. package/dist/object/set.cjs +13 -12
  60. package/dist/object/set.d.ts +1 -1
  61. package/dist/object/set.js +14 -14
  62. package/dist/object/set.test.d.ts +1 -0
  63. package/dist/path/file-url-to-path.cjs +10 -6
  64. package/dist/path/file-url-to-path.js +11 -8
  65. package/dist/path/file-url-to-path.test.d.ts +1 -0
  66. package/dist/path/normalize.cjs +41 -27
  67. package/dist/path/normalize.d.ts +8 -2
  68. package/dist/path/normalize.js +41 -28
  69. package/dist/path/normalize.test.d.ts +1 -0
  70. package/dist/set/difference.cjs +5 -6
  71. package/dist/set/difference.d.ts +1 -1
  72. package/dist/set/difference.js +6 -8
  73. package/dist/set/intersection.cjs +6 -9
  74. package/dist/set/intersection.d.ts +1 -1
  75. package/dist/set/intersection.js +7 -11
  76. package/dist/set/is-superset.cjs +5 -8
  77. package/dist/set/is-superset.d.ts +1 -1
  78. package/dist/set/is-superset.js +6 -10
  79. package/dist/set/set.test.d.ts +1 -0
  80. package/dist/set/symmetric-difference.cjs +6 -10
  81. package/dist/set/symmetric-difference.d.ts +1 -1
  82. package/dist/set/symmetric-difference.js +7 -12
  83. package/dist/set/union.cjs +5 -6
  84. package/dist/set/union.d.ts +1 -1
  85. package/dist/set/union.js +6 -8
  86. package/dist/string/capitalize.cjs +5 -2
  87. package/dist/string/capitalize.d.ts +1 -1
  88. package/dist/string/capitalize.js +6 -4
  89. package/dist/string/capitalize.test.d.ts +1 -0
  90. package/dist/string/normalize.cjs +7 -2
  91. package/dist/string/normalize.js +8 -4
  92. package/dist/string/normalize.test.d.ts +1 -0
  93. package/dist/string/pluralize/index.cjs +5 -4
  94. package/dist/string/pluralize/index.js +4 -5
  95. package/dist/string/pluralize/pluralize.cjs +162 -208
  96. package/dist/string/pluralize/pluralize.d.ts +4 -8
  97. package/dist/string/pluralize/pluralize.js +158 -205
  98. package/dist/string/pluralize/pluralize.test.d.ts +1 -0
  99. package/dist/string/pluralize/rules/index.cjs +8 -9
  100. package/dist/string/pluralize/rules/index.js +1 -6
  101. package/dist/string/pluralize/rules/irregular.cjs +55 -59
  102. package/dist/string/pluralize/rules/irregular.js +56 -61
  103. package/dist/string/pluralize/rules/pluralization.cjs +28 -36
  104. package/dist/string/pluralize/rules/pluralization.js +29 -38
  105. package/dist/string/pluralize/rules/singularization.cjs +27 -44
  106. package/dist/string/pluralize/rules/singularization.js +28 -46
  107. package/dist/string/pluralize/rules/uncountable.cjs +104 -110
  108. package/dist/string/pluralize/rules/uncountable.js +105 -112
  109. package/dist/string/pluralize/types.cjs +0 -1
  110. package/dist/string/pluralize/types.js +0 -1
  111. package/dist/string/slugify/index.cjs +2131 -2246
  112. package/dist/string/slugify/index.d.ts +1 -1
  113. package/dist/string/slugify/index.js +2132 -2248
  114. package/dist/string/slugify/slugify.test.d.ts +1 -0
  115. package/dist/string/strip-html-tags.cjs +4 -3
  116. package/dist/string/strip-html-tags.js +5 -5
  117. package/dist/string/strip-html-tags.test.d.ts +1 -0
  118. package/dist/string/to-int.cjs +14 -6
  119. package/dist/string/to-int.js +15 -8
  120. package/dist/string/to-int.test.d.ts +1 -0
  121. package/dist/string/to-sentence-case.cjs +6 -6
  122. package/dist/string/to-sentence-case.d.ts +1 -1
  123. package/dist/string/to-sentence-case.js +7 -8
  124. package/dist/string/to-sentence-case.test.d.ts +1 -0
  125. package/dist/string/trim.cjs +8 -7
  126. package/dist/string/trim.js +9 -9
  127. package/dist/string/trim.test.d.ts +1 -0
  128. package/dist/string/truncate.cjs +16 -15
  129. package/dist/string/truncate.js +17 -17
  130. package/dist/string/truncate.test.d.ts +1 -0
  131. package/dist/value/is-empty.cjs +30 -12
  132. package/dist/value/is-empty.d.ts +1 -1
  133. package/dist/value/is-empty.js +31 -14
  134. package/dist/value/value.test.d.ts +1 -0
  135. package/package.json +180 -69
  136. package/dist/array/index.cjs +0 -4
  137. package/dist/array/index.d.ts +0 -2
  138. package/dist/array/index.js +0 -4
  139. package/dist/date/index.cjs +0 -8
  140. package/dist/date/index.d.ts +0 -3
  141. package/dist/date/index.js +0 -8
  142. package/dist/date/iso-date-time.cjs +0 -256
  143. package/dist/date/iso-date-time.js +0 -256
  144. package/dist/duration/index.cjs +0 -8
  145. package/dist/duration/index.d.ts +0 -4
  146. package/dist/duration/index.js +0 -8
  147. package/dist/format/index.cjs +0 -13
  148. package/dist/format/index.d.ts +0 -5
  149. package/dist/format/index.js +0 -13
  150. package/dist/object/index.cjs +0 -12
  151. package/dist/object/index.d.ts +0 -6
  152. package/dist/object/index.js +0 -12
  153. package/dist/path/index.cjs +0 -6
  154. package/dist/path/index.d.ts +0 -4
  155. package/dist/path/index.js +0 -6
  156. package/dist/set/index.cjs +0 -12
  157. package/dist/set/index.d.ts +0 -6
  158. package/dist/set/index.js +0 -12
  159. package/dist/string/index.cjs +0 -14
  160. package/dist/string/index.d.ts +0 -8
  161. package/dist/string/index.js +0 -14
  162. package/dist/value/index.cjs +0 -4
  163. package/dist/value/index.d.ts +0 -2
  164. package/dist/value/index.js +0 -4
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,8 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const htmlTagRegExp = /(<([^>]+)>)/g;
2
+ //#region src/string/strip-html-tags.ts
3
+ var htmlTagRegExp = /(<([^>]+)>)/g;
4
4
  function stripHtmlTags(text) {
5
- return text.replace(htmlTagRegExp, "");
5
+ return text.replace(htmlTagRegExp, "");
6
6
  }
7
+ //#endregion
7
8
  exports.stripHtmlTags = stripHtmlTags;
@@ -1,7 +1,7 @@
1
- const htmlTagRegExp = /(<([^>]+)>)/g;
1
+ //#region src/string/strip-html-tags.ts
2
+ var htmlTagRegExp = /(<([^>]+)>)/g;
2
3
  function stripHtmlTags(text) {
3
- return text.replace(htmlTagRegExp, "");
4
+ return text.replace(htmlTagRegExp, "");
4
5
  }
5
- export {
6
- stripHtmlTags
7
- };
6
+ //#endregion
7
+ export { stripHtmlTags };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,18 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/string/to-int.ts
3
+ /**
4
+ * Converts a string (or a number) into a number.
5
+ * If the input can not be successfully converted, it will return the fallback.
6
+ * It will not return NaN.
7
+ * @param value - The value to convert
8
+ * @param fallback - The value to fallback to. Defaults to 0
9
+ * @returns number
10
+ */
3
11
  function stringToInt(value, fallback = 0) {
4
- let returnValue = value;
5
- if (typeof returnValue === "string")
6
- returnValue = Number.parseInt(returnValue);
7
- if (Number.isNaN(returnValue)) returnValue = fallback;
8
- return returnValue;
12
+ let returnValue = value;
13
+ if (typeof returnValue === "string") returnValue = Number.parseInt(returnValue);
14
+ if (Number.isNaN(returnValue)) returnValue = fallback;
15
+ return returnValue;
9
16
  }
17
+ //#endregion
10
18
  exports.stringToInt = stringToInt;
@@ -1,10 +1,17 @@
1
+ //#region src/string/to-int.ts
2
+ /**
3
+ * Converts a string (or a number) into a number.
4
+ * If the input can not be successfully converted, it will return the fallback.
5
+ * It will not return NaN.
6
+ * @param value - The value to convert
7
+ * @param fallback - The value to fallback to. Defaults to 0
8
+ * @returns number
9
+ */
1
10
  function stringToInt(value, fallback = 0) {
2
- let returnValue = value;
3
- if (typeof returnValue === "string")
4
- returnValue = Number.parseInt(returnValue);
5
- if (Number.isNaN(returnValue)) returnValue = fallback;
6
- return returnValue;
11
+ let returnValue = value;
12
+ if (typeof returnValue === "string") returnValue = Number.parseInt(returnValue);
13
+ if (Number.isNaN(returnValue)) returnValue = fallback;
14
+ return returnValue;
7
15
  }
8
- export {
9
- stringToInt
10
- };
16
+ //#endregion
17
+ export { stringToInt };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const specialCharRegExp = /[\s-_.+]+/g;
4
- const toSentenceCase = (s) => (s[0].toUpperCase() + s.slice(1).toLowerCase()).replace(
5
- specialCharRegExp,
6
- " "
7
- );
2
+ //#region src/string/to-sentence-case.ts
3
+ var specialCharRegExp = /[\s\-_.+]+/g;
4
+ function toSentenceCase(s) {
5
+ return (s[0].toUpperCase() + s.slice(1).toLowerCase()).replace(specialCharRegExp, " ");
6
+ }
7
+ //#endregion
8
8
  exports.toSentenceCase = toSentenceCase;
@@ -1 +1 @@
1
- export declare const toSentenceCase: <T extends string>(s: T) => string;
1
+ export declare function toSentenceCase<T extends string>(s: T): string;
@@ -1,8 +1,7 @@
1
- const specialCharRegExp = /[\s-_.+]+/g;
2
- const toSentenceCase = (s) => (s[0].toUpperCase() + s.slice(1).toLowerCase()).replace(
3
- specialCharRegExp,
4
- " "
5
- );
6
- export {
7
- toSentenceCase
8
- };
1
+ //#region src/string/to-sentence-case.ts
2
+ var specialCharRegExp = /[\s\-_.+]+/g;
3
+ function toSentenceCase(s) {
4
+ return (s[0].toUpperCase() + s.slice(1).toLowerCase()).replace(specialCharRegExp, " ");
5
+ }
6
+ //#endregion
7
+ export { toSentenceCase };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,12 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/string/trim.ts
3
3
  function trim(text, chars = " ") {
4
- let start = 0;
5
- let end = text.length;
6
- if (!Array.isArray(chars)) chars = [chars];
7
- while (start < end && chars.includes(text[start])) start += 1;
8
- while (end > start && chars.includes(text[end - 1])) end -= 1;
9
- return start > 0 || end < text.length ? text.substring(start, end) : text;
4
+ let start = 0;
5
+ let end = text.length;
6
+ if (!Array.isArray(chars)) chars = [chars];
7
+ while (start < end && chars.includes(text[start])) start += 1;
8
+ while (end > start && chars.includes(text[end - 1])) end -= 1;
9
+ return start > 0 || end < text.length ? text.substring(start, end) : text;
10
10
  }
11
+ //#endregion
11
12
  exports.trim = trim;
@@ -1,11 +1,11 @@
1
+ //#region src/string/trim.ts
1
2
  function trim(text, chars = " ") {
2
- let start = 0;
3
- let end = text.length;
4
- if (!Array.isArray(chars)) chars = [chars];
5
- while (start < end && chars.includes(text[start])) start += 1;
6
- while (end > start && chars.includes(text[end - 1])) end -= 1;
7
- return start > 0 || end < text.length ? text.substring(start, end) : text;
3
+ let start = 0;
4
+ let end = text.length;
5
+ if (!Array.isArray(chars)) chars = [chars];
6
+ while (start < end && chars.includes(text[start])) start += 1;
7
+ while (end > start && chars.includes(text[end - 1])) end -= 1;
8
+ return start > 0 || end < text.length ? text.substring(start, end) : text;
8
9
  }
9
- export {
10
- trim
11
- };
10
+ //#endregion
11
+ export { trim };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,20 +1,21 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const defaultOptions = {
4
- ending: "...",
5
- maxlength: 100,
6
- noWordBreak: false
2
+ //#region src/string/truncate.ts
3
+ var defaultOptions = {
4
+ ending: "...",
5
+ maxlength: 100,
6
+ noWordBreak: false
7
7
  };
8
8
  function truncate(text, options) {
9
- const conf = { ...defaultOptions, ...options };
10
- text = text.trim();
11
- if (conf.noWordBreak) {
12
- const lastSpaceIndex = text.indexOf(" ", conf.maxlength);
13
- if (lastSpaceIndex >= conf.maxlength)
14
- return text.substring(0, lastSpaceIndex) + conf.ending;
15
- } else if (text.length > conf.maxlength + conf.ending.length) {
16
- return text.substring(0, conf.maxlength) + conf.ending;
17
- }
18
- return text;
9
+ const conf = {
10
+ ...defaultOptions,
11
+ ...options
12
+ };
13
+ text = text.trim();
14
+ if (conf.noWordBreak) {
15
+ const lastSpaceIndex = text.indexOf(" ", conf.maxlength);
16
+ if (lastSpaceIndex >= conf.maxlength) return text.substring(0, lastSpaceIndex) + conf.ending;
17
+ } else if (text.length > conf.maxlength + conf.ending.length) return text.substring(0, conf.maxlength) + conf.ending;
18
+ return text;
19
19
  }
20
+ //#endregion
20
21
  exports.truncate = truncate;
@@ -1,20 +1,20 @@
1
- const defaultOptions = {
2
- ending: "...",
3
- maxlength: 100,
4
- noWordBreak: false
1
+ //#region src/string/truncate.ts
2
+ var defaultOptions = {
3
+ ending: "...",
4
+ maxlength: 100,
5
+ noWordBreak: false
5
6
  };
6
7
  function truncate(text, options) {
7
- const conf = { ...defaultOptions, ...options };
8
- text = text.trim();
9
- if (conf.noWordBreak) {
10
- const lastSpaceIndex = text.indexOf(" ", conf.maxlength);
11
- if (lastSpaceIndex >= conf.maxlength)
12
- return text.substring(0, lastSpaceIndex) + conf.ending;
13
- } else if (text.length > conf.maxlength + conf.ending.length) {
14
- return text.substring(0, conf.maxlength) + conf.ending;
15
- }
16
- return text;
8
+ const conf = {
9
+ ...defaultOptions,
10
+ ...options
11
+ };
12
+ text = text.trim();
13
+ if (conf.noWordBreak) {
14
+ const lastSpaceIndex = text.indexOf(" ", conf.maxlength);
15
+ if (lastSpaceIndex >= conf.maxlength) return text.substring(0, lastSpaceIndex) + conf.ending;
16
+ } else if (text.length > conf.maxlength + conf.ending.length) return text.substring(0, conf.maxlength) + conf.ending;
17
+ return text;
17
18
  }
18
- export {
19
- truncate
20
- };
19
+ //#endregion
20
+ export { truncate };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,14 +1,32 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const isEmpty = (value) => {
4
- if (value === void 0) return true;
5
- if (value === null) return true;
6
- if (typeof value === "string") return value.trim() === "";
7
- if (typeof value === "object") {
8
- if (Array.isArray(value) && value.length === 0) return true;
9
- if (value instanceof Map || value instanceof Set) return value.size === 0;
10
- return Object.keys(value).length === 0;
11
- }
12
- return false;
13
- };
2
+ //#region src/value/is-empty.ts
3
+ /**
4
+ * Checks if the value is `empty`
5
+ *
6
+ * returns `true`, if the value
7
+ *
8
+ * - `undefined`
9
+ * - `null`
10
+ * - `string` and there is no character in the string or all white space
11
+ * - `array` and there is no item in the array
12
+ * - `map` and there is no item in the map
13
+ * - `set` and there is no item in the set
14
+ * - `object` and there is no property in the object
15
+ *
16
+ * otherwise, false
17
+ *
18
+ */
19
+ function isEmpty(value) {
20
+ if (value === void 0) return true;
21
+ if (value === null) return true;
22
+ if (typeof value === "string") return value.trim() === "";
23
+ if (typeof value === "object") {
24
+ if (Array.isArray(value) && value.length === 0) return true;
25
+ if (value instanceof Map || value instanceof Set) return value.size === 0;
26
+ if (value instanceof Date) return false;
27
+ return Object.keys(value).length === 0;
28
+ }
29
+ return false;
30
+ }
31
+ //#endregion
14
32
  exports.isEmpty = isEmpty;
@@ -14,4 +14,4 @@
14
14
  * otherwise, false
15
15
  *
16
16
  */
17
- export declare const isEmpty: (value: unknown) => boolean;
17
+ export declare function isEmpty(value: unknown): boolean;
@@ -1,14 +1,31 @@
1
- const isEmpty = (value) => {
2
- if (value === void 0) return true;
3
- if (value === null) return true;
4
- if (typeof value === "string") return value.trim() === "";
5
- if (typeof value === "object") {
6
- if (Array.isArray(value) && value.length === 0) return true;
7
- if (value instanceof Map || value instanceof Set) return value.size === 0;
8
- return Object.keys(value).length === 0;
9
- }
10
- return false;
11
- };
12
- export {
13
- isEmpty
14
- };
1
+ //#region src/value/is-empty.ts
2
+ /**
3
+ * Checks if the value is `empty`
4
+ *
5
+ * returns `true`, if the value
6
+ *
7
+ * - `undefined`
8
+ * - `null`
9
+ * - `string` and there is no character in the string or all white space
10
+ * - `array` and there is no item in the array
11
+ * - `map` and there is no item in the map
12
+ * - `set` and there is no item in the set
13
+ * - `object` and there is no property in the object
14
+ *
15
+ * otherwise, false
16
+ *
17
+ */
18
+ function isEmpty(value) {
19
+ if (value === void 0) return true;
20
+ if (value === null) return true;
21
+ if (typeof value === "string") return value.trim() === "";
22
+ if (typeof value === "object") {
23
+ if (Array.isArray(value) && value.length === 0) return true;
24
+ if (value instanceof Map || value instanceof Set) return value.size === 0;
25
+ if (value instanceof Date) return false;
26
+ return Object.keys(value).length === 0;
27
+ }
28
+ return false;
29
+ }
30
+ //#endregion
31
+ export { isEmpty };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,59 +1,168 @@
1
1
  {
2
2
  "name": "@bccampus/utils",
3
- "version": "0.2.3",
3
+ "version": "0.3.1",
4
4
  "description": "BCcampus' utility box",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
+ "packageManager": "yarn@4.16.0",
8
+ "scripts": {
9
+ "_postinstall": "husky",
10
+ "prepack": "pinst --disable && yarn build",
11
+ "postpack": "pinst --enable",
12
+ "typecheck": "tsc --noEmit",
13
+ "lint": "eslint ./src",
14
+ "lint:fix": "eslint --fix ./src",
15
+ "test": "vitest",
16
+ "coverage": "vitest run --reporter=minimal --coverage",
17
+ "build": "yarn typecheck && yarn lint && yarn coverage && vite build",
18
+ "publish": "yarn npm publish --access public --tolerate-republish"
19
+ },
20
+ "devDependencies": {
21
+ "@antfu/eslint-config": "^9.0.0",
22
+ "@types/node": "^24.13.0",
23
+ "@vitest/coverage-v8": "4.1.8",
24
+ "baseline-browser-mapping": "^2.10.33",
25
+ "eslint": "^10.4.1",
26
+ "eslint-plugin-format": "^2.0.1",
27
+ "globals": "^17.6.0",
28
+ "husky": "^9.1.7",
29
+ "lint-staged": "^17.0.7",
30
+ "pinst": "^3.0.0",
31
+ "tinyglobby": "^0.2.17",
32
+ "typescript": "~6.0.3",
33
+ "unplugin-dts": "^1.0.2",
34
+ "vite": "^8.0.16",
35
+ "vitest": "^4.1.8"
36
+ },
37
+ "dependencies": {
38
+ "@sindresorhus/slugify": "^3.0.0"
39
+ },
40
+ "lint-staged": {
41
+ "!(*test).ts": [
42
+ "vitest related --run",
43
+ "eslint --fix"
44
+ ]
45
+ },
46
+ "main": "./dist/index.cjs",
47
+ "module": "./dist/index.js",
7
48
  "files": [
8
49
  "dist"
9
50
  ],
10
- "main": "./dist/index.cjs",
11
- "module": "./dist/index.js",
12
51
  "exports": {
13
52
  ".": {
14
53
  "types": "./dist/index.d.ts",
15
54
  "import": "./dist/index.js",
16
55
  "require": "./dist/index.cjs"
17
56
  },
18
- "./array": {
19
- "types": "./dist/array/index.d.ts",
20
- "import": "./dist/array/index.js",
21
- "require": "./dist/array/index.cjs"
22
- },
23
- "./date": {
24
- "types": "./dist/date/index.d.ts",
25
- "import": "./dist/date/index.js",
26
- "require": "./dist/date/index.cjs"
27
- },
28
- "./duration": {
29
- "types": "./dist/duration/index.d.ts",
30
- "import": "./dist/duration/index.js",
31
- "require": "./dist/duration/index.cjs"
32
- },
33
- "./format": {
34
- "types": "./dist/format/index.d.ts",
35
- "import": "./dist/format/index.js",
36
- "require": "./dist/format/index.cjs"
37
- },
38
- "./object": {
39
- "types": "./dist/object/index.d.ts",
40
- "import": "./dist/object/index.js",
41
- "require": "./dist/object/index.cjs"
42
- },
43
- "./path": {
44
- "types": "./dist/path/index.d.ts",
45
- "import": "./dist/path/index.js",
46
- "require": "./dist/path/index.cjs"
47
- },
48
- "./set": {
49
- "types": "./dist/set/index.d.ts",
50
- "import": "./dist/set/index.js",
51
- "require": "./dist/set/index.cjs"
52
- },
53
- "./string": {
54
- "types": "./dist/string/index.d.ts",
55
- "import": "./dist/string/index.js",
56
- "require": "./dist/string/index.cjs"
57
+ "./array/chunk": {
58
+ "types": "./dist/array/chunk.d.ts",
59
+ "import": "./dist/array/chunk.js",
60
+ "require": "./dist/array/chunk.cjs"
61
+ },
62
+ "./date/iso-date-time": {
63
+ "types": "./dist/date/iso-date-time/index.d.ts",
64
+ "import": "./dist/date/iso-date-time/index.js",
65
+ "require": "./dist/date/iso-date-time/index.cjs"
66
+ },
67
+ "./duration/add-durations": {
68
+ "types": "./dist/duration/add-durations.d.ts",
69
+ "import": "./dist/duration/add-durations.js",
70
+ "require": "./dist/duration/add-durations.cjs"
71
+ },
72
+ "./duration/is-duration": {
73
+ "types": "./dist/duration/is-duration.d.ts",
74
+ "import": "./dist/duration/is-duration.js",
75
+ "require": "./dist/duration/is-duration.cjs"
76
+ },
77
+ "./duration/to-number": {
78
+ "types": "./dist/duration/to-number.d.ts",
79
+ "import": "./dist/duration/to-number.js",
80
+ "require": "./dist/duration/to-number.cjs"
81
+ },
82
+ "./format/formatter": {
83
+ "types": "./dist/format/formatter.d.ts",
84
+ "import": "./dist/format/formatter.js",
85
+ "require": "./dist/format/formatter.cjs"
86
+ },
87
+ "./format/stringify": {
88
+ "types": "./dist/format/stringify.d.ts",
89
+ "import": "./dist/format/stringify.js",
90
+ "require": "./dist/format/stringify.cjs"
91
+ },
92
+ "./format/template": {
93
+ "types": "./dist/format/template.d.ts",
94
+ "import": "./dist/format/template.js",
95
+ "require": "./dist/format/template.cjs"
96
+ },
97
+ "./object/get": {
98
+ "types": "./dist/object/get.d.ts",
99
+ "import": "./dist/object/get.js",
100
+ "require": "./dist/object/get.cjs"
101
+ },
102
+ "./object/is-object": {
103
+ "types": "./dist/object/is-object.d.ts",
104
+ "import": "./dist/object/is-object.js",
105
+ "require": "./dist/object/is-object.cjs"
106
+ },
107
+ "./object/omit": {
108
+ "types": "./dist/object/omit.d.ts",
109
+ "import": "./dist/object/omit.js",
110
+ "require": "./dist/object/omit.cjs"
111
+ },
112
+ "./object/pick": {
113
+ "types": "./dist/object/pick.d.ts",
114
+ "import": "./dist/object/pick.js",
115
+ "require": "./dist/object/pick.cjs"
116
+ },
117
+ "./object/set": {
118
+ "types": "./dist/object/set.d.ts",
119
+ "import": "./dist/object/set.js",
120
+ "require": "./dist/object/set.cjs"
121
+ },
122
+ "./path/file-url-to-path": {
123
+ "types": "./dist/path/file-url-to-path.d.ts",
124
+ "import": "./dist/path/file-url-to-path.js",
125
+ "require": "./dist/path/file-url-to-path.cjs"
126
+ },
127
+ "./path/normalize": {
128
+ "types": "./dist/path/normalize.d.ts",
129
+ "import": "./dist/path/normalize.js",
130
+ "require": "./dist/path/normalize.cjs"
131
+ },
132
+ "./set/difference": {
133
+ "types": "./dist/set/difference.d.ts",
134
+ "import": "./dist/set/difference.js",
135
+ "require": "./dist/set/difference.cjs"
136
+ },
137
+ "./set/intersection": {
138
+ "types": "./dist/set/intersection.d.ts",
139
+ "import": "./dist/set/intersection.js",
140
+ "require": "./dist/set/intersection.cjs"
141
+ },
142
+ "./set/is-superset": {
143
+ "types": "./dist/set/is-superset.d.ts",
144
+ "import": "./dist/set/is-superset.js",
145
+ "require": "./dist/set/is-superset.cjs"
146
+ },
147
+ "./set/symmetric-difference": {
148
+ "types": "./dist/set/symmetric-difference.d.ts",
149
+ "import": "./dist/set/symmetric-difference.js",
150
+ "require": "./dist/set/symmetric-difference.cjs"
151
+ },
152
+ "./set/union": {
153
+ "types": "./dist/set/union.d.ts",
154
+ "import": "./dist/set/union.js",
155
+ "require": "./dist/set/union.cjs"
156
+ },
157
+ "./string/capitalize": {
158
+ "types": "./dist/string/capitalize.d.ts",
159
+ "import": "./dist/string/capitalize.js",
160
+ "require": "./dist/string/capitalize.cjs"
161
+ },
162
+ "./string/normalize": {
163
+ "types": "./dist/string/normalize.d.ts",
164
+ "import": "./dist/string/normalize.js",
165
+ "require": "./dist/string/normalize.cjs"
57
166
  },
58
167
  "./string/pluralize": {
59
168
  "types": "./dist/string/pluralize/index.d.ts",
@@ -65,33 +174,35 @@
65
174
  "import": "./dist/string/slugify/index.js",
66
175
  "require": "./dist/string/slugify/index.cjs"
67
176
  },
68
- "./value": {
69
- "types": "./dist/value/index.d.ts",
70
- "import": "./dist/value/index.js",
71
- "require": "./dist/value/index.cjs"
177
+ "./string/strip-html-tags": {
178
+ "types": "./dist/string/strip-html-tags.d.ts",
179
+ "import": "./dist/string/strip-html-tags.js",
180
+ "require": "./dist/string/strip-html-tags.cjs"
181
+ },
182
+ "./string/to-int": {
183
+ "types": "./dist/string/to-int.d.ts",
184
+ "import": "./dist/string/to-int.js",
185
+ "require": "./dist/string/to-int.cjs"
186
+ },
187
+ "./string/to-sentence-case": {
188
+ "types": "./dist/string/to-sentence-case.d.ts",
189
+ "import": "./dist/string/to-sentence-case.js",
190
+ "require": "./dist/string/to-sentence-case.cjs"
191
+ },
192
+ "./string/trim": {
193
+ "types": "./dist/string/trim.d.ts",
194
+ "import": "./dist/string/trim.js",
195
+ "require": "./dist/string/trim.cjs"
196
+ },
197
+ "./string/truncate": {
198
+ "types": "./dist/string/truncate.d.ts",
199
+ "import": "./dist/string/truncate.js",
200
+ "require": "./dist/string/truncate.cjs"
201
+ },
202
+ "./value/is-empty": {
203
+ "types": "./dist/value/is-empty.d.ts",
204
+ "import": "./dist/value/is-empty.js",
205
+ "require": "./dist/value/is-empty.cjs"
72
206
  }
73
- },
74
- "packageManager": "yarn@4.15.0",
75
- "scripts": {
76
- "check": "tsc -b && eslint ./src",
77
- "build": "tsc -b && vite build",
78
- "lint": "eslint .",
79
- "prepublish": "yarn build",
80
- "publish": "yarn npm publish --access public --tolerate-republish"
81
- },
82
- "devDependencies": {
83
- "@eslint/js": "^9.39.4",
84
- "@types/node": "^24.12.3",
85
- "baseline-browser-mapping": "^2.10.27",
86
- "eslint": "^9.39.4",
87
- "globals": "^17.6.0",
88
- "tinyglobby": "^0.2.16",
89
- "typescript": "~5.9.3",
90
- "typescript-eslint": "^8.59.2",
91
- "vite": "^7.3.3",
92
- "vite-plugin-dts": "^4.5.4"
93
- },
94
- "dependencies": {
95
- "@sindresorhus/slugify": "^3.0.0"
96
207
  }
97
208
  }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const array_chunk = require("./chunk.cjs");
4
- exports.chunk = array_chunk.chunk;
@@ -1,2 +0,0 @@
1
- import { chunk } from './chunk';
2
- export { chunk };