@esmate/utils 1.0.8 → 1.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.
@@ -0,0 +1 @@
1
+ export * from "es-toolkit";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "es-toolkit";
@@ -0,0 +1 @@
1
+ export * from "es-toolkit/compat";
package/dist/lodash.js ADDED
@@ -0,0 +1 @@
1
+ export * from "es-toolkit/compat";
package/dist/math.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "mathjs";
package/dist/math.js ADDED
@@ -0,0 +1 @@
1
+ export * from "mathjs";
@@ -0,0 +1 @@
1
+ export * from "es-toolkit";
@@ -0,0 +1 @@
1
+ export * from "es-toolkit";
@@ -0,0 +1 @@
1
+ export * from "mathjs";
@@ -0,0 +1 @@
1
+ export * from "mathjs";
package/dist/text.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import type { Configuration, Locale } from "typopo";
2
+ /**
3
+ * Formats a string to be used as a title.
4
+ * @param str The string to format.
5
+ * @param options The options to use.
6
+ * @returns The formatted string.
7
+ */
8
+ export declare function titleize(str: string, options?: {
9
+ locale?: "en";
10
+ special?: string[];
11
+ }): string;
12
+ /**
13
+ * Fixes typos in a string using typopo.
14
+ * @param str The string to fix.
15
+ * @param options The options to use.
16
+ * @returns The fixed string.
17
+ */
18
+ export declare function fixTypos(str: string, options?: Configuration & {
19
+ locale?: Locale;
20
+ }): string;
package/dist/text.js ADDED
@@ -0,0 +1,13 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_es_toolkit_string_d01e99ad__ from "es-toolkit/string";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_title__ from "title";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_typopo__ from "typopo";
4
+ function titleize(str, options) {
5
+ str = str.replace(/\s+/g, " ");
6
+ if (options?.locale === "en") return (0, __WEBPACK_EXTERNAL_MODULE_title__["default"])(str, options);
7
+ const specialWordsLower = options?.special?.map((s)=>s.toLocaleLowerCase());
8
+ return str.split(" ").map((word)=>specialWordsLower?.includes(word.toLocaleLowerCase()) ? word : (0, __WEBPACK_EXTERNAL_MODULE_es_toolkit_string_d01e99ad__.capitalize)(word)).join(" ");
9
+ }
10
+ function fixTypos(str, options) {
11
+ return __WEBPACK_EXTERNAL_MODULE_typopo__["default"].fixTypos(str, options?.locale, options).replace(/\u00A0/g, " ").trim();
12
+ }
13
+ export { fixTypos, titleize };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esmate/utils",
3
3
  "type": "module",
4
- "version": "1.0.8",
4
+ "version": "1.2.0",
5
5
  "description": "JavaScript/TypeScript utils, functions, and classes in one package.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -18,6 +18,10 @@
18
18
  "typescript"
19
19
  ],
20
20
  "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ },
21
25
  "./*": {
22
26
  "types": "./dist/*.d.ts",
23
27
  "import": "./dist/*.js"
@@ -32,33 +36,34 @@
32
36
  ],
33
37
  "dependencies": {
34
38
  "@types/typopo": "^2.5.4",
39
+ "es-toolkit": "^1.43.0",
35
40
  "iso-3166-1": "^2.1.1",
36
41
  "iso-639-1": "^3.1.5",
42
+ "mathjs": "^15.1.0",
37
43
  "tiny-invariant": "^1.3.3",
38
44
  "title": "^4.0.1",
39
- "typopo": "^2.7.1"
45
+ "typopo": "^2.8.0"
40
46
  },
41
47
  "devDependencies": {
42
- "@esmate/eslint": "^1.1.2",
43
- "@esmate/prettier": "^1.0.5",
48
+ "@esmate/eslint": "^1.2.2",
49
+ "@esmate/prettier": "^1.0.6",
44
50
  "@rslib/core": "^0.7.1",
45
51
  "@types/fs-extra": "^11.0.4",
46
- "@types/node": "^22.18.7",
47
- "@types/react": "^18.3.24",
52
+ "@types/node": "^22.19.3",
53
+ "@types/react": "^18.3.27",
48
54
  "@types/react-dom": "^18.3.7",
49
- "eslint": "^9.36.0",
50
- "fs-extra": "^11.3.2",
55
+ "eslint": "^9.39.2",
56
+ "fs-extra": "^11.3.3",
51
57
  "globby": "^14.1.0",
52
- "prettier": "^3.6.2",
58
+ "prettier": "^3.7.4",
53
59
  "react": "^18.3.1",
54
60
  "react-dom": "^18.3.1",
55
- "tsx": "^4.20.6",
56
- "typescript": "^5.9.2"
61
+ "tsx": "^4.21.0",
62
+ "typescript": "^5.9.3"
57
63
  },
58
64
  "scripts": {
59
65
  "build": "tsx export.ts && rslib build",
60
66
  "dev": "rslib build --watch",
61
- "start": "astro preview",
62
67
  "fix": "prettier --write . && eslint --fix .",
63
68
  "check": "tsc && prettier --check . && eslint ."
64
69
  }