🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

ding-dong

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ding-dong - npm Package Compare versions

Comparing version

to
0.1.4

2

example/app.js

@@ -7,3 +7,3 @@ var AGIServer = require('./../lib/index');

console.log('vars', vars);
return context.streamFile();
return context.streamFile('beep');
})

@@ -10,0 +10,0 @@ .then(function (result) {

@@ -141,3 +141,3 @@ var Readable = require('readable-stream');

commands.map(function (command) {
commands.forEach(function (command) {
var str = '';

@@ -156,24 +156,12 @@ Context.prototype[command.name] = function () {

var prepareArgs = function (args, argsRules, count) {
var q, argsP = [];
if (argsRules && count) {
if (!argsRules || !count) {
return args;
}
args = args.map(function (arg){
return arg.toString();
return Array.apply(null, new Array(count)) // old node.js versions don't support Array.fill()
.map(function (arg, i) {
arg = args[i] !== undefined && args[i] !== null ? args[i] : argsRules[i] && argsRules[i].default || '';
var prepare = argsRules[i] && argsRules[i].prepare || function (x) { return x; };
return prepare(String(arg));
});
for (var i = 0; i < count; i++) {
argsP[i] = (args[i]) ?
args[i] :
((argsRules[i] && argsRules[i].default) ?
argsRules[i].default :
'');
}
q = argsP.map(function (arg, i) {
return (argsRules[i] && argsRules[i].prepare) ? argsRules[i].prepare(arg) : arg;
});
} else {
q = args;
}
return q;
};

@@ -187,2 +175,2 @@

module.exports = Context;
module.exports = Context;

@@ -5,3 +5,3 @@ {

"description": "Write AGI-server quickly! (AGI - Asterisk Gateway Interface)",
"version": "0.1.3",
"version": "0.1.4",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

Sorry, the diff of this file is not supported yet