UNPKG

@kermank/slots

Version:

A TypeScript library for handling time slots, scheduling, and timezone operations

16 lines (15 loc) 469 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSlot = isSlot; const luxon_1 = require("luxon"); /** * Type guard to check if a value is a valid Slot */ function isSlot(value) { return (value !== null && typeof value === 'object' && value.start instanceof luxon_1.DateTime && value.end instanceof luxon_1.DateTime && value.start <= value.end && typeof value.metadata === 'object'); }