Skip to content

Commit c292ab9

Browse files
committed
squash: brevity check
1 parent 6f1344b commit c292ab9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/internal/fs/utils.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -884,15 +884,13 @@ const validateStringAfterArrayBufferView = hideStackFrames((buffer, name) => {
884884
});
885885

886886
const validatePrimitiveStringAfterArrayBufferView = hideStackFrames((buffer, name) => {
887-
if (typeof buffer === 'string') {
888-
return;
887+
if (typeof buffer !== 'string') {
888+
throw new ERR_INVALID_ARG_TYPE(
889+
name,
890+
['string', 'Buffer', 'TypedArray', 'DataView'],
891+
buffer
892+
);
889893
}
890-
891-
throw new ERR_INVALID_ARG_TYPE(
892-
name,
893-
['string', 'Buffer', 'TypedArray', 'DataView'],
894-
buffer
895-
);
896894
});
897895

898896
const validatePosition = hideStackFrames((position, name) => {

0 commit comments

Comments
 (0)