diff options
author | cjihrig <cjihrig@gmail.com> | 2015-01-21 19:36:59 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-01-22 00:21:31 +0300 |
commit | 804e7aa9ab0b34fa88709ef0980b960abca5e059 (patch) | |
tree | 4e09207abd54e30bd62459e43e2f9219619a7256 /lib/path.js | |
parent | 803883bb1a701da12c285fd735233eed7627eada (diff) |
lib: use const to define constants
This commit replaces a number of var statements throughout
the lib code with const statements.
PR-URL: https://github.com/iojs/io.js/pull/541
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/path.js b/lib/path.js index 02cdf541b62..f1acb06b45a 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1,7 +1,7 @@ 'use strict'; -var isWindows = process.platform === 'win32'; -var util = require('util'); +const isWindows = process.platform === 'win32'; +const util = require('util'); // resolves . and .. elements in a path array with directory names there @@ -33,11 +33,11 @@ function normalizeArray(parts, allowAboveRoot) { // Regex to split a windows path into three parts: [*, device, slash, // tail] windows-only -var splitDeviceRe = +const splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; // Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = +const splitTailRe = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; var win32 = {}; @@ -378,7 +378,7 @@ win32.delimiter = ';'; // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. -var splitPathRe = +const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var posix = {}; |