Sha256: 1fd17223681df93d62770ccb6c0663c5a6db392c85ba5465b773c94819811d60
Contents?: true
Size: 512 Bytes
Versions: 77
Compression:
Stored size: 512 Bytes
Contents
'use strict'; const path = require('path'); const pathExists = require('path-exists'); const pLocate = require('p-locate'); module.exports = (iterable, opts) => { opts = Object.assign({ cwd: process.cwd() }, opts); return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); }; module.exports.sync = (iterable, opts) => { opts = Object.assign({ cwd: process.cwd() }, opts); for (const el of iterable) { if (pathExists.sync(path.resolve(opts.cwd, el))) { return el; } } };
Version data entries
77 entries across 77 versions & 9 rubygems