+11
-7
@@ -9,2 +9,3 @@ /** | ||
| var dehydrate = require('./dehydrate'); | ||
| var isEqual = require('./is-equal'); | ||
@@ -59,11 +60,14 @@ | ||
| // Generate some sample values | ||
| var samples = _.reduce(_.range(n), function (memo, i) { | ||
| memo.push(generateSampleVal(dehydratedTypeSchema)); | ||
| return memo; | ||
| // Generate some (unique) sample values | ||
| var samples = _.reduce(_.range(n), function (samplesSoFar, i) { | ||
| var newSample = generateSampleVal(dehydratedTypeSchema); | ||
| var isUnique = _.reduce(samplesSoFar, function checkUniqueness(isUnique, existingSample){ | ||
| return isUnique && !isEqual(existingSample, newSample, typeSchema); | ||
| }, true); | ||
| if (isUnique) { | ||
| samplesSoFar.push(newSample); | ||
| } | ||
| return samplesSoFar; | ||
| }, []); | ||
| // Remove any duplicates | ||
| samples = _.uniq(samples); | ||
| // Scramble them and return. | ||
@@ -70,0 +74,0 @@ return _.shuffle(samples); |
+1
-1
| { | ||
| "name": "rttc", | ||
| "version": "4.4.2", | ||
| "version": "4.4.3", | ||
| "description": "Runtime type-checking for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
159097
0.16%3176
0.16%