Skip to content

Commit b968041

Browse files
my-tiencamdecoster
andauthored
Update src/lib/coerce.js
coerce: Simplify test for isSubplotId Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
1 parent 2636c7b commit b968041

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib/coerce.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ exports.valObjectMeta = {
237237
otherOpts: ['regex', 'arrayOk'],
238238
coerceFunction: function(v, propOut, dflt, opts) {
239239
var regex = opts.regex || counterRegex(dflt);
240-
function isSubplotId(value) {
241-
return typeof value === 'string' && regex.test(value);
242-
}
240+
const isSubplotId = value => typeof value === 'string' && regex.test(value);
243241
if (opts.arrayOk && isArrayOrTypedArray(v) && v.length > 0 && v.every(isSubplotId)) {
244242
propOut.set(v);
245243
} else if(isSubplotId(v)) {

0 commit comments

Comments
 (0)