add lisp packages

This commit is contained in:
2020-12-05 21:29:49 +01:00
parent 85e20365ae
commit a6e2395755
7272 changed files with 1363243 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
'use strict';
const success = (a) => [null, a];
const fail = (a) => [a];
const noArg = (f, a) => () => f(...a);
module.exports = (fn, ...args) => {
check(fn);
return Promise.resolve()
.then(noArg(fn, args))
.then(success)
.catch(fail);
};
function check(fn) {
if (typeof fn !== 'function')
throw Error('fn should be a function!');
}