From 5f8ffa32d186b7fa6e30770eb0698eaac2408e8f Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 10 Apr 2017 02:45:33 +0300 Subject: [PATCH 1/4] doc: unify spaces in path.md --- doc/api/path.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/path.md b/doc/api/path.md index 0039e2c3ef14bd..6caa1c4f08b23f 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -236,8 +236,8 @@ On Windows: ```js path.format({ - dir : "C:\\path\\dir", - base : "file.txt" + dir: "C:\\path\\dir", + base: "file.txt" }); // Returns: 'C:\\path\\dir\\file.txt' ``` From ad36735fafeb4cb0721cb832e7f0aeb1a457db07 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 10 Apr 2017 02:47:11 +0300 Subject: [PATCH 2/4] doc: unify quotes in path.md --- doc/api/path.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/path.md b/doc/api/path.md index 6caa1c4f08b23f..5c0ae774bed9e4 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -236,8 +236,8 @@ On Windows: ```js path.format({ - dir: "C:\\path\\dir", - base: "file.txt" + dir: 'C:\\path\\dir', + base: 'file.txt' }); // Returns: 'C:\\path\\dir\\file.txt' ``` From b6111e7d9922528ecc38a60b8f53ca7f83b2a68f Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 10 Apr 2017 02:47:57 +0300 Subject: [PATCH 3/4] doc: unify semicolons by sections in path.md --- doc/api/path.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/path.md b/doc/api/path.md index 5c0ae774bed9e4..c3321c4699d02c 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -332,7 +332,7 @@ path.normalize('/foo/bar//baz/asdf/quux/..') On Windows: ```js -path.normalize('C:\\temp\\\\foo\\bar\\..\\'); +path.normalize('C:\\temp\\\\foo\\bar\\..\\') // Returns: 'C:\\temp\\foo\\' ``` From 0490f1cd2acd3bf11ec6048f1fb297f42378a371 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 10 Apr 2017 02:52:00 +0300 Subject: [PATCH 4/4] doc: update output examples in path.md --- doc/api/path.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/doc/api/path.md b/doc/api/path.md index c3321c4699d02c..afb44d2de0fa86 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -299,7 +299,7 @@ path.join('/foo', 'bar', 'baz/asdf', 'quux', '..') // Returns: '/foo/bar/baz/asdf' path.join('foo', {}, 'bar') -// throws TypeError: Arguments to path.join must be strings +// throws 'TypeError: Path must be a string. Received {}' ``` A [`TypeError`][] is thrown if any of the path segments is not a string. @@ -362,13 +362,11 @@ For example on POSIX: ```js path.parse('/home/user/dir/file.txt') // Returns: -// { -// root : "/", -// dir : "/home/user/dir", -// base : "file.txt", -// ext : ".txt", -// name : "file" -// } +// { root: '/', +// dir: '/home/user/dir', +// base: 'file.txt', +// ext: '.txt', +// name: 'file' } ``` ```text @@ -386,13 +384,11 @@ On Windows: ```js path.parse('C:\\path\\dir\\file.txt') // Returns: -// { -// root : "C:\\", -// dir : "C:\\path\\dir", -// base : "file.txt", -// ext : ".txt", -// name : "file" -// } +// { root: 'C:\\', +// dir: 'C:\\path\\dir', +// base: 'file.txt', +// ext: '.txt', +// name: 'file' } ``` ```text