nft-art-engine
Advanced tools
Comparing version 0.1.18 to 0.1.19
22
index.js
@@ -99,12 +99,20 @@ const fs = require("fs"); | ||
for (const id of _dna) { | ||
if (!_whitelist[id]) { | ||
continue; | ||
while (true) { | ||
const oldDna = [..._dna] | ||
for (const id of _dna) { | ||
if (!_whitelist[id]) { | ||
continue; | ||
} | ||
for (const dnaIndex of Object.keys(_whitelist[id])) { | ||
if (!_whitelist[id][dnaIndex].includes(_dna[Number(dnaIndex)])) { | ||
_dna[Number(dnaIndex)] = _whitelist[id][dnaIndex][randomIndex(_whitelist[id][dnaIndex].length)]; | ||
} | ||
} | ||
} | ||
for (const dnaIndex of Object.keys(_whitelist[id])) { | ||
_dna[Number(dnaIndex)] = _whitelist[id][dnaIndex][randomIndex(_whitelist[id][dnaIndex].length)]; | ||
} | ||
if (oldDna.join(dnaSeparator) === _dna.join(dnaSeparator)) break | ||
} | ||
return _dna | ||
@@ -111,0 +119,0 @@ } |
{ | ||
"name": "nft-art-engine", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "NFT ART Engine is a package used to create multiple different instances of artworks based on provided layers.", | ||
@@ -5,0 +5,0 @@ "author": "Bagus Abdul Kurniawan", |
234898
347