Skip to main content

Module config_parser

Module config_parser 

Source
Expand description

AST-based config file parser utilities.

Helpers for statically extracting config values from JS/TS files.

Functions§

config_default_export_unreachable
True when a parsed config has neither an object nor array default export.
extract_config_aliases
Extract alias mappings from an object or array-based alias config.
extract_config_aliases_kinded
Like extract_config_aliases but each tuple carries a bare-string flag.
extract_config_array_nested_aliases
Extract alias mappings nested inside an array of config objects.
extract_config_array_nested_aliases_kinded
Kinded variant of extract_config_array_nested_aliases.
extract_config_array_nested_string_or_array
Extract string values from a property path, also searching inside array elements.
extract_config_array_object_string_pairs
Extract paired (primary, optional secondary) string values from each object element of an array at array_path.
extract_config_array_object_strings
Extract string values from a nested array, supporting both string elements and object elements with a named string/path field.
extract_config_nested_shallow_strings
Extract shallow strings from an array property inside a nested object path.
extract_config_object_keys
Extract keys of an object property at a nested path.
extract_config_object_nested_string_or_array
Extract string values from a property path, searching inside all values of an object.
extract_config_object_nested_strings
Extract a single string value from each object under a property path.
extract_config_path
Extract a statically recoverable path-like value from a property path.
extract_config_path_aliases
Extract alias mappings where the replacement is a filesystem path value.
extract_config_plugin_option_string
Extract a string-like option from a plugin tuple inside a config plugin array.
extract_config_plugin_option_string_from_paths
Extract a string-like option from the first plugin array path that contains it.
extract_config_property_strings
Extract string values from top-level properties of the default export or module.exports object.
extract_config_require_strings
Extract require('...') call argument strings from a property’s value.
extract_config_shallow_strings
Extract only top-level string values from a property’s array.
extract_config_shallow_strings_or_object_property
Extract top-level string values from a config array, including object entries.
extract_config_static_dir_entries
Extract Storybook-style static directory entries from an array.
extract_config_string
Extract a single string from a property at a nested path.
extract_config_string_array
Extract string array from a property at a nested path in a config’s default export.
extract_config_string_or_array
Extract a value that may be a single string, string array, or object with string/array values.
extract_config_truthy_bool_or_object
True when a nested config property is a static true boolean or object value.
extract_default_export_array_aliases_kinded
Extract kinded aliases from a default-exported ARRAY config.
extract_imports
Extract all import source specifiers from JS/TS source code.
extract_imports_and_requires
Extract import sources and top-level require('...') statements.
extract_lazy_imports_in_array
Extract static specifiers from thunk-wrapped dynamic imports inside an array property.
extract_vite_react_babel_dependencies
Extract Babel plugin and preset package names configured through @vitejs/plugin-react options in a Vite-style plugins array.
find_config_object_pub
Public wrapper for find_config_object.
normalize_config_path
Normalize a config-relative path to a project-root-relative forward-slash string.
normalize_config_path_buf
Normalize a config-relative path to a project-root-relative path.