404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.133.122.83: ~ $
'use strict';
/**
 * `input` type prompt
 */

var Input = require('./input');

/**
 * Extention of the Input prompt specifically for use with number inputs.
 */

class NumberPrompt extends Input {
  filterInput(input) {
    if (input && typeof input === 'string') {
      input = input.trim();
      // Match a number in the input
      let numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/);
      // If a number is found, return that input.
      if (numberMatch) {
        return Number(numberMatch[0]);
      }
    }

    // If the input was invalid return the default value.
    return this.opt.default == null ? NaN : this.opt.default;
  }
}

module.exports = NumberPrompt;

Filemanager

Name Type Size Permission Actions
base.js File 3.72 KB 0644
checkbox.js File 6.8 KB 0644
confirm.js File 1.85 KB 0644
editor.js File 2.28 KB 0644
expand.js File 6.38 KB 0644
input.js File 2.24 KB 0644
list.js File 5.16 KB 0644
number.js File 695 B 0644
password.js File 2.29 KB 0644
rawlist.js File 4.88 KB 0644