mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-11-25 12:32:42 +00:00
Migrate to Node 16 (#118)
* Node 16: fix build dependencies * Node 16: fix Bootstrap dependency problem * Node 16: fix error in HTML writer * Node 16: move await to proper place (h/t alliejones)
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = exports = function (md) {
|
||||
(state) => {
|
||||
state.tokens = flatten(state.tokens.map(descend).filter(Boolean));
|
||||
return false;
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ function is (...args) {
|
||||
IS_LOOKUP.get(a)
|
||||
|| (isFunction(a) && a)
|
||||
|| (isRegExp(a) && re(a))
|
||||
|| equals(a),
|
||||
|| equals(a)
|
||||
);
|
||||
if (args.length === 1) return (tok) => args[0](tok);
|
||||
return (tok) => anyBy(args, (check) => check(tok));
|
||||
@@ -124,7 +124,7 @@ function isAll (...args) {
|
||||
IS_LOOKUP.get(a)
|
||||
|| (isFunction(a) && a)
|
||||
|| (isRegExp(a) && re(a))
|
||||
|| equals(a),
|
||||
|| equals(a)
|
||||
);
|
||||
if (args.length === 1) return (tok) => args[0](tok);
|
||||
return (tok) => allBy(args, (check) => check(tok));
|
||||
@@ -184,7 +184,7 @@ function ucfirst (input) {
|
||||
|
||||
function ucsentence (input) {
|
||||
return input.replace(/((?:\S[^.?!]*)[.?!]*)/g, (txt) =>
|
||||
txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(),
|
||||
txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ function uniq (collection, predicate = null) {
|
||||
function keyBy (collection, predicate) {
|
||||
predicate = iteratee(predicate);
|
||||
return mapReduce(collection, (value, key, index) =>
|
||||
[ predicate(value, key, index), value ],
|
||||
[ predicate(value, key, index), value ]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ function omit (collection, predicate) {
|
||||
return mapReduce(collection, (value, key, index) =>
|
||||
(predicate(value, key, index)
|
||||
? [ undefined, undefined ]
|
||||
: [ key, value ]),
|
||||
: [ key, value ])
|
||||
);
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ function omit (collection, predicate) {
|
||||
return mapReduce(collection, (value, key) =>
|
||||
(predicate.includes(key)
|
||||
? [ undefined, undefined ]
|
||||
: [ key, value ]),
|
||||
: [ key, value ])
|
||||
);
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ function pick (collection, predicate) {
|
||||
return mapReduce(collection, (value, key, index) =>
|
||||
(predicate(value, key, index)
|
||||
? [ key, value ]
|
||||
: [ undefined, undefined ]),
|
||||
: [ undefined, undefined ])
|
||||
);
|
||||
}
|
||||
|
||||
@@ -805,9 +805,11 @@ function pathinate (object, delimiter = '.') {
|
||||
|
||||
/**
|
||||
* Iterates over a collection and generates an object based on tuple returned from the iteratee.
|
||||
*
|
||||
* @param {Object|Array|Map|Set} collection
|
||||
* @param {Function} iteratee Callback invoked for each item, receives `value, key, index`, returns `[key, value]`;
|
||||
* @return {Object}
|
||||
* @param cb
|
||||
* @returns {Object}
|
||||
*/
|
||||
function mapReduce (collection, cb) {
|
||||
if (!collection) return {};
|
||||
@@ -887,7 +889,7 @@ function flatten (collection, depth = Infinity) {
|
||||
? flatten(val, depth - 1)
|
||||
: [ val ]
|
||||
)),
|
||||
[],
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user