Skip to content

Commit a2d6b7e

Browse files
author
James Halliday
committed
arguments what
1 parent 4fb9216 commit a2d6b7e

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

index.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ var fs = require('fs');
33

44
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
55

6-
function mkdirP (p, mode, f) {
6+
function mkdirP (p, mode, f, made) {
77
if (typeof mode === 'function' || mode === undefined) {
88
f = mode;
99
mode = 0777 & (~process.umask());
1010
}
11-
12-
// secret passalong argument.
13-
var made = arguments[3] || null;
14-
11+
if (!made) made = null;
12+
1513
var cb = f || function () {};
1614
if (typeof mode === 'string') mode = parseInt(mode, 8);
1715
p = path.resolve(p);
@@ -45,14 +43,12 @@ function mkdirP (p, mode, f) {
4543
});
4644
}
4745

48-
mkdirP.sync = function sync (p, mode) {
46+
mkdirP.sync = function sync (p, mode, made) {
4947
if (mode === undefined) {
5048
mode = 0777 & (~process.umask());
5149
}
52-
53-
// secret passalong argument
54-
var made = arguments[2] || null;
55-
50+
if (!made) made = null;
51+
5652
if (typeof mode === 'string') mode = parseInt(mode, 8);
5753
p = path.resolve(p);
5854

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test" : "tap test/*.js"
1717
},
1818
"devDependencies" : {
19-
"tap" : "0.2"
19+
"tap" : "~0.2.4"
2020
},
2121
"license" : "MIT/X11",
2222
"engines": { "node": "*" }

0 commit comments

Comments
 (0)