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‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ const Buffer = require('buffer').Buffer;
44
constWritable=require('stream').Writable;
55
constfs=require('fs');
66
constutil=require('util');
7-
constconstants=process.binding('constants').fs;
8-
9-
constO_APPEND=constants.O_APPEND|0;
10-
constO_CREAT=constants.O_CREAT|0;
11-
constO_EXCL=constants.O_EXCL|0;
12-
constO_RDONLY=constants.O_RDONLY|0;
13-
constO_RDWR=constants.O_RDWR|0;
14-
constO_SYNC=constants.O_SYNC|0;
15-
constO_TRUNC=constants.O_TRUNC|0;
16-
constO_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
functionassertEncoding(encoding){
1920
if(encoding&&!Buffer.isEncoding(encoding)){

0 commit comments

Comments
(0)