Skip to content

Commit

Permalink
feat(replace): add safer default delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebilicious committed Jun 30, 2023
1 parent 3cb9dab commit 5f9a060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/replace/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function expandTypeofReplacements(replacements) {

export default function replace(options = {}) {
const filter = createFilter(options.include, options.exclude);
const { delimiters = ['\\b', '\\b(?!\\.)'], preventAssignment, objectGuards } = options;
const { delimiters = ['(?<!\\.)\\b', '\\b(?!\\.)'], preventAssignment, objectGuards } = options;
const replacements = getReplacements(options);
if (objectGuards) expandTypeofReplacements(replacements);
const functionValues = mapToFunctions(replacements);
Expand Down

0 comments on commit 5f9a060

Please sign in to comment.