Clean up the oopsie. Rebuild the blank exercises.

This commit is contained in:
Michael Frank
2021-05-09 00:39:21 +12:00
parent b984cb4c6f
commit d28d80c46f
1565 changed files with 27186 additions and 199003 deletions
+10 -6
View File
@@ -8,7 +8,7 @@ Think of it like an async version of [`Array#find`](https://developer.mozilla.or
## Install
```
$ npm install --save p-locate
$ npm install p-locate
```
@@ -22,14 +22,16 @@ const pLocate = require('p-locate');
const files = [
'unicorn.png',
'rainbow.png', // only this one actually exists on disk
'rainbow.png', // Only this one actually exists on disk
'pony.png'
];
pLocate(files, file => pathExists(file)).then(foundPath => {
(async () => {
const foundPath = await pLocate(files, file => pathExists(file));
console.log(foundPath);
//=> 'rainbow'
});
})();
```
*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*
@@ -43,13 +45,15 @@ Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the it
#### input
Type: `Iterable<Promise|any>`
Type: `Iterable<Promise | unknown>`
An iterable of promises/values to test.
#### tester(element)
Type: `Function`
Expected to return a `Promise<boolean>` or boolean.
This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
#### options