SpeciesFileGroup/taxonworks

View on GitHub
app/javascript/vue/tasks/data_attributes/field_synchronize/utils/customReplace.js

Summary

Maintainability
A
0 mins
Test Coverage
export function customReplace(match, text) {
  return match.reduce(
    (acc, curr, index) =>
      acc.replace(new RegExp('\\$' + (index + 1), 'g'), curr),
    text
  )
}