Skip to content

Commit 2b911d1

Browse files
committedJun 16, 2020
make room for opts - rename opts to attr
1 parent 21b86cd commit 2b911d1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/lib/coerce.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ exports.coerce = function(containerIn, containerOut, attributes, attribute, dflt
365365
};
366366

367367
function _coerce(containerIn, containerOut, attributes, attribute, dflt) {
368-
var opts = nestedProperty(attributes, attribute).get();
369-
if(dflt === undefined) dflt = opts.dflt;
368+
var attr = nestedProperty(attributes, attribute).get();
369+
if(dflt === undefined) dflt = attr.dflt;
370370
var src = ''; // i.e. default
371371

372372
var propIn = nestedProperty(containerIn, attribute);
@@ -388,7 +388,7 @@ function _coerce(containerIn, containerOut, attributes, attribute, dflt) {
388388
* individual form (eg. some array vals can be numbers, even if the
389389
* single values must be color strings)
390390
*/
391-
if(opts.arrayOk && isArrayOrTypedArray(valIn)) {
391+
if(attr.arrayOk && isArrayOrTypedArray(valIn)) {
392392
propOut.set(valIn);
393393
return {
394394
inp: valIn,
@@ -397,17 +397,17 @@ function _coerce(containerIn, containerOut, attributes, attribute, dflt) {
397397
};
398398
}
399399

400-
var coerceFunction = exports.valObjectMeta[opts.valType].coerceFunction;
401-
coerceFunction(valIn, propOut, dflt, opts);
400+
var coerceFunction = exports.valObjectMeta[attr.valType].coerceFunction;
401+
coerceFunction(valIn, propOut, dflt, attr);
402402

403403
var valOut = propOut.get();
404404
if(valOut !== undefined) src = 'c'; // container
405405

406406
// in case v was provided but invalid, try the template again so it still
407407
// overrides the regular default
408-
if(template && valOut === dflt && !validate(valIn, opts)) {
408+
if(template && valOut === dflt && !validate(valIn, attr)) {
409409
valIn = nestedProperty(template, attribute).get();
410-
coerceFunction(valIn, propOut, dflt, opts);
410+
coerceFunction(valIn, propOut, dflt, attr);
411411
valOut = propOut.get();
412412

413413
if(valOut !== undefined) src = 't'; // template

0 commit comments

Comments
 (0)
Please sign in to comment.