Skip to content

Commit 6a9e089

Browse files
gkelloggdavidlehn
authored andcommitted
Make sure valueCheck treats @value, @type, and @language as arrays.
1 parent 3ac6b40 commit 6a9e089

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/frame.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ function _valueMatch(pattern, value) {
603603
const v1 = value['@value'];
604604
const t1 = value['@type'];
605605
const l1 = value['@language'];
606-
const v2 = pattern['@value'] || [];
607-
const t2 = pattern['@type'] || [];
608-
const l2 = pattern['@language'] || [];
606+
const v2 = pattern['@value'] ? [].concat(pattern['@value']) : [];
607+
const t2 = pattern['@type'] ? [].concat(pattern['@type']) : [];
608+
const l2 = pattern['@language'] ? [].concat(pattern['@language']) : [];
609609

610610
if(v2.length === 0 && t2.length === 0 && l2.length === 0) {
611611
return true;

0 commit comments

Comments
 (0)