@gitrows/gitrows-utils
Advanced tools
Comparing version 0.3.12 to 0.3.13
@@ -333,5 +333,13 @@ const Data={ | ||
return arr[arr.length-1]; | ||
} | ||
}, | ||
pad : (arr,length,fill,from='left') => from==='left'?[...Array(length-arr.length).fill(fill), ...arr]:[ ...arr,...Array(length-arr.length).fill(fill)], | ||
chunk : (arr,size) => arr.reduce((all,one,i) => { | ||
const ch = Math.floor(i/size); | ||
all[ch] = [].concat((all[ch]||[]),one); | ||
return all | ||
}, []), | ||
} | ||
module.exports=Data; |
@@ -22,4 +22,7 @@ const Num={ | ||
}, | ||
rand : (min,max) => Math.random() * (max - min) + min, | ||
randSeries : (min,max,length) => Array.from({length: length}, ()=>Num.rand(min,max)), | ||
randIntSeries : (min,max,length) => Num.randSeries(min,max,length).map(x=>Math.floor(x)), | ||
} | ||
module.exports=Num; |
{ | ||
"name": "@gitrows/gitrows-utils", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"description": "Data and string handling utilities for @gitrows", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
26824
862