upath
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -5,3 +5,3 @@ /** | ||
* A proxy to `path`, replacing `\` with `/` for all results & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions. | ||
* Version 1.0.3 - Compiled on 2018-02-25 22:49:38 | ||
* Version 1.0.4 - Compiled on 2018-02-26 00:12:05 | ||
* Repository git://github.com/anodynos/upath | ||
@@ -15,5 +15,5 @@ * Copyright(c) 2018 Angelos Pikoulas <agelos.pikoulas@gmail.com> | ||
var VERSION = '1.0.3'; // injected by urequire-rc-inject-version | ||
var VERSION = '1.0.4'; // injected by urequire-rc-inject-version | ||
var _, extraFn, extraFunctions, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) { | ||
var extraFn, extraFunctions, isFunction, isString, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) { | ||
for (var i = 0, l = this.length; i < l; i++) { | ||
@@ -25,9 +25,9 @@ if (i in this && this[i] === item) | ||
}; | ||
_ = { | ||
startsWith: require("lodash.startswith"), | ||
endsWith: require("lodash.endswith"), | ||
isFunction: require("lodash.isfunction"), | ||
isString: require("lodash.isstring") | ||
path = require("path"); | ||
isFunction = function (val) { | ||
return val instanceof Function; | ||
}; | ||
path = require("path"); | ||
isString = function (val) { | ||
return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]"; | ||
}; | ||
upath = exports; | ||
@@ -46,3 +46,3 @@ upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION"; | ||
propValue = path[propName]; | ||
if (_.isFunction(propValue)) { | ||
if (isFunction(propValue)) { | ||
upath[propName] = function (propName) { | ||
@@ -53,3 +53,3 @@ return function () { | ||
args = args.map(function (p) { | ||
if (_.isString(p)) { | ||
if (isString(p)) { | ||
return toUnix(p); | ||
@@ -61,3 +61,3 @@ } else { | ||
result = path[propName].apply(path, args); | ||
if (_.isString(result)) { | ||
if (isString(result)) { | ||
return toUnix(result); | ||
@@ -78,4 +78,4 @@ } else { | ||
p = toUnix(p); | ||
if (_.startsWith(p, "./")) { | ||
if (_.startsWith(p, "./..") || p === "./") { | ||
if (p.startsWith("./")) { | ||
if (p.startsWith("./..") || p === "./") { | ||
return upath.normalize(p); | ||
@@ -91,3 +91,3 @@ } else { | ||
p = upath.normalizeSafe(p); | ||
if (_.endsWith(p, "/")) { | ||
if (p.endsWith("/")) { | ||
return p.slice(0, +(p.length - 2) + 1 || 9000000000); | ||
@@ -102,3 +102,3 @@ } else { | ||
result = upath.join.apply(null, p); | ||
if (_.startsWith(p[0], "./") && !_.startsWith(result, "./")) { | ||
if (p[0].startsWith("./") && !result.startsWith("./")) { | ||
result = "./" + result; | ||
@@ -115,3 +115,3 @@ } | ||
} | ||
return file + (_.endsWith(file, ext) ? "" : ext); | ||
return file + (file.endsWith(ext) ? "" : ext); | ||
} | ||
@@ -118,0 +118,0 @@ }, |
{ | ||
"name": "upath", | ||
"description": "A proxy to `path`, replacing `\\` with `/` for all results & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"homepage": "http://github.com/anodynos/upath/", | ||
@@ -45,8 +45,2 @@ "author": { | ||
}, | ||
"dependencies": { | ||
"lodash.endswith": "^4.2.1", | ||
"lodash.startswith": "^4.2.1", | ||
"lodash.isfunction": "^3.0.8", | ||
"lodash.isstring": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -53,0 +47,0 @@ "chai": "~4.0.2", |
@@ -1,2 +0,2 @@ | ||
# upath v1.0.3 | ||
# upath v1.0.4 | ||
@@ -17,4 +17,9 @@ [![Build Status](https://travis-ci.org/anodynos/upath.svg?branch=master)](https://travis-ci.org/anodynos/upath) | ||
**Useful note: these docs are actually auto generated from [specs](https://github.com/anodynos/upath/blob/master/source/spec/upath-spec.coffee), running on Linux.** | ||
Notes: | ||
* `upath.sep` is set to `'/'` for seamless replacement (as of 1.0.3). | ||
* upath has no runtime dependencies, except built-in `path` (as of 1.0.4) | ||
## Why ? | ||
@@ -21,0 +26,0 @@ |
33783
0
332
- Removedlodash.endswith@^4.2.1
- Removedlodash.isfunction@^3.0.8
- Removedlodash.isstring@^4.0.1
- Removedlodash.startswith@^4.2.1
- Removedlodash.endswith@4.2.1(transitive)
- Removedlodash.isfunction@3.0.9(transitive)
- Removedlodash.isstring@4.0.1(transitive)
- Removedlodash.startswith@4.2.1(transitive)