UNPKG

@zensen/form-validators

Version:
20 lines (17 loc) 430 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extents = extents; exports.getValueByPath = getValueByPath; function extents(ext1, ext2) { return { min: ext1 < ext2 ? ext1 : ext2, max: ext1 > ext2 ? ext1 : ext2 }; } function getValueByPath(obj, keyPath) { return keyPath.reduce(function (obj, key) { return typeof obj !== 'undefined' ? obj[key] : undefined; }, obj); }