Merge pull request #1037 from quicktype/typescript3
Update to TypeScript 3
This commit is contained in:
Коммит
a502d95c3a
|
@ -28,7 +28,7 @@
|
|||
"@types/node": "^8.10.10",
|
||||
"@types/pako": "^1.0.0",
|
||||
"@types/pluralize": "0.0.28",
|
||||
"typescript": "~2.8.3",
|
||||
"typescript": "~3.0.1",
|
||||
"tslint": "^5.9.1"
|
||||
},
|
||||
"files": ["dist/**"]
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"devDependencies": {
|
||||
"@types/node": "^8.10.10",
|
||||
"@types/graphql": "^0.11.7",
|
||||
"typescript": "~2.8.3",
|
||||
"typescript": "~3.0.1",
|
||||
"tslint": "^5.9.1"
|
||||
},
|
||||
"files": ["dist/**"]
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"quicktype-core": "the build script replaces this",
|
||||
"typescript": "~2.8.3",
|
||||
"typescript-json-schema": "quicktype/typescript-json-schema#d16083d29c8b6702c666a981fa6b21113300c059"
|
||||
"typescript": "~3.0.1",
|
||||
"typescript-json-schema": "quicktype/typescript-json-schema#8ce897297cd101605a8f331e439e3281585ce12e"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.10",
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
10
package.json
10
package.json
|
@ -31,7 +31,7 @@
|
|||
"pluralize": "^7.0.0",
|
||||
"stream-json": "0.5.2",
|
||||
"string-to-stream": "^1.1.0",
|
||||
"typescript-json-schema": "quicktype/typescript-json-schema#d16083d29c8b6702c666a981fa6b21113300c059",
|
||||
"typescript-json-schema": "quicktype/typescript-json-schema#8ce897297cd101605a8f331e439e3281585ce12e",
|
||||
"unicode-properties": "github:quicktype/unicode-properties#dist",
|
||||
"universal-analytics": "^0.4.16",
|
||||
"urijs": "^1.19.1",
|
||||
|
@ -40,7 +40,7 @@
|
|||
"devDependencies": {
|
||||
"@types/urijs": "github:quicktype/types-urijs",
|
||||
"@types/is-url": "^1.2.28",
|
||||
"@types/jest": "^22.2.0",
|
||||
"@types/jest": "^23.1.6",
|
||||
"@types/lodash": "^4.14.108",
|
||||
"@types/node": "^8.10.10",
|
||||
"@types/node-persist": "0.0.33",
|
||||
|
@ -53,15 +53,15 @@
|
|||
"exit": "^0.1.2",
|
||||
"flow-bin": "^0.66.0",
|
||||
"flow-remove-types": "^1.2.3",
|
||||
"jest": "^22.4.3",
|
||||
"jest": "^23.1.0",
|
||||
"pkg": "^4.3.1",
|
||||
"promise-timeout": "^1.3.0",
|
||||
"semver": "^5.5.0",
|
||||
"shelljs": "^0.7.8",
|
||||
"ts-jest": "^22.4.2",
|
||||
"ts-jest": "^23.1.3",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "^5.9.1",
|
||||
"typescript": "~2.8.3",
|
||||
"typescript": "~3.0.1",
|
||||
"uglify-js": "^3.3.22",
|
||||
"watch": "^1.0.2",
|
||||
"@types/graphql": "^0.11.7",
|
||||
|
|
|
@ -269,7 +269,7 @@ export function gatherNames(graph: TypeGraph, destructive: boolean, debugPrint:
|
|||
|
||||
if (t instanceof ObjectType) {
|
||||
const properties = t.getSortedProperties();
|
||||
for (const [_, property] of properties) {
|
||||
for (const [, property] of properties) {
|
||||
processType(t, property.type, undefined);
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ export function gatherNames(graph: TypeGraph, destructive: boolean, debugPrint:
|
|||
}
|
||||
}
|
||||
|
||||
for (const [_, t] of graph.topLevels) {
|
||||
for (const [, t] of graph.topLevels) {
|
||||
processType(undefined, t, undefined);
|
||||
}
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ export function assignNames(rootNamespaces: Iterable<Namespace>): ReadonlyMap<Na
|
|||
const byProposed = setGroupBy(namedsForNamingFunction, n =>
|
||||
n.namingFunction.nameStyle(n.firstProposedName(ctx.names))
|
||||
);
|
||||
for (const [_, nameds] of byProposed) {
|
||||
for (const [, nameds] of byProposed) {
|
||||
// 3. Use each set's naming function to name its members.
|
||||
|
||||
const names = namer.assignNames(ctx.names, forbiddenNames, nameds);
|
||||
|
|
|
@ -245,7 +245,7 @@ export class TypeGraph {
|
|||
}
|
||||
}
|
||||
|
||||
for (const [_, t] of this.topLevels) {
|
||||
for (const [, t] of this.topLevels) {
|
||||
addFromType(t);
|
||||
}
|
||||
return new Set(types);
|
||||
|
|
|
@ -55,7 +55,7 @@ function canBeCombined(c1: ClassType, c2: ClassType, onlyWithSameProperties: boo
|
|||
assert(maxFaults >= 0, "Max faults negative");
|
||||
const commonProperties: string[] = [];
|
||||
let faults = 0;
|
||||
for (const [name, _] of smaller) {
|
||||
for (const [name] of smaller) {
|
||||
if (larger.has(name)) {
|
||||
commonProperties.push(name);
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,7 @@ function shouldBeMap(properties: ReadonlyMap<string, ClassProperty>): ReadonlySe
|
|||
const allCases = new Set<Type>();
|
||||
let canBeMap = true;
|
||||
// Check that all the property types are the same, modulo nullability.
|
||||
for (const [_, p] of properties) {
|
||||
for (const [, p] of properties) {
|
||||
// The set of types first property can be, minus null.
|
||||
const nn = removeNullFromType(p.type)[1];
|
||||
if (nn.size > 0) {
|
||||
|
|
|
@ -60,13 +60,7 @@ class CompilerHost implements ts.CompilerHost {
|
|||
return libFileName;
|
||||
}
|
||||
|
||||
writeFile(
|
||||
fileName: string,
|
||||
_data: string,
|
||||
_writeByteOrderMark: boolean,
|
||||
_onError: ((message: string) => void) | undefined,
|
||||
_sourceFiles: ReadonlyArray<ts.SourceFile>
|
||||
): void {
|
||||
writeFile(fileName: string): void {
|
||||
return panic(`writeFile should not be called by the TypeScript compiler. Filename ${fileName}`);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export async function inParallel<Item, Result, Acc>(args: ParallelArgs<Item, Res
|
|||
let { setup, workers, map } = args;
|
||||
await setup();
|
||||
|
||||
cluster.on("message", (worker, { _result, _item }) => {
|
||||
cluster.on("message", worker => {
|
||||
if (items.length) {
|
||||
worker.send(items.shift());
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче