util.js
496 Bytes
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toArray = toArray;
exports.getFieldId = getFieldId;
function toArray(candidate) {
if (candidate === undefined || candidate === false) return [];
return Array.isArray(candidate) ? candidate : [candidate];
}
function getFieldId(namePath, formName) {
if (!namePath.length) return undefined;
var mergedId = namePath.join('_');
return formName ? "".concat(formName, "_").concat(mergedId) : mergedId;
}