export function escapePathPart()

in lib/object-path.ts [6:13]


export function escapePathPart(pathPart: string): string {
  if (!PATH_REG.test(pathPart)) {
    return pathPart;
  }

  const escaped = pathPart.replace(new RegExp(PATH_REG.source, 'g'), '\\$1');
  return `["${escaped}"]`;
}