UNPKG

@brizy/media-gallery

Version:
17 lines (16 loc) 406 B
import { pass } from "fp-utilities"; var id; (function(id) { id[id["type"] = 0] = "type"; })(id || (id = {})); /** * Check if a number is an Id. * - is a Natural number * - is higher then 0 */ export var is = function(v) { return Number.isInteger(v) && v > 0; }; /** * Read an Id value from a number. * In case number is not valid id, return undefined */ export var fromNumber = pass(is);