From 0ea3e08d9bcb45cc0b2b665f7200a647b3af3cf4 Mon Sep 17 00:00:00 2001 From: Martin Brodziansky Date: Tue, 10 Aug 2021 21:20:52 +0200 Subject: [PATCH 1/2] Cast min and max argument when Dates to get rid of TS error --- src/utils/buildAxis.linear.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/buildAxis.linear.ts b/src/utils/buildAxis.linear.ts index 294014d4..0d9776ac 100644 --- a/src/utils/buildAxis.linear.ts +++ b/src/utils/buildAxis.linear.ts @@ -122,12 +122,12 @@ function buildTimeAxis( // see https://stackoverflow.com/a/2831422 if (Object.prototype.toString.call(options.min) === '[object Date]') { - minValue = min([options.min, minValue as Date]) + minValue = min([options.min, minValue] as Date[]) shouldNice = false } if (Object.prototype.toString.call(options.max) === '[object Date]') { - maxValue = max([options.max, maxValue as Date]) + maxValue = max([options.max, maxValue] as Date[]) shouldNice = false } From 8c0bcb14de55405a115aa62c24330baba0992a3e Mon Sep 17 00:00:00 2001 From: Martin Brodziansky Date: Wed, 11 Aug 2021 02:42:45 +0200 Subject: [PATCH 2/2] Output TS version during build --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e711b951..04aee463 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "build:commonjs": "rimraf ./lib && cross-env BABEL_ENV=commonjs babel --extensions .ts,.tsx --ignore ./src/**/tests/**/* ./src --out-dir lib", "build:es": "rimraf ./es && babel --extensions .ts,.tsx --ignore ./src/**/tests/**/* ./src --out-dir es", "build:umd": "rimraf ./dist && cross-env NODE_ENV=production rollup -c && rollup-plugin-visualizer stats-react.json", - "build:types": "rimraf ./types && tsc --project ./tsconfig.types.json && replace 'import type' 'import' ./types -r --silent && replace 'export type' 'export' ./types -r --silent", + "build:types": "rimraf ./types && tsc --version && tsc --project ./tsconfig.types.json && replace 'import type' 'import' ./types -r --silent && replace 'export type' 'export' ./types -r --silent", "watch": "yarn watch:commonjs & yarn watch:es & yarn watch:umd & yarn watch:types", "watch:commonjs": "rimraf ./lib && cross-env BABEL_ENV=commonjs babel --watch --extensions .ts,.tsx --ignore ./src/**/tests/**/* ./src --out-dir lib", "watch:es": "rimraf ./es && babel --watch --extensions .ts,.tsx --ignore ./src/**/tests/**/* ./src --out-dir es",