Comparing version 0.4.0 to 1.0.0
@@ -1,4 +0,4 @@ | ||
export { Money } from './money'; | ||
export { MoneyCalculator } from './money_calculator'; | ||
export { MoneyFormatter } from './money_formatter'; | ||
export * from './money'; | ||
export * from './money_calculator'; | ||
export * from './money_formatter'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
"use strict";class B{_isNegative=!1;_integerPart="0";_fractionalPart="0";_floatingPointPrecision=1;static _intRegex=/^\d+$/;constructor(r){this.value=r}set value(r){if(/^-[0]+(?:\.0+)?$/.test(r)&&(r=r.substring(1)),/^-\d+(?:\.\d+)?$/.test(r)?(r=r.substring(1),this._isNegative=!0):this._isNegative=!1,/^\d+\.\d+$/.test(r)){const t=r.split(".");this._integerPart=t[0],this._fractionalPart=t[1],this._floatingPointPrecision=t[1].length}else if(B._intRegex.test(r))this._integerPart=r,this._fractionalPart="",this._floatingPointPrecision=0;else throw new Error("Value does not match valid pattern.")}get value(){let r=(this.isNegative?"-":"")+this._integerPart;return this._floatingPointPrecision!==0&&(r+="."+this._fractionalPart),r}get integerPart(){return this._integerPart}get fractionalPart(){return this._fractionalPart}set integerPart(r){if(!B._intRegex.test(r))throw new Error("Input number is not a valid positive integer.");this._integerPart=r.toString(),this.isNull()&&(this.isNegative=!1)}set fractionalPart(r){if(!B._intRegex.test(r))throw new Error("Input number is not a valid positive integer to represent floating point numbers.");this._fractionalPart=r.toString(),this._floatingPointPrecision=r.length,this.isNull()&&(this._isNegative=!1)}get floatingPointPrecision(){return this._floatingPointPrecision}get isNegative(){return this._isNegative}set isNegative(r){this.isNull()||(this._isNegative=r)}isNull(){return/^[0]+$/.test(this._integerPart)&&/^[0]*$/.test(this._fractionalPart)}}class l{static addDigits(r,t,e){if(!/^\d$/.test(r)||!/^\d$/.test(t))throw new Error("Strings need to be single ascii digits.");let _=parseInt(r)+parseInt(t)+(e?1:0),a=_.toString();return[a.length===1?a:a.charAt(1),_>=10]}static min(r,t){const e=l.max(r,t);return e!==l.max(t,r)||e===t?r:t}static max(r,t){const e=r.integerPart,_=t.integerPart;if(r.isNegative&&!t.isNegative)return t;if(!r.isNegative&&t.isNegative)return r;{const a=r.isNegative&&t.isNegative;if(e.length>_.length)return a?t:r;if(e.length<_.length)return a?r:t;{for(let n=0;n<e.length;n++){let c=parseInt(e.charAt(n)),S=parseInt(_.charAt(n));if(c>S)return a?t:r;if(S>c)return a?r:t}const m=r.fractionalPart,p=t.fractionalPart;for(let n=0;n<Math.max(m.length,p.length);n++){let c=m.length>n?parseInt(m.charAt(n)):0,S=p.length>n?parseInt(p.charAt(n)):0;if(c>S)return a?t:r;if(S>c)return a?r:t}}}return r}static add(r,t){const e=r.floatingPointPrecision;if(e!==t.floatingPointPrecision)throw new Error("Amounts to add need to have the same floating point precision.");let _="",a="";const m=r.isNegative&&!t.isNegative,p=!r.isNegative&&t.isNegative;if(m||p){let n=!1;const c=r.isNegative,S=t.isNegative;r.isNegative=!1,t.isNegative=!1;const o=l.max(r,t),h=o===r?t:r;r.isNegative=c,t.isNegative=S;let N="",g="",M="";for(let y=e>0?0:1;y<2;y++){let d=y===0?o.fractionalPart:o.integerPart,u=y===0?h.fractionalPart:h.integerPart;y===1&&d.length>u.length&&(u="0".repeat(d.length-u.length)+u);for(let b=d.length-1;b>=0;b--){N=d.charAt(b),g=u.charAt(b);const A=parseInt(N),f=parseInt(g)+(n?1:0);A>=f?(M=(A-f).toString(),n=!1):(M=(10-(f-A)).toString(),n=!0),y===0?a=M+a:_=M+_}y===0&&(r.fractionalPart=a)}r.integerPart=_==="0"?"0":_.replace(/^0+/,""),r.isNegative=o.isNegative}else{let n=r.integerPart,c=t.integerPart;const S=Math.max(n.length,c.length);n=n.split("").reverse().join(""),c=c.split("").reverse().join("");let o=!1;if(e>0){const h=r.fractionalPart,N=t.fractionalPart;for(let g=e-1;g>=0;g--){const M=l.addDigits(h.charAt(g),N.charAt(g),o);o=M[1],a=M[0]+a}r.fractionalPart=a}for(let h=0;h<S;h++){const N=l.addDigits(h<n.length?n.charAt(h):"0",h<c.length?c.charAt(h):"0",o);o=N[1],_=N[0]+_}o&&(_="1"+_),r.integerPart=_}return r}static subtract(r,t){const e=t.isNegative;t.isNegative=!e;try{this.add(r,t)}catch(_){throw t.isNegative=e,_}return t.isNegative=e,r}}var s;(function(i){i[i.SIGN_SYMBOL_NAME_NUMBER=0]="SIGN_SYMBOL_NAME_NUMBER",i[i.SIGN_NAME_SYMBOL_NUMBER=1]="SIGN_NAME_SYMBOL_NUMBER",i[i.SIGN_SYMBOL_NUMBER_NAME=2]="SIGN_SYMBOL_NUMBER_NAME",i[i.SIGN_NAME_NUMBER_SYMBOL=3]="SIGN_NAME_NUMBER_SYMBOL",i[i.SIGN_NUMBER_SYMBOL_NAME=4]="SIGN_NUMBER_SYMBOL_NAME",i[i.SIGN_NUMBER_NAME_SYMBOL=5]="SIGN_NUMBER_NAME_SYMBOL",i[i.SYMBOL_SIGN_NAME_NUMBER=6]="SYMBOL_SIGN_NAME_NUMBER",i[i.SYMBOL_NAME_SIGN_NUMBER=7]="SYMBOL_NAME_SIGN_NUMBER",i[i.SYMBOL_SIGN_NUMBER_NAME=8]="SYMBOL_SIGN_NUMBER_NAME",i[i.SYMBOL_NAME_NUMBER_SIGN=9]="SYMBOL_NAME_NUMBER_SIGN",i[i.SYMBOL_NUMBER_SIGN_NAME=10]="SYMBOL_NUMBER_SIGN_NAME",i[i.SYMBOL_NUMBER_NAME_SIGN=11]="SYMBOL_NUMBER_NAME_SIGN",i[i.NAME_SIGN_SYMBOL_NUMBER=12]="NAME_SIGN_SYMBOL_NUMBER",i[i.NAME_SYMBOL_SIGN_NUMBER=13]="NAME_SYMBOL_SIGN_NUMBER",i[i.NAME_SIGN_NUMBER_SYMBOL=14]="NAME_SIGN_NUMBER_SYMBOL",i[i.NAME_SYMBOL_NUMBER_SIGN=15]="NAME_SYMBOL_NUMBER_SIGN",i[i.NAME_NUMBER_SIGN_SYMBOL=16]="NAME_NUMBER_SIGN_SYMBOL",i[i.NAME_NUMBER_SYMBOL_SIGN=17]="NAME_NUMBER_SYMBOL_SIGN",i[i.NUMBER_NAME_SYMBOL_SIGN=18]="NUMBER_NAME_SYMBOL_SIGN",i[i.NUMBER_NAME_SIGN_SYMBOL=19]="NUMBER_NAME_SIGN_SYMBOL",i[i.NUMBER_SIGN_NAME_SYMBOL=20]="NUMBER_SIGN_NAME_SYMBOL",i[i.NUMBER_SIGN_SYMBOL_NAME=21]="NUMBER_SIGN_SYMBOL_NAME",i[i.NUMBER_SYMBOL_NAME_SIGN=22]="NUMBER_SYMBOL_NAME_SIGN",i[i.NUMBER_SYMBOL_SIGN_NAME=23]="NUMBER_SYMBOL_SIGN_NAME"})(s||(s={}));var E;(function(i){i[i.JAPANESE=0]="JAPANESE",i[i.CHINESE=1]="CHINESE"})(E||(E={}));class I{_currencySymbol="$";_symbolSeparator="";_currencyName="";_nameSeparator=" ";_positiveSign="";_negativeSign="-";_signSeparator="";_displayOrder=s.SIGN_SYMBOL_NUMBER_NAME;_digitCharacters=["0","1","2","3","4","5","6","7","8","9"];_myriadMode=E.JAPANESE;_myriadCharacters=["\u5341","\u767E","\u5343","\u4E07","\u5104","\u5146","\u4EAC","\u5793","\u{25771}","\u7A63","\u6E9D","\u6F97","\u6B63","\u8F09"];_decimalSeparator=".";_groupSeparator=",";_groupSize=3;constructor(r){typeof r.currencySymbol=="string"&&(this.currencySymbol=r.currencySymbol),typeof r.symbolSeparator=="string"&&(this.symbolSeparator=r.symbolSeparator),typeof r.currencyName=="string"&&(this.currencyName=r.currencyName),typeof r.nameSeparator=="string"&&(this.nameSeparator=r.nameSeparator),typeof r.positiveSign=="string"&&(this.positiveSign=r.positiveSign),typeof r.negativeSign=="string"&&(this.negativeSign=r.negativeSign),typeof r.signSeparator=="string"&&(this.signSeparator=r.signSeparator),typeof r.displayOrder<"u"&&typeof r.displayOrder==typeof s.SIGN_NUMBER_SYMBOL_NAME&&(this.displayOrder=r.displayOrder),typeof r.myriadMode<"u"&&typeof r.myriadMode==typeof E.JAPANESE&&(this.myriadMode=r.myriadMode),typeof r.digitCharacters=="object"&&(this.digitCharacters=r.digitCharacters),typeof r.myriadCharacters=="object"&&(this.myriadCharacters=r.myriadCharacters),typeof r.groupSeparator=="string"&&(this.groupSeparator=r.groupSeparator),typeof r.decimalSeparator=="string"&&(this.decimalSeparator=r.decimalSeparator),typeof r.groupSize=="number"&&(this.groupSize=r.groupSize)}handleJapaneseMyriad(r){let t=0,e="",_=!1;for(let a=0;a<r.length;a++)switch(t=parseInt(r.charAt(a)),_=r.length>a+1&&r.charAt(a+1)!=="0"||r.length>a+2&&r.charAt(a+2)!=="0"||r.length>a+3&&r.charAt(a+3)!=="0",a){case 0:t!==0&&(e=this._digitCharacters[t]+e);break;case 1:case 2:case 3:t!==0&&(t===1?e=this._myriadCharacters[a-1]+e:e=this._digitCharacters[t]+this._myriadCharacters[a-1]+e);break;case 4:t!==0?e=this._digitCharacters[t]+this._myriadCharacters[a-1]+e:_&&(e=this._myriadCharacters[Math.trunc(a/4)+2]+e);break;default:a%4===0?t!==0?e=this._digitCharacters[t]+this._myriadCharacters[Math.trunc(a/4)+2]+e:_&&(e=this._myriadCharacters[Math.trunc(a/4)+2]+e):a%4===1&&t!==0?t===1?e=this._myriadCharacters[0]+e:e=this._digitCharacters[t]+this._myriadCharacters[0]+e:a%4===2&&t!==0?t===1?e=this._myriadCharacters[1]+e:e=this._digitCharacters[t]+this._myriadCharacters[1]+e:a%4===3&&t!==0&&(e=this._digitCharacters[t]+this._myriadCharacters[2]+e);break}return e}replaceDigits(r){return r=r.replace(/[0]/g,this._digitCharacters[0]),r=r.replace(/[1]/g,this._digitCharacters[1]),r=r.replace(/[2]/g,this._digitCharacters[2]),r=r.replace(/[3]/g,this._digitCharacters[3]),r=r.replace(/[4]/g,this._digitCharacters[4]),r=r.replace(/[5]/g,this._digitCharacters[5]),r=r.replace(/[6]/g,this._digitCharacters[6]),r=r.replace(/[7]/g,this._digitCharacters[7]),r=r.replace(/[8]/g,this._digitCharacters[8]),r=r.replace(/[9]/g,this._digitCharacters[9]),r}prefix(r){let t="";const e=r?this._negativeSign:this._positiveSign;switch(this._displayOrder){case s.NAME_NUMBER_SIGN_SYMBOL:case s.NAME_NUMBER_SYMBOL_SIGN:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case s.NAME_SIGN_NUMBER_SYMBOL:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator);break;case s.NAME_SIGN_SYMBOL_NUMBER:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case s.NAME_SYMBOL_NUMBER_SIGN:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case s.NAME_SYMBOL_SIGN_NUMBER:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator);break;case s.SIGN_NAME_NUMBER_SYMBOL:e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case s.SIGN_NAME_SYMBOL_NUMBER:e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case s.SIGN_NUMBER_NAME_SYMBOL:case s.SIGN_NUMBER_SYMBOL_NAME:e!==""&&(t+=e+this._signSeparator);break;case s.SIGN_SYMBOL_NAME_NUMBER:e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case s.SIGN_SYMBOL_NUMBER_NAME:e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case s.SYMBOL_NAME_NUMBER_SIGN:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case s.SYMBOL_NAME_SIGN_NUMBER:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator);break;case s.SYMBOL_NUMBER_NAME_SIGN:case s.SYMBOL_NUMBER_SIGN_NAME:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case s.SYMBOL_SIGN_NAME_NUMBER:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case s.SYMBOL_SIGN_NUMBER_NAME:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator);break}return t}suffix(r){let t="";const e=r?this._negativeSign:this._positiveSign;switch(this._displayOrder){case s.NAME_NUMBER_SIGN_SYMBOL:e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.NAME_NUMBER_SYMBOL_SIGN:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e);break;case s.NAME_SIGN_NUMBER_SYMBOL:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.NAME_SYMBOL_NUMBER_SIGN:e!==""&&(t+=this._signSeparator+e);break;case s.NUMBER_NAME_SIGN_SYMBOL:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.NUMBER_NAME_SYMBOL_SIGN:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e);break;case s.NUMBER_SIGN_NAME_SYMBOL:e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.NUMBER_SIGN_SYMBOL_NAME:e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case s.NUMBER_SYMBOL_NAME_SIGN:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e);break;case s.NUMBER_SYMBOL_SIGN_NAME:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case s.SIGN_NAME_NUMBER_SYMBOL:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.SIGN_NUMBER_NAME_SYMBOL:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case s.SIGN_NUMBER_SYMBOL_NAME:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case s.SIGN_SYMBOL_NUMBER_NAME:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case s.SYMBOL_NAME_NUMBER_SIGN:e!==""&&(t+=this._signSeparator+e);break;case s.SYMBOL_NUMBER_NAME_SIGN:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e);break;case s.SYMBOL_NUMBER_SIGN_NAME:e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case s.SYMBOL_SIGN_NUMBER_NAME:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break}return t}formatMyriad(r){if(r.floatingPointPrecision!==0)throw new Error("Only values without decimals are supported for conversion to myriad system.");let t=r.integerPart;if(this._myriadCharacters.length<=4&&t.length!==1&&this._myriadCharacters.length<t.length-1||this._myriadCharacters.length>4&&this._myriadCharacters.length<3+Math.trunc((t.length-1)/4))throw new Error("Not enough characters defined to print myriad string. Use setMyriadCharacters to define more characters.");let e=this.prefix(r.isNegative);if(t.length===1)e+=this._digitCharacters[parseInt(t)];else if(t=t.split("").reverse().join(""),this._myriadMode===E.JAPANESE)e+=this.handleJapaneseMyriad(t);else throw new Error("Provided myriad mode not supported.");return e+=this.suffix(r.isNegative),e}format(r){let t=this.prefix(r.isNegative),e=this.replaceDigits(r.integerPart);if(this._groupSize>0&&e.length>this._groupSize&&this._groupSeparator!==""){let _=0;for(let a=Math.trunc((e.length-1)/this._groupSize);a>0;a--)_=e.length-this._groupSize*a,e=e.slice(0,_)+this._groupSeparator+e.slice(_)}return t+=e,r.floatingPointPrecision>0&&(t+=this._decimalSeparator,t+=this.replaceDigits(r.fractionalPart)),t+=this.suffix(r.isNegative),t}set digitCharacters(r){if(r.length!==10)throw new Error("10 digits need to passed as a string array.");for(let t=0;t<r.length;t++)this._digitCharacters[t]=r[t]}set myriadCharacters(r){this._myriadCharacters=r.slice(0)}set symbolSeparator(r){this._symbolSeparator=r}set myriadMode(r){this._myriadMode=r}set currencySymbol(r){this._currencySymbol=r}set positiveSign(r){this._positiveSign=r}set negativeSign(r){this._negativeSign=r}set decimalSeparator(r){this._decimalSeparator=r}set groupSize(r){if(!Number.isInteger(r)||r<0)throw new Error("Size should be a positive integer.");this._groupSize=r}set groupSeparator(r){this._groupSeparator=r}set displayOrder(r){this._displayOrder=r}set signSeparator(r){this._signSeparator=r}set currencyName(r){this._currencyName=r}set nameSeparator(r){this._nameSeparator=r}get currencySymbol(){return this._currencySymbol}get symbolSeparator(){return this._symbolSeparator}get positiveSign(){return this._positiveSign}get negativeSign(){return this._negativeSign}get digitCharacters(){return this._digitCharacters.slice(0)}get myriadMode(){return this._myriadMode}get myriadCharacters(){return this._myriadCharacters.slice(0)}get decimalSeparator(){return this._decimalSeparator}get groupSeparator(){return this._groupSeparator}get groupSize(){return this._groupSize}get displayOrder(){return this._displayOrder}get signSeparator(){return this._signSeparator}get currencyName(){return this._currencyName}get nameSeparator(){return this._nameSeparator}}exports.Money=B,exports.MoneyCalculator=l,exports.MoneyFormatter=I; | ||
"use strict";class u{_isNegative=!1;_integerPart="0";_fractionalPart="0";_floatingPointPrecision=1;static _intRegex=/^\d+$/;constructor(r){this.value=r}set value(r){if(/^-[0]+(?:\.0+)?$/.test(r)&&(r=r.substring(1)),/^-\d+(?:\.\d+)?$/.test(r)?(r=r.substring(1),this._isNegative=!0):this._isNegative=!1,/^\d+\.\d+$/.test(r)){const t=r.split(".");this._integerPart=t[0],this._fractionalPart=t[1],this._floatingPointPrecision=t[1].length}else if(u._intRegex.test(r))this._integerPart=r,this._fractionalPart="",this._floatingPointPrecision=0;else throw new Error("Value does not match valid pattern.")}get value(){let r=(this.isNegative?"-":"")+this._integerPart;return this._floatingPointPrecision!==0&&(r+="."+this._fractionalPart),r}get integerPart(){return this._integerPart}get fractionalPart(){return this._fractionalPart}set integerPart(r){if(!u._intRegex.test(r))throw new Error("Input number is not a valid positive integer.");this._integerPart=r.toString(),this.isNull()&&(this.isNegative=!1)}set fractionalPart(r){if(!u._intRegex.test(r))throw new Error("Input number is not a valid positive integer to represent floating point numbers.");this._fractionalPart=r.toString(),this._floatingPointPrecision=r.length,this.isNull()&&(this._isNegative=!1)}get floatingPointPrecision(){return this._floatingPointPrecision}get isNegative(){return this._isNegative}set isNegative(r){this.isNull()||(this._isNegative=r)}isNull(){return/^[0]+$/.test(this._integerPart)&&/^[0]*$/.test(this._fractionalPart)}}class M{static addDigits(r,t,e){if(!/^\d$/.test(r)||!/^\d$/.test(t))throw new Error("Strings need to be single ascii digits.");let s=parseInt(r)+parseInt(t)+(e?1:0),a=s.toString();return[a.length===1?a:a.charAt(1),s>=10]}static min(r,t){const e=M.max(r,t);return e!==M.max(t,r)||e===t?r:t}static max(r,t){const e=r.integerPart,s=t.integerPart;if(r.isNegative&&!t.isNegative)return t;if(!r.isNegative&&t.isNegative)return r;{const a=r.isNegative&&t.isNegative;if(e.length>s.length)return a?t:r;if(e.length<s.length)return a?r:t;{for(let _=0;_<e.length;_++){let n=parseInt(e.charAt(_)),o=parseInt(s.charAt(_));if(n>o)return a?t:r;if(o>n)return a?r:t}const g=r.fractionalPart,p=t.fractionalPart;for(let _=0;_<Math.max(g.length,p.length);_++){let n=g.length>_?parseInt(g.charAt(_)):0,o=p.length>_?parseInt(p.charAt(_)):0;if(n>o)return a?t:r;if(o>n)return a?r:t}}}return r}static add(r,t){const e=r.floatingPointPrecision;if(e!==t.floatingPointPrecision)throw new Error("Amounts to add need to have the same floating point precision.");let s="",a="";const g=r.isNegative&&!t.isNegative,p=!r.isNegative&&t.isNegative;if(g||p){let _=!1;const n=r.isNegative,o=t.isNegative;r.isNegative=!1,t.isNegative=!1;const h=M.max(r,t),c=h===r?t:r;r.isNegative=n,t.isNegative=o;let S="",N="",y="";for(let l=e>0?0:1;l<2;l++){let d=l===0?h.fractionalPart:h.integerPart,m=l===0?c.fractionalPart:c.integerPart;l===1&&d.length>m.length&&(m="0".repeat(d.length-m.length)+m);for(let E=d.length-1;E>=0;E--){S=d.charAt(E),N=m.charAt(E);const B=parseInt(S),O=parseInt(N)+(_?1:0);B>=O?(y=(B-O).toString(),_=!1):(y=(10-(O-B)).toString(),_=!0),l===0?a=y+a:s=y+s}l===0&&(r.fractionalPart=a)}r.integerPart=s==="0"?"0":s.replace(/^0+/,""),r.isNegative=h.isNegative}else{let _=r.integerPart,n=t.integerPart;const o=Math.max(_.length,n.length);_=_.split("").reverse().join(""),n=n.split("").reverse().join("");let h=!1;if(e>0){const c=r.fractionalPart,S=t.fractionalPart;for(let N=e-1;N>=0;N--){const y=M.addDigits(c.charAt(N),S.charAt(N),h);h=y[1],a=y[0]+a}r.fractionalPart=a}for(let c=0;c<o;c++){const S=M.addDigits(c<_.length?_.charAt(c):"0",c<n.length?n.charAt(c):"0",h);h=S[1],s=S[0]+s}h&&(s="1"+s),r.integerPart=s}return r}static subtract(r,t){const e=t.isNegative;t.isNegative=!e;try{this.add(r,t)}catch(s){throw t.isNegative=e,s}return t.isNegative=e,r}}exports.DisplayOrder=void 0,function(i){i[i.SIGN_SYMBOL_NAME_NUMBER=0]="SIGN_SYMBOL_NAME_NUMBER",i[i.SIGN_NAME_SYMBOL_NUMBER=1]="SIGN_NAME_SYMBOL_NUMBER",i[i.SIGN_SYMBOL_NUMBER_NAME=2]="SIGN_SYMBOL_NUMBER_NAME",i[i.SIGN_NAME_NUMBER_SYMBOL=3]="SIGN_NAME_NUMBER_SYMBOL",i[i.SIGN_NUMBER_SYMBOL_NAME=4]="SIGN_NUMBER_SYMBOL_NAME",i[i.SIGN_NUMBER_NAME_SYMBOL=5]="SIGN_NUMBER_NAME_SYMBOL",i[i.SYMBOL_SIGN_NAME_NUMBER=6]="SYMBOL_SIGN_NAME_NUMBER",i[i.SYMBOL_NAME_SIGN_NUMBER=7]="SYMBOL_NAME_SIGN_NUMBER",i[i.SYMBOL_SIGN_NUMBER_NAME=8]="SYMBOL_SIGN_NUMBER_NAME",i[i.SYMBOL_NAME_NUMBER_SIGN=9]="SYMBOL_NAME_NUMBER_SIGN",i[i.SYMBOL_NUMBER_SIGN_NAME=10]="SYMBOL_NUMBER_SIGN_NAME",i[i.SYMBOL_NUMBER_NAME_SIGN=11]="SYMBOL_NUMBER_NAME_SIGN",i[i.NAME_SIGN_SYMBOL_NUMBER=12]="NAME_SIGN_SYMBOL_NUMBER",i[i.NAME_SYMBOL_SIGN_NUMBER=13]="NAME_SYMBOL_SIGN_NUMBER",i[i.NAME_SIGN_NUMBER_SYMBOL=14]="NAME_SIGN_NUMBER_SYMBOL",i[i.NAME_SYMBOL_NUMBER_SIGN=15]="NAME_SYMBOL_NUMBER_SIGN",i[i.NAME_NUMBER_SIGN_SYMBOL=16]="NAME_NUMBER_SIGN_SYMBOL",i[i.NAME_NUMBER_SYMBOL_SIGN=17]="NAME_NUMBER_SYMBOL_SIGN",i[i.NUMBER_NAME_SYMBOL_SIGN=18]="NUMBER_NAME_SYMBOL_SIGN",i[i.NUMBER_NAME_SIGN_SYMBOL=19]="NUMBER_NAME_SIGN_SYMBOL",i[i.NUMBER_SIGN_NAME_SYMBOL=20]="NUMBER_SIGN_NAME_SYMBOL",i[i.NUMBER_SIGN_SYMBOL_NAME=21]="NUMBER_SIGN_SYMBOL_NAME",i[i.NUMBER_SYMBOL_NAME_SIGN=22]="NUMBER_SYMBOL_NAME_SIGN",i[i.NUMBER_SYMBOL_SIGN_NAME=23]="NUMBER_SYMBOL_SIGN_NAME"}(exports.DisplayOrder||(exports.DisplayOrder={})),exports.MyriadMode=void 0,function(i){i[i.JAPANESE=0]="JAPANESE",i[i.CHINESE=1]="CHINESE"}(exports.MyriadMode||(exports.MyriadMode={}));class b{_currencySymbol="$";_symbolSeparator="";_currencyName="";_nameSeparator=" ";_positiveSign="";_negativeSign="-";_signSeparator="";_displayOrder=exports.DisplayOrder.SIGN_SYMBOL_NUMBER_NAME;_digitCharacters=["0","1","2","3","4","5","6","7","8","9"];_myriadMode=exports.MyriadMode.JAPANESE;_myriadCharacters=["\u5341","\u767E","\u5343","\u4E07","\u5104","\u5146","\u4EAC","\u5793","\u{25771}","\u7A63","\u6E9D","\u6F97","\u6B63","\u8F09"];_decimalSeparator=".";_groupSeparator=",";_groupSize=3;constructor(r){typeof r.currencySymbol=="string"&&(this.currencySymbol=r.currencySymbol),typeof r.symbolSeparator=="string"&&(this.symbolSeparator=r.symbolSeparator),typeof r.currencyName=="string"&&(this.currencyName=r.currencyName),typeof r.nameSeparator=="string"&&(this.nameSeparator=r.nameSeparator),typeof r.positiveSign=="string"&&(this.positiveSign=r.positiveSign),typeof r.negativeSign=="string"&&(this.negativeSign=r.negativeSign),typeof r.signSeparator=="string"&&(this.signSeparator=r.signSeparator),typeof r.displayOrder<"u"&&typeof r.displayOrder==typeof exports.DisplayOrder.SIGN_NUMBER_SYMBOL_NAME&&(this.displayOrder=r.displayOrder),typeof r.myriadMode<"u"&&typeof r.myriadMode==typeof exports.MyriadMode.JAPANESE&&(this.myriadMode=r.myriadMode),typeof r.digitCharacters=="object"&&(this.digitCharacters=r.digitCharacters),typeof r.myriadCharacters=="object"&&(this.myriadCharacters=r.myriadCharacters),typeof r.groupSeparator=="string"&&(this.groupSeparator=r.groupSeparator),typeof r.decimalSeparator=="string"&&(this.decimalSeparator=r.decimalSeparator),typeof r.groupSize=="number"&&(this.groupSize=r.groupSize)}handleJapaneseMyriad(r){let t=0,e="",s=!1;for(let a=0;a<r.length;a++)switch(t=parseInt(r.charAt(a)),s=r.length>a+1&&r.charAt(a+1)!=="0"||r.length>a+2&&r.charAt(a+2)!=="0"||r.length>a+3&&r.charAt(a+3)!=="0",a){case 0:t!==0&&(e=this._digitCharacters[t]+e);break;case 1:case 2:case 3:t!==0&&(t===1?e=this._myriadCharacters[a-1]+e:e=this._digitCharacters[t]+this._myriadCharacters[a-1]+e);break;case 4:t!==0?e=this._digitCharacters[t]+this._myriadCharacters[a-1]+e:s&&(e=this._myriadCharacters[Math.trunc(a/4)+2]+e);break;default:a%4===0?t!==0?e=this._digitCharacters[t]+this._myriadCharacters[Math.trunc(a/4)+2]+e:s&&(e=this._myriadCharacters[Math.trunc(a/4)+2]+e):a%4===1&&t!==0?t===1?e=this._myriadCharacters[0]+e:e=this._digitCharacters[t]+this._myriadCharacters[0]+e:a%4===2&&t!==0?t===1?e=this._myriadCharacters[1]+e:e=this._digitCharacters[t]+this._myriadCharacters[1]+e:a%4===3&&t!==0&&(e=this._digitCharacters[t]+this._myriadCharacters[2]+e);break}return e}replaceDigits(r){return r=r.replace(/[0]/g,this._digitCharacters[0]),r=r.replace(/[1]/g,this._digitCharacters[1]),r=r.replace(/[2]/g,this._digitCharacters[2]),r=r.replace(/[3]/g,this._digitCharacters[3]),r=r.replace(/[4]/g,this._digitCharacters[4]),r=r.replace(/[5]/g,this._digitCharacters[5]),r=r.replace(/[6]/g,this._digitCharacters[6]),r=r.replace(/[7]/g,this._digitCharacters[7]),r=r.replace(/[8]/g,this._digitCharacters[8]),r=r.replace(/[9]/g,this._digitCharacters[9]),r}prefix(r){let t="";const e=r?this._negativeSign:this._positiveSign;switch(this._displayOrder){case exports.DisplayOrder.NAME_NUMBER_SIGN_SYMBOL:case exports.DisplayOrder.NAME_NUMBER_SYMBOL_SIGN:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case exports.DisplayOrder.NAME_SIGN_NUMBER_SYMBOL:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator);break;case exports.DisplayOrder.NAME_SIGN_SYMBOL_NUMBER:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case exports.DisplayOrder.NAME_SYMBOL_NUMBER_SIGN:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case exports.DisplayOrder.NAME_SYMBOL_SIGN_NUMBER:this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator);break;case exports.DisplayOrder.SIGN_NAME_NUMBER_SYMBOL:e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case exports.DisplayOrder.SIGN_NAME_SYMBOL_NUMBER:e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case exports.DisplayOrder.SIGN_NUMBER_NAME_SYMBOL:case exports.DisplayOrder.SIGN_NUMBER_SYMBOL_NAME:e!==""&&(t+=e+this._signSeparator);break;case exports.DisplayOrder.SIGN_SYMBOL_NAME_NUMBER:e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case exports.DisplayOrder.SIGN_SYMBOL_NUMBER_NAME:e!==""&&(t+=e+this._signSeparator),this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case exports.DisplayOrder.SYMBOL_NAME_NUMBER_SIGN:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case exports.DisplayOrder.SYMBOL_NAME_SIGN_NUMBER:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator),e!==""&&(t+=e+this._signSeparator);break;case exports.DisplayOrder.SYMBOL_NUMBER_NAME_SIGN:case exports.DisplayOrder.SYMBOL_NUMBER_SIGN_NAME:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator);break;case exports.DisplayOrder.SYMBOL_SIGN_NAME_NUMBER:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator),this._currencyName!==""&&(t+=this._currencyName+this._nameSeparator);break;case exports.DisplayOrder.SYMBOL_SIGN_NUMBER_NAME:this._currencySymbol!==""&&(t+=this._currencySymbol+this._symbolSeparator),e!==""&&(t+=e+this._signSeparator);break}return t}suffix(r){let t="";const e=r?this._negativeSign:this._positiveSign;switch(this._displayOrder){case exports.DisplayOrder.NAME_NUMBER_SIGN_SYMBOL:e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.NAME_NUMBER_SYMBOL_SIGN:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.NAME_SIGN_NUMBER_SYMBOL:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.NAME_SYMBOL_NUMBER_SIGN:e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.NUMBER_NAME_SIGN_SYMBOL:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.NUMBER_NAME_SYMBOL_SIGN:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.NUMBER_SIGN_NAME_SYMBOL:e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.NUMBER_SIGN_SYMBOL_NAME:e!==""&&(t+=this._signSeparator+e),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case exports.DisplayOrder.NUMBER_SYMBOL_NAME_SIGN:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.NUMBER_SYMBOL_SIGN_NAME:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case exports.DisplayOrder.SIGN_NAME_NUMBER_SYMBOL:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.SIGN_NUMBER_NAME_SYMBOL:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol);break;case exports.DisplayOrder.SIGN_NUMBER_SYMBOL_NAME:this._currencySymbol!==""&&(t+=this._symbolSeparator+this._currencySymbol),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case exports.DisplayOrder.SIGN_SYMBOL_NUMBER_NAME:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case exports.DisplayOrder.SYMBOL_NAME_NUMBER_SIGN:e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.SYMBOL_NUMBER_NAME_SIGN:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName),e!==""&&(t+=this._signSeparator+e);break;case exports.DisplayOrder.SYMBOL_NUMBER_SIGN_NAME:e!==""&&(t+=this._signSeparator+e),this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break;case exports.DisplayOrder.SYMBOL_SIGN_NUMBER_NAME:this._currencyName!==""&&(t+=this._nameSeparator+this._currencyName);break}return t}formatMyriad(r){if(r.floatingPointPrecision!==0)throw new Error("Only values without decimals are supported for conversion to myriad system.");let t=r.integerPart;if(this._myriadCharacters.length<=4&&t.length!==1&&this._myriadCharacters.length<t.length-1||this._myriadCharacters.length>4&&this._myriadCharacters.length<3+Math.trunc((t.length-1)/4))throw new Error("Not enough characters defined to print myriad string. Use setMyriadCharacters to define more characters.");let e=this.prefix(r.isNegative);if(t.length===1)e+=this._digitCharacters[parseInt(t)];else if(t=t.split("").reverse().join(""),this._myriadMode===exports.MyriadMode.JAPANESE)e+=this.handleJapaneseMyriad(t);else throw new Error("Provided myriad mode not supported.");return e+=this.suffix(r.isNegative),e}format(r){let t=this.prefix(r.isNegative),e=this.replaceDigits(r.integerPart);if(this._groupSize>0&&e.length>this._groupSize&&this._groupSeparator!==""){let s=0;for(let a=Math.trunc((e.length-1)/this._groupSize);a>0;a--)s=e.length-this._groupSize*a,e=e.slice(0,s)+this._groupSeparator+e.slice(s)}return t+=e,r.floatingPointPrecision>0&&(t+=this._decimalSeparator,t+=this.replaceDigits(r.fractionalPart)),t+=this.suffix(r.isNegative),t}set digitCharacters(r){if(r.length!==10)throw new Error("10 digits need to passed as a string array.");for(let t=0;t<r.length;t++)this._digitCharacters[t]=r[t]}set myriadCharacters(r){this._myriadCharacters=r.slice(0)}set symbolSeparator(r){this._symbolSeparator=r}set myriadMode(r){this._myriadMode=r}set currencySymbol(r){this._currencySymbol=r}set positiveSign(r){this._positiveSign=r}set negativeSign(r){this._negativeSign=r}set decimalSeparator(r){this._decimalSeparator=r}set groupSize(r){if(!Number.isInteger(r)||r<0)throw new Error("Size should be a positive integer.");this._groupSize=r}set groupSeparator(r){this._groupSeparator=r}set displayOrder(r){this._displayOrder=r}set signSeparator(r){this._signSeparator=r}set currencyName(r){this._currencyName=r}set nameSeparator(r){this._nameSeparator=r}get currencySymbol(){return this._currencySymbol}get symbolSeparator(){return this._symbolSeparator}get positiveSign(){return this._positiveSign}get negativeSign(){return this._negativeSign}get digitCharacters(){return this._digitCharacters.slice(0)}get myriadMode(){return this._myriadMode}get myriadCharacters(){return this._myriadCharacters.slice(0)}get decimalSeparator(){return this._decimalSeparator}get groupSeparator(){return this._groupSeparator}get groupSize(){return this._groupSize}get displayOrder(){return this._displayOrder}get signSeparator(){return this._signSeparator}get currencyName(){return this._currencyName}get nameSeparator(){return this._nameSeparator}}exports.Money=u,exports.MoneyCalculator=M,exports.MoneyFormatter=b; | ||
//# sourceMappingURL=index.js.map |
import { Money } from "./money"; | ||
export declare enum displayOrder { | ||
export declare enum DisplayOrder { | ||
SIGN_SYMBOL_NAME_NUMBER = 0, | ||
@@ -28,6 +28,22 @@ SIGN_NAME_SYMBOL_NUMBER = 1, | ||
} | ||
export declare enum myriadMode { | ||
export declare enum MyriadMode { | ||
JAPANESE = 0, | ||
CHINESE = 1 | ||
} | ||
export type FormatterInitializer = { | ||
currencySymbol?: string; | ||
symbolSeparator?: string; | ||
currencyName?: string; | ||
nameSeparator?: string; | ||
positiveSign?: string; | ||
negativeSign?: string; | ||
signSeparator?: string; | ||
displayOrder?: DisplayOrder; | ||
digitCharacters?: string[]; | ||
myriadMode?: MyriadMode; | ||
myriadCharacters?: string[]; | ||
decimalSeparator?: string; | ||
groupSeparator?: string; | ||
groupSize?: number; | ||
}; | ||
export declare class MoneyFormatter { | ||
@@ -48,18 +64,3 @@ private _currencySymbol; | ||
private _groupSize; | ||
constructor(initializer: { | ||
currencySymbol?: string; | ||
symbolSeparator?: string; | ||
currencyName?: string; | ||
nameSeparator?: string; | ||
positiveSign?: string; | ||
negativeSign?: string; | ||
signSeparator?: string; | ||
displayOrder?: displayOrder; | ||
digitCharacters?: string[]; | ||
myriadMode?: myriadMode; | ||
myriadCharacters?: string[]; | ||
decimalSeparator?: string; | ||
groupSeparator?: string; | ||
groupSize?: number; | ||
}); | ||
constructor(initializer: FormatterInitializer); | ||
/** | ||
@@ -131,3 +132,3 @@ * | ||
*/ | ||
set myriadMode(myriadMode: myriadMode); | ||
set myriadMode(myriadMode: MyriadMode); | ||
/** | ||
@@ -171,3 +172,3 @@ * @param symbol The currency symbol to use. | ||
*/ | ||
set displayOrder(order: displayOrder); | ||
set displayOrder(order: DisplayOrder); | ||
/** | ||
@@ -185,3 +186,3 @@ * @param symbol The symbol to display between the sign (pos/neg) and the number or currency symbol depending on display mode. | ||
get digitCharacters(): string[]; | ||
get myriadMode(): myriadMode; | ||
get myriadMode(): MyriadMode; | ||
get myriadCharacters(): string[]; | ||
@@ -191,3 +192,3 @@ get decimalSeparator(): string; | ||
get groupSize(): number; | ||
get displayOrder(): displayOrder; | ||
get displayOrder(): DisplayOrder; | ||
get signSeparator(): string; | ||
@@ -194,0 +195,0 @@ get currencyName(): string; |
{ | ||
"name": "moneydew", | ||
"version": "0.4.0", | ||
"version": "1.0.0", | ||
"description": "This is a library for formatting currencies designed for frontend applications. Also has arithmetic capabilities. Arithmetic implementation is slow and not designed for large-scale backend applications.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
62617
417
0
0