(root: string, path: string)
| 87 | } |
| 88 | |
| 89 | export function within(root: string, path: string): boolean { |
| 90 | const {relative, normalize, resolve, isAbsolute} = op; |
| 91 | path = relative(normalize(resolve(root)), normalize(resolve(path))); |
| 92 | return !path.startsWith("..") && !isAbsolute(path); |
| 93 | } |
no test coverage detected