better-trakt
Version:
A Trakt.tv client with native Typescript support and quality of life features
19 lines • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkRequiredArg = void 0;
/**
* Checks if an argument is an acceptable type
* @param arg the argument in question
* @param name name of the argument
* @param type type of the argument
* @returns void
* @throws {@link TypeError} if arg doesn't match provided type
* @internal
*/
function checkRequiredArg(arg, name, type) {
if (typeof arg === type)
return;
throw new TypeError(`Expected ${name} to be ${type} but got: ${typeof arg}`);
}
exports.checkRequiredArg = checkRequiredArg;
//# sourceMappingURL=requiredArg.js.map