File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,22 @@ path.extname('.index')
9393
9494## path.format(pathObject)
9595
96- Returns a path string from an object, the opposite of [ ` path.parse ` ] [ ] .
96+ Returns a path string from an object. This is the opposite of [ ` path.parse ` ] [ ] .
97+
98+ If ` pathObject ` has all expected properties, the returned string will be a
99+ concatenation of the ` dir ` property, the platform-dependent path separator, and
100+ the ` base ` property.
101+
102+ If the ` dir ` property is not supplied, the ` root ` property will be used as the
103+ ` dir ` property. However, it will be assumed that the ` root ` property already
104+ ends with the platform-dependent path separator. In this case, the returned
105+ string will be the concatenation fo the ` root ` property and the ` base ` property.
106+
107+ If both the ` dir ` and the ` root ` properties are not supplied, then the returned
108+ string will be the contents of the ` base ` property.
109+
110+ If the ` base ` property is not supplied, a concatenation of the ` name ` property
111+ and the ` ext ` property will be used as the ` base ` property.
97112
98113``` js
99114path .format ({
You can’t perform that action at this time.
0 commit comments