johnagan / clean-webpack-plugin
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
README.md has changed.

@@ -62,6 +62,16 @@
Loading
62 62
    dangerouslyAllowCleanPatternsOutsideProject?: boolean;
63 63
}
64 64
65 +
// Copied from https://github.com/sindresorhus/is-plain-obj/blob/97480673cf12145b32ec2ee924980d66572e8a86/index.js
66 +
function isPlainObject(value: unknown): boolean {
67 +
    if (Object.prototype.toString.call(value) !== '[object Object]') {
68 +
        return false;
69 +
    }
70 +
71 +
    const prototype = Object.getPrototypeOf(value);
72 +
    return prototype === null || prototype === Object.getPrototypeOf({});
73 +
}
74 +
65 75
class CleanWebpackPlugin {
66 76
    private readonly dry: boolean;
67 77
    private readonly verbose: boolean;
@@ -75,7 +85,7 @@
Loading
75 85
    private outputPath: string;
76 86
77 87
    constructor(options: Options = {}) {
78 -
        if (Object.prototype.toString.call(options) !== "[object Object]") {
88 +
        if (isPlainObject(options) === false) {
79 89
            throw new Error(`clean-webpack-plugin only accepts an options object. See:
80 90
            https://github.com/johnagan/clean-webpack-plugin#options-and-defaults-optional`);
81 91
        }
Files Coverage
src/clean-webpack-plugin.ts 98.78%
Project Totals (1 files) 98.78%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading