Skip to content

Commit

Permalink
v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Sep 24, 2020
1 parent 099c961 commit 7727bb2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 46 deletions.
68 changes: 36 additions & 32 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@seneca/repl",
"description": "Provides a client and server REPL for Seneca microservice systems.",
"version": "3.1.0",
"version": "4.0.0",
"main": "repl.js",
"license": "MIT",
"author": "Richard Rodger (https://github.com/rjrodger)",
Expand Down Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@hapi/code": "^8.0.2",
"@hapi/joi": "^17.1.1",
"@hapi/lab": "^23.0.0",
"@hapi/lab": "^24.0.0",
"acorn": "^8.0.1",
"async": "^3.2.0",
"coveralls": "^3.1.0",
Expand Down
24 changes: 12 additions & 12 deletions repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function repl(options) {
var cmd_map = Object.assign({}, default_cmds, options.cmds)

seneca.add('sys:repl,add:cmd', add_cmd)
seneca.add('sys:repl,echo:true', (msg,reply)=>reply(msg))
seneca.add('sys:repl,echo:true', (msg, reply) => reply(msg))

function add_cmd(msg, reply) {
var name = msg.name
Expand Down Expand Up @@ -195,7 +195,7 @@ function make_intern() {
}

if (!execute_action(cmdtext)) {
context.s.ready(()=>{
context.s.ready(() => {
execute_script(cmdtext)
})
}
Expand All @@ -204,29 +204,29 @@ function make_intern() {
try {
var msg = cmdtext
var m = msg.split(/\s*=>\s*/)
if(2===m.length) {
if (2 === m.length) {
msg = m[0]
}
var injected_msg = Inks(msg,context)

var injected_msg = Inks(msg, context)
var args = seneca.util.Jsonic(injected_msg)
context.s.ready(()=>{
context.s.ready(() => {
context.s.act(args, function (err, out) {
context.err = err
context.out = out

if(m[1]) {
if (m[1]) {
var ma = m[1].split(/\s*=\s*/)
if(2===ma.length) {
context[ma[0]]=Hoek.reach({out:out,err:err},ma[1])
if (2 === ma.length) {
context[ma[0]] = Hoek.reach({ out: out, err: err }, ma[1])
}
}

if (out && !r.context.act_trace) {
out =
out && out.entity$
? out
: context.inspekt(sd.util.clean(out))
? out
: context.inspekt(sd.util.clean(out))
socket.write(out + '\n')
} else if (err) {
socket.write(context.inspekt(err) + '\n')
Expand Down

0 comments on commit 7727bb2

Please sign in to comment.