UNPKG

@lyra/form-builder

Version:
19 lines (18 loc) 536 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.isLegacyOptionsItem = isLegacyOptionsItem; exports.resolveValueWithLegacyOptionsSupport = resolveValueWithLegacyOptionsSupport; function isLegacyOptionsItem(item) { if (item && typeof item === 'object') { const keys = Object.keys(item); if (keys.length <= 2 && 'value' in item) { return true; } } return false; } function resolveValueWithLegacyOptionsSupport(item) { return isLegacyOptionsItem(item) ? item.value : item; }