Skip to content

Commit e75ac16

Browse files
committed
chore: replace nyc with c8
nyc doesn't support ESM, but c8 does and is a drop in replacement See https://github.com/bcoe/c8
1 parent 4d7af3e commit e75ac16

6 files changed

Lines changed: 410 additions & 2292 deletions

File tree

lib/copy-prototype-methods.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ var disallowedProperties = [
1010

1111
// This branch is covered when tests are run with `--disable-proto=throw`,
1212
// however we cannot test both branches at the same time, so this is ignored
13-
/* istanbul ignore next */
13+
/* c8 ignore start */
1414
if (throwsOnProto) {
1515
disallowedProperties.push("__proto__");
1616
}
17+
/* c8 ignore stop */
1718

1819
/**
1920
* Copies prototype methods into a new object that has no prototype
@@ -41,6 +42,6 @@ function copyPrototypeMethods(prototype) {
4142
return result;
4243
},
4344
Object.create(null));
44-
};
45+
}
4546

4647
export default copyPrototypeMethods;

lib/deprecated.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export function defaultMsg(packageName, funcName) {
3535
* @returns {undefined}
3636
*/
3737
export function printWarning(msg) {
38-
/* istanbul ignore next */
3938
if (typeof process === "object" && process.emitWarning) {
4039
// Emit Warnings in Node
4140
process.emitWarning(msg);

lib/global.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* @type {object} globalObject
44
*/
55
var globalObject;
6-
7-
/* istanbul ignore else */
86
if (typeof global !== "undefined") {
97
// Node
108
globalObject = global;
11-
} else if (typeof window !== "undefined") {
9+
} /* c8 ignore start */ else if (typeof window !== "undefined") {
1210
// Browser
1311
globalObject = window;
1412
} else {
1513
// WebWorker
1614
globalObject = self;
1715
}
16+
/* c8 ignore stop */
1817

1918
export default globalObject;

lib/throws-on-proto.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ try {
1212
// eslint-disable-next-line no-proto, no-unused-expressions
1313
object.__proto__;
1414
throwsOnProto = false;
15-
} catch (_) {
15+
} /* c8 ignore start */ catch (_) {
1616
// This branch is covered when tests are run with `--disable-proto=throw`,
1717
// however we can test both branches at the same time, so this is ignored
18-
/* istanbul ignore next */
1918
throwsOnProto = true;
2019
}
20+
/* c8 ignore end */
2121

2222
export default throwsOnProto;

0 commit comments

Comments
 (0)