diff --git a/src/transforms/recordUpdate.ts b/src/transforms/recordUpdate.ts index 9d42108..a12c365 100644 --- a/src/transforms/recordUpdate.ts +++ b/src/transforms/recordUpdate.ts @@ -135,7 +135,8 @@ function isUpdateExpression(node: ts.Node): ts.CallExpression | null { } function generateCodeForReusableUpdate(objName: string, shape: string, objectProperties: Array): ts.Node { - const updateFnName = `$$update__${shape.replaceAll(',', '__')}`; + + const updateFnName = `$$update__${shape.replace(/,/g, '__')}`; const initialArgs: Array = [ ts.createIdentifier(objName) ]; const newValues = objectProperties.map((it) => (it as ts.PropertyAssignment).initializer); @@ -279,7 +280,8 @@ function createReusableUpdateStatements(updateSet: Map): ts.Node } function createReusableUpdateStatement(shape: string): string { - const updateFnName = `$$update__${shape.replaceAll(',', '__')}`; + + const updateFnName = `$$update__${shape.replace(/,/g, '__')}`; const props = shape.split(','); const propSetters = props.