function toArray(value) {
  if (Array.isArray(value))
    return value;
  return value !== void 0 ? [value] : [];
}
function fillFieldNames(fieldNames) {
  const { label, value, children } = fieldNames || {};
  const mergedValue = value || "value";
  return {
    _title: label ? [label] : ["title", "label"],
    value: mergedValue,
    key: mergedValue,
    children: children || "children"
  };
}
function isCheckDisabled(node) {
  return node.disabled || node.disableCheckbox || node.checkable === false;
}
function getAllKeys(treeData, fieldNames) {
  const keys = [];
  function dig(list) {
    list.forEach((item) => {
      keys.push(item[fieldNames.value]);
      const children = item[fieldNames.children];
      if (children)
        dig(children);
    });
  }
  dig(treeData);
  return keys;
}
function isNil(val) {
  return val === null || val === void 0;
}

export { fillFieldNames, getAllKeys, isCheckDisabled, isNil, toArray };
//# sourceMappingURL=valueUtil.mjs.map
