Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bloks/numbers

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bloks/numbers - npm Package Compare versions

Comparing version 25.0.5 to 25.0.6

3

dist/numbers.cjs.development.js

@@ -515,3 +515,4 @@ 'use strict';

trimMantissa: trimMantissa,
average: average
average: average,
lowPrecision: false
});

@@ -518,0 +519,0 @@ return "" + symbol + formattedNumber;

@@ -1,2 +0,2 @@

"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("bignumber.js"),o=t(require("@jafri/numbro")),r=t(require("dayjs")),e=t(require("dayjs/plugin/relativeTime")),i=t(require("dayjs/plugin/utc")),s=t(require("dayjs/plugin/timezone")),u=t(require("dayjs/plugin/advancedFormat"));function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var o=0,r=new Array(n);o<n;o++)r[o]=t[o];return r}function c(t,n){var o;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(o=function(t,n){if(t){if("string"==typeof t)return a(t,void 0);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?a(t,void 0):void 0}}(t))||n&&t&&"number"==typeof t.length){o&&(t=o);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(o=t[Symbol.iterator]()).next.bind(o)}n.BigNumber.set({ROUNDING_MODE:1});var m,p,f=n.BigNumber,d=function(t,n){if(!t)throw new Error(n)};(m=(p=exports.Maths||(exports.Maths={})).Operations||(p.Operations={})).PLUS="plus",m.MULTIPLY="multipliedBy",m.DIVIDE="dividedBy",m.MINUS="minus";var l=function(){function t(t){this.symbol=new h({code:t.code,precision:t.precision}),this.amount=new f(t.amount)}t.fromString=function(n){var o=n.split(" "),r=o[0];return new t({code:o[1],precision:(r.split(".")[1]||[]).length,amount:new f(r)})},t.fromSymbol=function(n){var o=n.symbol,r=n.amount;if(!(o instanceof h))throw new Error("Invalid symbol");return new t({code:o.code,precision:o.precision,amount:r})};var n,o=t.prototype;return o.isEqualTo=function(t){return this.isLooselyEqualTo(t)&&this.amount==t.amount},o.isLooselyEqualTo=function(t){return this.symbol.isEqualTo(t.symbol)},o.toString=function(){return new f(this.amount).toFixed(this.symbol.precision,f.ROUND_DOWN)+" "+this.symbol.code},o.modifyAmount=function(n,o){var r=new f(0);return("number"==typeof n||f.isBigNumber(n))&&(r=new f(n)),n instanceof t&&(d(this.isLooselyEqualTo(n),"invalid symbol"),r=new f(n.amount)),t.fromSymbol({symbol:this.symbol,amount:this.amount[o](r)})},o.plus=function(t){return this.modifyAmount(t,exports.Maths.Operations.PLUS)},o.minus=function(t){return this.modifyAmount(t,exports.Maths.Operations.MINUS)},o.multipliedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.MULTIPLY)},o.dividedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.DIVIDE)},(n=[{key:"integerAmount",get:function(){var t=Math.pow(10,this.symbol.precision);return this.amount.multipliedBy(t)}}])&&function(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,n),t}(),y=function(){function t(t){if(!(t.quantity instanceof l))throw new Error("Invalid quantity");this.quantity=t.quantity,this.contract=t.contract}var n=t.prototype;return n.isEqualTo=function(t){return this.contract===t.contract&&this.quantity.isEqualTo(t.quantity)},n.isLooselyEqualTo=function(t){return this.contract===t.contract&&this.quantity.isLooselyEqualTo(t.quantity)},n.toString=function(){return this.quantity.toString()+"@"+this.contract},n.modifyAmount=function(n,o){var r=new f(0);return n instanceof t?(d(this.isLooselyEqualTo(n),"invalid contract or symbol"),r=n.quantity):r=n,new t({contract:this.contract,quantity:this.quantity.modifyAmount(r,o)})},n.plus=function(t){return this.modifyAmount(t,exports.Maths.Operations.PLUS)},n.minus=function(t){return this.modifyAmount(t,exports.Maths.Operations.MINUS)},n.multipliedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.MULTIPLY)},n.dividedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.DIVIDE)},t}(),h=function(){function t(t){this.precision=t.precision,this.code=t.code}t.fromString=function(n){var o=n.split(",");return new t({precision:+o[0],code:o[1]})};var n=t.prototype;return n.isEqualTo=function(t){return this.code===t.code&&this.precision===t.precision},n.toString=function(){return this.precision+","+this.code},t}(),x=function(){function t(t,n){this.sym=t,this.contract=n}var n=t.prototype;return n.isEqualTo=function(t){return this.sym.isEqualTo(t.sym)&&this.contract===t.contract},n.toString=function(){return this.sym.toString()+"@"+this.contract},t}(),v={GBP:{symbol:"£",precision:2},EUR:{symbol:"€",precision:2},JPY:{symbol:"¥",precision:0},CAD:{symbol:"CA$",precision:2},USD:{symbol:"$",precision:2},INR:{symbol:"₹",precision:2},CNY:{symbol:"CN¥",precision:2},HKD:{symbol:"HK$",precision:2},KRW:{symbol:"₩",precision:0},AUD:{symbol:"AUD$",precision:2},SAR:{symbol:"SR",precision:2},ETH:{symbol:"Ξ",precision:4},BTC:{symbol:"₿",precision:8},EOS:{symbol:"EOS",precision:4}},b={decimalSeparator:".",groupSeparator:",",groupSize:3};function M(t,n,o){return void 0===o&&(o=f.ROUND_DOWN),new f(t).toFixed(n,o)}function D(t,n,o){return void 0===o&&(o=f.ROUND_DOWN),new f(t).toFormat(n,o,b)}function S(t){var n=t.split(" "),o=n[0],r=n[1],e=(o.split(".")[1]||[]).length;return{amount:+o,symbol:{code:r,precision:e}}}function A(t,n){return void 0===n&&(n=!1),o(t).format({thousandSeparated:!0,trimMantissa:n})}function w(t,n,r){return void 0===r&&(r=!1),o(t).format({thousandSeparated:!0,mantissa:n,trimMantissa:r})}function T(t,n,r,e){return void 0===e&&(e=!1),o(t).format({thousandSeparated:!0,mantissa:r,trimMantissa:e})+" "+n}function g(t){return r(t)}function N(t){return r(t).utc()}function Y(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),r(t).format(n)}function q(t){return new Date(t)}function E(t){return t="Z"===t.slice(-1)?t:t+"Z",new Date(t)}function O(t,n){return void 0===n&&(n=3),r(t).clone().subtract(n,"days")}function B(t,n){return void 0===n&&(n=3),r(t).clone().add(n,"days")}r.extend(e),r.extend(i),r.extend(s),r.extend(u),exports.Asset=l,exports.BN=f,exports.ExtendedAsset=y,exports.ExtendedSymbol=x,exports.Symbol=h,exports.add=function(){for(var t=new f(0),n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];if(o.length)for(var e,i=c(o);!(e=i()).done;){var s=e.value;t=t.plus(s)}return t},exports.bytesToKB=function(t){return void 0===t&&(t=0),o(t/1024).format({thousandSeparated:!1,mantissa:2})},exports.calculatePercentage=function(t,n,o){return M(new f(t).multipliedBy(n),o,f.ROUND_DOWN)},exports.currencyToSymbol=function(t){return v[t]},exports.dateToUtcTimePoint=function(t){return void 0===t&&(t=g()),r(t).utc().format("YYYY-MM-DDTHH:mm:ss.SSS")},exports.displayAsset=function(t){var n=S(t),o=n.symbol.code;return A(n.amount)+" "+o},exports.displayNumber=A,exports.displayNumberAsAmount=w,exports.displayNumberAsAsset=T,exports.displayNumberAsCurrency=function(t){var n=t.number,r=t.precision,e=t.average,i=void 0!==e&&e,s=t.trimMantissa,u=void 0!==s&&s,a=t.currency,c=void 0===a?"USD":a;if(!v[c])throw new Error("Unsupported currency");var m=v[c],p=m.precision;return""+m.symbol+o(n).format({thousandSeparated:!0,mantissa:void 0!==r?r:p,trimMantissa:u,average:i})},exports.displayRawNumberAsAsset=function(t,n,o,r){return void 0===r&&(r=!1),T(t/Math.pow(10,o),n,o,r)},exports.divide=function(t,n){return new f(t).dividedBy(n)},exports.emptyTimePoint="1970-01-01T00:00:00.000",exports.endDate=B,exports.eosDisplayFormatting=function(t,n,o){return D(t,o)+" "+n},exports.formatDate=Y,exports.formatDateLocal=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),r(t).utc().format(n)},exports.formatEndDate=function(t){return B(t).format("MMM-DD-YYYY, hh:mm:ss A")},exports.formatStartDate=function(t){return O(t).format("MMM-DD-YYYY, hh:mm:ss A")},exports.inFuture=function(t,n){return void 0===n&&(n=!1),n?N(t).isAfter(N()):g(t).isAfter(g())},exports.inPast=function(t,n){return void 0===n&&(n=!1),n?N(t).isBefore(N()):g(t).isBefore(g())},exports.isSameDay=function(t,n){return void 0===n&&(n=g()),r(t).isSame(r(n),"day")},exports.millisecondsFrom=function(t,n){return void 0===n&&(n=g()),r(t).diff(r(n))},exports.multiply=function(t,n){return new f(t).multipliedBy(n)},exports.numberToAmount=M,exports.numberToAmountFormatted=D,exports.numberToAsset=function(t,n,r,e){return void 0===e&&(e=!1),o(t).format({thousandSeparated:!1,mantissa:r,trimMantissa:e})+" "+n},exports.numberToEos=function(t,n,o){return M(t,o)+" "+n},exports.numberToEosRoundUp=function(t,n,o){return M(t,o,f.ROUND_UP)+" "+n},exports.parseCpu=function(t){var n=0,o="";return t<1e3?(n=t,o="µs"):t<1e6?(n=t/1e3,o="ms"):t<6e7?(n=t/1e6,o="s"):t<36e8?(n=t/6e7,o="min"):t<36e11?(n=t/36e8,o="hours"):(n=t/864e8,o="days"),w(n,2,!0)+" "+o},exports.parseNetAndRam=function(t){var n=0,o="";return t<1024?(n=t,o="Bytes"):t<1048576?(n=t/1024,o="KB"):t<1073741824?(n=t/1048576,o="MB"):t<1099511627776?(n=t/1073741824,o="GB"):t<0x4000000000000&&(n=t/1099511627776,o="TB"),w(n,2,!0)+" "+o},exports.parseRex=function(t){return new f(t).dividedBy(1e4)},exports.parseSeconds=function(t){var n=0,o=0,r=0,e="";return t>86400&&(t-=86400*(n+=Math.floor(t/86400)),e+=n.toFixed(0)+" "+(1===n?"Day":"Days")+" "),t>3600&&(t-=3600*(o+=Math.floor(t/3600)),e+=o.toFixed(0)+" "+(1===o?"Hour":"Hours")+" "),t>60&&(t-=60*(r+=Math.floor(t/60)),e+=r.toFixed(0)+" "+(1===r?"Minute":"Minutes")+" "),t>0&&(e+=t.toFixed(0)+" Seconds "),e},exports.parseTimestamp=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),Y(q(t),n)},exports.parseUtcTimestamp=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),Y(E(t),n)},exports.secondsFrom=function(t,n){return void 0===n&&(n=g()),r(t).diff(r(n),"second")},exports.split=S,exports.startDate=O,exports.substract=function(t,n){return new f(t).minus(n)},exports.time=g,exports.timestampFromNow=function(t){return g(t).fromNow()},exports.timestampToDate=q,exports.toBN=function(t){return new f(t)},exports.toNumbro=function(t){return o(t)},exports.unixTime=function(t){return r.unix(t)},exports.utcTime=N,exports.utcTimeToLocal=function(t){return r(t).local()},exports.utcTimestampFromNow=function(t){return g(t="Z"===t.slice(-1)?t:t+"Z").fromNow()},exports.utcTimestampToDate=E;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("bignumber.js"),o=t(require("@jafri/numbro")),r=t(require("dayjs")),e=t(require("dayjs/plugin/relativeTime")),i=t(require("dayjs/plugin/utc")),s=t(require("dayjs/plugin/timezone")),u=t(require("dayjs/plugin/advancedFormat"));function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var o=0,r=new Array(n);o<n;o++)r[o]=t[o];return r}function c(t,n){var o;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(o=function(t,n){if(t){if("string"==typeof t)return a(t,void 0);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?a(t,void 0):void 0}}(t))||n&&t&&"number"==typeof t.length){o&&(t=o);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(o=t[Symbol.iterator]()).next.bind(o)}n.BigNumber.set({ROUNDING_MODE:1});var m,p,f=n.BigNumber,d=function(t,n){if(!t)throw new Error(n)};(m=(p=exports.Maths||(exports.Maths={})).Operations||(p.Operations={})).PLUS="plus",m.MULTIPLY="multipliedBy",m.DIVIDE="dividedBy",m.MINUS="minus";var l=function(){function t(t){this.symbol=new h({code:t.code,precision:t.precision}),this.amount=new f(t.amount)}t.fromString=function(n){var o=n.split(" "),r=o[0];return new t({code:o[1],precision:(r.split(".")[1]||[]).length,amount:new f(r)})},t.fromSymbol=function(n){var o=n.symbol,r=n.amount;if(!(o instanceof h))throw new Error("Invalid symbol");return new t({code:o.code,precision:o.precision,amount:r})};var n,o=t.prototype;return o.isEqualTo=function(t){return this.isLooselyEqualTo(t)&&this.amount==t.amount},o.isLooselyEqualTo=function(t){return this.symbol.isEqualTo(t.symbol)},o.toString=function(){return new f(this.amount).toFixed(this.symbol.precision,f.ROUND_DOWN)+" "+this.symbol.code},o.modifyAmount=function(n,o){var r=new f(0);return("number"==typeof n||f.isBigNumber(n))&&(r=new f(n)),n instanceof t&&(d(this.isLooselyEqualTo(n),"invalid symbol"),r=new f(n.amount)),t.fromSymbol({symbol:this.symbol,amount:this.amount[o](r)})},o.plus=function(t){return this.modifyAmount(t,exports.Maths.Operations.PLUS)},o.minus=function(t){return this.modifyAmount(t,exports.Maths.Operations.MINUS)},o.multipliedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.MULTIPLY)},o.dividedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.DIVIDE)},(n=[{key:"integerAmount",get:function(){var t=Math.pow(10,this.symbol.precision);return this.amount.multipliedBy(t)}}])&&function(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,n),t}(),y=function(){function t(t){if(!(t.quantity instanceof l))throw new Error("Invalid quantity");this.quantity=t.quantity,this.contract=t.contract}var n=t.prototype;return n.isEqualTo=function(t){return this.contract===t.contract&&this.quantity.isEqualTo(t.quantity)},n.isLooselyEqualTo=function(t){return this.contract===t.contract&&this.quantity.isLooselyEqualTo(t.quantity)},n.toString=function(){return this.quantity.toString()+"@"+this.contract},n.modifyAmount=function(n,o){var r=new f(0);return n instanceof t?(d(this.isLooselyEqualTo(n),"invalid contract or symbol"),r=n.quantity):r=n,new t({contract:this.contract,quantity:this.quantity.modifyAmount(r,o)})},n.plus=function(t){return this.modifyAmount(t,exports.Maths.Operations.PLUS)},n.minus=function(t){return this.modifyAmount(t,exports.Maths.Operations.MINUS)},n.multipliedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.MULTIPLY)},n.dividedBy=function(t){return this.modifyAmount(t,exports.Maths.Operations.DIVIDE)},t}(),h=function(){function t(t){this.precision=t.precision,this.code=t.code}t.fromString=function(n){var o=n.split(",");return new t({precision:+o[0],code:o[1]})};var n=t.prototype;return n.isEqualTo=function(t){return this.code===t.code&&this.precision===t.precision},n.toString=function(){return this.precision+","+this.code},t}(),x=function(){function t(t,n){this.sym=t,this.contract=n}var n=t.prototype;return n.isEqualTo=function(t){return this.sym.isEqualTo(t.sym)&&this.contract===t.contract},n.toString=function(){return this.sym.toString()+"@"+this.contract},t}(),v={GBP:{symbol:"£",precision:2},EUR:{symbol:"€",precision:2},JPY:{symbol:"¥",precision:0},CAD:{symbol:"CA$",precision:2},USD:{symbol:"$",precision:2},INR:{symbol:"₹",precision:2},CNY:{symbol:"CN¥",precision:2},HKD:{symbol:"HK$",precision:2},KRW:{symbol:"₩",precision:0},AUD:{symbol:"AUD$",precision:2},SAR:{symbol:"SR",precision:2},ETH:{symbol:"Ξ",precision:4},BTC:{symbol:"₿",precision:8},EOS:{symbol:"EOS",precision:4}},b={decimalSeparator:".",groupSeparator:",",groupSize:3};function M(t,n,o){return void 0===o&&(o=f.ROUND_DOWN),new f(t).toFixed(n,o)}function D(t,n,o){return void 0===o&&(o=f.ROUND_DOWN),new f(t).toFormat(n,o,b)}function S(t){var n=t.split(" "),o=n[0],r=n[1],e=(o.split(".")[1]||[]).length;return{amount:+o,symbol:{code:r,precision:e}}}function A(t,n){return void 0===n&&(n=!1),o(t).format({thousandSeparated:!0,trimMantissa:n})}function w(t,n,r){return void 0===r&&(r=!1),o(t).format({thousandSeparated:!0,mantissa:n,trimMantissa:r})}function T(t,n,r,e){return void 0===e&&(e=!1),o(t).format({thousandSeparated:!0,mantissa:r,trimMantissa:e})+" "+n}function g(t){return r(t)}function N(t){return r(t).utc()}function Y(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),r(t).format(n)}function q(t){return new Date(t)}function E(t){return t="Z"===t.slice(-1)?t:t+"Z",new Date(t)}function O(t,n){return void 0===n&&(n=3),r(t).clone().subtract(n,"days")}function B(t,n){return void 0===n&&(n=3),r(t).clone().add(n,"days")}r.extend(e),r.extend(i),r.extend(s),r.extend(u),exports.Asset=l,exports.BN=f,exports.ExtendedAsset=y,exports.ExtendedSymbol=x,exports.Symbol=h,exports.add=function(){for(var t=new f(0),n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];if(o.length)for(var e,i=c(o);!(e=i()).done;){var s=e.value;t=t.plus(s)}return t},exports.bytesToKB=function(t){return void 0===t&&(t=0),o(t/1024).format({thousandSeparated:!1,mantissa:2})},exports.calculatePercentage=function(t,n,o){return M(new f(t).multipliedBy(n),o,f.ROUND_DOWN)},exports.currencyToSymbol=function(t){return v[t]},exports.dateToUtcTimePoint=function(t){return void 0===t&&(t=g()),r(t).utc().format("YYYY-MM-DDTHH:mm:ss.SSS")},exports.displayAsset=function(t){var n=S(t),o=n.symbol.code;return A(n.amount)+" "+o},exports.displayNumber=A,exports.displayNumberAsAmount=w,exports.displayNumberAsAsset=T,exports.displayNumberAsCurrency=function(t){var n=t.number,r=t.precision,e=t.average,i=void 0!==e&&e,s=t.trimMantissa,u=void 0!==s&&s,a=t.currency,c=void 0===a?"USD":a;if(!v[c])throw new Error("Unsupported currency");var m=v[c],p=m.precision;return""+m.symbol+o(n).format({thousandSeparated:!0,mantissa:void 0!==r?r:p,trimMantissa:u,average:i,lowPrecision:!1})},exports.displayRawNumberAsAsset=function(t,n,o,r){return void 0===r&&(r=!1),T(t/Math.pow(10,o),n,o,r)},exports.divide=function(t,n){return new f(t).dividedBy(n)},exports.emptyTimePoint="1970-01-01T00:00:00.000",exports.endDate=B,exports.eosDisplayFormatting=function(t,n,o){return D(t,o)+" "+n},exports.formatDate=Y,exports.formatDateLocal=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),r(t).utc().format(n)},exports.formatEndDate=function(t){return B(t).format("MMM-DD-YYYY, hh:mm:ss A")},exports.formatStartDate=function(t){return O(t).format("MMM-DD-YYYY, hh:mm:ss A")},exports.inFuture=function(t,n){return void 0===n&&(n=!1),n?N(t).isAfter(N()):g(t).isAfter(g())},exports.inPast=function(t,n){return void 0===n&&(n=!1),n?N(t).isBefore(N()):g(t).isBefore(g())},exports.isSameDay=function(t,n){return void 0===n&&(n=g()),r(t).isSame(r(n),"day")},exports.millisecondsFrom=function(t,n){return void 0===n&&(n=g()),r(t).diff(r(n))},exports.multiply=function(t,n){return new f(t).multipliedBy(n)},exports.numberToAmount=M,exports.numberToAmountFormatted=D,exports.numberToAsset=function(t,n,r,e){return void 0===e&&(e=!1),o(t).format({thousandSeparated:!1,mantissa:r,trimMantissa:e})+" "+n},exports.numberToEos=function(t,n,o){return M(t,o)+" "+n},exports.numberToEosRoundUp=function(t,n,o){return M(t,o,f.ROUND_UP)+" "+n},exports.parseCpu=function(t){var n=0,o="";return t<1e3?(n=t,o="µs"):t<1e6?(n=t/1e3,o="ms"):t<6e7?(n=t/1e6,o="s"):t<36e8?(n=t/6e7,o="min"):t<36e11?(n=t/36e8,o="hours"):(n=t/864e8,o="days"),w(n,2,!0)+" "+o},exports.parseNetAndRam=function(t){var n=0,o="";return t<1024?(n=t,o="Bytes"):t<1048576?(n=t/1024,o="KB"):t<1073741824?(n=t/1048576,o="MB"):t<1099511627776?(n=t/1073741824,o="GB"):t<0x4000000000000&&(n=t/1099511627776,o="TB"),w(n,2,!0)+" "+o},exports.parseRex=function(t){return new f(t).dividedBy(1e4)},exports.parseSeconds=function(t){var n=0,o=0,r=0,e="";return t>86400&&(t-=86400*(n+=Math.floor(t/86400)),e+=n.toFixed(0)+" "+(1===n?"Day":"Days")+" "),t>3600&&(t-=3600*(o+=Math.floor(t/3600)),e+=o.toFixed(0)+" "+(1===o?"Hour":"Hours")+" "),t>60&&(t-=60*(r+=Math.floor(t/60)),e+=r.toFixed(0)+" "+(1===r?"Minute":"Minutes")+" "),t>0&&(e+=t.toFixed(0)+" Seconds "),e},exports.parseTimestamp=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),Y(q(t),n)},exports.parseUtcTimestamp=function(t,n){return void 0===n&&(n="MMM-DD-YYYY, hh:mm:ss A"),Y(E(t),n)},exports.secondsFrom=function(t,n){return void 0===n&&(n=g()),r(t).diff(r(n),"second")},exports.split=S,exports.startDate=O,exports.substract=function(t,n){return new f(t).minus(n)},exports.time=g,exports.timestampFromNow=function(t){return g(t).fromNow()},exports.timestampToDate=q,exports.toBN=function(t){return new f(t)},exports.toNumbro=function(t){return o(t)},exports.unixTime=function(t){return r.unix(t)},exports.utcTime=N,exports.utcTimeToLocal=function(t){return r(t).local()},exports.utcTimestampFromNow=function(t){return g(t="Z"===t.slice(-1)?t:t+"Z").fromNow()},exports.utcTimestampToDate=E;
//# sourceMappingURL=numbers.cjs.production.min.js.map

@@ -511,3 +511,4 @@ import { BigNumber } from 'bignumber.js';

trimMantissa: trimMantissa,
average: average
average: average,
lowPrecision: false
});

@@ -514,0 +515,0 @@ return "" + symbol + formattedNumber;

{
"name": "@bloks/numbers",
"version": "25.0.5",
"version": "25.0.6",
"author": "jafri",

@@ -18,11 +18,8 @@ "module": "dist/api.esm.js",

},
"devDependencies": {
"bignumber.js": "^9.0.1"
},
"dependencies": {
"@jafri/numbro": "^2.3.3",
"@jafri/numbro": "^2.3.4",
"bignumber.js": "^9.0.1",
"dayjs": "^1.8.18"
},
"gitHead": "437edcc3dd1b4335d0ca4b0a47b48858e561af75"
"gitHead": "71cd999f64f29c9ded34ef7cec1f644763820d72"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc