UNPKG

@arpinum/log

Version:

Simple module to log on stdout or stderr

15 lines (14 loc) 525 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertOptionalString = assertOptionalString; exports.assertOptionalFunction = assertOptionalFunction; function assertOptionalString(value, name) { if (value !== undefined && typeof value !== "string") { throw new Error(`${name} must be a string`); } } function assertOptionalFunction(value, name) { if (value !== undefined && typeof value !== "function") { throw new Error(`${name} must be a function`); } }