diff --git a/README.md b/README.md index 4b3da26..c403a50 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ Both keys and values of the `rewritePaths` object must end with a `/`. Paths are Output files are expected to have the `.js` extension. +AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories. + ## Add additional extensions You can configure AVA to recognize additional file extensions. To add (partial†) JSX support: diff --git a/index.js b/index.js index 5d0cd1e..c054114 100644 --- a/index.js +++ b/index.js @@ -2,10 +2,13 @@ const path = require('path'); const escapeStringRegexp = require('escape-string-regexp'); -const isPlainObject = require('is-plain-object'); const pkg = require('./package.json'); +function isPlainObject(x) { + return x !== null && typeof x === 'object' && Reflect.getPrototypeOf(x) === Object.prototype; +} + function isValidExtensions(extensions) { return Array.isArray(extensions) && extensions.length > 0 && diff --git a/package.json b/package.json index 07b87ca..7e1ac53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ava/typescript", - "version": "1.1.0", + "version": "1.1.1", "description": "TypeScript provider for AVA", "engines": { "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0" @@ -19,8 +19,7 @@ "test": "xo && nyc ava" }, "dependencies": { - "escape-string-regexp": "^2.0.0", - "is-plain-object": "^3.0.0" + "escape-string-regexp": "^2.0.0" }, "devDependencies": { "ava": "^3.0.0",