Skip to content

Commit

Permalink
chore(release): 1.1.0 [skip ci]
Browse files Browse the repository at this point in the history
# [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
semantic-release-bot committed Dec 16, 2018
1 parent 1f4f59d commit 31fa585
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# [1.1.0](https://github.com/yeutech-lab/accept-dot-path/compare/v1.0.11...v1.1.0) (2018-12-16)


### Bug Fixes

* **rollup:** activate runtimeHelpers ([0e77ddd](https://github.com/yeutech-lab/accept-dot-path/commit/0e77ddd))
* **rollup:** fix rollup having wrong configuration ([0a1cfc3](https://github.com/yeutech-lab/accept-dot-path/commit/0a1cfc3))
* **travis:** fix travis triggering on pull wrong jobs ([31d86d8](https://github.com/yeutech-lab/accept-dot-path/commit/31d86d8))


### Features

* **greekeeper:** added greenkeeper and upgrade all dependencies ([d055aff](https://github.com/yeutech-lab/accept-dot-path/commit/d055aff))
* **greenkeeper:** added greenkeeper ([9ab1534](https://github.com/yeutech-lab/accept-dot-path/commit/9ab1534))

## [1.0.11](https://github.com/yeutech-lab/accept-dot-path/compare/v1.0.10...v1.0.11) (2018-06-27)


Expand Down
21 changes: 21 additions & 0 deletions lib/index.js
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;
37 changes: 37 additions & 0 deletions lib/tests/index.test.js
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'));
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yeutech-lab/accept-dot-path",
"version": "1.0.11",
"version": "1.1.0",
"description": "accept-dot-path is a simple function that accept all path starting with dot(s).",
"main": "lib/index.js",
"jsnext:main": "dist/accept-dot-path.esm.js",
Expand Down

0 comments on commit 31fa585

Please # to comment.