UNPKG

tanisa

Version:

A utility to convert Malagasy 🇲🇬 numbers, dates, and times into their word representations.

15 lines (14 loc) • 450 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.inputToNativeDate = inputToNativeDate; function inputToNativeDate(input) { if (input instanceof Date) { if (isNaN(input.getTime())) throw new TypeError('Invalid Date object'); return input; } const d = new Date(input); if (isNaN(d.getTime())) throw new TypeError(`Invalid timestamp: "${input}"`); return d; }