Skip to content

Commit af07d68

Browse files
committed
add trim redact for array buffers
1 parent a5e6e72 commit af07d68

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aws-lambda-stream",
3-
"version": "1.1.16",
3+
"version": "1.1.17",
44
"description": "Create stream processors with AWS Lambda functions.",
55
"keywords": [
66
"aws",

src/utils/uow.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const trimAndRedact = (_uow) => { // eslint-disable-line import/prefer-de
2323
cache.push(value);
2424
}
2525
}
26+
if (ArrayBuffer.isView(value)) {
27+
return `[TYPED_ARRAY: ${value.byteLength}]`;
28+
}
2629
}
2730
return undefined;
2831
};

test/unit/utils/uow.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('utils/uow.js', () => {
3131
inputParams: {
3232
f2: 'v2',
3333
},
34+
arrayBuffer: new Uint8Array([0]),
3435
};
3536

3637
expect(trimAndRedact(uow)).to.deep.equal({
@@ -53,6 +54,7 @@ describe('utils/uow.js', () => {
5354
inputParams: {
5455
f2: '[REDACTED]',
5556
},
57+
arrayBuffer: '[TYPED_ARRAY: 1]',
5658
});
5759
});
5860
});

0 commit comments

Comments
 (0)