@citruslime/utils 1.0.1-beta.1 → 1.1.0-beta.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.
@@ -1 +1 @@
1
- (function(i,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(i=typeof globalThis<"u"?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]<"u"?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"}})});
1
+ (function(i,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(i=typeof globalThis<"u"?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 y(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 h=o;o=t,t=h}const r=t.length;return r===0?n=100:n=Math.round((r-d(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]<"u"?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 o;for(let r=1;r<=n.length;r++){let h=r;const s=n[r-1];for(let l=1;l<=e.length;l++){if(s===e[l-1])o=t[l-1];else{const a=h+1,p=t[l]+1,c=a-(a-p&p-a>>7),m=t[l-1]+1;o=c-(c-m&m-c>>7)}t[l-1]=h,h=o}t[e.length]=h}return t[e.length]}i.compareByProperty=f,i.generateStringId=u,i.getParamsByName=y,i.nameOf=g,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citruslime/utils",
3
- "version": "1.0.1-beta.1",
3
+ "version": "1.1.0-beta.0",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Citrus-Lime Ltd",
package/dist/env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />