@toreda/time
Version:
Simple, small footprint library for common time operations and converting between units of time.
25 lines (24 loc) • 584 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.timeCheckMethods = void 0;
const methods_1 = require("../methods");
/**
* Check whether provided object defines all time methods required to
* a Time object.
* @param o
* @returns
*
* @category Validators
*/
function timeCheckMethods(o) {
if (!o) {
return false;
}
for (const timeMethod of methods_1.timeMethods) {
if (typeof o[timeMethod] !== 'function') {
return false;
}
}
return true;
}
exports.timeCheckMethods = timeCheckMethods;