Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yord committed Jun 23, 2020
2 parents 7e67ee9 + dd23d47 commit b2b4322
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 92 deletions.
154 changes: 77 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shargs-repl",
"version": "0.3.0",
"version": "0.4.0",
"description": "A REPL using shargs commands",
"keywords": [
"shargs",
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const {repl} = require('./repl')
const {repl, replF, replSync} = require('./repl')

module.exports = {
repl
repl,
replF,
replSync
}
31 changes: 31 additions & 0 deletions src/repl/Async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const Async = {
resolve,
reject,
all,
then,
catch: _catch
}

module.exports = {
Async
}

function resolve (value) {
return Promise.resolve(value)
}

function reject (reason) {
return Promise.reject(reason)
}

function all (promises) {
return Promise.all(promises)
}

function then (onFulfilled, onRejected) {
return promise => promise.then(onFulfilled, onRejected)
}

function _catch (onRejected) {
return promise => promise.catch(onRejected)
}
Loading

0 comments on commit b2b4322

Please sign in to comment.