@ai-sdk/provider-utils 4.0.16 → 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.16" : "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) {
@@ -2554,6 +2554,12 @@ var createStatusCodeErrorResponseHandler = () => async ({ response, url, request
2554
2554
  };
2555
2555
  };
2556
2556
 
2557
+ // src/strip-file-extension.ts
2558
+ function stripFileExtension(filename) {
2559
+ const firstDotIndex = filename.indexOf(".");
2560
+ return firstDotIndex === -1 ? filename : filename.slice(0, firstDotIndex);
2561
+ }
2562
+
2557
2563
  // src/without-trailing-slash.ts
2558
2564
  function withoutTrailingSlash(url) {
2559
2565
  return url == null ? void 0 : url.replace(/\/$/, "");
@@ -2642,6 +2648,7 @@ export {
2642
2648
  resolve,
2643
2649
  safeParseJSON,
2644
2650
  safeValidateTypes,
2651
+ stripFileExtension,
2645
2652
  tool,
2646
2653
  validateTypes,
2647
2654
  withUserAgentSuffix,