@sphido/core 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/all-pages.js CHANGED
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * Page generator that flatten pages structure
3
+ *
4
+ * @generator
3
5
  * @param {array} pages
6
+ * @yields {name:string, path:string} next page in pages list
4
7
  */
5
8
  export function * allPages(pages) {
6
9
  for (const page of pages) {
package/lib/copy-file.js CHANGED
@@ -5,8 +5,8 @@ import {dirname} from 'node:path';
5
5
  /**
6
6
  * Write content to the file and create directory if not exists
7
7
  *
8
- * @param {string} file
9
- * @param {string} content
8
+ * @param {string} src
9
+ * @param {string} dest
10
10
  * @returns {Promise<*>}
11
11
  */
12
12
  export async function copyFile(src, dest) {
package/lib/get-pages.js CHANGED
@@ -5,9 +5,9 @@ import {isPage} from './is-page.js';
5
5
  /**
6
6
  * Retrieve an array tree of pages from path
7
7
  * @param {string} path
8
- * @param {Function} include
9
- * @param extenders
10
- * @returns {Promise<Awaited<unknown>[{name, path}]>}
8
+ * @param {function(dirent:Dirent, path:string)} include
9
+ * @param {Object|function(page:{name:string, path:string}, dirent:Dirent, path:string)} extenders
10
+ * @returns {Promise<Awaited<unknown>[{name:string, path:string}]>}
11
11
  */
12
12
  export async function getPages({path = 'content', include = isPage} = {}, ...extenders) {
13
13
  const dir = await readdir(path, {withFileTypes: true});
package/lib/is-page.js CHANGED
@@ -7,7 +7,6 @@
7
7
  * - accept only *.html and *.md files
8
8
  *
9
9
  * @param {Dirent} dirent
10
- * @param {string} path
11
10
  * @returns {boolean}
12
11
  */
13
12
  export function isPage(dirent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphido/core",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "author": {
5
5
  "name": "Roman Ožana",
6
6
  "email": "roman@ozana.cz",
@@ -45,5 +45,5 @@
45
45
  "no-await-in-loop": 0
46
46
  }
47
47
  },
48
- "gitHead": "824894e08a8007b0c36d75fe005b153ccfa7c5fc"
48
+ "gitHead": "5ede811c6442f334f5dd04f0d146b49fc7a785ad"
49
49
  }