@citruslime/utils 1.0.0-beta.0 → 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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Citrus-Lime Utils
2
2
 
3
- A TypeScript package containing utilities for any JavaScript or TypeScript project. Used by the [Citrus-Lime UI](https://www.npmjs.com/package/@citruslime/ui) package.
3
+ A TypeScript package containing utilities for any JavaScript or TypeScript project. Used by [Citrus-Lime UI](https://www.npmjs.com/package/@citruslime/ui).
4
4
 
5
5
  ![version](https://img.shields.io/npm/v/@citruslime/utils/latest)
6
6
  ![version next](https://img.shields.io/npm/v/@citruslime/utils/next)
@@ -1 +1 @@
1
- (function(o,u){typeof exports=="object"&&typeof module!="undefined"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(o=typeof globalThis!="undefined"?globalThis:o||self,u(o.CitrusLimeUtils={}))})(this,function(o){"use strict";function u(){return Math.random().toString(36).slice(2,8)}function g(e){return e}function f(e,n,t){return e[t]<n[t]?-1:e[t]>n[t]?1:0}function y(e,n){let t="";const i=decodeURIComponent(e),r="[\\?&]"+n+"=([^&#]*)",s=new RegExp(r).exec(i);return s&&s[1]&&(t=decodeURIComponent(s[1].replace(/\+/g," "))),t}String.prototype.similarity=function(e){let n=0,t=this.toLowerCase(),i=e.toLowerCase();if(t<i){const l=i;i=t,t=l}const r=t.length;return r===0?n=100:n=Math.round((r-d(t,i))/r*100),n},String.prototype.trimChar=function(e){return this.trimStartChar(e).trimEndChar(e)},String.prototype.trimStartChar=function(e){return e!==""&&this.startsWith(e)?this.slice(1):this},String.prototype.trimEndChar=function(e){return e!==""&&this.endsWith(e)?this.slice(0,-1):this},String.prototype.trimToLength=function(e,n=!1){const t=this.length<e?this.length:e;return n&&t>=4&&t<this.length?`${this.slice(0,Math.max(t-3,1))}...`:this.slice(0,Math.max(t,1))},String.prototype.removeWhitespace=function(){return this.replace(/\s/g,"")},String.prototype.removeNonAlphanumeric=function(){return this.replace(/[^a-zA-Z0-9]/g,"")},String.prototype.removeNonAlphabetic=function(){return this.replace(/[^a-zA-Z]/g,"")},String.prototype.removeNonNumeric=function(){return this.replace(/[^0-9]/g,"")},String.prototype.replacePlaceholders=function(...e){let n=0;return this.replace(/{\d+}/g,()=>typeof e[n]!="undefined"?e[n++]:"")},String.prototype.toDateFromTime=function(){return new Date(`${new Date().toISOString().substr(0,11)}${this}`)};function d(e,n){if(e.length===0)return n.length;if(n.length===0)return e.length;if(e.length>n.length){const r=e;e=n,n=r}const t=new Int8Array(e.length+1);for(let r=0;r<=e.length;r++)t[r]=r;let i;for(let r=1;r<=n.length;r++){let l=r;const s=n[r-1];for(let h=1;h<=e.length;h++){if(s===e[h-1])i=t[h-1];else{const a=l+1,p=t[h]+1,c=a-(a-p&p-a>>7),m=t[h-1]+1;i=c-(c-m&m-c>>7)}t[h-1]=l,l=i}t[e.length]=l}return t[e.length]}o.compareByProperty=f,o.generateStringId=u,o.getParamsByName=y,o.nameOf=g,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
1
+ (function(i,u){typeof exports=="object"&&typeof module!="undefined"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(i=typeof globalThis!="undefined"?globalThis:i||self,u(i.CitrusLimeUtils={}))})(this,function(i){"use strict";function u(){return Math.random().toString(36).slice(2,8)}function g(e){return e}function f(e,n,t){return e[t]<n[t]?-1:e[t]>n[t]?1:0}function d(e,n){let t="";const o=decodeURIComponent(e),r="[\\?&]"+n+"=([^&#]*)",s=new RegExp(r).exec(o);return s&&s[1]&&(t=decodeURIComponent(s[1].replace(/\+/g," "))),t}String.prototype.similarity=function(e){let n=0,t=this.toLowerCase(),o=e.toLowerCase();if(t<o){const l=o;o=t,t=l}const r=t.length;return r===0?n=100:n=Math.round((r-y(t,o))/r*100),n},String.prototype.trimChar=function(e){return this.trimStartChar(e).trimEndChar(e)},String.prototype.trimStartChar=function(e){return e!==""&&this.startsWith(e)?this.slice(1):this},String.prototype.trimEndChar=function(e){return e!==""&&this.endsWith(e)?this.slice(0,-1):this},String.prototype.trimToLength=function(e,n=!1){const t=this.length<e?this.length:e;return n&&t>=4&&t<this.length?`${this.slice(0,Math.max(t-3,1))}...`:this.slice(0,Math.max(t,1))},String.prototype.removeWhitespace=function(){return this.replace(/\s/g,"")},String.prototype.removeNonAlphanumeric=function(){return this.replace(/[^a-zA-Z0-9]/g,"")},String.prototype.removeNonAlphabetic=function(){return this.replace(/[^a-zA-Z]/g,"")},String.prototype.removeNonNumeric=function(){return this.replace(/[^0-9]/g,"")},String.prototype.replacePlaceholders=function(...e){let n=0;return this.replace(/{\d+}/g,()=>typeof e[n]!="undefined"?e[n++]:"")},String.prototype.toDateFromTime=function(){return new Date(`${new Date().toISOString().substr(0,11)}${this}`)};function y(e,n){if(e.length===0)return n.length;if(n.length===0)return e.length;if(e.length>n.length){const r=e;e=n,n=r}const t=new Int8Array(e.length+1);for(let r=0;r<=e.length;r++)t[r]=r;let o;for(let r=1;r<=n.length;r++){let l=r;const s=n[r-1];for(let h=1;h<=e.length;h++){if(s===e[h-1])o=t[h-1];else{const a=l+1,p=t[h]+1,c=a-(a-p&p-a>>7),m=t[h-1]+1;o=c-(c-m&m-c>>7)}t[h-1]=l,l=o}t[e.length]=l}return t[e.length]}i.compareByProperty=f,i.generateStringId=u,i.getParamsByName=d,i.nameOf=g,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citruslime/utils",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0",
4
4
  "author": {
5
5
  "name": "Citrus-Lime Ltd",
6
6
  "url": "https://citruslime.com"
@@ -28,6 +28,6 @@
28
28
  "devDependencies": {
29
29
  "copyfiles": "^2.4.1",
30
30
  "del-cli": "^4.0.1",
31
- "vite-plugin-dts": "^0.9.9"
31
+ "vite-plugin-dts": "^0.9.10"
32
32
  }
33
33
  }