n-digit-token
Version:
Cryptographically secure pseudo-random token of n digits
19 lines (18 loc) • 647 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateCustomByteStream = void 0;
/**
* Validates type of options.customByteStream.
* Please read the README for more information.
* @param options
* @throws {error} if called with invalid options
*/
const validateCustomByteStream = (options) => {
if (!options || !options.customByteStream) {
return;
}
if (typeof options.customByteStream !== 'function') {
throw new Error('Invalid options: customByteStream must be a function that returns a byte Buffer.');
}
};
exports.validateCustomByteStream = validateCustomByteStream;