Skip to content

Commit 535df44

Browse files
fix: filter invalid characters from the type name (#2127)
Fixes #2124. There is no reason why the type name would contain anything other than alphanumeric characters. Filter the remaining characters with a regex.
1 parent f05e3c3 commit 535df44

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/type.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var Enum = require("./enum"),
2929
* @param {Object.<string,*>} [options] Declared options
3030
*/
3131
function Type(name, options) {
32+
name = name.replace(/\W/g, "");
3233
Namespace.call(this, name, options);
3334

3435
/**

0 commit comments

Comments
 (0)