Skip to content

Commit

Permalink
Bump to latest @types/node
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed May 4, 2018
1 parent 6388e4f commit 55ff3ff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"@types/lorem-ipsum": "^1.0.2",
"@types/mocha": "^5.2.0",
"@types/node": "^9.6.6",
"@types/node": "^10.0.3",
"browserify": "^16.2.0",
"coveralls": "^3.0.0",
"mocha": "^5.1.1",
Expand Down
34 changes: 2 additions & 32 deletions src/check/runner/Sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,6 @@ interface Dictionary<T> {
[key: string]: T;
}

function Object_entries<T>(obj: Dictionary<T>): [string, T][] {
const entries: [string, T][] = [];
for (const k of Object.keys(obj)) {
entries.push([k, obj[k]]);
}
return entries;
}
function String_padStart(s: string, length: number, padString: string): string {
let pad = padString;
if (s.length > length) {
return String(s);
}
const missing = length - s.length;
if (missing > pad.length) {
pad += pad.repeat(missing / pad.length);
}
return pad.slice(0, missing) + s;
}
function String_padEnd(s: string, length: number, padString: string): string {
let pad = padString;
if (s.length > length) {
return String(s);
}
const missing = length - s.length;
if (missing > pad.length) {
pad += pad.repeat(missing / pad.length);
}
return String(s) + pad.slice(0, missing);
}

function statistics<Ts>(
generator: IProperty<Ts> | Arbitrary<Ts>,
classify: (v: Ts) => string | string[],
Expand All @@ -72,13 +42,13 @@ function statistics<Ts>(
recorded[c] = (recorded[c] || 0) + 1;
}
}
const data = Object_entries(recorded)
const data = Object.entries(recorded)
.sort((a, b) => b[1] - a[1])
.map(i => [i[0], `${(i[1] * 100.0 / qParams.numRuns).toFixed(2)}%`]);
const longestName = data.map(i => i[0].length).reduce((p, c) => Math.max(p, c), 0);
const longestPercent = data.map(i => i[1].length).reduce((p, c) => Math.max(p, c), 0);
for (const item of data) {
qParams.logger(`${String_padEnd(item[0], longestName, '.')}..${String_padStart(item[1], longestPercent, '.')}`);
qParams.logger(`${item[0].padEnd(longestName, '.')}..${item[1].padStart(longestPercent, '.')}`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"downlevelIteration": true,
"target": "es3",
"lib": [
"es6"
"esnext"
],
"outDir": "lib/"
},
Expand Down

0 comments on commit 55ff3ff

Please sign in to comment.