@vbarbarosh/node-helpers
Advanced tools
Comparing version 3.60.0 to 3.61.0
@@ -5,3 +5,3 @@ { | ||
"name": "@vbarbarosh/node-helpers", | ||
"version": "3.60.0", | ||
"version": "3.61.0", | ||
"description": "A set of helpers for JavaScript/Node.js", | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -0,1 +1,8 @@ | ||
/** | ||
* Usage: | ||
* array_index(items, v => v.name) | ||
* | ||
* Seems, there is a native way to do it: | ||
* Object.fromEntries(items.map(v => [v.name, v])); | ||
*/ | ||
function array_index(array, fn) | ||
@@ -2,0 +9,0 @@ { |
/** | ||
* Create fcmp from an array of props. For desc order a prop should be prefixed with minus sign (e.g. -price). | ||
* Create fcmp from an array of props. For desc order a prop should be prefixed | ||
* with minus sign (e.g. -price). | ||
*/ | ||
@@ -4,0 +5,0 @@ function fcmp_from_spec(props) |
@@ -21,1 +21,9 @@ /** | ||
module.exports = format_bytes; | ||
// https://wiki.ubuntu.com/UnitsPolicy | ||
// > Applications must use SI standard for base-10 units: | ||
// > | ||
// > 1 kB = 1,000 bytes (Note: small k) | ||
// > 1 MB = 1,000 kB = 1,000,000 bytes | ||
// > 1 GB = 1,000 MB = 1,000,000 kB = 1,000,000,000 bytes | ||
// > 1 TB = 1,000 GB = 1,000,000 MB = 1,000,000,000 kB = 1,000,000,000,000 bytes |
@@ -14,3 +14,3 @@ const Promise = require('bluebird'); | ||
const tmp = ['--progress-meter']; | ||
const tmp = ['--no-silent', '--progress-meter']; | ||
if (!args.includes('-o')) { | ||
@@ -17,0 +17,0 @@ tmp.push('-o', '/dev/null'); |
@@ -7,3 +7,3 @@ const Promise = require('bluebird'); | ||
* | ||
* await waitcb(cb => fs.promises.writeFile('a', 'hello\n', cb)); | ||
* await waitcb(cb => fs.writeFile('a', 'hello\n', cb)); | ||
*/ | ||
@@ -10,0 +10,0 @@ function waitcb(fn) |
186174
249
5161
31