From b06dca4243cd7c79df2493bd75acf6eee1ace398 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 29 Oct 2020 19:25:19 -0500 Subject: [PATCH] Added a comment --- lib/usage-warns.ts | 6 +++++- pages/[...pages].tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/usage-warns.ts b/lib/usage-warns.ts index a81b6dc09..aa77f6304 100644 --- a/lib/usage-warns.ts +++ b/lib/usage-warns.ts @@ -1,8 +1,12 @@ +/** + * The utils here are used to help developers use the example + */ + export function missingLocaleInPages(): [string[], () => void] { const invalidPaths: string[] = [] const log = () => { if (invalidPaths.length) { - const single = invalidPaths.length === 0 + const single = invalidPaths.length === 1 const pages = single ? 'page' : 'pages' console.log( diff --git a/pages/[...pages].tsx b/pages/[...pages].tsx index ccd59932a..1457484fd 100644 --- a/pages/[...pages].tsx +++ b/pages/[...pages].tsx @@ -7,8 +7,8 @@ import { getConfig } from '@bigcommerce/storefront-data-hooks/api' import getPage from '@bigcommerce/storefront-data-hooks/api/operations/get-page' import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages' import getSlug from '@lib/get-slug' -import { Layout, HTMLContent } from '@components/core' import { missingLocaleInPages } from '@lib/usage-warns' +import { Layout, HTMLContent } from '@components/core' export async function getStaticProps({ preview,