( functions: FunctionScopeIndex, mangle: (name: string) => string )
| 110 | }; |
| 111 | |
| 112 | export const renameFunctions = ( |
| 113 | functions: FunctionScopeIndex, |
| 114 | mangle: (name: string) => string |
| 115 | ) => |
| 116 | Object.entries(functions).reduce<FunctionScopeIndex>( |
| 117 | (acc, [fnName, overloads]) => { |
| 118 | const mangled = mangle(fnName); |
| 119 | return { |
| 120 | ...acc, |
| 121 | [mangled]: renameFunction(overloads, mangled), |
| 122 | }; |
| 123 | }, |
| 124 | {} |
| 125 | ); |
| 126 | |
| 127 | export const xor = (a: any, b: any): boolean => (a || b) && !(a && b); |
| 128 |
no test coverage detected