This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node %~dp0\index.js %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Like Promise.all but is always successful. | |
* @param {Array|Object} iterable | |
* @returns {Promise} A promise with an array of all the resolved/rejected results. null for rejection. | |
*/ | |
export const reflect = function reflect (iterable) { | |
if (!Array.isArray(iterable)) { | |
iterable = Array.from(iterable) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"ISO2": "AD", | |
"ISO3": "AND", | |
"DIGITS": "20", | |
"ISO-3166-2": "ISO 3166-2:AD", | |
"English": " Andorra", | |
"China": "安道尔", | |
"Taiwan": "安道爾", | |
"Hongkong": "安道爾", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compose (...funcs) { | |
if (funcs.length <= 0) { | |
return x => x | |
} | |
if (funcs.length === 1) { | |
return funcs[0] | |
} | |
const innerFunc = funcs[funcs.length - 1] | |
const restFunc = funcs.slice(0, -1) |
OlderNewer