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

@hierotech/currency

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hierotech/currency - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

dist/index.browser.js

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

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("big.js")):"function"==typeof define&&define.amd?define(["big.js"],r):"object"==typeof exports?exports.hierotechCurrency=r(require("big.js")):e.hierotechCurrency=r(e["big.js"])}(self,(function(e){return(()=>{"use strict";var r={297:r=>{r.exports=e}},t={};function n(e){var o=t[e];if(o!==undefined)return o.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var r=e&&e.__esModule?()=>e["default"]:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r,t){return function(e){if(Array.isArray(e))return e}(r)||function(e,r){var t=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=t){var n,o,i=[],u=!0,a=!1;try{for(t=t.call(e);!(u=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);u=!0);}catch(c){a=!0,o=c}finally{try{u||null==t["return"]||t["return"]()}finally{if(a)throw o}}return i}}(r,t)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.r(o),n.d(o,{CRYPTO_UNIT_ATOM_COUNT:()=>f,CURRENCY_SIGN:()=>c,CURRENCY_TYPES:()=>l,DECIMAL_DIGIT_COUNT:()=>a,cryptoAtomsToUnit:()=>y,formatCurrency:()=>b,isCryptoCurrency:()=>m,isFiatCurrency:()=>v,ratioPercent:()=>C,unitToCryptoAtoms:()=>p});var t=n(297),i=n.n(t),u=new Set(["USD"]),a={USD:2,BTC:8},c={USD:"$",BTC:"₿"},f={BTC:new(i())("100000000")},l=["USD","BTC"];function s(e,r){return c[r]+" "+e}function d(e){var t=r(e.split("."),2),n=t[0],o=t[1];return"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(o)}function y(e,r){return new(i())(e).div(f[r])}function p(e,r){return Number(new(i())(e).times(f[r]).toFixed(0))}function b(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},n=t.withSign,o=void 0!==n&&n,u=t.withSeparators,c=void 0===u?o:u,f=a[r],l=new(i())(e),y=l.toFixed(f);return c&&(y=d(y)),o&&(y=s(y,r)),y}function v(e){return u.has(e.toUpperCase())}function m(e){return!v(e)}function C(e,r){var t=new(i())(e),n=new(i())(r);return t.div(n).times(100)}})(),o})()}));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("big.js")):"function"==typeof define&&define.amd?define(["big.js"],r):"object"==typeof exports?exports.hierotechCurrency=r(require("big.js")):e.hierotechCurrency=r(e["big.js"])}(self,(function(e){return(()=>{"use strict";var r={297:r=>{r.exports=e}},t={};function n(e){var o=t[e];if(o!==undefined)return o.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var r=e&&e.__esModule?()=>e["default"]:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r,t){return function(e){if(Array.isArray(e))return e}(r)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],u=!0,a=!1;try{for(t=t.call(e);!(u=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);u=!0);}catch(c){a=!0,o=c}finally{try{u||null==t["return"]||t["return"]()}finally{if(a)throw o}}return i}}(r,t)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.r(o),n.d(o,{CRYPTO_UNIT_ATOM_COUNT:()=>f,CURRENCY_SIGN:()=>c,CURRENCY_TYPES:()=>l,DECIMAL_DIGIT_COUNT:()=>a,cryptoAtomsToUnit:()=>y,formatCurrency:()=>b,isCryptoCurrency:()=>m,isFiatCurrency:()=>v,ratioPercent:()=>C,unitToCryptoAtoms:()=>p});var t=n(297),i=n.n(t),u=new Set(["USD"]),a={USD:2,BTC:8},c={USD:"$",BTC:"₿"},f={BTC:new(i())("100000000")},l=["USD","BTC"];function s(e,r){return c[r]+" "+e}function d(e){var t=r(e.split("."),2),n=t[0],o=t[1];return"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(o)}function y(e,r){return new(i())(e).div(f[r])}function p(e,r){return Number(new(i())(e).times(f[r]).toFixed(0))}function b(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},n=t.withSign,o=void 0!==n&&n,u=t.withSeparators,c=void 0===u?o:u,f=a[r],l=new(i())(e),y=l.toFixed(f);return c&&(y=d(y)),o&&(y=s(y,r)),y}function v(e){return u.has(e.toUpperCase())}function m(e){return!v(e)}function C(e,r){var t=new(i())(e),n=new(i())(r);return t.div(n).times(100)}})(),o})()}));
//# sourceMappingURL=index.browser.js.map

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("big.js")):"function"==typeof define&&define.amd?define(["big.js"],t):"object"==typeof exports?exports.hierotechCurrency=t(require("big.js")):e.hierotechCurrency=t(e["big.js"])}(global,(function(e){return(()=>{var t={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o},e.exports["default"]=e.exports,e.exports.__esModule=!0},858:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports["default"]=e.exports,e.exports.__esModule=!0},884:e=>{e.exports=function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var o,n,u=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(u.push(o.value),!t||u.length!==t);i=!0);}catch(a){s=!0,n=a}finally{try{i||null==r["return"]||r["return"]()}finally{if(s)throw n}}return u}},e.exports["default"]=e.exports,e.exports.__esModule=!0},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports["default"]=e.exports,e.exports.__esModule=!0},38:(e,t,r)=>{var o=r(858),n=r(884),u=r(379),i=r(521);e.exports=function(e,t){return o(e)||n(e,t)||u(e,t)||i()},e.exports["default"]=e.exports,e.exports.__esModule=!0},379:(e,t,r)=>{var o=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}},e.exports["default"]=e.exports,e.exports.__esModule=!0},297:t=>{"use strict";t.exports=e}},r={};function o(e){var n=r[e];if(n!==undefined)return n.exports;var u=r[e]={exports:{}};return t[e](u,u.exports,o),u.exports}o.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{DECIMAL_DIGIT_COUNT:()=>s,CURRENCY_SIGN:()=>a,CRYPTO_UNIT_ATOM_COUNT:()=>p,CURRENCY_TYPES:()=>l,cryptoAtomsToUnit:()=>d,unitToCryptoAtoms:()=>y,formatCurrency:()=>x,isFiatCurrency:()=>b,isCryptoCurrency:()=>v,ratioPercent:()=>m});var e=o(38),t=o.n(e),r=o(297),u=o.n(r),i=new Set(["USD"]),s={USD:2,BTC:8},a={USD:"$",BTC:"₿"},p={BTC:new(u())("100000000")},l=["USD","BTC"];function c(e,t){return a[t]+" "+e}function f(e){var r=e.split("."),o=t()(r,2),n=o[0],u=o[1];return"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(u)}function d(e,t){return new(u())(e).div(p[t])}function y(e,t){return Number(new(u())(e).times(p[t]).toFixed(0))}function x(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o=r.withSign,n=void 0!==o&&o,i=r.withSeparators,a=void 0===i?n:i,p=s[t],l=new(u())(e),d=l.toFixed(p);return a&&(d=f(d)),n&&(d=c(d,t)),d}function b(e){return i.has(e.toUpperCase())}function v(e){return!b(e)}function m(e,t){var r=new(u())(e),o=new(u())(t);return r.div(o).times(100)}})(),n})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("big.js")):"function"==typeof define&&define.amd?define(["big.js"],t):"object"==typeof exports?exports.hierotechCurrency=t(require("big.js")):e.hierotechCurrency=t(e["big.js"])}(global,(function(e){return(()=>{var t={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o},e.exports["default"]=e.exports,e.exports.__esModule=!0},858:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports["default"]=e.exports,e.exports.__esModule=!0},884:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,u=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(u.push(o.value),!t||u.length!==t);i=!0);}catch(a){s=!0,n=a}finally{try{i||null==r["return"]||r["return"]()}finally{if(s)throw n}}return u}},e.exports["default"]=e.exports,e.exports.__esModule=!0},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports["default"]=e.exports,e.exports.__esModule=!0},38:(e,t,r)=>{var o=r(858),n=r(884),u=r(379),i=r(521);e.exports=function(e,t){return o(e)||n(e,t)||u(e,t)||i()},e.exports["default"]=e.exports,e.exports.__esModule=!0},379:(e,t,r)=>{var o=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}},e.exports["default"]=e.exports,e.exports.__esModule=!0},297:t=>{"use strict";t.exports=e}},r={};function o(e){var n=r[e];if(n!==undefined)return n.exports;var u=r[e]={exports:{}};return t[e](u,u.exports,o),u.exports}o.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{DECIMAL_DIGIT_COUNT:()=>s,CURRENCY_SIGN:()=>a,CRYPTO_UNIT_ATOM_COUNT:()=>l,CURRENCY_TYPES:()=>p,cryptoAtomsToUnit:()=>d,unitToCryptoAtoms:()=>y,formatCurrency:()=>x,isFiatCurrency:()=>b,isCryptoCurrency:()=>v,ratioPercent:()=>m});var e=o(38),t=o.n(e),r=o(297),u=o.n(r),i=new Set(["USD"]),s={USD:2,BTC:8},a={USD:"$",BTC:"₿"},l={BTC:new(u())("100000000")},p=["USD","BTC"];function c(e,t){return a[t]+" "+e}function f(e){var r=e.split("."),o=t()(r,2),n=o[0],u=o[1];return"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(u)}function d(e,t){return new(u())(e).div(l[t])}function y(e,t){return Number(new(u())(e).times(l[t]).toFixed(0))}function x(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o=r.withSign,n=void 0!==o&&o,i=r.withSeparators,a=void 0===i?n:i,l=s[t],p=new(u())(e),d=p.toFixed(l);return a&&(d=f(d)),n&&(d=c(d,t)),d}function b(e){return i.has(e.toUpperCase())}function v(e){return!b(e)}function m(e,t){var r=new(u())(e),o=new(u())(t);return r.div(o).times(100)}})(),n})()}));
//# sourceMappingURL=index.node.js.map
{
"name": "@hierotech/currency",
"version": "0.1.5",
"version": "0.1.6",
"description": "Common currency constants and methods",

@@ -27,17 +27,17 @@ "main": "dist/index.node.js",

"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/register": "^7.13.16",
"@babel/runtime": "^7.14.0",
"@ololoepepe/babel-preset-default": "^0.1.18",
"@babel/core": "^7.14.6",
"@babel/register": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@ololoepepe/babel-preset-default": "^0.1.19",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"big.js": "^6.1.1",
"core-js": "^3.12.1",
"eslint": "^7.27.0",
"eslint-config-xo": "^0.36.0",
"mocha": "^8.4.0",
"core-js": "^3.15.1",
"eslint": "^7.29.0",
"eslint-config-xo": "^0.37.0",
"mocha": "^9.0.1",
"regenerator-runtime": "^0.13.7",
"terser-webpack-plugin": "^5.1.2",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0"
"terser-webpack-plugin": "^5.1.4",
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2"
},

@@ -44,0 +44,0 @@ "peerDependencies": {

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