Skip to content

Commit

Permalink
Renames default export to layouts for better intellisense
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Apr 3, 2023
1 parent f8cd111 commit 10eaa0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/index.d.ts
@@ -1,7 +1,7 @@
import { Plugin } from "metalsmith";
import getTransformer from "./get-transformer";

export default initLayouts;
export default layouts;
/**
* `@metalsmith/layouts` options
*/
Expand Down Expand Up @@ -32,7 +32,7 @@ export type Options = {
* @param {Options} options
* @returns {import('metalsmith').Plugin}
*/
declare function initLayouts(options: Options): Plugin;
declare namespace initLayouts {
declare function layouts(options: Options): Plugin;
declare namespace layouts {
export { getTransformer };
}
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -109,7 +109,7 @@ function validate({ filename, files, settings }) {
* @param {Options} options
* @returns {import('metalsmith').Plugin}
*/
function initLayouts(options) {
function layouts(options) {
return function layouts(files, metalsmith, done) {
debug = metalsmith.debug('@metalsmith/layouts')

Expand Down Expand Up @@ -167,5 +167,5 @@ function initLayouts(options) {
// ensures non-breaking change:
// import { getTransformer } from '@metalsmith/layouts' instead of
// import getTransformer from '@metalsmith/layouts/get-transformer'
initLayouts.getTransformer = getTransformer
export default initLayouts
layouts.getTransformer = getTransformer
export default layouts

0 comments on commit 10eaa0c

Please sign in to comment.