@fluid-experimental/property-changeset 2.70.0 → 2.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"pathHelper.js","sourceRoot":"","sources":["../src/pathHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAInD;;;GAGG;AACH,2DAA2D;AAC3D,MAAM,KAAW,UAAU,CA6gB1B;AA7gBD,WAAiB,UAAU;IAC1B,MAAM,2BAA2B,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE3D;;;;OAIG;IACH,IAAY,WAWX;IAXD,WAAY,WAAW;QACtB,6CAA6C;QAC7C,yEAAkB,CAAA;QAClB,+CAA+C;QAC/C,2DAAW,CAAA;QACX,uCAAuC;QACvC,mEAAe,CAAA;QACf,mDAAmD,CAAC,kBAAkB;QACtE,uEAAiB,CAAA;QACjB,2DAA2D;QAC3D,uEAAiB,CAAA;IAClB,CAAC,EAXW,WAAW,GAAX,sBAAW,KAAX,sBAAW,QAWtB;IAED;;;;;;;;OAQG;IACU,6BAAkB,GAAG,UACjC,OAAe,EACf,SAAyB;QAEzB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,SAAS,EAAE,CAAC;YACf,+BAA+B;YAC/B,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QAED,2EAA2E;QAC3E,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,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AE,EAAE,CAAC;YAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,+DAA+D;YAC/D,OAAO;gBACN,cAAc,EAAE,cAAc,CAAC,cAAc;gBAC7C,QAAQ,EAAE,KAAK;aACf,CAAC;QACH,CAAC;QAED,yDAAyD;QACzD,OAAO;YACN,cAAc,EAAE,cAAc,CAAC,SAAS;YACxC,QAAQ,EAAE,KAAK;SACf,CAAC;IACH,CAAC,CAAC;AACH,CAAC,EA7gBgB,UAAU,KAAV,UAAU,QA6gB1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions to work with path strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nexport type PathTree = Map<String, PathTree>;\n\n/**\n * Helper functions for string processing\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace PathHelper {\n\tconst RE_ALL_OPEN_SQUARE_BRACKETS = new RegExp(\"[[]\", \"g\");\n\n\t/**\n\t * Token Types\n\t * Type of the token in the path string\n\t * @internal\n\t */\n\texport enum TOKEN_TYPES {\n\t\t/** A normal path segment, separated via . */\n\t\tPATH_SEGMENT_TOKEN,\n\t\t/** An array path segment, separated via [ ] */\n\t\tARRAY_TOKEN,\n\t\t/** A / at the beginning of the path */\n\t\tPATH_ROOT_TOKEN,\n\t\t/** A * that indicates a dereferencing operation */ // note: reversed!\n\t\tDEREFERENCE_TOKEN,\n\t\t/** A ../ that indicates one step above the current path */\n\t\tRAISE_LEVEL_TOKEN,\n\t}\n\n\t/**\n\t * Tokenizes a path string\n\t *\n\t * @param in_path - The path string to divide into tokens\n\t * @param out_types - The types of the tokens\n\t *\n\t * @returns the tokens from the path string\n\t * @internal\n\t */\n\texport const tokenizePathString = function (\n\t\tin_path: string,\n\t\tout_types?: TOKEN_TYPES[],\n\t): string[] {\n\t\tconst tokens = [];\n\t\tlet currentToken = \"\";\n\n\t\tif (out_types) {\n\t\t\t// Make sure out_types is empty\n\t\t\tout_types.splice(0, out_types.length);\n\t\t}\n\n\t\t// Handle a / at the beginning of the path by adding a special token for it\n\t\tlet path_start = 0;\n\t\tif (in_path.startsWith(\"/\")) {\n\t\t\ttokens.push(\"/\");\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(TOKEN_TYPES.PATH_ROOT_TOKEN);\n\t\t\t}\n\t\t\tpath_start = 1;\n\t\t} else if (in_path.substr(0, 3) === \"../\") {\n\t\t\t// Handle relative paths by extracting the number steps above\n\t\t\tvar extractLevel = function (current_path) {\n\t\t\t\tif (current_path.substr(0, 3) === \"../\") {\n\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\tout_types.push(TOKEN_TYPES.RAISE_LEVEL_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t\ttokens.push(\"../\");\n\t\t\t\t\textractLevel(current_path.substr(3));\n\t\t\t\t\tpath_start = path_start + 3;\n\t\t\t\t}\n\t\t\t};\n\t\t\textractLevel(in_path);\n\t\t}\n\n\t\t// Let's see if the path is simple enough to use a fast-track algorithm.\n\t\tlet hackedPath = in_path.substr(path_start);\n\t\tif (\n\t\t\tin_path.indexOf(\"\\\\\") === -1 &&\n\t\t\tin_path.indexOf('\"') === -1 &&\n\t\t\tin_path.indexOf(\"*\") === -1\n\t\t) {\n\t\t\t// Yes, we can do something faster than parsing each character one by one.\n\t\t\tlet additionalTokens: string[] = [];\n\t\t\tconst additionalTypes = [];\n\t\t\tlet token: string | string[];\n\t\t\tlet i: number;\n\t\t\t// Hack for simplicity, let's first replace all occurences of '[' by '.['\n\t\t\thackedPath = hackedPath.replace(RE_ALL_OPEN_SQUARE_BRACKETS, \".[\");\n\t\t\t// Then split on '.'\n\t\t\tadditionalTokens = hackedPath.split(\".\");\n\t\t\t// And validate each token.\n\t\t\tfor (i = 0; i < additionalTokens.length; ++i) {\n\t\t\t\ttoken = additionalTokens[i];\n\t\t\t\t// Empty tokens are considered errors... but shouldn't '' be a valid name?\n\t\t\t\tif (token.length === 0) {\n\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (token.startsWith(\"[\")) {\n\t\t\t\t\tif (token.length > 2 && token.endsWith(\"]\")) {\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.ARRAY_TOKEN);\n\t\t\t\t\t\tadditionalTokens[i] = token.substr(1, token.length - 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (token.indexOf(\"]\") !== -1) {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// It was a simple property name.\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i === additionalTokens.length) {\n\t\t\t\t// Parsed everything successfully so end function here.\n\t\t\t\tif (out_types) {\n\t\t\t\t\tfor (i = 0; i < additionalTypes.length; i++) {\n\t\t\t\t\t\tout_types.push(additionalTypes[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn tokens.concat(additionalTokens);\n\t\t\t}\n\t\t}\n\n\t\tlet inSquareBrackets = false;\n\t\tlet tokenStarted = false;\n\t\tlet lastTokenWasQuoted = false;\n\n\t\t// We are in a context where an empty token is valid\n\t\tlet atStartToken = false;\n\t\tlet allowSegmentStart = true;\n\n\t\tconst storeNextToken = function (tokenType) {\n\t\t\t// Make sure, this is not an empty token (E.g. a .. or a [] )\n\t\t\tif (!tokenStarted) {\n\t\t\t\tif (!atStartToken) {\n\t\t\t\t\tthrow new Error(MSG.EMPTY_TOKEN + in_path);\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store the token\n\t\t\ttokens.push(currentToken);\n\t\t\tcurrentToken = \"\";\n\t\t\ttokenStarted = false;\n\t\t\tatStartToken = false;\n\t\t\tlastTokenWasQuoted = false;\n\t\t\tallowSegmentStart = false;\n\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(tokenType);\n\t\t\t}\n\t\t};\n\n\t\tfor (var i = path_start; i < in_path.length; i++) {\n\t\t\tconst character = in_path[i];\n\n\t\t\tif (character === '\"') {\n\t\t\t\t// If we encounter a quotation mark, we start parsing the\n\t\t\t\t// quoted section\n\t\t\t\tif (!tokenStarted) {\n\t\t\t\t\tlet endFound = false;\n\n\t\t\t\t\t// Read the quoted token\n\t\t\t\t\tfor (i++; i < in_path.length; i++) {\n\t\t\t\t\t\tif (in_path[i] === '\"') {\n\t\t\t\t\t\t\t// We have found the end of the quoted token\n\t\t\t\t\t\t\tendFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (in_path[i] === \"\\\\\") {\n\t\t\t\t\t\t\t// Read an escaped symbol\n\t\t\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t\t\tif (in_path[i + 1] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tcurrentToken += \"\\\\\";\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else if (in_path[i + 1] === '\"') {\n\t\t\t\t\t\t\t\t\tcurrentToken += '\"';\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Everything else is just added to the token\n\t\t\t\t\t\t\tcurrentToken += in_path[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endFound) {\n\t\t\t\t\t\tthrow new Error(MSG.UNCLOSED_QUOTATION_MARKS + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tlastTokenWasQuoted = true;\n\t\t\t\t\ttokenStarted = true;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t}\n\t\t\t} else if (!inSquareBrackets) {\n\t\t\t\tswitch (character) {\n\t\t\t\t\tcase PROPERTY_PATH_DELIMITER: {\n\t\t\t\t\t\t// A dot symbols starts a new token\n\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\n\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"[\": {\n\t\t\t\t\t\t// An opening square bracket starts a new token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// And sets the state to inSquareBrackets\n\t\t\t\t\t\tinSquareBrackets = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"]\": {\n\t\t\t\t\t\tthrow new Error(MSG.CLOSING_BRACKET_WITHOUT_OPENING + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tcase \"*\": {\n\t\t\t\t\t\t// Store the last token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Create a new dereference token\n\t\t\t\t\t\ttokens.push(\"*\");\n\t\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\t\tout_types.push(TOKEN_TYPES.DEREFERENCE_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Reset the token started flag\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t\tatStartToken = true;\n\t\t\t\t\t\tallowSegmentStart = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tif (!tokenStarted && !allowSegmentStart && !inSquareBrackets) {\n\t\t\t\t\t\t\tthrow new Error(MSG.MISSING_DOT_AT_SEGMENT_START + in_path);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (character === \"]\") {\n\t\t\t\t\t// A closing square bracket starts a new token\n\t\t\t\t\tstoreNextToken(TOKEN_TYPES.ARRAY_TOKEN);\n\n\t\t\t\t\t// We now have to check the next character,\n\t\t\t\t\t// as only the combinations '][' and '].' are\n\t\t\t\t\t// valid\n\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t// We only have to check this at the end of the string\n\t\t\t\t\t\tif (in_path[i + 1] === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\t\t\t// We are no longer in square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"[\") {\n\t\t\t\t\t\t\t// We remain in square brackets\n\t\t\t\t\t\t\t// so inSquareBrackets remains true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"*\") {\n\t\t\t\t\t\t\t// We leave the square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_END_OF_SQUARE_BRACKETS + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (character === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\tthrow new Error(MSG.DOTS_IN_SQUARE_BRACKETS + in_path);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At the end of the path we have to distinguish a few error cases\n\t\tif (inSquareBrackets) {\n\t\t\t// There was a un-closed bracket at the end\n\t\t\tthrow new Error(MSG.UNCLOSED_BRACKETS + in_path);\n\t\t} else if (in_path.endsWith(PROPERTY_PATH_DELIMITER)) {\n\t\t\t// A path ended with a PROPERTY_PATH_DELIMITER\n\t\t\tthrow new Error(MSG.DOT_AT_END + in_path);\n\t\t} else if (tokenStarted) {\n\t\t\t// There was a valid, not yet ended token\n\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t}\n\n\t\treturn tokens;\n\t};\n\n\t/**\n\t * Creates a quoted string for a path seqment to make sure it parses correctly\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegment = function (in_pathSegment: string): string {\n\t\t// WARNING: I use RegExps here, as the normal replace\n\t\t// function only replaces the first occurrence\n\n\t\t// First we escape escape symbols\n\t\tin_pathSegment = in_pathSegment.replace(/\\\\/g, \"\\\\\\\\\");\n\n\t\t// Then we escape quotes\n\t\tin_pathSegment = in_pathSegment.replace(/\"/g, '\\\\\"');\n\n\t\t// And finally, we put the string into quotation marks\n\t\treturn `\"${in_pathSegment}\"`;\n\t};\n\n\t/**\n\t * Reverse a quoted/escaped string for a path seqment\n\t *\n\t * @param in_quotedPathSegment - The quoted/escaped path string to put in quotes\n\t *\n\t * @return unquoted path string\n\t * @internal\n\t */\n\texport const unquotePathSegment = function (in_quotedPathSegment: string): string {\n\t\tif (typeof in_quotedPathSegment !== \"string\") {\n\t\t\tthrow new TypeError(`Expecting a string as a path: ${in_quotedPathSegment}`);\n\t\t}\n\n\t\tif (in_quotedPathSegment.startsWith('\"') && in_quotedPathSegment.endsWith('\"')) {\n\t\t\t// We remove double quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.substr(1, in_quotedPathSegment.length - 2);\n\n\t\t\t// Then we unescape escape symbols\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\\\\/g, \"\\\\\");\n\n\t\t\t// Then we unescape quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\"/g, '\"');\n\t\t}\n\n\t\treturn in_quotedPathSegment;\n\t};\n\n\t/**\n\t * Adds quotation marks to a path string if they are needed\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegmentIfNeeded = function (in_pathSegment: string): string {\n\t\treturn in_pathSegment.indexOf(PROPERTY_PATH_DELIMITER) !== -1 ||\n\t\t\tin_pathSegment.indexOf('\"') !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"\\\\\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"/\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"*\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"[\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"]\") !== -1 ||\n\t\t\tin_pathSegment.length === 0\n\t\t\t? quotePathSegment(in_pathSegment)\n\t\t\t: in_pathSegment;\n\t};\n\n\t/**\n\t * This function checks, whether the supplied path is a valid repository absolute path.\n\t *\n\t * It has to be either an empty string, or a path starting with a /\n\t *\n\t * @param in_path - The path to check\n\t * @internal\n\t */\n\texport const checkValidRepositoryAbsolutePath = function (in_path: string) {\n\t\tif (\n\t\t\tin_path !== \"\" && // either an empty reference\n\t\t\t!in_path.startsWith(\"/\")\n\t\t) {\n\t\t\t// or an absolute path starting with /\n\t\t\tthrow new Error(MSG.INVALID_PATH_IN_REFERENCE);\n\t\t}\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of an absolute property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_absolutePath - The absolute path to make canonical\n\t * @return Absolute path in canonical form\n\t * @internal\n\t */\n\texport const convertAbsolutePathToCanonical = function (in_absolutePath: string): string {\n\t\tconst tokenTypes = [];\n\t\tconst tokens = tokenizePathString(in_absolutePath, tokenTypes);\n\t\tlet path = \"\";\n\t\tfor (let i = 0; i < tokenTypes.length; i++) {\n\t\t\tconst tokenType = tokenTypes[i];\n\t\t\tswitch (tokenType) {\n\t\t\t\tcase TOKEN_TYPES.PATH_ROOT_TOKEN:\n\t\t\t\t\t// Skip the leading '/'\n\t\t\t\t\tbreak;\n\t\t\t\tcase TOKEN_TYPES.RAISE_LEVEL_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No level up (\"../\") is expected in an absolute path: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.DEREFERENCE_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Dereference (\"*\") is not supported in canonical paths: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.ARRAY_TOKEN:\n\t\t\t\tcase TOKEN_TYPES.PATH_SEGMENT_TOKEN:\n\t\t\t\t\tpath += PROPERTY_PATH_DELIMITER + quotePathSegmentIfNeeded(tokens[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Removes the leading PROPERTY_PATH_DELIMITER.\n\t\tif (path) {\n\t\t\tpath = path.substring(1);\n\t\t}\n\t\treturn path;\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of a child property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_parentAbsolutePathCanonical - The absolute path of the parent property in canonical form\n\t * @param in_childId - The name of the child property in its parent\n\t * @returns Absolute path of the child property in canonical form\n\t * @internal\n\t */\n\texport const getChildAbsolutePathCanonical = function (\n\t\tin_parentAbsolutePathCanonical: string,\n\t\tin_childId: string,\n\t): string {\n\t\tconst childPath = quotePathSegmentIfNeeded(String(in_childId));\n\t\treturn in_parentAbsolutePathCanonical\n\t\t\t? in_parentAbsolutePathCanonical + PROPERTY_PATH_DELIMITER + childPath\n\t\t\t: childPath;\n\t};\n\n\t/**\n\t * @internal\n\t */\n\texport enum CoverageExtent {\n\t\t// The base path is not covered by any path from a given list of paths.\n\t\t// This means a property with this path and all its children would not be covered.\n\t\tUNCOVERED,\n\t\t// The base path is partially covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered, but some of its children could be uncovered.\n\t\tPARTLY_COVERED,\n\t\t// The base path is fully covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered and all of its children would be covered also.\n\t\tFULLY_COVERED,\n\t}\n\n\tinterface BasePathCoverage {\n\t\tcoverageExtent: CoverageExtent;\n\t\tpathList: string[];\n\t}\n\n\t/**\n\t * Determines if the base path is covered by the given list of paths. From that you can deduce if a\n\t * property with that path and all its children are covered by the given list of paths.\n\t *\n\t * This function uses the canonical representation of the property paths.\n\t *\n\t * @param in_basePath - The property's absolute path in canonical form\n\t * @param in_paths - The array of paths that must cover the property and its children\n\t * @returns The coverage of the property and its children. For a coverage of\n\t * 'FULLY_COVERED', only the first matching path is returned.\n\t * @internal\n\t */\n\texport const getPathCoverage = function (\n\t\tin_basePath: string,\n\t\tin_paths: string[],\n\t): BasePathCoverage {\n\t\t// First, check if the base path is entirely included in one of the paths\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_basePath.startsWith(in_paths[i])) {\n\t\t\t\treturn {\n\t\t\t\t\tcoverageExtent: CoverageExtent.FULLY_COVERED,\n\t\t\t\t\tpathList: [in_paths[i]],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t// We did not find a path including all the children of this insertion\n\t\t// Let's check if there are paths going through it.\n\t\tconst paths = [];\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_paths[i].startsWith(in_basePath)) {\n\t\t\t\tpaths.push(in_paths[i]);\n\t\t\t}\n\t\t}\n\t\tif (paths.length) {\n\t\t\t// We found at least one path including parts of the base path.\n\t\t\treturn {\n\t\t\t\tcoverageExtent: CoverageExtent.PARTLY_COVERED,\n\t\t\t\tpathList: paths,\n\t\t\t};\n\t\t}\n\n\t\t// We did not find any path covering the given base path.\n\t\treturn {\n\t\t\tcoverageExtent: CoverageExtent.UNCOVERED,\n\t\t\tpathList: paths,\n\t\t};\n\t};\n}\n"]}
1
+ {"version":3,"file":"pathHelper.js","sourceRoot":"","sources":["../src/pathHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAInD;;;GAGG;AACH,2DAA2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AE,cAAc,CAAC,SAAS;YACxC,QAAQ,EAAE,KAAK;SACf,CAAC;IACH,CAAC,CAAC;AACH,CAAC,EA7gBgB,UAAU,KAAV,UAAU,QA6gB1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions to work with path strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nexport type PathTree = Map<string, PathTree>;\n\n/**\n * Helper functions for string processing\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace PathHelper {\n\tconst RE_ALL_OPEN_SQUARE_BRACKETS = new RegExp(\"[[]\", \"g\");\n\n\t/**\n\t * Token Types\n\t * Type of the token in the path string\n\t * @internal\n\t */\n\texport enum TOKEN_TYPES {\n\t\t/** A normal path segment, separated via . */\n\t\tPATH_SEGMENT_TOKEN,\n\t\t/** An array path segment, separated via [ ] */\n\t\tARRAY_TOKEN,\n\t\t/** A / at the beginning of the path */\n\t\tPATH_ROOT_TOKEN,\n\t\t/** A * that indicates a dereferencing operation */ // note: reversed!\n\t\tDEREFERENCE_TOKEN,\n\t\t/** A ../ that indicates one step above the current path */\n\t\tRAISE_LEVEL_TOKEN,\n\t}\n\n\t/**\n\t * Tokenizes a path string\n\t *\n\t * @param in_path - The path string to divide into tokens\n\t * @param out_types - The types of the tokens\n\t *\n\t * @returns the tokens from the path string\n\t * @internal\n\t */\n\texport const tokenizePathString = function (\n\t\tin_path: string,\n\t\tout_types?: TOKEN_TYPES[],\n\t): string[] {\n\t\tconst tokens = [];\n\t\tlet currentToken = \"\";\n\n\t\tif (out_types) {\n\t\t\t// Make sure out_types is empty\n\t\t\tout_types.splice(0, out_types.length);\n\t\t}\n\n\t\t// Handle a / at the beginning of the path by adding a special token for it\n\t\tlet path_start = 0;\n\t\tif (in_path.startsWith(\"/\")) {\n\t\t\ttokens.push(\"/\");\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(TOKEN_TYPES.PATH_ROOT_TOKEN);\n\t\t\t}\n\t\t\tpath_start = 1;\n\t\t} else if (in_path.substr(0, 3) === \"../\") {\n\t\t\t// Handle relative paths by extracting the number steps above\n\t\t\tvar extractLevel = function (current_path) {\n\t\t\t\tif (current_path.substr(0, 3) === \"../\") {\n\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\tout_types.push(TOKEN_TYPES.RAISE_LEVEL_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t\ttokens.push(\"../\");\n\t\t\t\t\textractLevel(current_path.substr(3));\n\t\t\t\t\tpath_start = path_start + 3;\n\t\t\t\t}\n\t\t\t};\n\t\t\textractLevel(in_path);\n\t\t}\n\n\t\t// Let's see if the path is simple enough to use a fast-track algorithm.\n\t\tlet hackedPath = in_path.substr(path_start);\n\t\tif (\n\t\t\tin_path.indexOf(\"\\\\\") === -1 &&\n\t\t\tin_path.indexOf('\"') === -1 &&\n\t\t\tin_path.indexOf(\"*\") === -1\n\t\t) {\n\t\t\t// Yes, we can do something faster than parsing each character one by one.\n\t\t\tlet additionalTokens: string[] = [];\n\t\t\tconst additionalTypes = [];\n\t\t\tlet token: string | string[];\n\t\t\tlet i: number;\n\t\t\t// Hack for simplicity, let's first replace all occurences of '[' by '.['\n\t\t\thackedPath = hackedPath.replace(RE_ALL_OPEN_SQUARE_BRACKETS, \".[\");\n\t\t\t// Then split on '.'\n\t\t\tadditionalTokens = hackedPath.split(\".\");\n\t\t\t// And validate each token.\n\t\t\tfor (i = 0; i < additionalTokens.length; ++i) {\n\t\t\t\ttoken = additionalTokens[i];\n\t\t\t\t// Empty tokens are considered errors... but shouldn't '' be a valid name?\n\t\t\t\tif (token.length === 0) {\n\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (token.startsWith(\"[\")) {\n\t\t\t\t\tif (token.length > 2 && token.endsWith(\"]\")) {\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.ARRAY_TOKEN);\n\t\t\t\t\t\tadditionalTokens[i] = token.substr(1, token.length - 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (token.indexOf(\"]\") !== -1) {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// It was a simple property name.\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i === additionalTokens.length) {\n\t\t\t\t// Parsed everything successfully so end function here.\n\t\t\t\tif (out_types) {\n\t\t\t\t\tfor (i = 0; i < additionalTypes.length; i++) {\n\t\t\t\t\t\tout_types.push(additionalTypes[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn tokens.concat(additionalTokens);\n\t\t\t}\n\t\t}\n\n\t\tlet inSquareBrackets = false;\n\t\tlet tokenStarted = false;\n\t\tlet lastTokenWasQuoted = false;\n\n\t\t// We are in a context where an empty token is valid\n\t\tlet atStartToken = false;\n\t\tlet allowSegmentStart = true;\n\n\t\tconst storeNextToken = function (tokenType) {\n\t\t\t// Make sure, this is not an empty token (E.g. a .. or a [] )\n\t\t\tif (!tokenStarted) {\n\t\t\t\tif (!atStartToken) {\n\t\t\t\t\tthrow new Error(MSG.EMPTY_TOKEN + in_path);\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store the token\n\t\t\ttokens.push(currentToken);\n\t\t\tcurrentToken = \"\";\n\t\t\ttokenStarted = false;\n\t\t\tatStartToken = false;\n\t\t\tlastTokenWasQuoted = false;\n\t\t\tallowSegmentStart = false;\n\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(tokenType);\n\t\t\t}\n\t\t};\n\n\t\tfor (var i = path_start; i < in_path.length; i++) {\n\t\t\tconst character = in_path[i];\n\n\t\t\tif (character === '\"') {\n\t\t\t\t// If we encounter a quotation mark, we start parsing the\n\t\t\t\t// quoted section\n\t\t\t\tif (!tokenStarted) {\n\t\t\t\t\tlet endFound = false;\n\n\t\t\t\t\t// Read the quoted token\n\t\t\t\t\tfor (i++; i < in_path.length; i++) {\n\t\t\t\t\t\tif (in_path[i] === '\"') {\n\t\t\t\t\t\t\t// We have found the end of the quoted token\n\t\t\t\t\t\t\tendFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (in_path[i] === \"\\\\\") {\n\t\t\t\t\t\t\t// Read an escaped symbol\n\t\t\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t\t\tif (in_path[i + 1] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tcurrentToken += \"\\\\\";\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else if (in_path[i + 1] === '\"') {\n\t\t\t\t\t\t\t\t\tcurrentToken += '\"';\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Everything else is just added to the token\n\t\t\t\t\t\t\tcurrentToken += in_path[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endFound) {\n\t\t\t\t\t\tthrow new Error(MSG.UNCLOSED_QUOTATION_MARKS + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tlastTokenWasQuoted = true;\n\t\t\t\t\ttokenStarted = true;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t}\n\t\t\t} else if (!inSquareBrackets) {\n\t\t\t\tswitch (character) {\n\t\t\t\t\tcase PROPERTY_PATH_DELIMITER: {\n\t\t\t\t\t\t// A dot symbols starts a new token\n\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\n\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"[\": {\n\t\t\t\t\t\t// An opening square bracket starts a new token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// And sets the state to inSquareBrackets\n\t\t\t\t\t\tinSquareBrackets = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"]\": {\n\t\t\t\t\t\tthrow new Error(MSG.CLOSING_BRACKET_WITHOUT_OPENING + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tcase \"*\": {\n\t\t\t\t\t\t// Store the last token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Create a new dereference token\n\t\t\t\t\t\ttokens.push(\"*\");\n\t\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\t\tout_types.push(TOKEN_TYPES.DEREFERENCE_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Reset the token started flag\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t\tatStartToken = true;\n\t\t\t\t\t\tallowSegmentStart = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tif (!tokenStarted && !allowSegmentStart && !inSquareBrackets) {\n\t\t\t\t\t\t\tthrow new Error(MSG.MISSING_DOT_AT_SEGMENT_START + in_path);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (character === \"]\") {\n\t\t\t\t\t// A closing square bracket starts a new token\n\t\t\t\t\tstoreNextToken(TOKEN_TYPES.ARRAY_TOKEN);\n\n\t\t\t\t\t// We now have to check the next character,\n\t\t\t\t\t// as only the combinations '][' and '].' are\n\t\t\t\t\t// valid\n\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t// We only have to check this at the end of the string\n\t\t\t\t\t\tif (in_path[i + 1] === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\t\t\t// We are no longer in square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"[\") {\n\t\t\t\t\t\t\t// We remain in square brackets\n\t\t\t\t\t\t\t// so inSquareBrackets remains true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"*\") {\n\t\t\t\t\t\t\t// We leave the square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_END_OF_SQUARE_BRACKETS + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (character === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\tthrow new Error(MSG.DOTS_IN_SQUARE_BRACKETS + in_path);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At the end of the path we have to distinguish a few error cases\n\t\tif (inSquareBrackets) {\n\t\t\t// There was a un-closed bracket at the end\n\t\t\tthrow new Error(MSG.UNCLOSED_BRACKETS + in_path);\n\t\t} else if (in_path.endsWith(PROPERTY_PATH_DELIMITER)) {\n\t\t\t// A path ended with a PROPERTY_PATH_DELIMITER\n\t\t\tthrow new Error(MSG.DOT_AT_END + in_path);\n\t\t} else if (tokenStarted) {\n\t\t\t// There was a valid, not yet ended token\n\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t}\n\n\t\treturn tokens;\n\t};\n\n\t/**\n\t * Creates a quoted string for a path seqment to make sure it parses correctly\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegment = function (in_pathSegment: string): string {\n\t\t// WARNING: I use RegExps here, as the normal replace\n\t\t// function only replaces the first occurrence\n\n\t\t// First we escape escape symbols\n\t\tin_pathSegment = in_pathSegment.replace(/\\\\/g, \"\\\\\\\\\");\n\n\t\t// Then we escape quotes\n\t\tin_pathSegment = in_pathSegment.replace(/\"/g, '\\\\\"');\n\n\t\t// And finally, we put the string into quotation marks\n\t\treturn `\"${in_pathSegment}\"`;\n\t};\n\n\t/**\n\t * Reverse a quoted/escaped string for a path seqment\n\t *\n\t * @param in_quotedPathSegment - The quoted/escaped path string to put in quotes\n\t *\n\t * @return unquoted path string\n\t * @internal\n\t */\n\texport const unquotePathSegment = function (in_quotedPathSegment: string): string {\n\t\tif (typeof in_quotedPathSegment !== \"string\") {\n\t\t\tthrow new TypeError(`Expecting a string as a path: ${in_quotedPathSegment}`);\n\t\t}\n\n\t\tif (in_quotedPathSegment.startsWith('\"') && in_quotedPathSegment.endsWith('\"')) {\n\t\t\t// We remove double quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.substr(1, in_quotedPathSegment.length - 2);\n\n\t\t\t// Then we unescape escape symbols\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\\\\/g, \"\\\\\");\n\n\t\t\t// Then we unescape quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\"/g, '\"');\n\t\t}\n\n\t\treturn in_quotedPathSegment;\n\t};\n\n\t/**\n\t * Adds quotation marks to a path string if they are needed\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegmentIfNeeded = function (in_pathSegment: string): string {\n\t\treturn in_pathSegment.indexOf(PROPERTY_PATH_DELIMITER) !== -1 ||\n\t\t\tin_pathSegment.indexOf('\"') !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"\\\\\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"/\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"*\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"[\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"]\") !== -1 ||\n\t\t\tin_pathSegment.length === 0\n\t\t\t? quotePathSegment(in_pathSegment)\n\t\t\t: in_pathSegment;\n\t};\n\n\t/**\n\t * This function checks, whether the supplied path is a valid repository absolute path.\n\t *\n\t * It has to be either an empty string, or a path starting with a /\n\t *\n\t * @param in_path - The path to check\n\t * @internal\n\t */\n\texport const checkValidRepositoryAbsolutePath = function (in_path: string) {\n\t\tif (\n\t\t\tin_path !== \"\" && // either an empty reference\n\t\t\t!in_path.startsWith(\"/\")\n\t\t) {\n\t\t\t// or an absolute path starting with /\n\t\t\tthrow new Error(MSG.INVALID_PATH_IN_REFERENCE);\n\t\t}\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of an absolute property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_absolutePath - The absolute path to make canonical\n\t * @return Absolute path in canonical form\n\t * @internal\n\t */\n\texport const convertAbsolutePathToCanonical = function (in_absolutePath: string): string {\n\t\tconst tokenTypes = [];\n\t\tconst tokens = tokenizePathString(in_absolutePath, tokenTypes);\n\t\tlet path = \"\";\n\t\tfor (let i = 0; i < tokenTypes.length; i++) {\n\t\t\tconst tokenType = tokenTypes[i];\n\t\t\tswitch (tokenType) {\n\t\t\t\tcase TOKEN_TYPES.PATH_ROOT_TOKEN:\n\t\t\t\t\t// Skip the leading '/'\n\t\t\t\t\tbreak;\n\t\t\t\tcase TOKEN_TYPES.RAISE_LEVEL_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No level up (\"../\") is expected in an absolute path: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.DEREFERENCE_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Dereference (\"*\") is not supported in canonical paths: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.ARRAY_TOKEN:\n\t\t\t\tcase TOKEN_TYPES.PATH_SEGMENT_TOKEN:\n\t\t\t\t\tpath += PROPERTY_PATH_DELIMITER + quotePathSegmentIfNeeded(tokens[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Removes the leading PROPERTY_PATH_DELIMITER.\n\t\tif (path) {\n\t\t\tpath = path.substring(1);\n\t\t}\n\t\treturn path;\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of a child property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_parentAbsolutePathCanonical - The absolute path of the parent property in canonical form\n\t * @param in_childId - The name of the child property in its parent\n\t * @returns Absolute path of the child property in canonical form\n\t * @internal\n\t */\n\texport const getChildAbsolutePathCanonical = function (\n\t\tin_parentAbsolutePathCanonical: string,\n\t\tin_childId: string,\n\t): string {\n\t\tconst childPath = quotePathSegmentIfNeeded(String(in_childId));\n\t\treturn in_parentAbsolutePathCanonical\n\t\t\t? in_parentAbsolutePathCanonical + PROPERTY_PATH_DELIMITER + childPath\n\t\t\t: childPath;\n\t};\n\n\t/**\n\t * @internal\n\t */\n\texport enum CoverageExtent {\n\t\t// The base path is not covered by any path from a given list of paths.\n\t\t// This means a property with this path and all its children would not be covered.\n\t\tUNCOVERED,\n\t\t// The base path is partially covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered, but some of its children could be uncovered.\n\t\tPARTLY_COVERED,\n\t\t// The base path is fully covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered and all of its children would be covered also.\n\t\tFULLY_COVERED,\n\t}\n\n\tinterface BasePathCoverage {\n\t\tcoverageExtent: CoverageExtent;\n\t\tpathList: string[];\n\t}\n\n\t/**\n\t * Determines if the base path is covered by the given list of paths. From that you can deduce if a\n\t * property with that path and all its children are covered by the given list of paths.\n\t *\n\t * This function uses the canonical representation of the property paths.\n\t *\n\t * @param in_basePath - The property's absolute path in canonical form\n\t * @param in_paths - The array of paths that must cover the property and its children\n\t * @returns The coverage of the property and its children. For a coverage of\n\t * 'FULLY_COVERED', only the first matching path is returned.\n\t * @internal\n\t */\n\texport const getPathCoverage = function (\n\t\tin_basePath: string,\n\t\tin_paths: string[],\n\t): BasePathCoverage {\n\t\t// First, check if the base path is entirely included in one of the paths\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_basePath.startsWith(in_paths[i])) {\n\t\t\t\treturn {\n\t\t\t\t\tcoverageExtent: CoverageExtent.FULLY_COVERED,\n\t\t\t\t\tpathList: [in_paths[i]],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t// We did not find a path including all the children of this insertion\n\t\t// Let's check if there are paths going through it.\n\t\tconst paths = [];\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_paths[i].startsWith(in_basePath)) {\n\t\t\t\tpaths.push(in_paths[i]);\n\t\t\t}\n\t\t}\n\t\tif (paths.length) {\n\t\t\t// We found at least one path including parts of the base path.\n\t\t\treturn {\n\t\t\t\tcoverageExtent: CoverageExtent.PARTLY_COVERED,\n\t\t\t\tpathList: paths,\n\t\t\t};\n\t\t}\n\n\t\t// We did not find any path covering the given base path.\n\t\treturn {\n\t\t\tcoverageExtent: CoverageExtent.UNCOVERED,\n\t\t\tpathList: paths,\n\t\t};\n\t};\n}\n"]}