This commit is contained in:
Timo Hocker 2020-04-29 22:24:45 +02:00
parent 84bda96276
commit de0edfc0ac
2 changed files with 0 additions and 12 deletions

View File

@ -25,13 +25,6 @@ export class Element {
}
public constructor (name: string, parent = '') {
<<<<<<< HEAD
=======
const regex = /^[a-z_][a-z_0-9]+$/iu;
if (!regex.test (name))
throw new Error ('invalid name specified');
>>>>>>> f553396eee29e1e0820624345e5d23dc3471a4a4
this.name = name;
this.parent_name = parent;
}

View File

@ -59,12 +59,7 @@ test ('adhere to naming convention', (t) => {
test ('throw on invalid name', (t) => {
t.throws (() => {
<<<<<<< HEAD
const n = new Node ('564#+-.,/@', 'parent');
=======
const n = new Node ('invalid.name', 'parent');
>>>>>>> f553396eee29e1e0820624345e5d23dc3471a4a4
return n.toString ();
}, { message: 'invalid name specified' });
});