-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# [1.1.0](v1.0.11...v1.1.0) (2018-12-16) ### Bug Fixes * **rollup:** activate runtimeHelpers ([0e77ddd](0e77ddd)) * **rollup:** fix rollup having wrong configuration ([0a1cfc3](0a1cfc3)) * **travis:** fix travis triggering on pull wrong jobs ([31d86d8](31d86d8)) ### Features * **greekeeper:** added greenkeeper and upgrade all dependencies ([d055aff](d055aff)) * **greenkeeper:** added greenkeeper ([9ab1534](9ab1534))
- Loading branch information
1 parent
1f4f59d
commit 31fa585
Showing
4 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use strict"; | ||
|
||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = acceptDotPath; | ||
|
||
var _path = _interopRequireDefault(require("path")); | ||
|
||
function acceptDotPath(p, cwd) { | ||
if (p[0] === '/') { | ||
return p; | ||
} | ||
|
||
var c = cwd || process.cwd(); | ||
return p[1] === '/' ? _path.default.join(c, p.slice(2)) : _path.default.join(c, p); | ||
} | ||
|
||
module.exports = exports.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict"; | ||
|
||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
|
||
var _path = _interopRequireDefault(require("path")); | ||
|
||
var _index = _interopRequireDefault(require("../index")); | ||
|
||
/** | ||
* Testing dot path | ||
*/ | ||
describe('acceptDotPath', function () { | ||
it('should accept unprefixed path', function () { | ||
expect((0, _index.default)('foobar')).toBe(_path.default.join(process.cwd(), 'foobar')); | ||
}); | ||
it('should accept unprefixed path with custom cwd', function () { | ||
expect((0, _index.default)('foobar', '/home/user')).toBe(_path.default.join('/home/user', 'foobar')); | ||
}); | ||
it('should accept relative path', function () { | ||
expect((0, _index.default)('/foobar')).toBe('/foobar'); | ||
}); | ||
it('should accept relative path with custom cwd', function () { | ||
expect((0, _index.default)('/foobar', '/home/user')).toBe('/foobar'); | ||
}); | ||
it('should accept dot path', function () { | ||
expect((0, _index.default)('./foobar')).toBe(_path.default.join(process.cwd(), 'foobar')); | ||
}); | ||
it('should accept dot path with custom cwd', function () { | ||
expect((0, _index.default)('./foobar', '/home/user')).toBe(_path.default.join('/home/user', 'foobar')); | ||
}); | ||
it('should accept dot path with ..', function () { | ||
expect((0, _index.default)('../foobar')).toBe(_path.default.join(process.cwd(), '../foobar')); | ||
}); | ||
it('should accept dot path with .. and custom cwd', function () { | ||
expect((0, _index.default)('../foobar', '/home/user')).toBe(_path.default.join('/home/user', '../foobar')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters