nhb-toolbox 0.8.1 → 0.8.6

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.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './string';
1
+ export { capitalizeString } from './string';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./string"), exports);
3
+ exports.capitalizeString = void 0;
4
+ var string_1 = require("./string");
5
+ Object.defineProperty(exports, "capitalizeString", { enumerable: true, get: function () { return string_1.capitalizeString; } });
5
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA4C;AAAnC,0GAAA,gBAAgB,OAAA"}
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "0.8.1",
3
+ "version": "0.8.6",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
5
- "main": "./dist/index.cjs.js",
6
- "module": "./dist/index.esm.js",
7
- "types": "./dist/types/index.d.ts",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./dist/index.esm.js",
11
- "require": "./dist/index.cjs.js"
12
- }
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./package.json": "./package.json"
13
14
  },
14
15
  "publishConfig": {
15
16
  "access": "public"
@@ -39,10 +40,6 @@
39
40
  "license": "ISC",
40
41
  "devDependencies": {
41
42
  "@eslint/js": "^9.18.0",
42
- "@rollup/plugin-commonjs": "^28.0.2",
43
- "@rollup/plugin-node-resolve": "^16.0.0",
44
- "@rollup/plugin-terser": "^0.4.4",
45
- "@rollup/plugin-typescript": "^12.1.2",
46
43
  "@types/jest": "^29.5.14",
47
44
  "@types/node": "^22.10.7",
48
45
  "@typescript-eslint/eslint-plugin": "^8.21.0",
@@ -58,18 +55,13 @@
58
55
  "prettier": "^3.4.2",
59
56
  "progress-estimator": "^0.3.1",
60
57
  "rimraf": "^6.0.1",
61
- "rollup": "^4.31.0",
62
- "rollup-plugin-dts": "^6.1.1",
63
58
  "ts-jest": "^29.2.5",
64
59
  "typescript": "^5.7.3",
65
60
  "typescript-eslint": "^8.21.0"
66
61
  },
67
- "dependencies": {
68
- "tslib": "^2.8.1"
69
- },
70
62
  "scripts": {
71
63
  "clean": "rimraf dist",
72
- "build": "node build.mjs && rollup -c",
64
+ "build": "node build.mjs",
73
65
  "test": "jest --coverage",
74
66
  "format": "prettier --write src/",
75
67
  "lint": "node lint.mjs",
package/dist/index.esm.js DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * Utility to convert the first letter of any string to uppercase and the rest lowercase (unless specified).
3
- * @param string String to be capitalized.
4
- * @param capEach If true, capitalizes the first letter of each word (space separated). Defaults to `false`.
5
- * @param lowerRest If true, ensures that the rest of the string is lowercase. Defaults to `true`.
6
- * @returns Capitalized string.
7
- */
8
- const capitalizeString = (string, capEach = false, lowerRest = true) => {
9
- if (!string)
10
- return '';
11
- const trimmedString = string.trim();
12
- if (!trimmedString)
13
- return '';
14
- if (capEach) {
15
- return trimmedString
16
- .split(' ')
17
- .map((word) => capitalizeString(word, false, lowerRest))
18
- .join(' ');
19
- }
20
- else {
21
- if (lowerRest) {
22
- return trimmedString
23
- .charAt(0)
24
- .toUpperCase()
25
- .concat(trimmedString.slice(1).toLowerCase());
26
- }
27
- return trimmedString
28
- .charAt(0)
29
- .toUpperCase()
30
- .concat(trimmedString.slice(1));
31
- }
32
- };
33
-
34
- export { capitalizeString };
35
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/string/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;AAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,MAAc,EACd,OAAA,GAAmB,KAAK,EACxB,SAAqB,GAAA,IAAI,KACd;AACX,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;AAEtB,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,EAAE;AAEnC,IAAA,IAAI,CAAC,aAAa;AAAE,QAAA,OAAO,EAAE;IAE7B,IAAI,OAAO,EAAE;AACZ,QAAA,OAAO;aACL,KAAK,CAAC,GAAG;AACT,aAAA,GAAG,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC;aACtD,IAAI,CAAC,GAAG,CAAC;;SACL;QACN,IAAI,SAAS,EAAE;AACd,YAAA,OAAO;iBACL,MAAM,CAAC,CAAC;AACR,iBAAA,WAAW;iBACX,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;;AAG/C,QAAA,OAAO;aACL,MAAM,CAAC,CAAC;AACR,aAAA,WAAW;aACX,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;;AAElC;;;;"}
package/dist/index.min.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";const t=(e,r=!1,c=!0)=>{if(!e)return"";const s=e.trim();return s?r?s.split(" ").map((e=>t(e,!1,c))).join(" "):c?s.charAt(0).toUpperCase().concat(s.slice(1).toLowerCase()):s.charAt(0).toUpperCase().concat(s.slice(1)):""};exports.capitalizeString=t;
2
- //# sourceMappingURL=index.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.min.js","sources":["../src/string/index.ts"],"sourcesContent":[null],"names":["capitalizeString","string","capEach","lowerRest","trimmedString","trim","split","map","word","join","charAt","toUpperCase","concat","slice","toLowerCase"],"mappings":"aAOO,MAAMA,EAAmB,CAC/BC,EACAC,GAAmB,EACnBC,GAAqB,KAErB,IAAKF,EAAQ,MAAO,GAEpB,MAAMG,EAAgBH,EAAOI,OAE7B,OAAKD,EAEDF,EACIE,EACLE,MAAM,KACNC,KAAKC,GAASR,EAAiBQ,GAAM,EAAOL,KAC5CM,KAAK,KAEHN,EACIC,EACLM,OAAO,GACPC,cACAC,OAAOR,EAAcS,MAAM,GAAGC,eAG1BV,EACLM,OAAO,GACPC,cACAC,OAAOR,EAAcS,MAAM,IAlBH"}
package/dist/index.umd.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NHBToolBox={})}(this,(function(e){"use strict";const t=(e,o=!1,i=!0)=>{if(!e)return"";const n=e.trim();return n?o?n.split(" ").map((e=>t(e,!1,i))).join(" "):i?n.charAt(0).toUpperCase().concat(n.slice(1).toLowerCase()):n.charAt(0).toUpperCase().concat(n.slice(1)):""};e.capitalizeString=t}));
2
- //# sourceMappingURL=index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/string/index.ts"],"sourcesContent":[null],"names":["capitalizeString","string","capEach","lowerRest","trimmedString","trim","split","map","word","join","charAt","toUpperCase","concat","slice","toLowerCase"],"mappings":"kPAOO,MAAMA,EAAmB,CAC/BC,EACAC,GAAmB,EACnBC,GAAqB,KAErB,IAAKF,EAAQ,MAAO,GAEpB,MAAMG,EAAgBH,EAAOI,OAE7B,OAAKD,EAEDF,EACIE,EACLE,MAAM,KACNC,KAAKC,GAASR,EAAiBQ,GAAM,EAAOL,KAC5CM,KAAK,KAEHN,EACIC,EACLM,OAAO,GACPC,cACAC,OAAOR,EAAcS,MAAM,GAAGC,eAG1BV,EACLM,OAAO,GACPC,cACAC,OAAOR,EAAcS,MAAM,IAlBH"}