Skip to content

Commit

Permalink
fix(TypeScript): Migrated to TypeScript 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Jun 15, 2018
1 parent 37a8832 commit de3d937
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
},
"homepage": "https://github.com/jan-molak/tiny-types#readme",
"devDependencies": {
"@types/chai": "4.1.3",
"@types/mocha": "5.2.0",
"@types/chai": "4.1.4",
"@types/mocha": "5.2.2",
"@types/node": "10.1.2",
"@types/sinon": "5.0.0",
"@types/sinon-chai": "2.7.32",
"@types/sinon": "5.0.1",
"@types/sinon-chai": "3.2.0",
"chai": "4.1.2",
"cheerio": "1.0.0-rc.2",
"commitizen": "2.10.1",
Expand All @@ -63,10 +63,10 @@
"sinon": "5.0.10",
"sinon-chai": "3.1.0",
"travis-deploy-once": "5.0.0",
"ts-node": "6.0.5",
"ts-node": "6.1.1",
"tslint": "5.10.0",
"tslint-microsoft-contrib": "5.0.3",
"typescript": "2.8.3"
"typescript": "2.9.2"
},
"config": {
"commitizen": {
Expand Down
2 changes: 1 addition & 1 deletion spec/pattern-matching/IdentityMatcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('pattern-matching', () => {

const result = new IdentityMatcher(s)
.when(s, _ => `received "some symbol"`)
.else(_ => `else, received "${_}"`);
.else(_ => `else, received "${_.toString()}"`);

expect(result).to.equal('received "some symbol"');
});
Expand Down
3 changes: 2 additions & 1 deletion src/types/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export type IsNeverWorker<S extends string> = (
// Worker needed because of https://github.com/Microsoft/TypeScript/issues/18118
export type IsNever<T extends string> = Not<HaveIntersection<IsNeverWorker<T>, 'false'>>;

export type IsFunction<T> = IsNever<keyof T>;
// http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html
export type IsFunction<T> = IsNever<Extract<keyof T, string>>;

export type NonFunctionProps<T> = {
[K in keyof T]: {
Expand Down

0 comments on commit de3d937

Please sign in to comment.