17 lines
362 B
Plaintext
17 lines
362 B
Plaintext
//#region src/Matches.ts
|
|
/**
|
|
* Narrows matches based on a path
|
|
* @experimental
|
|
*/
|
|
const isMatch = (match, path) => {
|
|
const parts = path.split(".");
|
|
let part;
|
|
let i = 0;
|
|
let value = match;
|
|
while ((part = parts[i++]) != null && value != null) value = value[part];
|
|
return value != null;
|
|
};
|
|
//#endregion
|
|
export { isMatch };
|
|
|
|
//# sourceMappingURL=Matches.js.map |