Typo: marge -> merge

This commit is contained in:
anseki 2021-02-25 15:11:29 +09:00
parent 668a1e8371
commit ab0806ee61

View file

@ -465,10 +465,10 @@ function escapePattern(pattern) {
function(s) { return '\\x' + ('00' + s.charCodeAt().toString(16)).substr(-2); });
}
// margeOptions(options1, options2 ... )
// margeOptions(true, options1, options2 ... )
// mergeOptions(options1, options2 ... )
// mergeOptions(true, options1, options2 ... )
// arg1=true : Start from defaultOptions and pick elements of that.
function margeOptions() {
function mergeOptions() {
var optionsList = Array.prototype.slice.call(arguments),
optionNames, fromDefault;
@ -848,27 +848,27 @@ exports._DBG_clearHistory = function() { lastInput = ''; inputHistory = []; };
// ------------------------------------
exports.setDefaultOptions = function(options) {
defaultOptions = margeOptions(true, options);
return margeOptions(true); // copy
defaultOptions = mergeOptions(true, options);
return mergeOptions(true); // copy
};
exports.question = function(query, options) {
/* eslint-disable key-spacing */
return getValidLine(margeOptions(margeOptions(true, options), {
return getValidLine(mergeOptions(mergeOptions(true, options), {
display: query
}));
/* eslint-enable key-spacing */
};
exports.prompt = function(options) {
var readOptions = margeOptions(true, options);
var readOptions = mergeOptions(true, options);
readOptions.display = readOptions.prompt;
return getValidLine(readOptions);
};
exports.keyIn = function(query, options) {
/* eslint-disable key-spacing */
var readOptions = margeOptions(margeOptions(true, options), {
var readOptions = mergeOptions(mergeOptions(true, options), {
display: query,
keyIn: true,
keepWhitespace: true
@ -906,7 +906,7 @@ exports.keyIn = function(query, options) {
exports.questionEMail = function(query, options) {
if (query == null) { query = 'Input e-mail address: '; }
/* eslint-disable key-spacing */
return exports.question(query, margeOptions({
return exports.question(query, mergeOptions({
// -------- default
hideEchoBack: false,
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
@ -925,7 +925,7 @@ exports.questionEMail = function(query, options) {
exports.questionNewPassword = function(query, options) {
/* eslint-disable key-spacing */
var resCharlist, min, max,
readOptions = margeOptions({
readOptions = mergeOptions({
// -------- default
hideEchoBack: true,
mask: '*',
@ -988,7 +988,7 @@ function _questionNum(query, options, parser) {
return !isNaN(validValue) && typeof validValue === 'number';
}
/* eslint-disable key-spacing */
exports.question(query, margeOptions({
exports.question(query, mergeOptions({
// -------- default
limitMessage: 'Input valid number, please.'
}, options, {
@ -1011,7 +1011,7 @@ exports.questionPath = function(query, options) {
/* eslint-disable key-spacing */
var error = '',
validPath, // before readOptions
readOptions = margeOptions({
readOptions = mergeOptions({
// -------- default
hideEchoBack: false,
limitMessage: '$<error(\n)>Input valid path, please.' +
@ -1142,7 +1142,7 @@ function getClHandler(commandHandler, options) {
exports.promptCL = function(commandHandler, options) {
/* eslint-disable key-spacing */
var readOptions = margeOptions({
var readOptions = mergeOptions({
// -------- default
hideEchoBack: false,
limitMessage: 'Requested command is not available.',
@ -1162,7 +1162,7 @@ exports.promptCL = function(commandHandler, options) {
exports.promptLoop = function(inputHandler, options) {
/* eslint-disable key-spacing */
var readOptions = margeOptions({
var readOptions = mergeOptions({
// -------- default
hideEchoBack: false,
trueValue: null,
@ -1177,7 +1177,7 @@ exports.promptLoop = function(inputHandler, options) {
exports.promptCLLoop = function(commandHandler, options) {
/* eslint-disable key-spacing */
var readOptions = margeOptions({
var readOptions = mergeOptions({
// -------- default
hideEchoBack: false,
limitMessage: 'Requested command is not available.',
@ -1200,7 +1200,7 @@ exports.promptCLLoop = function(commandHandler, options) {
exports.promptSimShell = function(options) {
/* eslint-disable key-spacing */
return exports.prompt(margeOptions({
return exports.prompt(mergeOptions({
// -------- default
hideEchoBack: false,
history: true
@ -1224,7 +1224,7 @@ function _keyInYN(query, options, limit) {
query = query.replace(/\s*:?\s*$/, '') + ' [y/n]: ';
}
/* eslint-disable key-spacing */
res = exports.keyIn(query, margeOptions(options, {
res = exports.keyIn(query, mergeOptions(options, {
// -------- forced
hideEchoBack: false,
limit: limit,
@ -1246,7 +1246,7 @@ exports.keyInPause = function(query, options) {
query = query.replace(/\s+$/, '') + ' (Hit any key)';
}
/* eslint-disable key-spacing */
exports.keyIn(query, margeOptions({
exports.keyIn(query, mergeOptions({
// -------- default
limit: null
}, options, {
@ -1261,7 +1261,7 @@ exports.keyInPause = function(query, options) {
exports.keyInSelect = function(items, query, options) {
/* eslint-disable key-spacing */
var readOptions = margeOptions({
var readOptions = mergeOptions({
// -------- default
hideEchoBack: false
}, options, {