Skip to content

Commit

Permalink
chore(gatsby-cli): Convert did-you-mean to typescript (#22068)
Browse files Browse the repository at this point in the history
  • Loading branch information
mottox2 committed Mar 9, 2020
1 parent 7c19e61 commit 8736755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-cli/src/create-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const resolveCwd = require(`resolve-cwd`)
const yargs = require(`yargs`)
const report = require(`./reporter`)
const { setStore } = require(`./reporter/redux`)
const didYouMean = require(`./did-you-mean`)
const { didYouMean } = require(`./did-you-mean`)
const { getLocalGatsbyVersion } = require(`./util/version`)
const envinfo = require(`envinfo`)
const existsSync = require(`fs-exists-cached`).sync
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const meant = require(`meant`)
import meant from "meant"

function didYouMean(scmd, commands) {
const bestSimilarity = meant(scmd, commands).map(function(str) {
export function didYouMean(scmd: string, commands: string[]): string {
const bestSimilarity = meant(scmd, commands).map(function(
str: string
): string {
return ` ${str}`
})

Expand All @@ -16,5 +18,3 @@ function didYouMean(scmd, commands) {
)
}
}

module.exports = didYouMean

0 comments on commit 8736755

Please sign in to comment.