Skip to content
Permalink
Browse files

fs: simplify constant decls

PR-URL: #12644
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information...
jasnell committed Apr 25, 2017
1 parent e2199e0 commit 08809f28ad797b914bad2dcd21eefba898eaaa4d
Showing with 11 additions and 10 deletions.
  1. +11 −10 lib/internal/fs.js
@@ -4,16 +4,17 @@ const Buffer = require('buffer').Buffer;
const Writable = require('stream').Writable;
const fs = require('fs');
const util = require('util');
const constants = process.binding('constants').fs;

const O_APPEND = constants.O_APPEND | 0;
const O_CREAT = constants.O_CREAT | 0;
const O_EXCL = constants.O_EXCL | 0;
const O_RDONLY = constants.O_RDONLY | 0;
const O_RDWR = constants.O_RDWR | 0;
const O_SYNC = constants.O_SYNC | 0;
const O_TRUNC = constants.O_TRUNC | 0;
const O_WRONLY = constants.O_WRONLY | 0;

const {
O_APPEND,
O_CREAT,
O_EXCL,
O_RDONLY,
O_RDWR,
O_SYNC,
O_TRUNC,
O_WRONLY
} = process.binding('constants').fs;

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

0 comments on commit 08809f2

Please sign in to comment.
You can’t perform that action at this time.