Skip to content

Commit 72533e9

Browse files
author
intech
committed
fix Set.size
1 parent f4e9fbb commit 72533e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = function({ schema, messages }, path, context) {
5656

5757
if (schema.unique === true) {
5858
src.push(`
59-
if(len > Array.from(new Set(value)).length) {
59+
if(len > (new Set(value)).size) {
6060
${this.makeError({ type: "arrayUnique", expected: "Array.from(new Set(value.filter((item, index) => value.indexOf(item) !== index)))", actual: "value", messages })}
6161
}
6262
`);

0 commit comments

Comments
 (0)