@miniflare/shared
Advanced tools
Comparing version 2.6.0 to 2.7.0
import { Awaitable as Awaitable_2 } from '@miniflare/shared'; | ||
import { MockAgent } from 'undici'; | ||
@@ -225,2 +226,3 @@ export declare function addAll<T>(set: Set<T>, values: Iterable<T>): void; | ||
globalAsyncIO?: boolean; | ||
fetchMock?: MockAgent; | ||
} | ||
@@ -324,2 +326,8 @@ | ||
export declare type RouteType = string | { | ||
pattern: string; | ||
zone_id?: string; | ||
zone_name?: string; | ||
}; | ||
/** | ||
@@ -512,4 +520,4 @@ * Runs closure with the context's input gate (if any) closed, unless | ||
workers_dev?: boolean; | ||
route?: string; | ||
routes?: string[]; | ||
route?: RouteType; | ||
routes?: RouteType[]; | ||
webpack_config?: string; | ||
@@ -576,4 +584,4 @@ vars?: Record<string, any>; | ||
mounts?: Record<string, string>; | ||
route?: string; | ||
routes?: string[]; | ||
route?: RouteType; | ||
routes?: RouteType[]; | ||
global_async_io?: boolean; | ||
@@ -580,0 +588,0 @@ global_timers?: boolean; |
@@ -78,3 +78,3 @@ var __create = Object.create; | ||
var import_path = __toModule(require("path")); | ||
var import_ignore = __toModule(require("ignore")); | ||
var import_picomatch = __toModule(require("picomatch")); | ||
var numericCompare = new Intl.Collator(void 0, { numeric: true }).compare; | ||
@@ -110,9 +110,21 @@ function lexicographicCompare(x, y) { | ||
} | ||
function globsToMatcher(globs) { | ||
const ign = (0, import_ignore.default)(); | ||
if (globs) | ||
ign.add(globs); | ||
function globsToMatcher(globs = []) { | ||
const matchGlobs = []; | ||
const ignoreGlobs = []; | ||
for (const glob of globs) { | ||
if (glob.startsWith("!")) { | ||
ignoreGlobs.push(glob.slice(1)); | ||
} else { | ||
matchGlobs.push(glob); | ||
} | ||
} | ||
const isMatch = (0, import_picomatch.default)(matchGlobs, { | ||
dot: true, | ||
bash: true, | ||
contains: true, | ||
ignore: ignoreGlobs | ||
}); | ||
return { | ||
test: (string) => ign.ignores(string), | ||
toString: () => globs?.join(", ") ?? "" | ||
test: (string) => isMatch(string), | ||
toString: () => globs.join(", ") | ||
}; | ||
@@ -119,0 +131,0 @@ } |
{ | ||
"name": "@miniflare/shared", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"description": "Shared utility module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=16.7" | ||
"node": ">=16.13" | ||
}, | ||
@@ -39,8 +39,9 @@ "publishConfig": { | ||
"dependencies": { | ||
"ignore": "^5.1.8", | ||
"kleur": "^4.1.4" | ||
"kleur": "^4.1.4", | ||
"picomatch": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"@miniflare/shared-test": "2.6.0" | ||
"@miniflare/shared-test": "2.7.0", | ||
"@types/picomatch": "^2.3.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58931
1269
2
+ Addedpicomatch@^2.3.1
+ Addedpicomatch@2.3.1(transitive)
- Removedignore@^5.1.8
- Removedignore@5.3.2(transitive)