From 23dbffd7e3320b7420c710e5eb6f9920d027f600 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Thu, 17 Oct 2019 10:47:34 -0700 Subject: [PATCH] chore: upgrade typescript to 3.5.3 --- ui/package.json | 2 +- ui/src/variables/components/CSVVariableBuilder.tsx | 4 ++-- ui/src/variables/utils/hydrateVars.ts | 6 +++--- ui/src/variables/utils/mapBuilder.ts | 2 +- ui/yarn.lock | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ui/package.json b/ui/package.json index a7f6a0ee1b..fc63f0d20c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -113,7 +113,7 @@ "ts-loader": "^5.3.3", "ts-node": "^8.3.0", "tslib": "^1.9.0", - "typescript": "3.4.5", + "typescript": "3.5.3", "webpack": "^4.37.0", "webpack-cli": "^3.3.6", "webpack-dev-server": "^3.7.2", diff --git a/ui/src/variables/components/CSVVariableBuilder.tsx b/ui/src/variables/components/CSVVariableBuilder.tsx index 8700a15d3c..d09a200008 100644 --- a/ui/src/variables/components/CSVVariableBuilder.tsx +++ b/ui/src/variables/components/CSVVariableBuilder.tsx @@ -92,11 +92,11 @@ export default class CSVTemplateBuilder extends PureComponent { this.setState({csv}) } - private getUniqueValuesFromCSV(csv: string) { + private getUniqueValuesFromCSV(csv: string): string[] { const parsedTVS = Papa.parse(csv) const templateValuesData: string[][] = _.get(parsedTVS, 'data', [[]]) - const valueSet = new Set() + const valueSet: Set = new Set() for (const row of templateValuesData) { for (const value of row) { const trimmedValue = trimAndRemoveQuotes(value) diff --git a/ui/src/variables/utils/hydrateVars.ts b/ui/src/variables/utils/hydrateVars.ts index 59e28778b8..ae2d75cae8 100644 --- a/ui/src/variables/utils/hydrateVars.ts +++ b/ui/src/variables/utils/hydrateVars.ts @@ -93,7 +93,7 @@ const getVarChildren = ( */ const collectAncestors = ( node: VariableNode, - acc = new Set() + acc: Set = new Set() ): VariableNode[] => { for (const parent of node.parents) { if (!acc.has(parent)) { @@ -119,7 +119,7 @@ const findSubgraph = ( graph: VariableNode[], variables: Variable[] ): VariableNode[] => { - const subgraph = new Set() + const subgraph: Set = new Set() for (const node of graph) { const shouldKeep = @@ -204,7 +204,7 @@ const constVariableValues = ( */ export const collectDescendants = ( node: VariableNode, - acc = new Set() + acc: Set = new Set() ): VariableNode[] => { for (const child of node.children) { if (!acc.has(child)) { diff --git a/ui/src/variables/utils/mapBuilder.ts b/ui/src/variables/utils/mapBuilder.ts index 94e1755b9e..760292c048 100644 --- a/ui/src/variables/utils/mapBuilder.ts +++ b/ui/src/variables/utils/mapBuilder.ts @@ -36,7 +36,7 @@ export const csvToMap = (csv: string): MapResult => { return {values, errors} } -export const trimAndRemoveQuotes = elt => { +export const trimAndRemoveQuotes = (elt: string): string => { const trimmed = elt.trim() const dequoted = trimmed.replace(/(^")|("$)/g, '') diff --git a/ui/yarn.lock b/ui/yarn.lock index f11842ad3b..981480886d 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -11834,10 +11834,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.4.5: - version "3.4.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" - integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw== +typescript@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== ua-parser-js@^0.7.18: version "0.7.18"