@stryke/string-format 0.2.4 â 0.3.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/README.md +1 -1
- package/dist/kebab-case.cjs +4 -5
- package/dist/kebab-case.d.ts +1 -1
- package/dist/kebab-case.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŠī¸ Stryke** monorepo. Stryke pac
|
|
|
22
22
|
|
|
23
23
|
<h3 align="center">đģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
24
24
|
|
|
25
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT] This repository, and the apps, libraries, and tools contained
|
|
28
28
|
> within, is still in it's initial development phase. As a result, bugs and
|
package/dist/kebab-case.cjs
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.kebabCase =
|
|
6
|
+
exports.kebabCase = kebabCase;
|
|
7
7
|
var _types = require("@stryke/types");
|
|
8
8
|
var _upperCaseFirst = require("./upper-case-first.cjs");
|
|
9
|
-
|
|
9
|
+
function kebabCase(t) {
|
|
10
10
|
const e = t?.replace(/[A-Z]+/g, r => (0, _upperCaseFirst.upperCaseFirst)(r) ?? _types.EMPTY_STRING)?.split(/(?=[A-Z])|[\s._-]/).map(r => r.toLowerCase()) ?? [];
|
|
11
|
-
return e.length === 0 ? "" : e.length === 1 ? e[0] : e.reduce((r,
|
|
12
|
-
}
|
|
13
|
-
exports.kebabCase = kebabCase;
|
|
11
|
+
return e.length === 0 ? "" : e.length === 1 ? e[0] : e.reduce((r, n) => `${r}-${n.toLowerCase()}`.toLowerCase());
|
|
12
|
+
}
|
package/dist/kebab-case.d.ts
CHANGED
package/dist/kebab-case.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EMPTY_STRING as
|
|
1
|
+
import{EMPTY_STRING as s}from"@stryke/types";import{upperCaseFirst as i}from"./upper-case-first";export function kebabCase(t){const e=t?.replace(/[A-Z]+/g,r=>i(r)??s)?.split(/(?=[A-Z])|[\s._-]/).map(r=>r.toLowerCase())??[];return e.length===0?"":e.length===1?e[0]:e.reduce((r,n)=>`${r}-${n.toLowerCase()}`.toLowerCase())}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/string-format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing utility functions to transform strings into various formats.",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
12
|
"publishConfig": { "access": "public" },
|
|
13
|
-
"dependencies": { "@stryke/helpers": ">=0.4.
|
|
13
|
+
"dependencies": { "@stryke/helpers": ">=0.4.5", "@stryke/types": ">=0.7.3" },
|
|
14
14
|
"devDependencies": {},
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": ["dist/**/*"],
|