Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

"add improvements"

  • Loading branch information...
commit f1283d3a7e8d4d8555a591515ea58efcb07af16f 1 parent 7437d94
@gero3 authored
Showing with 18 additions and 18 deletions.
  1. +18 −18 lib/path.js
View
36 lib/path.js
@@ -79,7 +79,7 @@ if (isWindows) {
return [device, dir, basename, ext];
};
- exports.split = function(filepath){
+ exports.parse = function(filepath){
var result = splitDeviceRe.exec(filepath),
device = (result[1] || '') + (result[2] || ''),
@@ -95,14 +95,14 @@ if (isWindows) {
isAbsolute = !!result[2] || isUnc,
directories = dir.split(/[\\\/]/);
- return {"device": device, //outputs "C:"
- "directories": directories, //outputs [test1,test2]
- "baseName":basename, //outputs "test3"
- "filename" : basename + ext, //outputs "test3.ext"
- "extension":ext, //outputs ".ext"
- "isUnc":isUnc, //outputs false
- "isAbsolute":isAbsolute, //outputs true
- "filepath":filepath //outputs C:/test1/test2/test3.ext
+ return {"device": device, //outputs "C:"
+ "directories": directories, //outputs [test1,test2]
+ "baseName":basename, //outputs "test3"
+ "filename" : basename + ext, //outputs "test3.ext"
+ "extension":ext, //outputs ".ext"
+ "isUnc":isUnc, //outputs false
+ "isAbsolute":isAbsolute, //outputs true
+ "filepath":filepath //outputs C:/test1/test2/test3.ext
};
@@ -291,7 +291,7 @@ if (isWindows) {
return [result[1] || '', result[2] || '', result[3] || '', result[4] || ''];
};
- exports.split = function(filepath){
+ exports.parse = function(filepath){
var result = splitPathRe.exec(filepath),
isAbsolute = filepath.charAt(0) === '/',
@@ -301,14 +301,14 @@ if (isWindows) {
ext = result[4] || '',
directories = dir.split(/[\/]/);
- return {"device": device,
- "directories": directories,
- "baseName":basename,
- "filename" : basename + ext,
- "extension":ext,
- "isUnc":false,
- "isAbsolute":isAbsolute,
- "filepath":filepath
+ return {
+ "directories": directories,
+ "baseName":basename,
+ "filename" : basename + ext,
+ "extension":ext,
+ "isUnc":false,
+ "isAbsolute":isAbsolute,
+ "filepath":filepath
};
Please sign in to comment.
Something went wrong with that request. Please try again.