From a670727a3721d3db44a20c3091454508fdcba2b1 Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Thu, 26 Oct 2017 17:56:50 +0200 Subject: [PATCH 01/14] Add typings for leo/args --- types/args/args-tests.ts | 67 +++++++++++++++++++++++++++++++ types/args/index.d.ts | 87 ++++++++++++++++++++++++++++++++++++++++ types/args/tsconfig.json | 22 ++++++++++ types/args/tslint.json | 1 + 4 files changed, 177 insertions(+) create mode 100644 types/args/args-tests.ts create mode 100644 types/args/index.d.ts create mode 100644 types/args/tsconfig.json create mode 100644 types/args/tslint.json diff --git a/types/args/args-tests.ts b/types/args/args-tests.ts new file mode 100644 index 0000000000..3430288cd3 --- /dev/null +++ b/types/args/args-tests.ts @@ -0,0 +1,67 @@ +import * as args from "args"; + +args + .option("opt1", "desc") + .option("opt2", "desc", false, (value: any): any => value) + .options([ + { + name: 'opt3', + description: 'desc', + defaultValue: 1, + init: (value: any) => { }, + }, + { + name: 'opt4', + description: 'desc', + }, + ]) + .command("cm1", "desc") + .command("cm2", "desc", (value: any): void => { }, ['a']) + .example("ex1", "desc") + .examples([ + { + usage: "ex2", + description: "desc", + }, + ]); + +args.parse(['~/bin/node', '~/dir', 'arg', '--param'], { + help: true, + name: "name", + version: true, + usageFilter: (a: any): any => a, + value: "value", + mri: { + args: ['a'], + alias: { + a: "b", + c: ['d'], + }, + boolean: ['wat'], + default: { + foo: 'bar', + }, + string: ['zulu'], + unknown: (param: string): boolean => true, + }, + minimist: { + string: ['string'], + boolean: ['string'], + alias: { + bar: 'foo', + foo: ['bar1', 'bar2'], + }, + default: { + foo: 'bar', + }, + stopEarly: true, + "--": false, + unknown: (param: string): boolean => true, + }, + mainColor: "yellow", + subColor: "dim" +}); + +args.showHelp(); + +const x: string = args.sub[0]; diff --git a/types/args/index.d.ts b/types/args/index.d.ts new file mode 100644 index 0000000000..4e77da737b --- /dev/null +++ b/types/args/index.d.ts @@ -0,0 +1,87 @@ +declare var args: Args.API; +export = args; + +declare namespace Args { + export interface IMriUnknownFunction { + (param: string): boolean + } + + export interface IMinimistUnknownFunction { + (param: string): boolean + } + + export interface IMriArguments { + args?: string[]; + alias?: { + [key: string]: string | string[] + }; + boolean?: string | string[]; + default?: { + [key: string]: any + }; + string?: string | string[]; + unknown?: IMriUnknownFunction; + } + + export interface IMinimistArguments { + string?: string | string[]; + boolean?: boolean | string | string[]; + alias?: { + [key: string]: string | string[] + }; + default?: { + [key: string]: any + }; + stopEarly?: boolean; + "--"?: boolean; + unknown?: IMinimistUnknownFunction; + } + + export interface IOptionInitFunction { + (value: any): any; + } + + export interface ICommandInitFunction { + (name: string, sub: {}[], options: {}[]): void; + } + + export interface IUsageFilterFunction { + (output: any): any; + } + + export interface IConfiguration { + help?: boolean; + name?: string; + version?: boolean; + usageFilter?: IUsageFilterFunction; + value?: string; + mri: IMriArguments; + minimist?: IMinimistArguments; + mainColor: string | string[]; + subColor: string | string[]; + } + + export interface IOption { + name: string; + description: string; + init?: IOptionInitFunction; + defaultValue?: any; + } + + export interface IExample { + usage: string; + description: string; + } + + export interface API { + sub: string[]; + + option(name: string | [string, string], description: string, defaultValue?: any, init?: IOptionInitFunction): API; + options(list: IOption[]): API; + command(name: string, description: string, init?: ICommandInitFunction, aliases?: string[]): API; + example(usage: string, description: string): API; + examples(list: IExample[]): API; + parse(argv: string[], options?: IConfiguration): { [key: string]: any }; + showHelp(): void; + } +} diff --git a/types/args/tsconfig.json b/types/args/tsconfig.json new file mode 100644 index 0000000000..ccc4d54297 --- /dev/null +++ b/types/args/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "args-tests.ts" + ] +} diff --git a/types/args/tslint.json b/types/args/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/args/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 17e36b8576cddb120ed2e5c974c1619a24de6870 Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Thu, 26 Oct 2017 18:46:27 +0200 Subject: [PATCH 02/14] Updates to follow guidelines --- types/args/index.d.ts | 142 ++++++++++++++++++--------------------- types/args/tsconfig.json | 3 +- 2 files changed, 68 insertions(+), 77 deletions(-) diff --git a/types/args/index.d.ts b/types/args/index.d.ts index 4e77da737b..b6048d2c5f 100644 --- a/types/args/index.d.ts +++ b/types/args/index.d.ts @@ -1,87 +1,77 @@ -declare var args: Args.API; +// Type definitions for args 3.0 +// Project: https://github.com/leo/args#readme +// Definitions by: Slessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + export = args; -declare namespace Args { - export interface IMriUnknownFunction { - (param: string): boolean - } +declare namespace args { + let sub: string[]; - export interface IMinimistUnknownFunction { - (param: string): boolean - } + function option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): typeof args; + function options(list: Option[]): typeof args; + function command(name: string, description: string, init?: CommandInitFunction, aliases?: string[]): typeof args; + function example(usage: string, description: string): typeof args; + function examples(list: Example[]): typeof args; + function parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; + function showHelp(): void; +} - export interface IMriArguments { - args?: string[]; - alias?: { - [key: string]: string | string[] - }; - boolean?: string | string[]; - default?: { - [key: string]: any - }; - string?: string | string[]; - unknown?: IMriUnknownFunction; - } +type MriUnknownFunction = (param: string) => boolean; +type MinimistUnknownFunction = (param: string) => boolean; - export interface IMinimistArguments { - string?: string | string[]; - boolean?: boolean | string | string[]; - alias?: { - [key: string]: string | string[] - }; - default?: { - [key: string]: any - }; - stopEarly?: boolean; - "--"?: boolean; - unknown?: IMinimistUnknownFunction; - } +type OptionInitFunction = (value: any) => any; +type CommandInitFunction = (name: string, sub: string[], options: ConfigurationOptions) => void; +type UsageFilterFunction = (output: any) => any; - export interface IOptionInitFunction { - (value: any): any; - } +interface MriOptions { + args?: string[]; + alias?: { + [key: string]: string | string[] + }; + boolean?: string | string[]; + default?: { + [key: string]: any + }; + string?: string | string[]; + unknown?: MriUnknownFunction; +} - export interface ICommandInitFunction { - (name: string, sub: {}[], options: {}[]): void; - } +interface MinimistOptions { + string?: string | string[]; + boolean?: boolean | string | string[]; + alias?: { + [key: string]: string | string[] + }; + default?: { + [key: string]: any + }; + stopEarly?: boolean; + "--"?: boolean; + unknown?: MinimistUnknownFunction; +} - export interface IUsageFilterFunction { - (output: any): any; - } +interface ConfigurationOptions { + help?: boolean; + name?: string; + version?: boolean; + usageFilter?: UsageFilterFunction; + value?: string; + mri: MriOptions; + minimist?: MinimistOptions; + mainColor: string | string[]; + subColor: string | string[]; +} - export interface IConfiguration { - help?: boolean; - name?: string; - version?: boolean; - usageFilter?: IUsageFilterFunction; - value?: string; - mri: IMriArguments; - minimist?: IMinimistArguments; - mainColor: string | string[]; - subColor: string | string[]; - } +interface Option { + name: string; + description: string; + init?: OptionInitFunction; + defaultValue?: any; +} - export interface IOption { - name: string; - description: string; - init?: IOptionInitFunction; - defaultValue?: any; - } - - export interface IExample { - usage: string; - description: string; - } - - export interface API { - sub: string[]; - - option(name: string | [string, string], description: string, defaultValue?: any, init?: IOptionInitFunction): API; - options(list: IOption[]): API; - command(name: string, description: string, init?: ICommandInitFunction, aliases?: string[]): API; - example(usage: string, description: string): API; - examples(list: IExample[]): API; - parse(argv: string[], options?: IConfiguration): { [key: string]: any }; - showHelp(): void; - } +interface Example { + usage: string; + description: string; } diff --git a/types/args/tsconfig.json b/types/args/tsconfig.json index ccc4d54297..d287417769 100644 --- a/types/args/tsconfig.json +++ b/types/args/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "args-tests.ts" ] -} +} \ No newline at end of file From a33c9d1eed8c65f2ad47ec120c4387d04084493d Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Fri, 27 Oct 2017 10:09:58 +0200 Subject: [PATCH 03/14] Fix lint warnings --- types/args/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/types/args/index.d.ts b/types/args/index.d.ts index b6048d2c5f..43e1f86e85 100644 --- a/types/args/index.d.ts +++ b/types/args/index.d.ts @@ -2,20 +2,20 @@ // Project: https://github.com/leo/args#readme // Definitions by: Slessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 -export = args; +declare const c: args; +export = c; -declare namespace args { - let sub: string[]; +interface args { + sub: string[]; - function option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): typeof args; - function options(list: Option[]): typeof args; - function command(name: string, description: string, init?: CommandInitFunction, aliases?: string[]): typeof args; - function example(usage: string, description: string): typeof args; - function examples(list: Example[]): typeof args; - function parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; - function showHelp(): void; + option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): args; + options(list: Option[]): args; + command(name: string, description: string, init?: CommandInitFunction, aliases?: string[]): args; + example(usage: string, description: string): args; + examples(list: Example[]): args; + parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; + showHelp(): void; } type MriUnknownFunction = (param: string) => boolean; From 7758f8bcb995a8d9f841cde4c02500663804c06f Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Fri, 27 Oct 2017 15:07:11 +0200 Subject: [PATCH 04/14] Fix name for option type --- types/args/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/args/index.d.ts b/types/args/index.d.ts index 43e1f86e85..2ef8b1eb88 100644 --- a/types/args/index.d.ts +++ b/types/args/index.d.ts @@ -65,7 +65,7 @@ interface ConfigurationOptions { } interface Option { - name: string; + name: [string, string]; description: string; init?: OptionInitFunction; defaultValue?: any; From 8f9739685b4dc06c2b1c85bd8148d2299fead924 Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Sat, 28 Oct 2017 20:35:52 +0200 Subject: [PATCH 05/14] Move types only used once inline --- types/args/index.d.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/types/args/index.d.ts b/types/args/index.d.ts index 2ef8b1eb88..70b784564d 100644 --- a/types/args/index.d.ts +++ b/types/args/index.d.ts @@ -11,19 +11,14 @@ interface args { option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): args; options(list: Option[]): args; - command(name: string, description: string, init?: CommandInitFunction, aliases?: string[]): args; + command(name: string, description: string, init?: (name: string, sub: string[], options: ConfigurationOptions) => void, aliases?: string[]): args; example(usage: string, description: string): args; examples(list: Example[]): args; parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; showHelp(): void; } -type MriUnknownFunction = (param: string) => boolean; -type MinimistUnknownFunction = (param: string) => boolean; - type OptionInitFunction = (value: any) => any; -type CommandInitFunction = (name: string, sub: string[], options: ConfigurationOptions) => void; -type UsageFilterFunction = (output: any) => any; interface MriOptions { args?: string[]; @@ -35,7 +30,7 @@ interface MriOptions { [key: string]: any }; string?: string | string[]; - unknown?: MriUnknownFunction; + unknown?: (param: string) => boolean; } interface MinimistOptions { @@ -49,14 +44,14 @@ interface MinimistOptions { }; stopEarly?: boolean; "--"?: boolean; - unknown?: MinimistUnknownFunction; + unknown?: (param: string) => boolean; } interface ConfigurationOptions { help?: boolean; name?: string; version?: boolean; - usageFilter?: UsageFilterFunction; + usageFilter?: (output: any) => any; value?: string; mri: MriOptions; minimist?: MinimistOptions; @@ -65,7 +60,7 @@ interface ConfigurationOptions { } interface Option { - name: [string, string]; + name: string | [string, string]; description: string; init?: OptionInitFunction; defaultValue?: any; From 5bca9792476a08bf500e20c1978e73b760b714f1 Mon Sep 17 00:00:00 2001 From: isMeCoder Date: Mon, 30 Oct 2017 10:11:20 -0700 Subject: [PATCH 06/14] .html() can return null .html() can return null when querying an element that does not exist. Repro: const response = await axios.default.get('https://www.google.com/') const $ = cheerio.load(response.data) const foo = $('.bar').html() console.log(`foo is: ${foo}`) //foo is: null --- types/cheerio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 93f30e8a9f..511fce354d 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -172,7 +172,7 @@ interface Cheerio { empty(): Cheerio; - html(): string; + html(): string | null; html(html: string): Cheerio; text(): string; From ae9e9cee490557965317c0777ab85a66c5b6de9c Mon Sep 17 00:00:00 2001 From: Sebastien Cote Date: Mon, 30 Oct 2017 23:41:00 -0400 Subject: [PATCH 07/14] Update Materialize-Css for missing collapsible parameters --- types/materialize-css/index.d.ts | 13 +++++++++++-- types/materialize-css/materialize-css-tests.ts | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index 13b32c985d..eea7597392 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -4,6 +4,7 @@ // Leon Yu // Sukhdeep Singh // Jean-Francois Cere +// Sebastien Cote // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -555,9 +556,17 @@ interface JQuery { * Collapsibles are accordion elements that expand when clicked on. * They allow you to hide content that is not immediately relevant to the user. * - * @param CollapsibleOptions options the collapsible options + * @param CollapsibleOptions | string options the collapsible toptons or the string "destroy" to destroy the collapsible */ - collapsible(options?: Materialize.CollapsibleOptions): JQuery; + collapsible(options?: Materialize.CollapsibleOptions | string): JQuery; + + /** + * Programmatically trigger an event on a selected index + * + * @param string method the string "open" or "close" to open or to close the collapsible element on specified index + * @param number index the element index to trigger "open" or "close" function + */ + collapsible(method: string, index: number): JQuery; /** * Tooltips are small, interactive, textual hints for mainly graphical elements. diff --git a/types/materialize-css/materialize-css-tests.ts b/types/materialize-css/materialize-css-tests.ts index 50586ab104..02d35c7f40 100644 --- a/types/materialize-css/materialize-css-tests.ts +++ b/types/materialize-css/materialize-css-tests.ts @@ -39,6 +39,8 @@ let collapseHtml = '
    ' + $(collapseHtml).collapsible({ accordion: false, onClose: () => { alert('Closed'); } }); $(collapseHtml).collapsible({ accordion: true, onOpen: () => { alert('Opened'); } }); +$(collapseHtml).collapsible('destroy'); +$(collapseHtml).collapsible('open', 0); // Dialogs - Toasts Materialize.toast('I am a toast!', 4000); From 949d80bd1961a31a3c9438fe50a41494c9cf7608 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2017 01:02:31 -0400 Subject: [PATCH 08/14] Update chrome API --- types/chrome/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 0b6e1fd6e4..1d7c1ca651 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -7030,8 +7030,9 @@ declare namespace chrome.webNavigation { /** * The ID of the process runs the renderer for this tab. * @since Chrome 22. + * @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored. */ - processId: number; + processId?: number; /** The ID of the tab in which the frame is. */ tabId: number; /** The ID of the frame in the given tab. */ From 47ee461380f00c37eff94a2c434cd518f5b92991 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 31 Oct 2017 09:32:34 -0700 Subject: [PATCH 09/14] redux-storage: Fix compile errors (#21128) --- types/redux-storage/redux-storage-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/redux-storage/redux-storage-tests.ts b/types/redux-storage/redux-storage-tests.ts index 4e84468a64..b8d9ccdbb0 100644 --- a/types/redux-storage/redux-storage-tests.ts +++ b/types/redux-storage/redux-storage-tests.ts @@ -23,7 +23,7 @@ const initialStateLoader = createLoader(storageEngine); const storageMiddleware = createMiddleware(storageEngine, [], []); -const store = applyMiddleware(storageMiddleware)(createStore)(enhancedReducer); +const store = applyMiddleware(storageMiddleware)(createStore)(enhancedReducer); initialStateLoader(store).then(() => { // render app @@ -33,7 +33,7 @@ initialStateLoader(store).then(() => { // Test for React Native Async Storage engine const storageEngineReactNative = createReactNativeAsyncStorageEngine("test"); const storageMiddlewareReactNative = createMiddleware(storageEngine); -const storeReactNative = applyMiddleware(storageMiddlewareReactNative)(createStore)(enhancedReducer); +const storeReactNative = applyMiddleware(storageMiddlewareReactNative)(createStore)(enhancedReducer); initialStateLoader(storeReactNative).then(() => { // render app }) From d3a1e4b85e9e7e200d218b50fa56f41b8abe61a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20C=C3=B4t=C3=A9?= Date: Tue, 31 Oct 2017 12:45:29 -0400 Subject: [PATCH 10/14] Fix comment typo --- types/materialize-css/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index eea7597392..e1b4cd25ea 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -556,7 +556,7 @@ interface JQuery { * Collapsibles are accordion elements that expand when clicked on. * They allow you to hide content that is not immediately relevant to the user. * - * @param CollapsibleOptions | string options the collapsible toptons or the string "destroy" to destroy the collapsible + * @param CollapsibleOptions | string options the collapsible optons or the string "destroy" to destroy the collapsible */ collapsible(options?: Materialize.CollapsibleOptions | string): JQuery; From 4bf47706709307ea854eae84d9d1feb394c624bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20C=C3=B4t=C3=A9?= Date: Tue, 31 Oct 2017 13:26:56 -0400 Subject: [PATCH 11/14] Fix typo error --- types/materialize-css/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index e1b4cd25ea..a457c3ad1a 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -556,7 +556,7 @@ interface JQuery { * Collapsibles are accordion elements that expand when clicked on. * They allow you to hide content that is not immediately relevant to the user. * - * @param CollapsibleOptions | string options the collapsible optons or the string "destroy" to destroy the collapsible + * @param CollapsibleOptions | string options the collapsible options or the string "destroy" to destroy the collapsible */ collapsible(options?: Materialize.CollapsibleOptions | string): JQuery; From a11a781688ef98a5859b14a3e465a4ef7bc2cc73 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 31 Oct 2017 10:52:41 -0700 Subject: [PATCH 12/14] Fix some no-empty-interface lint errors (#21144) --- types/enzyme/index.d.ts | 1 + types/react-navigation/react-navigation-tests.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 101215462f..d4498397bd 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -437,6 +437,7 @@ export class ShallowWrapper

    { parent(): ShallowWrapper; } +// tslint:disable-next-line no-empty-interface export interface ReactWrapper

    extends CommonWrapper {} export class ReactWrapper

    { constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps); diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 668621399d..62286dd4c3 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -45,12 +45,11 @@ interface StartScreenNavigationParams { s: string; } -interface StartScreenProps extends NavigationScreenProps { } /** * @desc Simple screen component class with typed component props that should * receive the navigation prop from the AppNavigator. */ -class StartScreen extends React.Component { +class StartScreen extends React.Component> { render() { // Implicit type checks. const navigationStateParams: StartScreenNavigationParams = this.props.navigation.state.params; From 5c3c66eaaa6ad01dc0612b454266bd06b26baf95 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 31 Oct 2017 14:38:38 -0700 Subject: [PATCH 13/14] Lock down to node version 8 (#21156) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07914721a9..9bd31bda14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - node + - 8 sudo: false From 17f38a9945d005b1f86589bbfdd0ecc1f76c489e Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 31 Oct 2017 14:45:50 -0700 Subject: [PATCH 14/14] baconjs: Make tests pass again (#21155) --- types/baconjs/baconjs-tests.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/types/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts index 75560d4e42..d39a4fd466 100644 --- a/types/baconjs/baconjs-tests.ts +++ b/types/baconjs/baconjs-tests.ts @@ -165,7 +165,12 @@ function CommonMethodsInEventStreamsAndProperties() { { // Calculator for grouped consecutive values until group is cancelled: - var events = [ + interface Event { + id:number; + type:string; + val?:number; + } + var events: Event[] = [ {id: 1, type: "add", val: 3}, {id: 2, type: "add", val: -1}, {id: 1, type: "add", val: 2}, @@ -177,7 +182,7 @@ function CommonMethodsInEventStreamsAndProperties() { {id: 1, type: "cancel"} ], keyF = (event:{id:number}) => event.id, - limitF = (groupedStream:Bacon.EventStream) => { + limitF = (groupedStream:Bacon.EventStream) => { var cancel = groupedStream.filter(x => x.type === "cancel").take(1), adds = groupedStream.filter(x => x.type === "add"); return adds.takeUntil(cancel).map(x => x.val);