@intlayer/docs 5.5.11 → 5.5.12
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/blog/ar/intlayer_with_next-intl.md +0 -1
- package/blog/ar/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ar/what_is_internationalization.md +2 -2
- package/blog/de/intlayer_with_next-intl.md +0 -1
- package/blog/de/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/de/what_is_internationalization.md +2 -2
- package/blog/en/intlayer_with_next-intl.md +0 -1
- package/blog/en/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/en/what_is_internationalization.md +2 -2
- package/blog/en-GB/intlayer_with_next-intl.md +0 -1
- package/blog/en-GB/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/en-GB/what_is_internationalization.md +2 -2
- package/blog/es/intlayer_with_next-intl.md +0 -1
- package/blog/es/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/es/what_is_internationalization.md +2 -2
- package/blog/fr/intlayer_with_next-intl.md +0 -1
- package/blog/fr/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/fr/what_is_internationalization.md +2 -2
- package/blog/hi/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/hi/what_is_internationalization.md +2 -2
- package/blog/it/intlayer_with_next-intl.md +0 -1
- package/blog/it/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/it/what_is_internationalization.md +2 -2
- package/blog/ja/intlayer_with_next-intl.md +0 -1
- package/blog/ja/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ja/what_is_internationalization.md +2 -2
- package/blog/ko/intlayer_with_next-intl.md +0 -1
- package/blog/ko/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/pt/intlayer_with_next-intl.md +0 -1
- package/blog/pt/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/pt/what_is_internationalization.md +2 -2
- package/blog/ru/intlayer_with_next-intl.md +0 -1
- package/blog/ru/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ru/what_is_internationalization.md +2 -2
- package/blog/zh/intlayer_with_next-intl.md +0 -1
- package/blog/zh/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/zh/what_is_internationalization.md +2 -2
- package/dist/cjs/blog.cjs +2 -2
- package/dist/cjs/blog.cjs.map +1 -1
- package/dist/cjs/common.cjs +17 -6
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/doc.cjs +2 -2
- package/dist/cjs/doc.cjs.map +1 -1
- package/dist/cjs/frequentQuestions.cjs +2 -2
- package/dist/cjs/frequentQuestions.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +1152 -252
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +3778 -1124
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +794 -161
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +32 -31
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/cjs/legal.cjs +2 -2
- package/dist/cjs/legal.cjs.map +1 -1
- package/dist/esm/blog.mjs +2 -2
- package/dist/esm/blog.mjs.map +1 -1
- package/dist/esm/common.mjs +17 -6
- package/dist/esm/common.mjs.map +1 -1
- package/dist/esm/doc.mjs +2 -2
- package/dist/esm/doc.mjs.map +1 -1
- package/dist/esm/frequentQuestions.mjs +2 -2
- package/dist/esm/frequentQuestions.mjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +1151 -252
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +3777 -1124
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +793 -161
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +31 -31
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/esm/legal.mjs +2 -2
- package/dist/esm/legal.mjs.map +1 -1
- package/dist/types/blog.d.ts +2 -2
- package/dist/types/blog.d.ts.map +1 -1
- package/dist/types/common.d.ts +3 -2
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/doc.d.ts +2 -2
- package/dist/types/doc.d.ts.map +1 -1
- package/dist/types/frequentQuestions.d.ts +2 -2
- package/dist/types/frequentQuestions.d.ts.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts +1 -0
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/dist/types/legal.d.ts +2 -2
- package/dist/types/legal.d.ts.map +1 -1
- package/docs/ar/intlayer_with_vite+react.md +100 -108
- package/docs/de/intlayer_with_vite+react.md +121 -142
- package/docs/en/CI_CD.md +3 -1
- package/docs/en/autoFill.md +3 -1
- package/docs/en/configuration.md +4 -1
- package/docs/en/dictionary/condition.md +3 -1
- package/docs/en/dictionary/content_extention_customization.md +3 -1
- package/docs/en/dictionary/enumeration.md +3 -1
- package/docs/en/dictionary/file.md +3 -1
- package/docs/en/dictionary/function_fetching.md +3 -1
- package/docs/en/dictionary/get_started.md +3 -1
- package/docs/en/dictionary/insertion.md +3 -1
- package/docs/en/dictionary/markdown.md +3 -1
- package/docs/en/dictionary/nesting.md +3 -1
- package/docs/en/dictionary/translation.md +3 -1
- package/docs/en/how_works_intlayer.md +3 -1
- package/docs/en/index.md +3 -1
- package/docs/en/interest_of_intlayer.md +3 -1
- package/docs/en/intlayer_CMS.md +3 -1
- package/docs/en/intlayer_cli.md +3 -1
- package/docs/en/intlayer_visual_editor.md +3 -1
- package/docs/en/intlayer_with_angular.md +3 -1
- package/docs/en/intlayer_with_create_react_app.md +3 -1
- package/docs/en/intlayer_with_express.md +3 -1
- package/docs/en/intlayer_with_lynx+react.md +3 -1
- package/docs/en/intlayer_with_nextjs_14.md +6 -1
- package/docs/en/intlayer_with_nextjs_15.md +5 -1
- package/docs/en/intlayer_with_nextjs_page_router.md +5 -1
- package/docs/en/intlayer_with_nuxt.md +3 -1
- package/docs/en/intlayer_with_react_native+expo.md +3 -1
- package/docs/en/intlayer_with_vite+preact.md +3 -1
- package/docs/en/intlayer_with_vite+react.md +9 -7
- package/docs/en/intlayer_with_vite+solid.md +3 -1
- package/docs/en/intlayer_with_vite+svelte.md +3 -1
- package/docs/en/intlayer_with_vite+vue.md +3 -1
- package/docs/en/introduction.md +3 -1
- package/docs/en/mcp_server.md +42 -1
- package/docs/en/packages/@intlayer/api/index.md +3 -1
- package/docs/en/packages/@intlayer/chokidar/index.md +3 -1
- package/docs/en/packages/@intlayer/cli/index.md +3 -1
- package/docs/en/packages/@intlayer/config/index.md +3 -1
- package/docs/en/packages/@intlayer/core/index.md +3 -1
- package/docs/en/packages/@intlayer/design-system/index.md +3 -1
- package/docs/en/packages/@intlayer/dictionary-entry/index.md +3 -1
- package/docs/en/packages/@intlayer/editor/index.md +3 -1
- package/docs/en/packages/@intlayer/editor-react/index.md +3 -1
- package/docs/en/packages/@intlayer/webpack/index.md +3 -1
- package/docs/en/packages/angular-intlayer/index.md +3 -1
- package/docs/en/packages/express-intlayer/index.md +3 -1
- package/docs/en/packages/express-intlayer/t.md +3 -1
- package/docs/en/packages/intlayer/getConfiguration.md +3 -1
- package/docs/en/packages/intlayer/getEnumeration.md +3 -1
- package/docs/en/packages/intlayer/getHTMLTextDir.md +3 -1
- package/docs/en/packages/intlayer/getLocaleLang.md +3 -1
- package/docs/en/packages/intlayer/getLocaleName.md +3 -1
- package/docs/en/packages/intlayer/getLocalizedUrl.md +3 -1
- package/docs/en/packages/intlayer/getMultilingualUrls.md +3 -1
- package/docs/en/packages/intlayer/getPathWithoutLocale.md +3 -1
- package/docs/en/packages/intlayer/getTranslation.md +3 -1
- package/docs/en/packages/intlayer/getTranslationContent.md +3 -1
- package/docs/en/packages/intlayer/index.md +3 -1
- package/docs/en/packages/intlayer-cli/index.md +3 -1
- package/docs/en/packages/intlayer-editor/index.md +3 -1
- package/docs/en/packages/lynx-intlayer/index.md +3 -1
- package/docs/en/packages/next-intlayer/index.md +3 -1
- package/docs/en/packages/next-intlayer/t.md +3 -1
- package/docs/en/packages/next-intlayer/useDictionary.md +3 -1
- package/docs/en/packages/next-intlayer/useIntlayer.md +3 -1
- package/docs/en/packages/next-intlayer/useIntlayerAsync.md +3 -1
- package/docs/en/packages/next-intlayer/useLocale.md +3 -1
- package/docs/en/packages/nuxt-intlayer/index.md +3 -1
- package/docs/en/packages/preact-intlayer/index.md +3 -1
- package/docs/en/packages/react-intlayer/index.md +3 -1
- package/docs/en/packages/react-intlayer/t.md +3 -1
- package/docs/en/packages/react-intlayer/useDictionary.md +3 -1
- package/docs/en/packages/react-intlayer/useIntlayer.md +3 -1
- package/docs/en/packages/react-intlayer/useIntlayerAsync.md +3 -1
- package/docs/en/packages/react-intlayer/useLocale.md +3 -1
- package/docs/en/packages/react-native-intlayer/index.md +3 -1
- package/docs/en/packages/react-scripts-intlayer/index.md +3 -1
- package/docs/en/packages/solid-intlayer/index.md +3 -1
- package/docs/en/packages/svelte-intlayer/index.md +3 -1
- package/docs/en/packages/vite-intlayer/index.md +3 -1
- package/docs/en/packages/vue-intlayer/index.md +3 -1
- package/docs/en/per_locale_file.md +3 -1
- package/docs/en/roadmap.md +5 -2
- package/docs/en/vs_code_extension.md +3 -1
- package/docs/en-GB/intlayer_with_vite+react.md +64 -83
- package/docs/es/intlayer_with_vite+react.md +91 -94
- package/docs/fr/intlayer_with_vite+react.md +73 -65
- package/docs/hi/intlayer_with_vite+react.md +107 -107
- package/docs/it/intlayer_with_vite+react.md +156 -112
- package/docs/ja/intlayer_with_vite+react.md +153 -218
- package/docs/ko/intlayer_with_vite+react.md +116 -148
- package/docs/ko/packages/intlayer/getLocalizedUrl.md +1 -23
- package/docs/pt/intlayer_with_vite+react.md +110 -132
- package/docs/ru/intlayer_with_vite+react.md +98 -83
- package/docs/zh/intlayer_with_vite+react.md +147 -184
- package/docs/zh/packages/intlayer/getLocalizedUrl.md +1 -23
- package/frequent_questions/ar/build_error_CI_CD.md +75 -0
- package/frequent_questions/de/build_error_CI_CD.md +75 -0
- package/frequent_questions/en/build_error_CI_CD.md +75 -0
- package/frequent_questions/en-GB/build_error_CI_CD.md +75 -0
- package/frequent_questions/es/build_error_CI_CD.md +75 -0
- package/frequent_questions/fr/build_error_CI_CD.md +75 -0
- package/frequent_questions/hi/build_error_CI_CD.md +75 -0
- package/frequent_questions/it/build_error_CI_CD.md +75 -0
- package/frequent_questions/ja/build_error_CI_CD.md +75 -0
- package/frequent_questions/ja/intlayer_command_undefined.md +3 -3
- package/frequent_questions/ko/build_error_CI_CD.md +75 -0
- package/frequent_questions/ko/intlayer_command_undefined.md +3 -3
- package/frequent_questions/pt/build_error_CI_CD.md +75 -0
- package/frequent_questions/ru/build_error_CI_CD.md +75 -0
- package/frequent_questions/zh/build_error_CI_CD.md +75 -0
- package/frequent_questions/zh/intlayer_command_undefined.md +3 -3
- package/legal/ar/privacy_notice.md +83 -0
- package/legal/ar/terms_of_service.md +55 -0
- package/legal/de/privacy_notice.md +83 -0
- package/legal/de/terms_of_service.md +55 -0
- package/legal/en/privacy_notice.md +83 -0
- package/legal/en/terms_of_service.md +55 -0
- package/legal/en-GB/privacy_notice.md +83 -0
- package/legal/en-GB/terms_of_service.md +55 -0
- package/legal/es/privacy_notice.md +83 -0
- package/legal/es/terms_of_service.md +55 -0
- package/legal/fr/privacy_notice.md +83 -0
- package/legal/fr/terms_of_service.md +55 -0
- package/legal/hi/privacy_notice.md +83 -0
- package/legal/hi/terms_of_service.md +55 -0
- package/legal/it/privacy_notice.md +83 -0
- package/legal/it/terms_of_service.md +55 -0
- package/legal/ja/privacy_notice.md +83 -0
- package/legal/ja/terms_of_service.md +55 -0
- package/legal/ko/privacy_notice.md +83 -0
- package/legal/ko/terms_of_service.md +55 -0
- package/legal/pt/privacy_notice.md +83 -0
- package/legal/pt/terms_of_service.md +55 -0
- package/legal/ru/privacy_notice.md +83 -0
- package/legal/ru/terms_of_service.md +55 -0
- package/legal/zh/privacy_notice.md +83 -0
- package/legal/zh/terms_of_service.md +55 -0
- package/package.json +7 -6
- package/src/blog.ts +6 -4
- package/src/common.ts +23 -7
- package/src/doc.ts +6 -4
- package/src/frequentQuestions.ts +6 -4
- package/src/generated/blog.entry.ts +1177 -280
- package/src/generated/docs.entry.ts +3868 -1217
- package/src/generated/frequentQuestions.entry.ts +808 -178
- package/src/generated/legal.entry.ts +34 -36
- package/src/legal.ts +6 -4
package/dist/cjs/blog.cjs
CHANGED
|
@@ -32,8 +32,8 @@ const getBlogs = async (locale = import_common.defaultLocale) => await (0, impor
|
|
|
32
32
|
const getBlog = async (docName, locale = import_common.defaultLocale) => await (0, import_common.getFile)(import_blog.blogEntry, docName, locale);
|
|
33
33
|
const getBlogMetadataRecord = async (locale = import_common.defaultLocale) => await (0, import_common.getFileMetadataRecord)(import_blog.blogEntry, locale);
|
|
34
34
|
const getBlogMetadata = async (docName, locale = import_common.defaultLocale) => await (0, import_common.getFileMetadata)(import_blog.blogEntry, docName, locale);
|
|
35
|
-
const getBlogMetadataBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileMetadataBySlug)(import_blog.blogEntry, slugs, locale);
|
|
36
|
-
const getBlogBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileBySlug)(import_blog.blogEntry, slugs, locale);
|
|
35
|
+
const getBlogMetadataBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileMetadataBySlug)(import_blog.blogEntry, slugs, locale, strict);
|
|
36
|
+
const getBlogBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileBySlug)(import_blog.blogEntry, slugs, locale, strict);
|
|
37
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
38
|
0 && (module.exports = {
|
|
39
39
|
getBlog,
|
package/dist/cjs/blog.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/blog.ts"],"sourcesContent":["import { LocalesValues } from 'intlayer';\nimport {\n defaultLocale,\n FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { blogEntry } from './generated/blog.entry';\n\nexport type BlogKey = keyof typeof blogEntry;\nexport type Blogs = Record<BlogKey, Record<LocalesValues, Promise<string>>>;\nexport type BlogMetadata = FileMetadata;\n\nexport const getBlogs = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, string>> => await getFiles(blogEntry, locale);\n\nexport const getBlog = async <L extends LocalesValues>(\n docName: BlogKey,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(blogEntry, docName, locale);\n\nexport const getBlogMetadataRecord = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, FileMetadata>> =>\n await getFileMetadataRecord(blogEntry, locale);\n\nexport const getBlogMetadata = async <\n D extends BlogKey,\n L extends LocalesValues,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(blogEntry, docName, locale);\n\nexport const getBlogMetadataBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(blogEntry, slugs, locale);\n\nexport const getBlogBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<string[]> => await getFileBySlug(blogEntry, slugs, locale);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,kBAA0B;AAMnB,MAAM,WAAW,OACtB,SAAY,gCACyB,UAAM,wBAAS,uBAAW,MAAM;AAEhE,MAAM,UAAU,OACrB,SACA,SAAY,gCACQ,UAAM,uBAAQ,uBAAW,SAAS,MAAM;AAEvD,MAAM,wBAAwB,OACnC,SAAY,gCAEZ,UAAM,qCAAsB,uBAAW,MAAM;AAExC,MAAM,kBAAkB,OAI7B,SACA,SAAY,gCACc,UAAM,+BAAgB,uBAAW,SAAS,MAAM;AAErE,MAAM,wBAAwB,OACnC,OACA,SAAY,
|
|
1
|
+
{"version":3,"sources":["../../src/blog.ts"],"sourcesContent":["import { LocalesValues } from 'intlayer';\nimport {\n defaultLocale,\n FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { blogEntry } from './generated/blog.entry';\n\nexport type BlogKey = keyof typeof blogEntry;\nexport type Blogs = Record<BlogKey, Record<LocalesValues, Promise<string>>>;\nexport type BlogMetadata = FileMetadata;\n\nexport const getBlogs = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, string>> => await getFiles(blogEntry, locale);\n\nexport const getBlog = async <L extends LocalesValues>(\n docName: BlogKey,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(blogEntry, docName, locale);\n\nexport const getBlogMetadataRecord = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, FileMetadata>> =>\n await getFileMetadataRecord(blogEntry, locale);\n\nexport const getBlogMetadata = async <\n D extends BlogKey,\n L extends LocalesValues,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(blogEntry, docName, locale);\n\nexport const getBlogMetadataBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(blogEntry, slugs, locale, strict);\n\nexport const getBlogBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(blogEntry, slugs, locale, strict);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,kBAA0B;AAMnB,MAAM,WAAW,OACtB,SAAY,gCACyB,UAAM,wBAAS,uBAAW,MAAM;AAEhE,MAAM,UAAU,OACrB,SACA,SAAY,gCACQ,UAAM,uBAAQ,uBAAW,SAAS,MAAM;AAEvD,MAAM,wBAAwB,OACnC,SAAY,gCAEZ,UAAM,qCAAsB,uBAAW,MAAM;AAExC,MAAM,kBAAkB,OAI7B,SACA,SAAY,gCACc,UAAM,+BAAgB,uBAAW,SAAS,MAAM;AAErE,MAAM,wBAAwB,OACnC,OACA,SAAY,6BACZ,SAAS,UAET,UAAM,qCAAsB,uBAAW,OAAO,QAAQ,MAAM;AAEvD,MAAM,gBAAgB,OAC3B,OACA,SAAY,6BACZ,SAAS,UACa,UAAM,6BAAc,uBAAW,OAAO,QAAQ,MAAM;","names":[]}
|
package/dist/cjs/common.cjs
CHANGED
|
@@ -60,10 +60,11 @@ const getFile = async (files, docKey, locale = defaultLocale) => {
|
|
|
60
60
|
const formatMetadata = (docKey, file, locale = defaultLocale) => {
|
|
61
61
|
const metadata = (0, import_intlayer.getMarkdownMetadata)(file);
|
|
62
62
|
const relativeUrl = (0, import_path.join)("/", ...metadata.slugs ?? []);
|
|
63
|
+
const slicedDocKey = docKey.slice(1);
|
|
63
64
|
return {
|
|
64
65
|
...metadata,
|
|
65
66
|
docKey,
|
|
66
|
-
githubUrl:
|
|
67
|
+
githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(
|
|
67
68
|
"/en/",
|
|
68
69
|
`/${locale}/`
|
|
69
70
|
),
|
|
@@ -90,15 +91,20 @@ const getFileMetadataRecord = async (files, locale = defaultLocale) => {
|
|
|
90
91
|
const filesResult = Object.fromEntries(filesEntries);
|
|
91
92
|
return filesResult;
|
|
92
93
|
};
|
|
93
|
-
const getFileMetadataBySlug = async (files, slugs, locale = defaultLocale) => {
|
|
94
|
+
const getFileMetadataBySlug = async (files, slugs, locale = defaultLocale, strict = false) => {
|
|
94
95
|
const slugsArray = Array.isArray(slugs) ? slugs : [slugs];
|
|
95
96
|
const filesMetadata = await getFileMetadataRecord(
|
|
96
97
|
files,
|
|
97
98
|
defaultLocale
|
|
98
99
|
);
|
|
99
|
-
|
|
100
|
+
let fileMetadataArray = Object.values(filesMetadata).filter(
|
|
100
101
|
(fileMetadata) => slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))
|
|
101
102
|
);
|
|
103
|
+
if (strict) {
|
|
104
|
+
fileMetadataArray = fileMetadataArray.filter(
|
|
105
|
+
(fileMetadata) => fileMetadata.slugs.length === slugsArray.length
|
|
106
|
+
);
|
|
107
|
+
}
|
|
102
108
|
if (locale !== defaultLocale) {
|
|
103
109
|
const localizedFileMetadata = await Promise.all(
|
|
104
110
|
fileMetadataArray.map(
|
|
@@ -109,15 +115,20 @@ const getFileMetadataBySlug = async (files, slugs, locale = defaultLocale) => {
|
|
|
109
115
|
}
|
|
110
116
|
return fileMetadataArray;
|
|
111
117
|
};
|
|
112
|
-
const getFileBySlug = async (files, slugs, locale = defaultLocale) => {
|
|
118
|
+
const getFileBySlug = async (files, slugs, locale = defaultLocale, strict = false) => {
|
|
113
119
|
const slugsArray = Array.isArray(slugs) ? slugs : [slugs];
|
|
114
120
|
const filesMetadata = await getFileMetadataRecord(
|
|
115
121
|
files,
|
|
116
122
|
defaultLocale
|
|
117
123
|
);
|
|
118
|
-
|
|
119
|
-
(fileMetadata) =>
|
|
124
|
+
let fileMetadataArray = Object.values(filesMetadata).filter(
|
|
125
|
+
(fileMetadata) => slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))
|
|
120
126
|
);
|
|
127
|
+
if (strict) {
|
|
128
|
+
fileMetadataArray = fileMetadataArray.filter(
|
|
129
|
+
(fileMetadata) => fileMetadata.slugs.length === slugsArray.length
|
|
130
|
+
);
|
|
131
|
+
}
|
|
121
132
|
const fileList = await Promise.all(
|
|
122
133
|
fileMetadataArray.map(async (fileMetadata) => {
|
|
123
134
|
const file = await getFile(files, fileMetadata.docKey, locale);
|
package/dist/cjs/common.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common.ts"],"sourcesContent":["import {\n getLocalizedUrl,\n getMarkdownMetadata,\n Locales,\n LocalesValues,\n} from 'intlayer';\nimport { join } from 'path';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey][defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n const relativeUrl = join('/', ...(metadata.slugs ?? []));\n\n return {\n ...metadata,\n docKey,\n githubUrl:
|
|
1
|
+
{"version":3,"sources":["../../src/common.ts"],"sourcesContent":["import {\n getLocalizedUrl,\n getMarkdownMetadata,\n Locales,\n LocalesValues,\n} from 'intlayer';\nimport { join } from 'path';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey][defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n author?: string;\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n const relativeUrl = join('/', ...(metadata.slugs ?? []));\n\n const slicedDocKey = docKey.slice(1);\n\n return {\n ...metadata,\n docKey,\n githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(\n '/en/',\n `/${locale}/`\n ),\n relativeUrl: getLocalizedUrl(relativeUrl, locale),\n url: getLocalizedUrl(join(URL_PREFIX, relativeUrl), locale),\n } as FileMetadata;\n};\n\nexport const getFileMetadata = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n R extends FileMetadata,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<R> => {\n try {\n const file = await getFile(files, docKey, locale);\n\n return formatMetadata(docKey as string, file, locale) as R;\n } catch (error) {\n console.log({ error, docKey, locale });\n throw error;\n }\n};\n\nexport const getFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n const filesEntries = await Promise.all(\n Object.entries(files).map(async ([key]) => [\n key,\n await getFileMetadata(files, key as keyof F, locale),\n ])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFileMetadataBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray: FileMetadata[] = Object.values(filesMetadata).filter(\n (fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n if (locale !== defaultLocale) {\n const localizedFileMetadata = await Promise.all(\n fileMetadataArray.map(\n async (fileMetadata) =>\n await getFileMetadata(files, fileMetadata.docKey, locale)\n )\n );\n\n return localizedFileMetadata;\n }\n\n return fileMetadataArray;\n};\n\nexport const getFileBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n const fileList = await Promise.all(\n fileMetadataArray.map(async (fileMetadata) => {\n const file = await getFile(files, fileMetadata.docKey, locale);\n return file;\n })\n );\n\n return fileList;\n};\n"],"mappings":"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","names":[]}
|
package/dist/cjs/doc.cjs
CHANGED
|
@@ -32,8 +32,8 @@ const getDocs = async (locale = import_common.defaultLocale) => await (0, import
|
|
|
32
32
|
const getDoc = async (docName, locale = import_common.defaultLocale) => await (0, import_common.getFile)(import_docs.docsEntry, docName, locale);
|
|
33
33
|
const getDocMetadataRecord = async (locale = import_common.defaultLocale) => await (0, import_common.getFileMetadataRecord)(import_docs.docsEntry, locale);
|
|
34
34
|
const getDocMetadata = async (docName, locale = import_common.defaultLocale) => await (0, import_common.getFileMetadata)(import_docs.docsEntry, docName, locale);
|
|
35
|
-
const getDocMetadataBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileMetadataBySlug)(import_docs.docsEntry, slugs, locale);
|
|
36
|
-
const getDocBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileBySlug)(import_docs.docsEntry, slugs, locale);
|
|
35
|
+
const getDocMetadataBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileMetadataBySlug)(import_docs.docsEntry, slugs, locale, strict);
|
|
36
|
+
const getDocBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileBySlug)(import_docs.docsEntry, slugs, locale, strict);
|
|
37
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
38
|
0 && (module.exports = {
|
|
39
39
|
getDoc,
|
package/dist/cjs/doc.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/doc.ts"],"sourcesContent":["import { LocalesValues } from '@intlayer/config';\nimport {\n FileMetadata,\n defaultLocale,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { docsEntry } from './generated/docs.entry';\n\nexport type DocKey = keyof typeof docsEntry;\nexport type Docs = Record<DocKey, Record<LocalesValues, Promise<string>>>;\nexport type DocMetadata = FileMetadata;\n\nexport const getDocs = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, string>> => await getFiles(docsEntry, locale);\n\nexport const getDoc = async <L extends LocalesValues>(\n docName: keyof typeof docsEntry,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(docsEntry, docName, locale);\n\nexport const getDocMetadataRecord = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, FileMetadata>> =>\n await getFileMetadataRecord(docsEntry, locale);\n\nexport const getDocMetadata = async <D extends DocKey, L extends LocalesValues>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(docsEntry, docName, locale);\n\nexport const getDocMetadataBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(docsEntry, slugs, locale);\n\nexport const getDocBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<string[]> => await getFileBySlug(docsEntry, slugs, locale);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,kBAA0B;AAMnB,MAAM,UAAU,OACrB,SAAY,gCACwB,UAAM,wBAAS,uBAAW,MAAM;AAE/D,MAAM,SAAS,OACpB,SACA,SAAY,gCACQ,UAAM,uBAAQ,uBAAW,SAAS,MAAM;AAEvD,MAAM,uBAAuB,OAClC,SAAY,gCAEZ,UAAM,qCAAsB,uBAAW,MAAM;AAExC,MAAM,iBAAiB,OAC5B,SACA,SAAY,gCACc,UAAM,+BAAgB,uBAAW,SAAS,MAAM;AAErE,MAAM,uBAAuB,OAClC,OACA,SAAY,
|
|
1
|
+
{"version":3,"sources":["../../src/doc.ts"],"sourcesContent":["import { LocalesValues } from '@intlayer/config';\nimport {\n FileMetadata,\n defaultLocale,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { docsEntry } from './generated/docs.entry';\n\nexport type DocKey = keyof typeof docsEntry;\nexport type Docs = Record<DocKey, Record<LocalesValues, Promise<string>>>;\nexport type DocMetadata = FileMetadata;\n\nexport const getDocs = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, string>> => await getFiles(docsEntry, locale);\n\nexport const getDoc = async <L extends LocalesValues>(\n docName: keyof typeof docsEntry,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(docsEntry, docName, locale);\n\nexport const getDocMetadataRecord = async <L extends LocalesValues>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, FileMetadata>> =>\n await getFileMetadataRecord(docsEntry, locale);\n\nexport const getDocMetadata = async <D extends DocKey, L extends LocalesValues>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(docsEntry, docName, locale);\n\nexport const getDocMetadataBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(docsEntry, slugs, locale, strict);\n\nexport const getDocBySlug = async <L extends LocalesValues>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(docsEntry, slugs, locale, strict);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,kBAA0B;AAMnB,MAAM,UAAU,OACrB,SAAY,gCACwB,UAAM,wBAAS,uBAAW,MAAM;AAE/D,MAAM,SAAS,OACpB,SACA,SAAY,gCACQ,UAAM,uBAAQ,uBAAW,SAAS,MAAM;AAEvD,MAAM,uBAAuB,OAClC,SAAY,gCAEZ,UAAM,qCAAsB,uBAAW,MAAM;AAExC,MAAM,iBAAiB,OAC5B,SACA,SAAY,gCACc,UAAM,+BAAgB,uBAAW,SAAS,MAAM;AAErE,MAAM,uBAAuB,OAClC,OACA,SAAY,6BACZ,SAAS,UAET,UAAM,qCAAsB,uBAAW,OAAO,QAAQ,MAAM;AAEvD,MAAM,eAAe,OAC1B,OACA,SAAY,6BACZ,SAAS,UACa,UAAM,6BAAc,uBAAW,OAAO,QAAQ,MAAM;","names":[]}
|
|
@@ -32,8 +32,8 @@ const getFrequentQuestions = async (locale = import_common.defaultLocale) => (0,
|
|
|
32
32
|
const getFrequentQuestion = async (docName, locale = import_common.defaultLocale) => (0, import_common.getFile)(import_frequentQuestions.frequentQuestionsEntry, docName, locale);
|
|
33
33
|
const getFrequentQuestionMetadataRecord = async (locale = import_common.defaultLocale) => (0, import_common.getFileMetadataRecord)(import_frequentQuestions.frequentQuestionsEntry, locale);
|
|
34
34
|
const getFrequentQuestionMetadata = async (docName, locale = import_common.defaultLocale) => (0, import_common.getFileMetadata)(import_frequentQuestions.frequentQuestionsEntry, docName, locale);
|
|
35
|
-
const getFrequentQuestionMetadataBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileMetadataBySlug)(import_frequentQuestions.frequentQuestionsEntry, slugs, locale);
|
|
36
|
-
const getFrequentQuestionBySlug = async (slugs, locale = import_common.defaultLocale) => await (0, import_common.getFileBySlug)(import_frequentQuestions.frequentQuestionsEntry, slugs, locale);
|
|
35
|
+
const getFrequentQuestionMetadataBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileMetadataBySlug)(import_frequentQuestions.frequentQuestionsEntry, slugs, locale, strict);
|
|
36
|
+
const getFrequentQuestionBySlug = async (slugs, locale = import_common.defaultLocale, strict = false) => await (0, import_common.getFileBySlug)(import_frequentQuestions.frequentQuestionsEntry, slugs, locale, strict);
|
|
37
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
38
|
0 && (module.exports = {
|
|
39
39
|
getFrequentQuestion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/frequentQuestions.ts"],"sourcesContent":["import { Locales, LocalesValues } from '@intlayer/config';\nimport {\n defaultLocale,\n FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { frequentQuestionsEntry } from './generated/frequentQuestions.entry';\n\nexport type FrequentQuestionKey = keyof typeof frequentQuestionsEntry;\nexport type FrequentQuestions = Record<\n FrequentQuestionKey,\n Record<LocalesValues, Promise<string>>\n>;\nexport type FrequentQuestionMetadata = FileMetadata;\n\nexport const getFrequentQuestions = async <L extends Locales>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, string>> =>\n getFiles(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestion = async <L extends Locales>(\n docName: FrequentQuestionKey,\n locale: L = defaultLocale as L\n): Promise<string> => getFile(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataRecord = async <L extends Locales>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, FileMetadata>> =>\n getFileMetadataRecord(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestionMetadata = async <\n D extends FrequentQuestionKey,\n L extends Locales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> =>\n getFileMetadata(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataBySlug = async <L extends Locales>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(frequentQuestionsEntry, slugs, locale);\n\nexport const getFrequentQuestionBySlug = async <L extends Locales>(\n slugs: string | string[],\n locale: L = defaultLocale as L\n): Promise<string[]> =>\n await getFileBySlug(frequentQuestionsEntry, slugs, locale);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,+BAAuC;AAShC,MAAM,uBAAuB,OAClC,SAAY,oCAEZ,wBAAS,iDAAwB,MAAM;AAElC,MAAM,sBAAsB,OACjC,SACA,SAAY,oCACQ,uBAAQ,iDAAwB,SAAS,MAAM;AAE9D,MAAM,oCAAoC,OAC/C,SAAY,oCAEZ,qCAAsB,iDAAwB,MAAM;AAE/C,MAAM,8BAA8B,OAIzC,SACA,SAAY,oCAEZ,+BAAgB,iDAAwB,SAAS,MAAM;AAElD,MAAM,oCAAoC,OAC/C,OACA,SAAY,
|
|
1
|
+
{"version":3,"sources":["../../src/frequentQuestions.ts"],"sourcesContent":["import { Locales, LocalesValues } from '@intlayer/config';\nimport {\n defaultLocale,\n FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n} from './common';\nimport { frequentQuestionsEntry } from './generated/frequentQuestions.entry';\n\nexport type FrequentQuestionKey = keyof typeof frequentQuestionsEntry;\nexport type FrequentQuestions = Record<\n FrequentQuestionKey,\n Record<LocalesValues, Promise<string>>\n>;\nexport type FrequentQuestionMetadata = FileMetadata;\n\nexport const getFrequentQuestions = async <L extends Locales>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, string>> =>\n getFiles(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestion = async <L extends Locales>(\n docName: FrequentQuestionKey,\n locale: L = defaultLocale as L\n): Promise<string> => getFile(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataRecord = async <L extends Locales>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, FileMetadata>> =>\n getFileMetadataRecord(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestionMetadata = async <\n D extends FrequentQuestionKey,\n L extends Locales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> =>\n getFileMetadata(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataBySlug = async <L extends Locales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(frequentQuestionsEntry, slugs, locale, strict);\n\nexport const getFrequentQuestionBySlug = async <L extends Locales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> =>\n await getFileBySlug(frequentQuestionsEntry, slugs, locale, strict);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBASO;AACP,+BAAuC;AAShC,MAAM,uBAAuB,OAClC,SAAY,oCAEZ,wBAAS,iDAAwB,MAAM;AAElC,MAAM,sBAAsB,OACjC,SACA,SAAY,oCACQ,uBAAQ,iDAAwB,SAAS,MAAM;AAE9D,MAAM,oCAAoC,OAC/C,SAAY,oCAEZ,qCAAsB,iDAAwB,MAAM;AAE/C,MAAM,8BAA8B,OAIzC,SACA,SAAY,oCAEZ,+BAAgB,iDAAwB,SAAS,MAAM;AAElD,MAAM,oCAAoC,OAC/C,OACA,SAAY,6BACZ,SAAS,UAET,UAAM,qCAAsB,iDAAwB,OAAO,QAAQ,MAAM;AAEpE,MAAM,4BAA4B,OACvC,OACA,SAAY,6BACZ,SAAS,UAET,UAAM,6BAAc,iDAAwB,OAAO,QAAQ,MAAM;","names":[]}
|