3 {{# def.setupKeyword }}
7 {{? ($schema || $isData) && it.opts.uniqueItems !== false }}
10 if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined)
12 else if (typeof {{=$schemaValue}} != 'boolean')
17 var i = {{=$data}}.length
22 var $itemType = it.schema.items && it.schema.items.type
23 , $typeIsArray = Array.isArray($itemType);
25 {{? !$itemType || $itemType == 'object' || $itemType == 'array' ||
26 ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }}
30 if (equal({{=$data}}[i], {{=$data}}[j])) {
37 var itemIndices = {}, item;
39 var item = {{=$data}}[i];
40 {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }}
41 if ({{= it.util[$method]($itemType, 'item', it.opts.strictNumbers, true) }}) continue;
43 if (typeof item == 'string') item = '"' + item;
45 if (typeof itemIndices[item] == 'number') {
47 j = itemIndices[item];
50 itemIndices[item] = i;
55 {{? $isData }} } {{?}}
58 {{# def.error:'uniqueItems' }}
59 } {{? $breakOnError }} else { {{?}}
61 {{? $breakOnError }} if (true) { {{?}}