MCPcopy Create free account
hub / github.com/LaunchPlatform/beanhub-cli / rename_commodity_transform

Function rename_commodity_transform

beanhub_cli/format.py:90–101  ·  view source on GitHub ↗
(
    replacements: dict[str, str], tree_or_token: TreeOrToken
)

Source from the content-addressed store, hash-verified

88
89
90def rename_commodity_transform(
91 replacements: dict[str, str], tree_or_token: TreeOrToken
92) -> TreeOrToken | None:
93 if not isinstance(tree_or_token, Token):
94 return
95 if tree_or_token.type != "CURRENCY":
96 return
97 if tree_or_token.value not in replacements:
98 return
99 new_token = copy.deepcopy(tree_or_token)
100 new_token.value = replacements[tree_or_token.value]
101 return new_token
102
103
104def combine_transforms(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected