UNPKG

@prismicio/types-internal

Version:
21 lines (20 loc) 571 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContentPath = void 0; const PATH_SEPARATOR = "::"; exports.ContentPath = { serialize(path) { return path.map((entry) => entry.key).join(PATH_SEPARATOR); }, current(path) { return path[path.length - 1]; }, append(path, strElement) { return path + PATH_SEPARATOR + strElement; }, make(entries) { return entries.reduce((acc, { key, type }) => { return key ? acc.concat({ key, type }) : acc; }, []); }, };