UNPKG

@intlayer/core

Version:

Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.

31 lines (29 loc) 1.57 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('../../_virtual/_rolldown/runtime.cjs'); const require_interpreter_getContent_deepTransform = require('./deepTransform.cjs'); const require_interpreter_getContent_plugins = require('./plugins.cjs'); let _intlayer_config_built = require("@intlayer/config/built"); //#region src/interpreter/getContent/getContent.ts const getBasePlugins = (locale, fallback = true) => [ require_interpreter_getContent_plugins.translationPlugin(locale ?? _intlayer_config_built.internationalization.defaultLocale, fallback ? _intlayer_config_built.internationalization.defaultLocale : void 0), require_interpreter_getContent_plugins.enumerationPlugin, require_interpreter_getContent_plugins.conditionPlugin, require_interpreter_getContent_plugins.insertionPlugin, require_interpreter_getContent_plugins.nestedPlugin(locale ?? _intlayer_config_built.internationalization.defaultLocale), require_interpreter_getContent_plugins.filePlugin, require_interpreter_getContent_plugins.genderPlugin ]; /** * Transforms a node in a single pass, applying each plugin as needed. * * @param node The node to transform. * @param locale The locale to use if your transformers need it (e.g. for translations). */ const getContent = (node, nodeProps, plugins = []) => require_interpreter_getContent_deepTransform.deepTransformNode(node, { ...nodeProps, plugins }); //#endregion exports.getBasePlugins = getBasePlugins; exports.getContent = getContent; //# sourceMappingURL=getContent.cjs.map