@titocandradev/neatcore 0.1.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 +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +119 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function i(e,r){let t=[];for(let n=0;n<e.length;n+=r)t.push(e.slice(n,n+r));return t}function f(e){return [...new Set(e)]}function s(e,r){let t;return function(...n){clearTimeout(t),t=setTimeout(()=>{e(...n);},r);}}function l(e,r,t){let n=r.split("."),o=e;for(let u of n){if(o==null)return t;o=o[u];}return o===void 0?t:o}function x(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}exports.capitalize=x;exports.chunk=i;exports.debounce=s;exports.get=l;exports.unique=f;//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/array/chunk.ts","../src/array/unique.ts","../src/function/debounce.ts","../src/object/get.ts","../src/string/capitalize.ts"],"names":["chunk","arr","size","result","i","unique","array","debounce","fn","delay","timeout","args","get","obj","path","defaultValue","keys","key","capitalize","str"],"mappings":"aAAO,SAASA,CAAAA,CAASC,CAAAA,CAAUC,CAAAA,CAAqB,CACtD,IAAMC,CAAAA,CAAgB,EAAC,CAEvB,IAAA,IAASC,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAIH,CAAAA,CAAI,OAAQG,CAAAA,EAAKF,CAAAA,CACnCC,CAAAA,CAAO,IAAA,CAAKF,CAAAA,CAAI,KAAA,CAAMG,CAAAA,CAAGA,CAAAA,CAAIF,CAAI,CAAC,CAAA,CAGpC,OAAOC,CACT,CCRO,SAASE,CAAAA,CAAUC,CAAAA,CAAiB,CACzC,OAAO,CAAC,GAAG,IAAI,GAAA,CAAIA,CAAK,CAAC,CAC3B,CCFO,SAASC,CAAAA,CAA6CC,EAAOC,CAAAA,CAAe,CACjF,IAAIC,CAAAA,CAEJ,OAAO,SAAA,GAAaC,CAAAA,CAAqB,CACvC,YAAA,CAAaD,CAAO,CAAA,CAEpBA,CAAAA,CAAU,UAAA,CAAW,IAAM,CACzBF,CAAAA,CAAG,GAAGG,CAAI,EACZ,CAAA,CAAGF,CAAK,EACV,CACF,CCVO,SAASG,CAAAA,CAAIC,CAAAA,CAAUC,CAAAA,CAAcC,CAAAA,CAAoB,CAC9D,IAAMC,CAAAA,CAAOF,CAAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CACvBX,CAAAA,CAASU,CAAAA,CAEb,IAAA,IAAWI,CAAAA,IAAOD,CAAAA,CAAM,CACtB,GAAIb,CAAAA,EAAU,KAAM,OAAOY,CAAAA,CAC3BZ,CAAAA,CAASA,CAAAA,CAAOc,CAAG,EACrB,CAEA,OAAOd,CAAAA,GAAW,MAAA,CAAYY,CAAAA,CAAeZ,CAC/C,CCVO,SAASe,CAAAA,CAAWC,CAAAA,CAAqB,CAC9C,OAAKA,CAAAA,EACEA,CAAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAY,CAAIA,CAAAA,CAAI,KAAA,CAAM,CAAC,CAClD","file":"index.cjs","sourcesContent":["export function chunk<T>(arr: T[], size: number): T[][] {\n const result: T[][] = [];\n\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n\n return result;\n}\n","export function unique<T>(array: T[]): T[] {\n return [...new Set(array)];\n}\n","export function debounce<T extends (...args: any[]) => void>(fn: T, delay: number) {\n let timeout: ReturnType<typeof setTimeout>;\n\n return function (...args: Parameters<T>) {\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n}\n","export function get(obj: any, path: string, defaultValue?: any) {\n const keys = path.split(\".\");\n let result = obj;\n\n for (const key of keys) {\n if (result == null) return defaultValue;\n result = result[key];\n }\n\n return result === undefined ? defaultValue : result;\n}\n","export function capitalize(str: string): string {\n if (!str) return str;\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare function chunk<T>(arr: T[], size: number): T[][];
|
|
2
|
+
|
|
3
|
+
declare function unique<T>(array: T[]): T[];
|
|
4
|
+
|
|
5
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
6
|
+
|
|
7
|
+
declare function get(obj: any, path: string, defaultValue?: any): any;
|
|
8
|
+
|
|
9
|
+
declare function capitalize(str: string): string;
|
|
10
|
+
|
|
11
|
+
export { capitalize, chunk, debounce, get, unique };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare function chunk<T>(arr: T[], size: number): T[][];
|
|
2
|
+
|
|
3
|
+
declare function unique<T>(array: T[]): T[];
|
|
4
|
+
|
|
5
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
6
|
+
|
|
7
|
+
declare function get(obj: any, path: string, defaultValue?: any): any;
|
|
8
|
+
|
|
9
|
+
declare function capitalize(str: string): string;
|
|
10
|
+
|
|
11
|
+
export { capitalize, chunk, debounce, get, unique };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function i(e,r){let t=[];for(let n=0;n<e.length;n+=r)t.push(e.slice(n,n+r));return t}function f(e){return [...new Set(e)]}function s(e,r){let t;return function(...n){clearTimeout(t),t=setTimeout(()=>{e(...n);},r);}}function l(e,r,t){let n=r.split("."),o=e;for(let u of n){if(o==null)return t;o=o[u];}return o===void 0?t:o}function x(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}export{x as capitalize,i as chunk,s as debounce,l as get,f as unique};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/array/chunk.ts","../src/array/unique.ts","../src/function/debounce.ts","../src/object/get.ts","../src/string/capitalize.ts"],"names":["chunk","arr","size","result","i","unique","array","debounce","fn","delay","timeout","args","get","obj","path","defaultValue","keys","key","capitalize","str"],"mappings":"AAAO,SAASA,CAAAA,CAASC,CAAAA,CAAUC,CAAAA,CAAqB,CACtD,IAAMC,CAAAA,CAAgB,EAAC,CAEvB,IAAA,IAASC,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAIH,CAAAA,CAAI,OAAQG,CAAAA,EAAKF,CAAAA,CACnCC,CAAAA,CAAO,IAAA,CAAKF,CAAAA,CAAI,KAAA,CAAMG,CAAAA,CAAGA,CAAAA,CAAIF,CAAI,CAAC,CAAA,CAGpC,OAAOC,CACT,CCRO,SAASE,CAAAA,CAAUC,CAAAA,CAAiB,CACzC,OAAO,CAAC,GAAG,IAAI,GAAA,CAAIA,CAAK,CAAC,CAC3B,CCFO,SAASC,CAAAA,CAA6CC,EAAOC,CAAAA,CAAe,CACjF,IAAIC,CAAAA,CAEJ,OAAO,SAAA,GAAaC,CAAAA,CAAqB,CACvC,YAAA,CAAaD,CAAO,CAAA,CAEpBA,CAAAA,CAAU,UAAA,CAAW,IAAM,CACzBF,CAAAA,CAAG,GAAGG,CAAI,EACZ,CAAA,CAAGF,CAAK,EACV,CACF,CCVO,SAASG,CAAAA,CAAIC,CAAAA,CAAUC,CAAAA,CAAcC,CAAAA,CAAoB,CAC9D,IAAMC,CAAAA,CAAOF,CAAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CACvBX,CAAAA,CAASU,CAAAA,CAEb,IAAA,IAAWI,CAAAA,IAAOD,CAAAA,CAAM,CACtB,GAAIb,CAAAA,EAAU,KAAM,OAAOY,CAAAA,CAC3BZ,CAAAA,CAASA,CAAAA,CAAOc,CAAG,EACrB,CAEA,OAAOd,CAAAA,GAAW,MAAA,CAAYY,CAAAA,CAAeZ,CAC/C,CCVO,SAASe,CAAAA,CAAWC,CAAAA,CAAqB,CAC9C,OAAKA,CAAAA,EACEA,CAAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAY,CAAIA,CAAAA,CAAI,KAAA,CAAM,CAAC,CAClD","file":"index.js","sourcesContent":["export function chunk<T>(arr: T[], size: number): T[][] {\n const result: T[][] = [];\n\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n\n return result;\n}\n","export function unique<T>(array: T[]): T[] {\n return [...new Set(array)];\n}\n","export function debounce<T extends (...args: any[]) => void>(fn: T, delay: number) {\n let timeout: ReturnType<typeof setTimeout>;\n\n return function (...args: Parameters<T>) {\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n}\n","export function get(obj: any, path: string, defaultValue?: any) {\n const keys = path.split(\".\");\n let result = obj;\n\n for (const key of keys) {\n if (result == null) return defaultValue;\n result = result[key];\n }\n\n return result === undefined ? defaultValue : result;\n}\n","export function capitalize(str: string): string {\n if (!str) return str;\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@titocandradev/neatcore",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "A clean, zero-dependency, TypeScript-first utility core.",
|
|
6
|
+
"homepage": "https://github.com/tcandra24/neat-core#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/tcandra24/neat-core/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/tcandra24/neat-core.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Tito Candra",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"directories": {
|
|
26
|
+
"test": "tests"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "tsup --watch",
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:run": "vitest run",
|
|
36
|
+
"coverage": "vitest run --coverage"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"acorn": "^8.15.0",
|
|
40
|
+
"any-promise": "^1.3.0",
|
|
41
|
+
"assertion-error": "^2.0.1",
|
|
42
|
+
"ast-v8-to-istanbul": "^0.3.11",
|
|
43
|
+
"bundle-require": "^5.1.0",
|
|
44
|
+
"cac": "^6.7.14",
|
|
45
|
+
"chai": "^6.2.2",
|
|
46
|
+
"chokidar": "^4.0.3",
|
|
47
|
+
"commander": "^4.1.1",
|
|
48
|
+
"confbox": "^0.1.8",
|
|
49
|
+
"consola": "^3.4.2",
|
|
50
|
+
"debug": "^4.4.3",
|
|
51
|
+
"es-module-lexer": "^1.7.0",
|
|
52
|
+
"esbuild": "^0.27.3",
|
|
53
|
+
"estree-walker": "^3.0.3",
|
|
54
|
+
"expect-type": "^1.3.0",
|
|
55
|
+
"fdir": "^6.5.0",
|
|
56
|
+
"fix-dts-default-cjs-exports": "^1.0.1",
|
|
57
|
+
"has-flag": "^4.0.0",
|
|
58
|
+
"html-escaper": "^2.0.2",
|
|
59
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
60
|
+
"istanbul-lib-report": "^3.0.1",
|
|
61
|
+
"istanbul-reports": "^3.2.0",
|
|
62
|
+
"joycon": "^3.1.1",
|
|
63
|
+
"js-tokens": "^10.0.0",
|
|
64
|
+
"lilconfig": "^3.1.3",
|
|
65
|
+
"lines-and-columns": "^1.2.4",
|
|
66
|
+
"load-tsconfig": "^0.2.5",
|
|
67
|
+
"magic-string": "^0.30.21",
|
|
68
|
+
"magicast": "^0.5.2",
|
|
69
|
+
"make-dir": "^4.0.0",
|
|
70
|
+
"mlly": "^1.8.0",
|
|
71
|
+
"ms": "^2.1.3",
|
|
72
|
+
"mz": "^2.7.0",
|
|
73
|
+
"nanoid": "^3.3.11",
|
|
74
|
+
"object-assign": "^4.1.1",
|
|
75
|
+
"obug": "^2.1.1",
|
|
76
|
+
"pathe": "^2.0.3",
|
|
77
|
+
"picocolors": "^1.1.1",
|
|
78
|
+
"picomatch": "^4.0.3",
|
|
79
|
+
"pirates": "^4.0.7",
|
|
80
|
+
"pkg-types": "^1.3.1",
|
|
81
|
+
"postcss": "^8.5.6",
|
|
82
|
+
"postcss-load-config": "^6.0.1",
|
|
83
|
+
"readdirp": "^4.1.2",
|
|
84
|
+
"resolve-from": "^5.0.0",
|
|
85
|
+
"rollup": "^4.57.1",
|
|
86
|
+
"semver": "^7.7.4",
|
|
87
|
+
"siginfo": "^2.0.0",
|
|
88
|
+
"source-map": "^0.7.6",
|
|
89
|
+
"source-map-js": "^1.2.1",
|
|
90
|
+
"stackback": "^0.0.2",
|
|
91
|
+
"std-env": "^3.10.0",
|
|
92
|
+
"sucrase": "^3.35.1",
|
|
93
|
+
"supports-color": "^7.2.0",
|
|
94
|
+
"thenify": "^3.3.1",
|
|
95
|
+
"thenify-all": "^1.6.0",
|
|
96
|
+
"tinybench": "^2.9.0",
|
|
97
|
+
"tinyexec": "^0.3.2",
|
|
98
|
+
"tinyglobby": "^0.2.15",
|
|
99
|
+
"tinyrainbow": "^3.0.3",
|
|
100
|
+
"tree-kill": "^1.2.2",
|
|
101
|
+
"ts-interface-checker": "^0.1.13",
|
|
102
|
+
"ufo": "^1.6.3",
|
|
103
|
+
"undici-types": "^7.16.0",
|
|
104
|
+
"vite": "^7.3.1",
|
|
105
|
+
"why-is-node-running": "^2.3.0"
|
|
106
|
+
},
|
|
107
|
+
"devDependencies": {
|
|
108
|
+
"@types/node": "^25.2.3",
|
|
109
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
110
|
+
"tsup": "^8.5.1",
|
|
111
|
+
"typescript": "^5.9.3",
|
|
112
|
+
"vitest": "^4.0.18"
|
|
113
|
+
},
|
|
114
|
+
"publishConfig": {
|
|
115
|
+
"access": "public"
|
|
116
|
+
},
|
|
117
|
+
"sideEffects": false,
|
|
118
|
+
"module": "./dist/index.js"
|
|
119
|
+
}
|