Comparing version 1.1.0 to 1.1.1
@@ -11,3 +11,4 @@ 'use strict'; | ||
function join(parts, filename) { | ||
return parts.join(path.sep) + path.sep + filename; | ||
var base = parts.join(path.sep); | ||
return base ? (base + path.sep + filename) : filename; | ||
} | ||
@@ -27,6 +28,6 @@ | ||
resolve(fp); | ||
} else if (!parts.pop()) { | ||
} else if (parts.pop()) { | ||
find(); | ||
} else { | ||
resolve(null); | ||
} else { | ||
find(); | ||
} | ||
@@ -33,0 +34,0 @@ }); |
{ | ||
"name": "find-up", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Find a file by walking up parent directories", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -28,5 +28,5 @@ # find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) | ||
// example.js | ||
var findUp = require('find-up'); | ||
const findUp = require('find-up'); | ||
findUp('unicorn.png').then(function (filepath) { | ||
findUp('unicorn.png').then(filepath => { | ||
console.log(filepath); | ||
@@ -42,3 +42,3 @@ //=> '/Users/sindresorhus/unicorn.png' | ||
Returns a promise that resolves to a filepath or `null`. | ||
Returns a promise for the filepath or `null`. | ||
@@ -69,3 +69,3 @@ ### findUp.sync(filename, [options]) | ||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file | ||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of a npm package | ||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package | ||
@@ -72,0 +72,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4194
42