mirror of
https://github.com/vacp2p/rfc.vac.dev.git
synced 2026-01-06 21:03:52 -05:00
* scrape with 1:1 mapping to origin repo * exclude .md extension from file path in URLs inside MDs * removed legacy static files * remove image path manipulation * move scrapper to new folder * sidebar custom ordering implemented
27 lines
531 B
JavaScript
27 lines
531 B
JavaScript
function isNumber(value) {
|
|
if (true === Array.isArray(value)) {
|
|
return false;
|
|
}
|
|
return !isNaN(parseInt(value, 10));
|
|
}
|
|
|
|
/*
|
|
Composes multiple functions with same arguments into a single one
|
|
NOTE: Functions are executed from end of array to start (right to left)
|
|
*/
|
|
function compose(...funcs) {
|
|
if (funcs.length === 1) {
|
|
return funcs[0]
|
|
}
|
|
|
|
return funcs.reduce(
|
|
(firstFunction, nextFunction) =>
|
|
(...args) =>
|
|
firstFunction(nextFunction(...args))
|
|
)
|
|
}
|
|
|
|
module.exports = {
|
|
isNumber,
|
|
compose
|
|
} |