Browse Source

Do the Node.js check ourselves

string-allowed-chars
Sindre Sorhus 6 years ago
parent
commit
7065605245
  1. 1
      package.json
  2. 4
      source/lib/utils/infer-label.ts
  3. 2
      source/lib/utils/node/is-node.ts
  4. 2
      source/types.d.ts

1
package.json

@ -60,7 +60,6 @@
"codecov": "^3.1.0",
"del-cli": "^1.1.0",
"dot-prop": "^4.2.0",
"is-node": "^1.0.2",
"license-webpack-plugin": "^2.0.2",
"lodash.isequal": "^4.5.0",
"nyc": "^13.1.0",

4
source/lib/utils/infer-label.ts

@ -1,7 +1,7 @@
import lazyFS from './node/fs';
import {CallSite} from 'callsites';
import * as isNode from 'is-node';
import lazyFS from './node/fs';
import isValidIdentifier from './is-valid-identifier';
import isNode from './node/is-node';
// Regex to extract the label out of the `ow` function call
const labelRegex = /^.*?\((.*?)[,)]/;

2
source/lib/utils/node/is-node.ts

@ -0,0 +1,2 @@
// tslint:disable-next-line strict-type-predicates no-typeof-undefined
export default Boolean(typeof process !== 'undefined' && process.versions && process.versions.node);

2
source/types.d.ts

@ -1,2 +0,0 @@
declare module 'is-valid-identifier';
declare module 'is-node';
Loading…
Cancel
Save