Skip to content

Commit

Permalink
Renames default export to 'metadata' for better editor intellisense
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Jun 11, 2023
1 parent 28a0cc5 commit a63c1d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Metalsmith from "metalsmith";

export default initMetadata;
export default metadata;
export type Options = {
[key: string]: string;
};
Expand All @@ -16,7 +16,5 @@ export type Options = {
* // target a keypath
* metalsmith.use(metadata({ 'config.nav.items': 'navitems.yaml' }))
* ```
* @param {Options} options
* @returns {import('metalsmith').Plugin}
*/
declare function initMetadata(options?: Options): Metalsmith.Plugin;
declare function metadata(options?: Options): Metalsmith.Plugin;
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function normalizeOptions(options) {
* @param {Options} options
* @returns {import('metalsmith').Plugin}
*/
function initMetadata(options = {}) {
function metadata(options = {}) {
options = normalizeOptions(options)
if (Object.keys(options).length === 0) {
return function metadata(files, metalsmith, done) {
Expand Down Expand Up @@ -238,4 +238,4 @@ function initMetadata(options = {}) {
}
}

export default initMetadata
export default metadata

0 comments on commit a63c1d3

Please # to comment.