Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
session.right();
} else if (event.name === 'up') {
session[event.shift === true ? 'shiftup' : 'up']();
} else if (event.name === 'down') {
session[event.shift === true ? 'shiftdown' : 'down']();
} else if (item.readonly !== true) {
// session.dispatch(input, event);
if (event.name === 'backspace' || event.name === 'delete') {
item.input = item.input.slice(0, -1);
} else {
item.input = item.input + input;
}
item.input = item.input.replace(/\r/g, '');
item.input = item.input.replace(/\\?"/g, '\\"');
session.values.set(item.key, colors.unstyle(item.input));
}
update(session.render());
});
prompt.once('run', async() => {
let init = colors.unstyle([prompt.symbols.pointer, prompt.options.initial].join(' '));
await prompt.render();
try {
let buf = colors.unstyle(prompt.state.buffer);
assert(!buf.includes(init));
prompt.submit();
cb();
} catch (err) {
cb(err);
}
});
it('should use custom symbols', () => {
prompt = new Prompt({
message: 'prompt',
symbols: {
indicator: 'X',
check: 'ok',
prefix: '?',
separator: '|>'
}
});
assert.equal(colors.unstyle(prompt.symbols.separator), '|>');
assert.equal(colors.unstyle(prompt.symbols.indicator), 'X');
assert.equal(colors.unstyle(prompt.symbols.prefix), '?');
});
});
tree.on('select',function(node){
screen.key('w',function(ch,key){
clipboardy.writeSync(color.unstyle(node.name));
clipboardy.readSync();
})
clean_widgets()
if(!node.name.includes('timewindow')){
getIpInfo_box_ip(color.unstyle(node.name), 1);}
else{
ip = color.unstyle(node.parent.name);
timewindow = color.unstyle(node.name);
redis_outtuples_timewindow.hgetall("profile_"+ip+"_"+timewindow, (err,reply)=>{
var ips = [];
timeline_reply_global = reply;
map.innerMap.draw(null);
getEvidence(reply['Evidence']);
var obj_outTuples = JSON.parse(reply["OutTuples"]);
var keys = Object.keys(obj_outTuples);
async.each(keys, function(key,callback){
var outTuple_ip = key.split(':')[0];
ips.push(outTuple_ip);
callback(null);
},function(err) {
if( err ) {
console.log('unable to create user');
sections() {
let { buffer, input, prompt } = this.state;
prompt = colors.unstyle(prompt);
let buf = colors.unstyle(buffer);
let idx = buf.indexOf(prompt);
let header = buf.slice(0, idx);
let rest = buf.slice(idx);
let lines = rest.split('\n');
let first = lines[0];
let last = lines[lines.length - 1];
let promptLine = prompt + (input ? ' ' + input : '');
let len = promptLine.length;
let after = len < first.length ? first.slice(len + 1) : '';
return { header, prompt: first, after, rest: lines.slice(1), last };
}
let width = str => [...colors.unstyle(str)].length;
let lines = input.split(/\r?\n/);
renderChoice(choice, index) {
const len = this.longest + 1;
let message = trim(choice.message).padStart(len, ' ') + ' ';
let value = choice.value || choice.hint || '';
let prefix = message;
if (this.answered) {
return prefix + colors.cyan(colors.unstyle(value));
}
if (this.cursor === index) {
if (this.action && this.options.history) {
let state = this.history(this.action, choice.name, choice.value);
if (state.present) {
this.store.set(choice.name, state);
value = this.value = choice.value = state.present;
}
}
prefix = colors.cyan(message);
}
return prefix + value + (choice.help || '');
}
return (data = {}) => {
let init = this.initial;
let value = this.tabstops.get(this.number);
let state = { resolved: 'tabstop', value };
if ((init && init.value === state.value) || !this.isValue(state.value)) {
state.resolved = 'placeholder';
state.value = this.placeholder(data, options);
if (this.hasTextPlaceholder()) {
this.tabstops.set(this.number, colors.unstyle(state.value));
}
} else {
this.tabstops.set(this.number, colors.unstyle(state.value));
}
return this.format(state, options);
};
}
get off() {
let on = colors.unstyle(this.on()).trim();
return ' '.repeat(on.length);
},
get default() {
screen.key('w',function(ch,key){
clipboardy.writeSync(color.unstyle(node.name));
clipboardy.readSync();
})
clean_widgets()