@stryker-mutator/util
Advanced tools
Comparing version 5.4.1 to 5.5.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [5.5.0](https://github.com/stryker-mutator/stryker-js/compare/v5.4.1...v5.5.0) (2021-11-23) | ||
### Bug Fixes | ||
* **util:** clear require.cache behavior on case-insensitive file systems ([#3194](https://github.com/stryker-mutator/stryker-js/issues/3194)) ([39e3d86](https://github.com/stryker-mutator/stryker-js/commit/39e3d86238b29e5326b4f741f882cf3665200d1a)) | ||
## [5.4.1](https://github.com/stryker-mutator/stryker-js/compare/v5.4.0...v5.4.1) (2021-09-30) | ||
@@ -8,0 +19,0 @@ |
@@ -7,2 +7,3 @@ "use strict"; | ||
const not_empty_1 = require("./not-empty"); | ||
const platform_1 = require("./platform"); | ||
/** | ||
@@ -25,4 +26,7 @@ * A helper class that can be used by test runners. | ||
const cwd = process.cwd(); | ||
const startsWithCaseInsensitive = (filename, prefix) => filename.toLowerCase().startsWith(prefix.toLowerCase()); | ||
const startsWithCaseSensitive = (filename, prefix) => filename.startsWith(prefix); | ||
const startsWith = (0, platform_1.caseSensitiveFs)() ? startsWithCaseSensitive : startsWithCaseInsensitive; | ||
Object.keys(require.cache) | ||
.filter((fileName) => fileName.startsWith(`${cwd}${path_1.default.sep}`) && !fileName.startsWith(path_1.default.join(cwd, 'node_modules'))) | ||
.filter((fileName) => startsWith(fileName, `${cwd}${path_1.default.sep}`) && !startsWith(fileName, path_1.default.join(cwd, 'node_modules'))) | ||
.forEach((file) => cache.add(file)); | ||
@@ -29,0 +33,0 @@ this.parents = new Set(Array.from(cache) |
import { Primitive } from './primitive'; | ||
declare type ImmutablePrimitive = Primitive | ((...args: any[]) => any); | ||
export declare type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>; | ||
export declare type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : T extends RegExp ? Readonly<RegExp> : ImmutableObject<T>; | ||
export declare type ImmutableArray<T> = ReadonlyArray<Immutable<T>>; | ||
@@ -5,0 +5,0 @@ export declare type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>; |
@@ -16,2 +16,3 @@ export { childProcessAsPromised } from './child-process-as-promised'; | ||
export * from './find-unserializables'; | ||
export * from './platform'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -22,2 +22,3 @@ "use strict"; | ||
(0, tslib_1.__exportStar)(require("./find-unserializables"), exports); | ||
(0, tslib_1.__exportStar)(require("./platform"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stryker-mutator/util", | ||
"version": "5.4.1", | ||
"version": "5.5.0", | ||
"description": "Contains utilities for Stryker, the mutation testing framework for JavaScript and friends", | ||
@@ -32,3 +32,3 @@ "main": "dist/src/index.js", | ||
"devDependencies": { | ||
"@stryker-mutator/test-helpers": "5.4.1", | ||
"@stryker-mutator/test-helpers": "5.5.0", | ||
"@types/lodash.flatmap": "~4.5.6", | ||
@@ -40,3 +40,3 @@ "@types/node": "^15.0.0" | ||
}, | ||
"gitHead": "65118a02e5bad93ea95308c94458651131b8971e" | ||
"gitHead": "00bc8b9513ad49582d657c1a66d00562870f725b" | ||
} |
import path from 'path'; | ||
import { notEmpty } from './not-empty'; | ||
import { caseSensitiveFs } from './platform'; | ||
@@ -25,4 +26,7 @@ /** | ||
const cwd = process.cwd(); | ||
const startsWithCaseInsensitive = (filename: string, prefix: string) => filename.toLowerCase().startsWith(prefix.toLowerCase()); | ||
const startsWithCaseSensitive = (filename: string, prefix: string) => filename.startsWith(prefix); | ||
const startsWith = caseSensitiveFs() ? startsWithCaseSensitive : startsWithCaseInsensitive; | ||
Object.keys(require.cache) | ||
.filter((fileName) => fileName.startsWith(`${cwd}${path.sep}`) && !fileName.startsWith(path.join(cwd, 'node_modules'))) | ||
.filter((fileName) => startsWith(fileName, `${cwd}${path.sep}`) && !startsWith(fileName, path.join(cwd, 'node_modules'))) | ||
.forEach((file) => cache.add(file)); | ||
@@ -29,0 +33,0 @@ |
@@ -13,2 +13,4 @@ import { Primitive } from './primitive'; | ||
? ImmutableSet<M> | ||
: T extends RegExp | ||
? Readonly<RegExp> | ||
: ImmutableObject<T>; | ||
@@ -15,0 +17,0 @@ |
@@ -16,1 +16,2 @@ export { childProcessAsPromised } from './child-process-as-promised'; | ||
export * from './find-unserializables'; | ||
export * from './platform'; |
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
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
85708
94
1039