Add yesterday snippets
This commit is contained in:
6
dist/_30s.js
vendored
6
dist/_30s.js
vendored
@@ -1356,6 +1356,11 @@
|
||||
const xProd = (a, b) => a.reduce((acc, x) => acc.concat(b.map(y => [x, y])), []);
|
||||
const yesNo = (val, def = false) =>
|
||||
/^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def;
|
||||
const yesterday = () => {
|
||||
let t = new Date();
|
||||
t.setDate(t.getDate() - 1);
|
||||
return t.toISOString().split('T')[0];
|
||||
};
|
||||
const zip = (...arrays) => {
|
||||
const maxLength = Math.max(...arrays.map(x => x.length));
|
||||
return Array.from({ length: maxLength }).map((_, i) => {
|
||||
@@ -1716,6 +1721,7 @@
|
||||
exports.words = words;
|
||||
exports.xProd = xProd;
|
||||
exports.yesNo = yesNo;
|
||||
exports.yesterday = yesterday;
|
||||
exports.zip = zip;
|
||||
exports.zipObject = zipObject;
|
||||
exports.zipWith = zipWith;
|
||||
|
||||
Reference in New Issue
Block a user