Skip to content

Commit 13e2c9b

Browse files
authored
fix: swap @yields for @returns (#178)
Motivation: * Fix ipfs/js-ipfs#4080 * tl;dr * fix `import globSourceImport from 'ipfs-utils/src/files/glob-source.js'` from typescript * fix importing ipfs-core from typescript Context: * microsoft/TypeScript#23857 Strategy * Use jsdoc `@return` instead of `@yields` because tsc doesn't understand that `@yields` implies a `@return` type Test Case * gobengo/ipfs-core-esm-test#3 * I tested locally with `npm link` and this seemed to fix it
1 parent b319e67 commit 13e2c9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/files/glob-source.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const errCode = require('err-code')
1818
* @param {boolean} [options.preserveMtime] - preserve mtime
1919
* @param {number} [options.mode] - mode to use - if preserveMode is true this will be ignored
2020
* @param {import('ipfs-unixfs').MtimeLike} [options.mtime] - mtime to use - if preserveMtime is true this will be ignored
21-
* @yields {Object} File objects in the form `{ path: String, content: AsyncIterator<Buffer> }`
21+
* @returns {AsyncGenerator<{
22+
* path: string;
23+
* content: AsyncIterable<Buffer> | undefined;
24+
* mode: number | undefined;
25+
* mtime: import("ipfs-unixfs/types/src/types").MtimeLike | undefined;
26+
* }, void, unknown>} File objects that match glob
2227
*/
2328
module.exports = async function * globSource (cwd, pattern, options) {
2429
options = options || {}

0 commit comments

Comments
 (0)