UNPKG

recoder-code

Version:

🚀 AI-powered development platform - Chat with 32+ models, build projects, automate workflows. Free models included!

11 lines (10 loc) • 313 B
"use strict"; exports.__esModule = true; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reHasRegExpChar = RegExp(reRegExpChar.source); function escapeRegExp(str) { return (str && reHasRegExpChar.test(str)) ? str.replace(reRegExpChar, '\\$&') : (str || ''); } exports["default"] = escapeRegExp;