path-ends-with
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -6,4 +6,11 @@ # {%= name %} {%= badge("fury") %} | ||
## Install | ||
{%= include("install", {save: 'save'}) %} | ||
{%= include("install-npm", {save: 'save'}) %} | ||
{%= include("install-bower", {save: 'save'}) %} | ||
## Run tests | ||
```bash | ||
npm test | ||
``` | ||
## Usage | ||
@@ -36,2 +43,6 @@ | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue][issues]. | ||
## Author | ||
@@ -38,0 +49,0 @@ {%= include("author") %} |
{ | ||
"name": "path-ends-with", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"main": [ | ||
"index.js" | ||
] | ||
], | ||
"ignore": ["node_modules", ".git"] | ||
} |
20
index.js
@@ -1,14 +0,12 @@ | ||
/*! | ||
* path-ends-with <https://github.com/jonschlinkert/path-ends-with> | ||
* | ||
* Copyright (c) 2014 Jon Schlinkert, contributors. | ||
* Licensed under the MIT License | ||
'use strict'; | ||
/** | ||
* Module dependencies | ||
*/ | ||
'use strict'; | ||
var path = require('path'); | ||
var endsWith = require('ends-with'); | ||
/** | ||
* Return true if the filepath ends with the given string | ||
* Return true if `filepath` ends with the given `str`ing | ||
* | ||
@@ -20,6 +18,4 @@ * @param {String} `filepath` | ||
module.exports = function endsWith(filepath, str) { | ||
filepath = path.normalize(filepath); | ||
str = path.normalize(str); | ||
return filepath.indexOf(str, filepath.length - str.length) !== -1; | ||
module.exports = function(fp, str) { | ||
return endsWith(path.normalize(fp), path.normalize(str)); | ||
}; |
{ | ||
"name": "path-ends-with", | ||
"description": "Return `true` if a file path ends with the given string.", | ||
"version": "0.1.1", | ||
"description": "Return `true` if a file path ends with the given string/suffix.", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/jonschlinkert/path-ends-with", | ||
@@ -31,17 +31,28 @@ "author": { | ||
"devDependencies": { | ||
"verb": "~0.2.6", | ||
"chai": "~1.9.1", | ||
"mocha": "*" | ||
"mocha": "*", | ||
"should": "^4.0.4", | ||
"verb": "^0.2.15" | ||
}, | ||
"keywords": [ | ||
"path", | ||
"file", | ||
"segment", | ||
"end", | ||
"ending", | ||
"ends", | ||
"ends-with", | ||
"ext", | ||
"extension", | ||
"extname", | ||
"file", | ||
"filepath", | ||
"end", | ||
"ending" | ||
] | ||
"match", | ||
"matches", | ||
"path", | ||
"re", | ||
"regex", | ||
"regexp", | ||
"segment", | ||
"suffix" | ||
], | ||
"dependencies": { | ||
"ends-with": "^0.2.0" | ||
} | ||
} |
@@ -1,7 +0,7 @@ | ||
# path-ends-with [![NPM version](https://badge.fury.io/js/path-ends-with.png)](http://badge.fury.io/js/path-ends-with) | ||
# path-ends-with [![NPM version](https://badge.fury.io/js/path-ends-with.svg)](http://badge.fury.io/js/path-ends-with) | ||
> Return `true` if a file path ends with the given string. | ||
> Return `true` if a file path ends with the given string/suffix. | ||
## Install | ||
Install with [npm](npmjs.org): | ||
#### Install with [npm](npmjs.org) | ||
@@ -11,3 +11,14 @@ ```bash | ||
``` | ||
#### Install with [bower](https://github.com/bower/bower) | ||
```bash | ||
bower install path-ends-with --save | ||
``` | ||
## Run tests | ||
```bash | ||
npm test | ||
``` | ||
## Usage | ||
@@ -40,2 +51,6 @@ | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue][issues]. | ||
## Author | ||
@@ -54,2 +69,2 @@ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 25, 2014._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 16, 2014._ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
16480
329
67
1
3
1
+ Addedends-with@^0.2.0
+ Addedends-with@0.2.0(transitive)