@ai-sdk/provider-utils 4.0.0-beta.27 → 4.0.0-beta.28
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/CHANGELOG.md +6 -0
 - package/dist/index.js +11 -2
 - package/dist/index.js.map +1 -1
 - package/dist/index.mjs +11 -2
 - package/dist/index.mjs.map +1 -1
 - package/package.json +1 -1
 
    
        package/CHANGELOG.md
    CHANGED
    
    
    
        package/dist/index.js
    CHANGED
    
    | 
         @@ -98,6 +98,7 @@ function combineHeaders(...headers) { 
     | 
|
| 
       98 
98 
     | 
    
         | 
| 
       99 
99 
     | 
    
         
             
            // src/convert-async-iterator-to-readable-stream.ts
         
     | 
| 
       100 
100 
     | 
    
         
             
            function convertAsyncIteratorToReadableStream(iterator) {
         
     | 
| 
      
 101 
     | 
    
         
            +
              let cancelled = false;
         
     | 
| 
       101 
102 
     | 
    
         
             
              return new ReadableStream({
         
     | 
| 
       102 
103 
     | 
    
         
             
                /**
         
     | 
| 
       103 
104 
     | 
    
         
             
                 * Called when the consumer wants to pull more data from the stream.
         
     | 
| 
         @@ -106,6 +107,7 @@ function convertAsyncIteratorToReadableStream(iterator) { 
     | 
|
| 
       106 
107 
     | 
    
         
             
                 * @returns {Promise<void>}
         
     | 
| 
       107 
108 
     | 
    
         
             
                 */
         
     | 
| 
       108 
109 
     | 
    
         
             
                async pull(controller) {
         
     | 
| 
      
 110 
     | 
    
         
            +
                  if (cancelled) return;
         
     | 
| 
       109 
111 
     | 
    
         
             
                  try {
         
     | 
| 
       110 
112 
     | 
    
         
             
                    const { value, done } = await iterator.next();
         
     | 
| 
       111 
113 
     | 
    
         
             
                    if (done) {
         
     | 
| 
         @@ -120,7 +122,14 @@ function convertAsyncIteratorToReadableStream(iterator) { 
     | 
|
| 
       120 
122 
     | 
    
         
             
                /**
         
     | 
| 
       121 
123 
     | 
    
         
             
                 * Called when the consumer cancels the stream.
         
     | 
| 
       122 
124 
     | 
    
         
             
                 */
         
     | 
| 
       123 
     | 
    
         
            -
                cancel() {
         
     | 
| 
      
 125 
     | 
    
         
            +
                async cancel(reason) {
         
     | 
| 
      
 126 
     | 
    
         
            +
                  cancelled = true;
         
     | 
| 
      
 127 
     | 
    
         
            +
                  if (iterator.return) {
         
     | 
| 
      
 128 
     | 
    
         
            +
                    try {
         
     | 
| 
      
 129 
     | 
    
         
            +
                      await iterator.return(reason);
         
     | 
| 
      
 130 
     | 
    
         
            +
                    } catch (e) {
         
     | 
| 
      
 131 
     | 
    
         
            +
                    }
         
     | 
| 
      
 132 
     | 
    
         
            +
                  }
         
     | 
| 
       124 
133 
     | 
    
         
             
                }
         
     | 
| 
       125 
134 
     | 
    
         
             
              });
         
     | 
| 
       126 
135 
     | 
    
         
             
            }
         
     | 
| 
         @@ -294,7 +303,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) { 
     | 
|
| 
       294 
303 
     | 
    
         
             
            }
         
     | 
| 
       295 
304 
     | 
    
         | 
| 
       296 
305 
     | 
    
         
             
            // src/version.ts
         
     | 
| 
       297 
     | 
    
         
            -
            var VERSION = true ? "4.0.0-beta. 
     | 
| 
      
 306 
     | 
    
         
            +
            var VERSION = true ? "4.0.0-beta.28" : "0.0.0-test";
         
     | 
| 
       298 
307 
     | 
    
         | 
| 
       299 
308 
     | 
    
         
             
            // src/get-from-api.ts
         
     | 
| 
       300 
309 
     | 
    
         
             
            var getOriginalFetch = () => globalThis.fetch;
         
     |