UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

20 lines (18 loc) • 716 B
function assertStepCountListener(listener) { if (typeof listener !== "function") { throw new Error("Pedometer.watchStepCount: listener must be a function"); } } function assertStepCountRange(start, end) { if (!(start instanceof Date) || !(end instanceof Date)) { throw new Error("Pedometer.getStepCount: start and end must be Dates"); } if (!Number.isFinite(start.getTime()) || !Number.isFinite(end.getTime())) { throw new Error("Pedometer.getStepCount: start and end must be valid dates"); } if (start.getTime() > end.getTime()) { throw new Error("Pedometer.getStepCount: start must precede end"); } } export { assertStepCountListener, assertStepCountRange }; //# sourceMappingURL=validate.mjs.map