-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix/write array command #83
base: release
Are you sure you want to change the base?
Hotfix/write array command #83
Conversation
Array parameter in 'write' method surely needs to be fixed! Not possible to run queries in requests |
@@ -55,5 +55,9 @@ | |||
"main": "dist/mikronode.js", | |||
"engines": { | |||
"node": ">= 6" | |||
}, | |||
"dependencies": { | |||
"pegjs": "^0.10.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pegjs should be devDependencies
Promise is not required since it is available natively in NodeJs
@@ -359,7 +359,7 @@ export default class Channel extends events.EventEmitter { | |||
} else return o; | |||
},{}) | |||
|
|||
const isListen=command.split('/').indexOf('listen')>0; | |||
const isListen= typeof command === 'object' ? command.indexOf('listen')>0 : command.split('/').indexOf('listen')>0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Array.isArray(command)?command:command.split('/')).indexOf('listend')>0
@@ -17,7 +17,7 @@ data | |||
= id:identifier value:value s { return {field:id, value:value}} | |||
|
|||
identifier | |||
= "=" id:[\.a-zA-Z\-0-9]+ "=" {return id.join('')} | |||
= "=" id:[\.a-zA-Z\-0-9\/]+ "=" {return id.join('')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should '/' be allowed as part of an ID? Could :, |, ;, _, or - be used just as effectively? Didn't want to cause issues when doing splits and regular expressions.
Fixed handling of first parameter being a type of array of strings in
channel.write
.Added allowance for forward slashes in field values grep.