6 lines
237 B
JavaScript
Raw Normal View History

2019-09-13 11:27:52 +07:00
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};