Skip to content

Commit 4326a22

Browse files
committed
Allow - in filenames - HashLips#1508
1 parent da000ba commit 4326a22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ctx = canvas.getContext("2d");
4040
ctx.imageSmoothingEnabled = format.smoothing;
4141
const iconCanvas = createCanvas(iconFormat.width, iconFormat.height);
4242
const iconCtx = iconCanvas.getContext("2d");
43-
const DNA_DELIMITER = "-";
43+
const DNA_DELIMITER = "\n";
4444
var metadataList = [];
4545
var attributesList = [];
4646
var dnaList = new Set();
@@ -86,8 +86,8 @@ const getElements = (path) => {
8686
.readdirSync(path)
8787
.filter((item) => !/(^|\/)\.[^\/\.]/g.test(item))
8888
.map((i, index) => {
89-
if (i.includes("-")) {
90-
throw new Error(`layer name can not contain dashes, please fix: ${i}`);
89+
if (i.includes(DNA_DELIMITER)) {
90+
throw new Error(`layer name can not contain ${DNA_DELIMITER}, please fix: ${i}`);
9191
}
9292
return {
9393
id: index,

0 commit comments

Comments
 (0)