Skip to content

Commit 08809f2

Browse files
committed
fs: simplify constant decls
PR-URL: #12644 Reviewed-By: Brian White <[email protected]>
1 parent e2199e0 commit 08809f2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/internal/fs.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ const Buffer = require('buffer').Buffer;
44
const Writable = require('stream').Writable;
55
const fs = require('fs');
66
const util = require('util');
7-
const constants = process.binding('constants').fs;
8-
9-
const O_APPEND = constants.O_APPEND | 0;
10-
const O_CREAT = constants.O_CREAT | 0;
11-
const O_EXCL = constants.O_EXCL | 0;
12-
const O_RDONLY = constants.O_RDONLY | 0;
13-
const O_RDWR = constants.O_RDWR | 0;
14-
const O_SYNC = constants.O_SYNC | 0;
15-
const O_TRUNC = constants.O_TRUNC | 0;
16-
const O_WRONLY = constants.O_WRONLY | 0;
7+
8+
const {
9+
O_APPEND,
10+
O_CREAT,
11+
O_EXCL,
12+
O_RDONLY,
13+
O_RDWR,
14+
O_SYNC,
15+
O_TRUNC,
16+
O_WRONLY
17+
} = process.binding('constants').fs;
1718

1819
function assertEncoding(encoding) {
1920
if (encoding && !Buffer.isEncoding(encoding)) {

0 commit comments

Comments
 (0)