@gershy/util-phrasing 0.0.5 → 0.0.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/cmp/cjs/main.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import '../sideEffects.js';
2
1
  import '@gershy/clearing';
3
2
  export type Mode = 'camel' | 'kebab' | 'snake' | 'kamel';
4
3
  declare const _default: {
package/cmp/cjs/main.js CHANGED
@@ -1,19 +1,35 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("@gershy/clearing");
4
- exports.default = ((conversion, str) => {
5
- const [src, trg] = conversion[cl.cut]('->', 1);
6
- const splitReg = { camel: /(?=[A-Z])/, kamel: /(?=[A-Z])/, kebab: /[-]+/, snake: /[_]+/ }[src];
7
- const parts = str.split(splitReg).map(cmp => cmp[cl.lower]()).filter(v => !!v);
8
- if (trg === 'parts')
9
- return parts;
10
- if (trg === 'camel')
11
- return [parts[0], ...parts.slice(1).map(v => v[0][cl.upper]() + v.slice(1))].join('');
12
- if (trg === 'kamel')
13
- return parts.map(v => v[0][cl.upper]() + v.slice(1)).join('');
14
- if (trg === 'kebab')
15
- return parts.join('-');
16
- if (trg === 'snake')
17
- return parts.join('_');
18
- throw Error('ouch');
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
+ var main_exports = {};
20
+ __export(main_exports, {
21
+ default: () => main_default
22
+ });
23
+ module.exports = __toCommonJS(main_exports);
24
+ var import_clearing = require("@gershy/clearing");
25
+ var main_default = ((conversion, str) => {
26
+ const [src, trg] = conversion[cl.cut]("->", 1);
27
+ const splitReg = { camel: /(?=[A-Z])/, kamel: /(?=[A-Z])/, kebab: /[-]+/, snake: /[_]+/ }[src];
28
+ const parts = str.split(splitReg).map((cmp) => cmp[cl.lower]()).filter((v) => !!v);
29
+ if (trg === "parts") return parts;
30
+ if (trg === "camel") return [parts[0], ...parts.slice(1).map((v) => v[0][cl.upper]() + v.slice(1))].join("");
31
+ if (trg === "kamel") return parts.map((v) => v[0][cl.upper]() + v.slice(1)).join("");
32
+ if (trg === "kebab") return parts.join("-");
33
+ if (trg === "snake") return parts.join("_");
34
+ throw Error("ouch");
19
35
  });
@@ -1,4 +1,3 @@
1
- import '../sideEffects.js';
2
1
  import '@gershy/clearing';
3
2
  export type Mode = 'camel' | 'kebab' | 'snake' | 'kamel';
4
3
  declare const _default: {
@@ -0,0 +1,15 @@
1
+ import "@gershy/clearing";
2
+ var main_default = ((conversion, str) => {
3
+ const [src, trg] = conversion[cl.cut]("->", 1);
4
+ const splitReg = { camel: /(?=[A-Z])/, kamel: /(?=[A-Z])/, kebab: /[-]+/, snake: /[_]+/ }[src];
5
+ const parts = str.split(splitReg).map((cmp) => cmp[cl.lower]()).filter((v) => !!v);
6
+ if (trg === "parts") return parts;
7
+ if (trg === "camel") return [parts[0], ...parts.slice(1).map((v) => v[0][cl.upper]() + v.slice(1))].join("");
8
+ if (trg === "kamel") return parts.map((v) => v[0][cl.upper]() + v.slice(1)).join("");
9
+ if (trg === "kebab") return parts.join("-");
10
+ if (trg === "snake") return parts.join("_");
11
+ throw Error("ouch");
12
+ });
13
+ export {
14
+ main_default as default
15
+ };
@@ -0,0 +1,2 @@
1
+ declare global {}
2
+ export {};
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@gershy/util-phrasing",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
+ "author": "Gershom Maes",
4
5
  "description": "TODO",
5
6
  "keywords": [
6
7
  "TODO"
7
8
  ],
8
- "author": "Gershom Maes",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/gershy/utilPhrasing.git"
@@ -14,36 +14,26 @@
14
14
  "url": "https://github.com/gershy/utilPhrasing/issues"
15
15
  },
16
16
  "homepage": "https://github.com/gershy/utilPhrasing#readme",
17
+ "type": "module",
18
+ "files": [
19
+ "cmp"
20
+ ],
17
21
  "license": "ISC",
18
22
  "peerDependencies": {
19
- "@gershy/clearing": "^0.0.36"
23
+ "@gershy/clearing": "^0.0.41"
20
24
  },
21
25
  "devDependencies": {
22
- "@types/node": "^24.10.1",
23
- "tsx": "^4.21.0",
24
- "typescript": "^5.9.3"
26
+ "@types/node": "^24.10.1"
25
27
  },
26
- "type": "module",
27
- "files": [
28
- "cmp"
29
- ],
30
- "sideEffects": false,
31
- "types": "./cmp/mjs/main.d.ts",
32
28
  "exports": {
33
29
  ".": {
34
- "import": "./cmp/mjs/main.js",
30
+ "import": "./cmp/esm/main.js",
35
31
  "require": "./cmp/cjs/main.js"
36
32
  }
37
33
  },
38
34
  "scripts": {
39
35
  "test": "npm run ts.check && npx tsx ./src/main.test.ts",
40
- "ts.check": "npx tsc --noEmit",
41
- "build.cjs": "tsc -p build/tsconfig.cjs.json",
42
- "build.mjs": "tsc -p build/tsconfig.mjs.json",
43
- "build": "node ./build/act.js removeCmp && npm run build.cjs && npm run build.mjs && node ./build/act.js finalizeExportVariants",
44
- "git.pub": "npm run test && git add --all && git commit -m \"automated\" && git push",
45
- "npm.login": "npm login",
46
- "npm.pub": "npm run test && npm run build && npm publish --access public"
36
+ "ts.check": "npx tsc --noEmit"
47
37
  },
48
38
  "dependencies": {}
49
39
  }
package/cmp/mjs/main.js DELETED
@@ -1,17 +0,0 @@
1
- import '@gershy/clearing';
2
- export default ((conversion, str) => {
3
- const [src, trg] = conversion[cl.cut]('->', 1);
4
- const splitReg = { camel: /(?=[A-Z])/, kamel: /(?=[A-Z])/, kebab: /[-]+/, snake: /[_]+/ }[src];
5
- const parts = str.split(splitReg).map(cmp => cmp[cl.lower]()).filter(v => !!v);
6
- if (trg === 'parts')
7
- return parts;
8
- if (trg === 'camel')
9
- return [parts[0], ...parts.slice(1).map(v => v[0][cl.upper]() + v.slice(1))].join('');
10
- if (trg === 'kamel')
11
- return parts.map(v => v[0][cl.upper]() + v.slice(1)).join('');
12
- if (trg === 'kebab')
13
- return parts.join('-');
14
- if (trg === 'snake')
15
- return parts.join('_');
16
- throw Error('ouch');
17
- });
File without changes
File without changes