MCPcopy Create free account
hub / github.com/nodejs/node / load_extensions

Function load_extensions

deps/v8/third_party/jinja2/environment.py:106–121  ·  view source on GitHub ↗

Load the extensions from the list and bind it to the environment. Returns a dict of instantiated extensions.

(
    environment: "Environment",
    extensions: t.Sequence[t.Union[str, t.Type["Extension"]]],
)

Source from the content-addressed store, hash-verified

104
105
106def load_extensions(
107 environment: "Environment",
108 extensions: t.Sequence[t.Union[str, t.Type["Extension"]]],
109) -> t.Dict[str, "Extension"]:
110 """Load the extensions from the list and bind it to the environment.
111 Returns a dict of instantiated extensions.
112 """
113 result = {}
114
115 for extension in extensions:
116 if isinstance(extension, str):
117 extension = t.cast(t.Type["Extension"], import_string(extension))
118
119 result[extension.identifier] = extension(environment)
120
121 return result
122
123
124def _environment_config_check(environment: "Environment") -> "Environment":

Callers 3

__init__Method · 0.70
add_extensionMethod · 0.70
overlayMethod · 0.70

Calls 1

import_stringFunction · 0.70

Tested by

no test coverage detected