We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
RegExp
new RegExp
structuredClone
1 parent f2c07db commit 56ad2beCopy full SHA for 56ad2be
packages/vite/src/node/utils.ts
@@ -1122,7 +1122,7 @@ function deepClone<T>(value: T): DeepWritable<T> {
1122
return value as DeepWritable<T>
1123
}
1124
if (value instanceof RegExp) {
1125
- return structuredClone(value) as DeepWritable<T>
+ return new RegExp(value) as DeepWritable<T>
1126
1127
if (typeof value === 'object' && value != null) {
1128
throw new Error('Cannot deep clone non-plain object')
0 commit comments