@js-utils-kit/string 1.3.0 → 1.4.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/dist/index.cjs +1 -1
  2. package/package.json +23 -23
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- function e(e){return e.replace(/^\w/,e=>e.toUpperCase())}function t(e,t=/\s+/){return e.split(t)}function n(e,n){return n?[...e].filter(e=>e===n).length:t(e).length}function r(e){return[...e].reduce((e,t)=>(e[t]=(e[t]||0)+1,e),{})}function i(e){return e?t(e,/\r\n|\r|\n/).length:0}function a(e,n){return n.length===0?0:t(e,n).length-1}function o(e){return t(e.trim()).length}function s(e,t=``){return e.replace(/[^\p{L}\p{N}\s]/gu,t)}function c(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);if(n.length===0)return``;let r=Math.max(...n.map(e=>e.length)),i=n.filter(e=>e.length===r),a=[...new Set(i)];return a.length===1?a[0]:a}function l(e){let n=t(e).map(e=>s(e)).filter(Boolean);return n.length===0?0:n.reduce((e,t)=>Math.max(e,t.length),0)}function u(e,t,n=` `){return e.padStart(t,n)}function d(e,t,n=` `){return e.padEnd(t,n)}function f(e,t){return e.repeat(t)}function p(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);if(n.length===0)return``;let r=Math.min(...n.map(e=>e.length)),i=n.filter(e=>e.length===r),a=[...new Set(i)];return a.length===1?a[0]:a}function m(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);return n.length===0?0:n.reduce((e,t)=>Math.min(e,t.length),1/0)}const h=Object.assign(e=>e.trim(),{start:e=>e.trimStart(),end:e=>e.trimEnd(),normalizeWhitespace:e=>e.trim().replace(/\s+/g,` `)});function g(e,t,n=`...`){return t<=0?``:e.length<=t?e:n.length>=t?n.slice(0,t):e.trim().slice(0,t)+n}function _(e){return[...new Set(e)]}exports.capitalize=e,exports.countChars=n,exports.countFrequencies=r,exports.countLines=i,exports.countSubstring=a,exports.countWords=o,exports.longestWord=c,exports.longestWordLength=l,exports.padLeft=u,exports.padRight=d,exports.repeatString=f,exports.shortestWord=p,exports.shortestWordLength=m,exports.splitString=t,exports.stripSymbols=s,exports.trim=h,exports.truncate=g,exports.uniqueChars=_;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e.replace(/^\w/,e=>e.toUpperCase())}function t(e,t=/\s+/){return e.split(t)}function n(e,n){return n?[...e].filter(e=>e===n).length:t(e).length}function r(e){return[...e].reduce((e,t)=>(e[t]=(e[t]||0)+1,e),{})}function i(e){return e?t(e,/\r\n|\r|\n/).length:0}function a(e,n){return n.length===0?0:t(e,n).length-1}function o(e){return t(e.trim()).length}function s(e,t=``){return e.replace(/[^\p{L}\p{N}\s]/gu,t)}function c(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);if(n.length===0)return``;let r=Math.max(...n.map(e=>e.length)),i=n.filter(e=>e.length===r),a=[...new Set(i)];return a.length===1?a[0]:a}function l(e){let n=t(e).map(e=>s(e)).filter(Boolean);return n.length===0?0:n.reduce((e,t)=>Math.max(e,t.length),0)}function u(e,t,n=` `){return e.padStart(t,n)}function d(e,t,n=` `){return e.padEnd(t,n)}function f(e,t){return e.repeat(t)}function p(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);if(n.length===0)return``;let r=Math.min(...n.map(e=>e.length)),i=n.filter(e=>e.length===r),a=[...new Set(i)];return a.length===1?a[0]:a}function m(e){let n=t(e.trim()).map(e=>s(e)).filter(Boolean);return n.length===0?0:n.reduce((e,t)=>Math.min(e,t.length),1/0)}const h=Object.assign(e=>e.trim(),{start:e=>e.trimStart(),end:e=>e.trimEnd(),normalizeWhitespace:e=>e.trim().replace(/\s+/g,` `)});function g(e,t,n=`...`){return t<=0?``:e.length<=t?e:n.length>=t?n.slice(0,t):e.trim().slice(0,t)+n}function _(e){return[...new Set(e)]}exports.capitalize=e,exports.countChars=n,exports.countFrequencies=r,exports.countLines=i,exports.countSubstring=a,exports.countWords=o,exports.longestWord=c,exports.longestWordLength=l,exports.padLeft=u,exports.padRight=d,exports.repeatString=f,exports.shortestWord=p,exports.shortestWordLength=m,exports.splitString=t,exports.stripSymbols=s,exports.trim=h,exports.truncate=g,exports.uniqueChars=_;
package/package.json CHANGED
@@ -1,9 +1,20 @@
1
1
  {
2
2
  "name": "@js-utils-kit/string",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "String utilities",
5
- "license": "MIT",
6
- "private": false,
5
+ "keywords": [
6
+ "string",
7
+ "string-utils",
8
+ "stringify",
9
+ "text",
10
+ "case",
11
+ "trim",
12
+ "format",
13
+ "sanitize",
14
+ "camelcase",
15
+ "typescript",
16
+ "utilities"
17
+ ],
7
18
  "homepage": "https://js-utils.js.org",
8
19
  "repository": {
9
20
  "type": "git",
@@ -13,42 +24,31 @@
13
24
  "bugs": {
14
25
  "url": "https://github.com/teneplaysofficial/js-utils-kit/issues"
15
26
  },
27
+ "license": "MIT",
16
28
  "author": {
17
29
  "name": "Sriman",
18
30
  "email": "136729116+TenEplaysOfficial@users.noreply.github.com",
19
31
  "url": "https://tene.vercel.app"
20
32
  },
21
- "keywords": [
22
- "string",
23
- "string-utils",
24
- "stringify",
25
- "text",
26
- "case",
27
- "trim",
28
- "format",
29
- "sanitize",
30
- "camelcase",
31
- "typescript",
32
- "utilities"
33
- ],
33
+ "private": false,
34
34
  "files": [
35
35
  "dist"
36
36
  ],
37
- "engines": {
38
- "node": ">=22"
39
- },
40
37
  "type": "module",
41
38
  "main": "./dist/index.cjs",
42
39
  "module": "./dist/index.mjs",
43
- "types": "./dist/index.d.cts",
44
40
  "exports": {
45
41
  ".": {
46
- "require": "./dist/index.cjs",
47
- "import": "./dist/index.mjs"
42
+ "import": "./dist/index.mjs",
43
+ "require": "./dist/index.cjs"
48
44
  }
49
45
  },
46
+ "types": "./dist/index.d.cts",
47
+ "engines": {
48
+ "node": ">=22"
49
+ },
50
50
  "dependencies": {
51
- "@js-utils-kit/types": "1.3.0"
51
+ "@js-utils-kit/types": "1.4.0"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsdown",