How to use is-path-inside - 1 common examples

To help you get started, we’ve selected a few is-path-inside examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / src / legacy / server / sass / build.js View on Github external
await Promise.all(urlAssets.map(async (asset) => {
      if (!await exists(asset.path)) {
        throw this._makeError(
          'Invalid url() in css output',
          `url("${asset.requestUrl}") resolves to "${asset.path}", which does not exist.\n` +
          `  Make sure that the request is relative to "${asset.root}"`
        );
      }

      if (!isPathInside(asset.path, asset.boundry)) {
        throw this._makeError(
          'Invalid url() in css output',
          `url("${asset.requestUrl}") resolves to "${asset.path}"\n` +
          `  which is outside of "${asset.boundry}"`
        );
      }
    }));

is-path-inside

Check if a path is inside another path

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular is-path-inside functions