Skip to content

Commit

Permalink
fix: Added browser check before importing BufferConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
edcarroll committed Aug 10, 2018
1 parent 85b6fbd commit aab4f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/converters/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ export interface IPropertyConverter {

export const propertyConverters:Map<Function, IPropertyConverter> = new Map<Function, IPropertyConverter>();

propertyConverters.set(Buffer, new BufferConverter());
// Only import Buffer code if running in NodeJS
if (typeof window === "undefined") {
propertyConverters.set(Buffer, new BufferConverter());
}
propertyConverters.set(Date, new DateConverter());
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "es5",
"module": "es6",
"moduleResolution": "node",
"lib": ["es2015"],
"lib": ["es2015", "dom"],
"noEmitOnError": true,
"strict": true,
"strictPropertyInitialization": false,
Expand Down

0 comments on commit aab4f20

Please sign in to comment.