MCPcopy Create free account
hub / github.com/ShaderFrog/glsl-parser / renameBindings

Function renameBindings

src/parser/utils.ts:34–44  ·  view source on GitHub ↗
(
  bindings: ScopeIndex,
  mangle: (name: string) => string
)

Source from the content-addressed store, hash-verified

32};
33
34export const renameBindings = (
35 bindings: ScopeIndex,
36 mangle: (name: string) => string
37) =>
38 Object.entries(bindings).reduce<ScopeIndex>((acc, [name, binding]) => {
39 const mangled = mangle(name);
40 return {
41 ...acc,
42 [mangled]: renameBinding(binding, mangled),
43 };
44 }, {});
45
46export const renameType = (type: TypeScopeEntry, newName: string) => {
47 type.references.forEach((node) => {

Callers 1

scope.test.tsFile · 0.85

Calls 1

renameBindingFunction · 0.85

Tested by

no test coverage detected