Code with hyperdev.com url should not run

This commit is contained in:
Yasser Hussain
2016-10-27 18:41:20 +05:30
committed by Stuart Taylor
parent 54321af9af
commit a33e34f942

View File

@ -48,6 +48,16 @@ const throwForJsHtml = {
throw new Error('Invalid if (null) console.log(1); detected');
}
}
}, {
name: 'hyperdev in code',
description: 'Code with the URL hyperdev.com ' +
'should not be allowed to run',
detectHyperdevInCode: /hyperdev\.com/gi,
thrower: function checkForHyperdev({ contents }) {
if (contents.match(this.detectHyperdevInCode)) {
throw new Error('Hyperdev.com should not be in the code');
}
}
}
]
};