Skip to content

Commit 6263881

Browse files
Rasmus SybergMTschannett
authored andcommitted
Added typecheck for the node Buffer
1 parent 9b15f64 commit 6263881

File tree

4 files changed

+143
-42
lines changed

4 files changed

+143
-42
lines changed

package-lock.json

Lines changed: 106 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"@types/mocha": "^2.2.33",
3333
"@types/node": "0.0.2",
3434
"@types/sinon": "^2.2.2",
35-
"chai": "^3.4.1",
36-
"chai-as-promised": "^6.0.0",
35+
"chai": "^4.2.0",
36+
"chai-as-promised": "^7.1.1",
3737
"del": "^2.2.1",
3838
"es6-shim": "^0.35.1",
3939
"gulp": "^3.9.1",
@@ -44,7 +44,7 @@
4444
"gulp-replace": "^0.5.4",
4545
"gulp-shell": "^0.5.1",
4646
"gulp-sourcemaps": "^1.6.0",
47-
"gulp-tslint": "^7.0.1",
47+
"gulp-tslint": "^8.1.3",
4848
"gulp-typescript": "^3.1.3",
4949
"gulp-uglify": "^2.0.0",
5050
"gulpclass": "^0.1.1",

src/TransformOperationExecutor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ export class TransformOperationExecutor {
9696
}
9797
if (value === null || value === undefined)
9898
return value;
99-
10099
return new Date(value);
100+
101+
} else if ((targetType === Buffer || value instanceof Buffer) && !isMap) {
102+
if (value === null || value === undefined)
103+
return value;
104+
return Buffer.from(value);
101105

102106
} else if (typeof value === "object" && value !== null) {
103107

0 commit comments

Comments
 (0)