Skip to content

Commit

Permalink
Stop using Babel for types/make.js
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Jan 20, 2017
1 parent 0603edc commit 95ff309
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -47,7 +47,7 @@
"test-win": "tap --no-cov --reporter=classic --timeout=150 test/*.js test/reporters/*.js",
"visual": "node test/visual/run-visual-tests.js",
"prepublish": "npm run make-ts",
"make-ts": "babel-node --presets=babel-preset-es2015-node4 --plugins=transform-runtime types/make.js"
"make-ts": "node types/make.js"
},
"files": [
"lib",
Expand Down Expand Up @@ -168,7 +168,6 @@
"update-notifier": "^1.0.0"
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-preset-react": "^6.5.0",
"cli-table2": "^0.2.0",
"coveralls": "^2.11.4",
Expand Down
8 changes: 4 additions & 4 deletions types/make.js
Expand Up @@ -16,7 +16,7 @@ const path = require('path');
const fs = require('fs');
const runner = require('../lib/runner');

const arrayHas = parts => part => parts.includes(part);
const arrayHas = parts => part => parts.indexOf(part) > -1;

const base = fs.readFileSync(path.join(__dirname, 'base.d.ts'), 'utf8');

Expand All @@ -35,7 +35,7 @@ function generatePrefixed(prefix) {
for (const part of allParts) {
const parts = prefix.concat([part]);

if (prefix.includes(part) || !verify(parts, true)) {
if (prefix.indexOf(part) > -1 || !verify(parts, true)) {
// Function already in prefix or not allowed here
continue;
}
Expand All @@ -55,7 +55,7 @@ function generatePrefixed(prefix) {
// `always` is a valid prefix, for instance of `always.after`,
// but not a valid function name.
if (verify(parts, false)) {
if (parts.includes('todo')) {
if (parts.indexOf('todo') > -1) {
output += '\t' + writeFunction(part, 'name: string', 'void');
} else {
const type = testType(parts);
Expand Down Expand Up @@ -139,7 +139,7 @@ function exists(parts) {

// Valid prefix, check whether it has members
for (const prefix of allParts) {
if (!parts.includes(prefix) && exists(parts.concat([prefix]))) {
if (parts.indexOf(prefix) === -1 && exists(parts.concat([prefix]))) {
return true;
}
}
Expand Down

0 comments on commit 95ff309

Please sign in to comment.