seroval 1.6.9 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2161,7 +2161,10 @@ function serializeTemporal(ctx, node) {
2161
2161
  throw new SerovalUnsupportedNodeError(node);
2162
2162
  }
2163
2163
  function serializeRegExp(ctx, node) {
2164
- if (ctx.base.features & 32) return "/" + deserializeString(node.c) + "/" + node.m;
2164
+ if (ctx.base.features & 32) {
2165
+ if (node.c.includes("\\x3C")) return "new RegExp(\"" + node.c + "\",\"" + node.m + "\")";
2166
+ return "/" + deserializeString(node.c) + "/" + node.m;
2167
+ }
2165
2168
  throw new SerovalUnsupportedNodeError(node);
2166
2169
  }
2167
2170
  function serializeSetItem(ctx, id, item) {
package/dist/dev/index.js CHANGED
@@ -2160,7 +2160,10 @@ function serializeTemporal(ctx, node) {
2160
2160
  throw new SerovalUnsupportedNodeError(node);
2161
2161
  }
2162
2162
  function serializeRegExp(ctx, node) {
2163
- if (ctx.base.features & 32) return "/" + deserializeString(node.c) + "/" + node.m;
2163
+ if (ctx.base.features & 32) {
2164
+ if (node.c.includes("\\x3C")) return "new RegExp(\"" + node.c + "\",\"" + node.m + "\")";
2165
+ return "/" + deserializeString(node.c) + "/" + node.m;
2166
+ }
2164
2167
  throw new SerovalUnsupportedNodeError(node);
2165
2168
  }
2166
2169
  function serializeSetItem(ctx, id, item) {
package/dist/index.cjs CHANGED
@@ -2154,7 +2154,10 @@ function serializeTemporal(ctx, node) {
2154
2154
  throw new SerovalUnsupportedNodeError(node);
2155
2155
  }
2156
2156
  function serializeRegExp(ctx, node) {
2157
- if (ctx.base.features & 32) return "/" + deserializeString(node.c) + "/" + node.m;
2157
+ if (ctx.base.features & 32) {
2158
+ if (node.c.includes("\\x3C")) return "new RegExp(\"" + node.c + "\",\"" + node.m + "\")";
2159
+ return "/" + deserializeString(node.c) + "/" + node.m;
2160
+ }
2158
2161
  throw new SerovalUnsupportedNodeError(node);
2159
2162
  }
2160
2163
  function serializeSetItem(ctx, id, item) {
package/dist/index.js CHANGED
@@ -2153,7 +2153,10 @@ function serializeTemporal(ctx, node) {
2153
2153
  throw new SerovalUnsupportedNodeError(node);
2154
2154
  }
2155
2155
  function serializeRegExp(ctx, node) {
2156
- if (ctx.base.features & 32) return "/" + deserializeString(node.c) + "/" + node.m;
2156
+ if (ctx.base.features & 32) {
2157
+ if (node.c.includes("\\x3C")) return "new RegExp(\"" + node.c + "\",\"" + node.m + "\")";
2158
+ return "/" + deserializeString(node.c) + "/" + node.m;
2159
+ }
2157
2160
  throw new SerovalUnsupportedNodeError(node);
2158
2161
  }
2159
2162
  function serializeSetItem(ctx, id, item) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "seroval",
3
3
  "type": "module",
4
- "version": "1.6.9",
4
+ "version": "1.6.10",
5
5
  "files": [
6
6
  "dist"
7
7
  ],