nomics-platform
Advanced tools
Comparing version 0.13.5 to 0.13.6
@@ -276,4 +276,7 @@ const au = require('../au') | ||
au.assert(typeof bid0 === 'number' && !isNaN(bid0), 'Expect bid price to be of type number or numeric string') | ||
au.assert( | ||
typeof bid0 === 'number' && !isNaN(bid0), | ||
'Expect bid price to be of type number or numeric string' | ||
) | ||
au.assert( | ||
typeof bid1 === 'number' && !isNaN(bid1), | ||
@@ -288,4 +291,7 @@ 'Expect bid amount to be of type number or numeric string' | ||
au.assert(typeof ask0 === 'number' && !isNaN(ask0), 'Expect ask price to be of type number or numeric string') | ||
au.assert( | ||
typeof ask0 === 'number' && !isNaN(ask0), | ||
'Expect ask price to be of type number or numeric string' | ||
) | ||
au.assert( | ||
typeof ask1 === 'number' && !isNaN(ask1), | ||
@@ -296,4 +302,11 @@ 'Expect ask amount to be of type number or numeric string' | ||
au.assert( | ||
typeof orderBook.bids[0] === typeof orderBook.asks[0], | ||
'Expect ask prices and bid prices to be of the same type' | ||
); | ||
const bidPrices = orderBook.bids.map(b => b[0]) | ||
const bidPricesSorted = orderBook.bids.map(b => b[0]).sort((a, b) => b - a) | ||
const bidPricesSorted = typeof orderBook.bids[0][0] === 'number' | ||
? orderBook.bids.map(b => b[0]).sort((a, b) => b - a) | ||
: orderBook.bids.map(b => b[0]).sort((a, b) => b.localeCompare(a)); | ||
au.assert( | ||
@@ -305,3 +318,5 @@ JSON.stringify(bidPrices) === JSON.stringify(bidPricesSorted), | ||
const askPrices = orderBook.asks.map(b => b[0]) | ||
const askPricesSorted = orderBook.asks.map(b => b[0]).sort((a, b) => a - b) | ||
const askPricesSorted = typeof orderBook.asks[0][0] === 'number' | ||
? orderBook.asks.map(b => b[0]).sort((a, b) => a - b) | ||
: orderBook.asks.map(b => b[0]).sort((a, b) => a.localeCompare(b)); | ||
au.assert( | ||
@@ -308,0 +323,0 @@ JSON.stringify(askPrices) === JSON.stringify(askPricesSorted), |
{ | ||
"name": "nomics-platform", | ||
"version": "0.13.5", | ||
"version": "0.13.6", | ||
"description": "Nomics Platform Toolkit", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27972
616
1