automutate
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -61,12 +61,9 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, new Promise(function (resolve, reject) { | ||
fs.readFile(_this.fileName, function (error, data) { | ||
error | ||
? reject(error) | ||
: resolve(data.toString()); | ||
}); | ||
})]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
} | ||
return [2 /*return*/, new Promise(function (resolve, reject) { | ||
fs.readFile(_this.fileName, function (error, data) { | ||
error | ||
? reject(error) | ||
: resolve(data.toString()); | ||
}); | ||
})]; | ||
}); | ||
@@ -73,0 +70,0 @@ }); |
export * from "./automutator"; | ||
export * from "./logger"; | ||
export * from "./loggers/consoleLogger"; | ||
export * from "./mutation"; | ||
export * from "./mutationsAppliers/fileMutationsApplier"; | ||
export * from "./mutationsProvider"; | ||
export * from "./mutator"; | ||
export * from "./mutators/textSwapMutator"; | ||
export * from "./mutators/textDeleteMutator"; | ||
export * from "./mutators/textInsertMutator"; | ||
export * from "./mutators/textReplaceMutator"; |
@@ -7,3 +7,10 @@ "use strict"; | ||
__export(require("./automutator")); | ||
__export(require("./logger")); | ||
__export(require("./loggers/consoleLogger")); | ||
__export(require("./mutationsAppliers/fileMutationsApplier")); | ||
__export(require("./mutator")); | ||
__export(require("./mutators/textSwapMutator")); | ||
__export(require("./mutators/textDeleteMutator")); | ||
__export(require("./mutators/textInsertMutator")); | ||
__export(require("./mutators/textReplaceMutator")); | ||
//# sourceMappingURL=index.js.map |
import { IMutation } from "./mutation"; | ||
import { IMutationsWave } from "./mutationsProvider"; | ||
import { IFileMutations, IMutationsWave } from "./mutationsProvider"; | ||
/** | ||
* Mutations applied to each file, keyed by file name. | ||
*/ | ||
export interface IFileMutations { | ||
[i: string]: IMutation[]; | ||
} | ||
/** | ||
* Generates output messages for significant operations. | ||
@@ -50,7 +44,7 @@ */ | ||
*/ | ||
private fileMutations; | ||
private readonly fileMutations; | ||
/** | ||
* Waves of file mutations. | ||
*/ | ||
private mutationsWaves; | ||
private readonly mutationsWaves; | ||
/** | ||
@@ -57,0 +51,0 @@ * Logs that mutations have completed. |
@@ -32,3 +32,3 @@ "use strict"; | ||
.map(function (fileName) { return fileMutations[fileName].length; }) | ||
.reduce(function (a, b) { return a + b; }); | ||
.reduce(function (a, b) { return a + b; }, 0); | ||
var wavesCount = this.getMutationsWaves().length; | ||
@@ -35,0 +35,0 @@ console.log([ |
{ | ||
"name": "automutate", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Applies waves of mutations provided by other tools, such as linters.", | ||
"index": "lib/index.js", | ||
"types": "lib/idnex.d.ts", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"directories": { | ||
@@ -12,2 +12,5 @@ "test": "test" | ||
"@types/chai": "^4.1.2", | ||
"@types/es6-promise": "3.3.0", | ||
"@types/glob": "^5.0.35", | ||
"@types/glob-stream": "^6.1.0", | ||
"@types/minimatch": "^3.0.3", | ||
@@ -19,3 +22,11 @@ "@types/mocha": "^5.0.0", | ||
"del": "^3.0.0", | ||
"glob": "^7.1.2", | ||
"gulp": "^3.9.1", | ||
"gulp-mocha": "^5.0.0", | ||
"gulp-sourcemaps": "^2.6.4", | ||
"gulp-tslint": "^8.1.3", | ||
"gulp-typescript": "^4.0.1", | ||
"merge2": "^1.2.1", | ||
"mocha": "^5.0.5", | ||
"run-sequence": "^2.2.1", | ||
"sinon": "^4.4.8", | ||
@@ -22,0 +33,0 @@ "tslint": "^5.9.1", |
# automutate | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/automutate/automutate.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://travis-ci.org/automutate/automutate.svg?branch=master)](https://travis-ci.org/automutate/automutate) | ||
[![npm](https://img.shields.io/npm/v/automutate.svg)](https://www.npmjs.com/package/automutate) | ||
@@ -3,0 +6,0 @@ |
@@ -30,3 +30,3 @@ import * as fs from "fs"; | ||
public async read(): Promise<string> { | ||
return await new Promise<string>((resolve, reject): void => { | ||
return new Promise<string>((resolve, reject): void => { | ||
fs.readFile(this.fileName, (error: Error, data: Buffer): void => { | ||
@@ -33,0 +33,0 @@ error |
export * from "./automutator"; | ||
export * from "./logger"; | ||
export * from "./loggers/consoleLogger"; | ||
export * from "./mutation"; | ||
export * from "./mutationsAppliers/fileMutationsApplier"; | ||
export * from "./mutationsProvider"; | ||
export * from "./mutator"; | ||
export * from "./mutators/textSwapMutator"; | ||
export * from "./mutators/textDeleteMutator"; | ||
export * from "./mutators/textInsertMutator"; | ||
export * from "./mutators/textReplaceMutator"; |
import { IMutation } from "./mutation"; | ||
import { IMutationsWave } from "./mutationsProvider"; | ||
import { IFileMutations, IMutationsWave } from "./mutationsProvider"; | ||
/** | ||
* Mutations applied to each file, keyed by file name. | ||
*/ | ||
export interface IFileMutations { | ||
[i: string]: IMutation[]; | ||
} | ||
/** | ||
* Generates output messages for significant operations. | ||
@@ -57,3 +50,3 @@ */ | ||
*/ | ||
private fileMutations: IFileMutations = {}; | ||
private readonly fileMutations: IFileMutations = {}; | ||
@@ -63,3 +56,3 @@ /** | ||
*/ | ||
private mutationsWaves: IMutationsWave[] = []; | ||
private readonly mutationsWaves: IMutationsWave[] = []; | ||
@@ -66,0 +59,0 @@ /** |
@@ -1,3 +0,4 @@ | ||
import { IFileMutations, Logger } from "../logger"; | ||
import { Logger } from "../logger"; | ||
import { IMutation } from "../mutation"; | ||
import { IFileMutations } from "../mutationsProvider"; | ||
@@ -20,3 +21,3 @@ // tslint:disable:no-console | ||
.map((fileName: string): number => fileMutations[fileName].length) | ||
.reduce((a: number, b: number): number => a + b); | ||
.reduce((a: number, b: number): number => a + b, 0); | ||
const wavesCount: number = this.getMutationsWaves().length; | ||
@@ -23,0 +24,0 @@ |
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"lib": [ | ||
"es2015" | ||
], | ||
"module": "commonjs", | ||
@@ -5,0 +8,0 @@ "moduleResolution": "node", |
@@ -6,2 +6,3 @@ { | ||
"linebreak-style": false, | ||
"newline-per-chained-call": false, | ||
"no-parameter-reassignment": false, | ||
@@ -8,0 +9,0 @@ "no-submodule-imports": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188707
140
4078
86
22