@ai-sdk/google 3.0.80 → 3.0.82
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 +22 -0
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +18 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +18 -4
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +179 -29
- package/package.json +3 -3
- package/src/google-generative-ai-video-model.ts +8 -4
- package/src/google-json-accumulator.ts +35 -4
package/dist/internal/index.js
CHANGED
|
@@ -1167,11 +1167,25 @@ function parsePath(rawPath) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
return segments;
|
|
1169
1169
|
}
|
|
1170
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
1171
|
+
function hasOwnProperty(obj, key) {
|
|
1172
|
+
return hasOwn.call(obj, key);
|
|
1173
|
+
}
|
|
1174
|
+
function defineOwnProperty(obj, key, value) {
|
|
1175
|
+
Object.defineProperty(obj, key, {
|
|
1176
|
+
value,
|
|
1177
|
+
enumerable: true,
|
|
1178
|
+
configurable: true,
|
|
1179
|
+
writable: true
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1170
1182
|
function getNestedValue(obj, segments) {
|
|
1171
1183
|
let current = obj;
|
|
1172
1184
|
for (const seg of segments) {
|
|
1173
1185
|
if (current == null || typeof current !== "object") return void 0;
|
|
1174
|
-
|
|
1186
|
+
const currentRecord = current;
|
|
1187
|
+
if (!hasOwnProperty(currentRecord, seg)) return void 0;
|
|
1188
|
+
current = currentRecord[seg];
|
|
1175
1189
|
}
|
|
1176
1190
|
return current;
|
|
1177
1191
|
}
|
|
@@ -1180,12 +1194,12 @@ function setNestedValue(obj, segments, value) {
|
|
|
1180
1194
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
1181
1195
|
const seg = segments[i];
|
|
1182
1196
|
const nextSeg = segments[i + 1];
|
|
1183
|
-
if (current[seg] == null) {
|
|
1184
|
-
current
|
|
1197
|
+
if (!hasOwnProperty(current, seg) || current[seg] == null) {
|
|
1198
|
+
defineOwnProperty(current, seg, typeof nextSeg === "number" ? [] : {});
|
|
1185
1199
|
}
|
|
1186
1200
|
current = current[seg];
|
|
1187
1201
|
}
|
|
1188
|
-
current
|
|
1202
|
+
defineOwnProperty(current, segments[segments.length - 1], value);
|
|
1189
1203
|
}
|
|
1190
1204
|
function resolvePartialArgValue(arg) {
|
|
1191
1205
|
var _a, _b;
|