import lodash from "lodash";
const fieldsToPath = (path) => path.map((field) => typeof field === "number" ? `[${field}]` : field).join(".").replace(/(.\[)/g, "[");
const fieldsToTranslatables = (node, fields) => {
  const { id, type } = node;
  const text = lodash.get(node, fields);
  const path = fieldsToPath(fields);
  if (!text) {
    return [];
  }
  return [{ id, text, type, path }];
};
export {
  fieldsToTranslatables
};
//# sourceMappingURL=fields-to-translatables.js.map
