Socket
Socket
Sign inDemoInstall

@parcel/watcher

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/watcher - npm Package Compare versions

Comparing version 2.0.7 to 2.1.0

src/Glob.cc

3

index.d.ts
declare type FilePath = string;
declare type GlobPattern = string;

@@ -12,3 +13,3 @@ declare namespace ParcelWatcher {

export interface Options {
ignore?: FilePath[];
ignore?: (FilePath|GlobPattern)[];
backend?: BackendType;

@@ -15,0 +16,0 @@ }

const binding = require('node-gyp-build')(__dirname);
const path = require('path');
const micromatch = require('micromatch');
const isGlob = require('is-glob');
function normalizeOptions(dir, opts = {}) {
if (Array.isArray(opts.ignore)) {
opts = Object.assign({}, opts, {
ignore: opts.ignore.map((ignore) => path.resolve(dir, ignore)),
});
const { ignore, ...rest } = opts;
if (Array.isArray(ignore)) {
opts = { ...rest };
for (const value of ignore) {
if (isGlob(value)) {
if (!opts.ignoreGlobs) {
opts.ignoreGlobs = [];
}
const regex = micromatch.makeRe(value, {
// We set `dot: true` to workaround an issue with the
// regular expression on Linux where the resulting
// negative lookahead `(?!(\\/|^)` was never matching
// in some cases. See also https://bit.ly/3UZlQDm
dot: true,
// C++ does not support lookbehind regex patterns, they
// were only added later to JavaScript engines
// (https://bit.ly/3V7S6UL)
lookbehinds: false
});
opts.ignoreGlobs.push(regex.source);
} else {
if (!opts.ignorePaths) {
opts.ignorePaths = [];
}
opts.ignorePaths.push(path.resolve(dir, value));
}
}
}

@@ -10,0 +39,0 @@

{
"name": "@parcel/watcher",
"version": "2.0.7",
"version": "2.1.0",
"main": "index.js",

@@ -51,2 +51,4 @@ "types": "index.d.ts",

"dependencies": {
"is-glob": "^4.0.3",
"micromatch": "^4.0.5",
"node-addon-api": "^3.2.1",

@@ -58,5 +60,5 @@ "node-gyp-build": "^4.3.0"

"husky": "^7.0.2",
"lint-staged": "^11.1.2",
"mocha": "^9.1.1",
"prebuildify": "^4.2.1",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2"

@@ -63,0 +65,0 @@ },

@@ -105,3 +105,5 @@ # @parcel/watcher

- `ignore` - an array of paths to ignore. They can be either files or directories. No events will be emitted about these files or directories or their children.
- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`micromatch`](https://github.com/micromatch/micromatch) (see [features](https://github.com/micromatch/micromatch#matching-features)).
- paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children.
- glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths.
- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead.

@@ -108,0 +110,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc