Skip to content

Commit 6a108f8

Browse files
committed
Fix for TypeScript 3.4
1 parent 4da1790 commit 6a108f8

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"editor.formatOnSave": true
2+
"editor.formatOnSave": true,
3+
"typescript.tsdk": "node_modules/typescript/lib"
34
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"jest": "^21.2.1",
2020
"prettier": "^1.11.1",
2121
"ts-jest": "^21.2.4",
22-
"typescript": "^2.8.1"
22+
"typescript": "^3.4.1"
2323
},
2424
"jest": {
2525
"verbose": false,
@@ -34,4 +34,4 @@
3434
"mapCoverage": true,
3535
"testEnvironment": "node"
3636
}
37-
}
37+
}

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export type MultiValueVariants<Record extends MultiValueRec, TagProp extends str
6161
: { [_ in TagProp]: T } & Record[T] // no: decorate with tag
6262
};
6363

64-
export type UnTagged<Record, TagProp extends string = 'tag'> = Record extends {}
65-
? Pick<Record, { [k in keyof Record]: k extends TagProp ? never : k }[keyof Record]>
64+
export type UnTagged<Record, TagProp extends string = 'tag'> = Record extends any
65+
? Pick<Record, Exclude<keyof Record, TagProp>>
6666
: never;
6767

6868
export type SingleValueVariants<
@@ -111,7 +111,7 @@ export function unionize<Record>(record: Record, config?: { value?: string; tag?
111111

112112
const creators = {} as Creators<Record, any, any>;
113113
for (const tag in record) {
114-
creators[tag] = ((value = {}) =>
114+
creators[tag] = ((value: any = {}) =>
115115
valProp ? { [tagProp]: tag, [valProp]: value } : { ...value, [tagProp]: tag }) as any;
116116
}
117117

yarn.lock

+4-3
Original file line numberDiff line numberDiff line change
@@ -2534,9 +2534,10 @@ type-check@~0.3.2:
25342534
dependencies:
25352535
prelude-ls "~1.1.2"
25362536

2537-
typescript@^2.8.1:
2538-
version "2.8.1"
2539-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624"
2537+
typescript@^3.4.1:
2538+
version "3.4.1"
2539+
resolved "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6"
2540+
integrity sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==
25402541

25412542
uglify-js@^2.6:
25422543
version "2.8.29"

0 commit comments

Comments
 (0)