@ai-sdk/provider-utils 4.0.17 → 4.0.18

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.
package/dist/index.mjs CHANGED
@@ -479,7 +479,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
479
479
  }
480
480
 
481
481
  // src/version.ts
482
- var VERSION = true ? "4.0.17" : "0.0.0-test";
482
+ var VERSION = true ? "4.0.18" : "0.0.0-test";
483
483
 
484
484
  // src/get-from-api.ts
485
485
  var getOriginalFetch = () => globalThis.fetch;
@@ -717,8 +717,8 @@ import {
717
717
  } from "@ai-sdk/provider";
718
718
 
719
719
  // src/secure-json-parse.ts
720
- var suspectProtoRx = /"__proto__"\s*:/;
721
- var suspectConstructorRx = /"constructor"\s*:/;
720
+ var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
721
+ var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
722
722
  function _parse(text) {
723
723
  const obj = JSON.parse(text);
724
724
  if (obj === null || typeof obj !== "object") {
@@ -738,7 +738,7 @@ function filter(obj) {
738
738
  if (Object.prototype.hasOwnProperty.call(node, "__proto__")) {
739
739
  throw new SyntaxError("Object contains forbidden prototype property");
740
740
  }
741
- if (Object.prototype.hasOwnProperty.call(node, "constructor") && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
741
+ if (Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
742
742
  throw new SyntaxError("Object contains forbidden prototype property");
743
743
  }
744
744
  for (const key in node) {