fix
This commit is contained in:
parent
84bda96276
commit
de0edfc0ac
@ -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;
|
||||
}
|
||||
|
@ -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' });
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user