trueValue
, falseValue
of keyIn
accept function
This commit is contained in:
parent
57758fa427
commit
e952a7b089
1 changed files with 4 additions and 7 deletions
|
@ -811,16 +811,13 @@ exports.keyIn = function(query, options) {
|
||||||
readOptions.limit = readOptions.limitSrc.join('').replace(/[^A-Za-z0-9_ ]/g, '\\$&');
|
readOptions.limit = readOptions.limitSrc.join('').replace(/[^A-Za-z0-9_ ]/g, '\\$&');
|
||||||
|
|
||||||
['trueValue', 'falseValue'].forEach(function(optionName) {
|
['trueValue', 'falseValue'].forEach(function(optionName) {
|
||||||
var comps = [];
|
readOptions[optionName] = readOptions[optionName].reduce(function(comps, comp) {
|
||||||
readOptions[optionName].forEach(function(comp) {
|
|
||||||
var type = typeof comp;
|
var type = typeof comp;
|
||||||
if (type === 'string' || type === 'number') {
|
if (type === 'string' || type === 'number') {
|
||||||
comps = comps.concat((comp + '').split(''));
|
comps = comps.concat((comp + '').split(''));
|
||||||
} else if (comp instanceof RegExp) {
|
} else { comps.push(comp); }
|
||||||
comps.push(comp);
|
return comps;
|
||||||
}
|
}, []);
|
||||||
});
|
|
||||||
readOptions[optionName] = comps;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
readOptions.display = replacePlaceholder(readOptions.display + '',
|
readOptions.display = replacePlaceholder(readOptions.display + '',
|
||||||
|
|
Loading…
Reference in a new issue