Skip to content

Commit

Permalink
fix: Downlevel type definitions (#410)
Browse files Browse the repository at this point in the history
The definitions are now made compatible with older versions of typescript
adds a build step using downlevel-dts to handle this

NODE-2844
  • Loading branch information
nbbeeken committed Nov 6, 2020
1 parent 2df6b42 commit 203402f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@typescript-eslint/parser": "^3.10.1",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"downlevel-dts": "^0.7.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
Expand Down Expand Up @@ -81,7 +82,7 @@
"test-node": "mocha test/node",
"test-browser": "karma start karma.conf.js",
"build:ts": "tsc",
"build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*'",
"build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*' && downlevel-dts bson.d.ts bson.d.ts",
"build:bundle": "rollup -c rollup.config.js",
"build": "npm run build:dts && npm run build:bundle",
"lint": "eslint -v && eslint --ext '.js,.ts' --max-warnings=0 src test && tsc -v && tsc --noEmit",
Expand Down
3 changes: 2 additions & 1 deletion src/long.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ export class Long {
/**
* Tests if the specified object is a Long.
*/
static isLong(value: unknown): value is Long {
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
static isLong(value: any): value is Long {
return isObjectLike(value) && value['__isLong__'] === true;
}

Expand Down

0 comments on commit 203402f

Please sign in to comment.