UNPKG

@parcel/utils

Version:

Blazing fast, zero configuration web application bundler

12 lines (10 loc) 306 B
// @flow strict-local import type {FilePath} from '@parcel/types'; import path from 'path'; export default function isDirectoryInside( child: FilePath, parent: FilePath, ): boolean { const relative = path.relative(parent, child); return !relative.startsWith('..') && !path.isAbsolute(relative); }