UNPKG

acud

Version:

acg react 组件库

26 lines • 642 B
/** * @file form utils * @author chenqiang(chenqiang03) */ export function toArray(candidate) { if (candidate === undefined || candidate === false) { return []; } return Array.isArray(candidate) ? candidate : [candidate]; } export function getFieldId(namePath, formName) { if (!namePath.length) { return undefined; } var mergedId = namePath.join('_'); return formName ? "".concat(formName, "_").concat(mergedId) : mergedId; } export function getCSSNumbericValue(value) { if (value === undefined) { return undefined; } if (typeof value === 'number') { return "".concat(value, "px"); } return value; }