@devt110103/devt-utils 1.0.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 ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ generateSlug: () => generateSlug
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var generateSlug = (str) => {
27
+ return str.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/đ/g, "d").trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
28
+ };
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ generateSlug
32
+ });
33
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const generateSlug = (str: string): string => {\r\n return str\r\n .toLowerCase()\r\n .normalize(\"NFD\")\r\n .replace(/[\\u0300-\\u036f]/g, \"\")\r\n .replace(/đ/g, \"d\")\r\n .trim()\r\n .replace(/[^a-z0-9]+/g, \"-\")\r\n .replace(/^-+|-+$/g, \"\");\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAe,CAAC,QAAwB;AACnD,SAAO,IACJ,YAAY,EACZ,UAAU,KAAK,EACf,QAAQ,oBAAoB,EAAE,EAC9B,QAAQ,MAAM,GAAG,EACjB,KAAK,EACL,QAAQ,eAAe,GAAG,EAC1B,QAAQ,YAAY,EAAE;AAC3B;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare const generateSlug: (str: string) => string;
2
+
3
+ export { generateSlug };
@@ -0,0 +1,3 @@
1
+ declare const generateSlug: (str: string) => string;
2
+
3
+ export { generateSlug };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ // src/index.ts
2
+ var generateSlug = (str) => {
3
+ return str.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/đ/g, "d").trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
4
+ };
5
+ export {
6
+ generateSlug
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const generateSlug = (str: string): string => {\r\n return str\r\n .toLowerCase()\r\n .normalize(\"NFD\")\r\n .replace(/[\\u0300-\\u036f]/g, \"\")\r\n .replace(/đ/g, \"d\")\r\n .trim()\r\n .replace(/[^a-z0-9]+/g, \"-\")\r\n .replace(/^-+|-+$/g, \"\");\r\n};\r\n"],"mappings":";AAAO,IAAM,eAAe,CAAC,QAAwB;AACnD,SAAO,IACJ,YAAY,EACZ,UAAU,KAAK,EACf,QAAQ,oBAAoB,EAAE,EAC9B,QAAQ,MAAM,GAAG,EACjB,KAAK,EACL,QAAQ,eAAe,GAAG,EAC1B,QAAQ,YAAY,EAAE;AAC3B;","names":[]}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@devt110103/devt-utils",
3
+ "version": "1.0.0",
4
+ "description": "Một bộ utils functions hay ho bằng TypeScript",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsup",
21
+ "dev": "tsup --watch",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "keywords": [
25
+ "utils",
26
+ "typescript",
27
+ "helper"
28
+ ],
29
+ "author": "DevT",
30
+ "license": "MIT",
31
+ "devDependencies": {
32
+ "tsup": "^8.5.1",
33
+ "typescript": "^6.0.2"
34
+ }
35
+ }