How to use contains-path - 2 common examples

To help you get started, we’ve selected a few contains-path 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 benmosher / eslint-plugin-import / src / rules / no-restricted-paths.js View on Github external
matchingZones.forEach((zone) => {
          const absoluteFrom = path.resolve(basePath, zone.from)

          if (containsPath(absoluteImportPath, absoluteFrom)) {
            context.report({
              node,
              message: `Unexpected path "${importPath}" imported in restricted zone.`,
            })
          }
        })
    }
github benmosher / eslint-plugin-import / src / rules / no-restricted-paths.js View on Github external
const matchingZones = restrictedPaths.filter((zone) => {
      const targetPath = path.resolve(basePath, zone.target)

      return containsPath(currentFilename, targetPath)
    })

contains-path

Return true if a file path contains the given path.

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis

Popular contains-path functions