(method, isReadonly2, isShallow2)
| 1201 | const toShallow = (value) => value; |
| 1202 | const getProto = (v) => Reflect.getPrototypeOf(v); |
| 1203 | function createIterableMethod(method, isReadonly2, isShallow2) { |
| 1204 | return function(...args) { |
| 1205 | const target = this["__v_raw"]; |
| 1206 | const rawTarget = /* @__PURE__ */ toRaw(target); |
| 1207 | const targetIsMap = isMap(rawTarget); |
| 1208 | const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; |
| 1209 | const isKeyOnly = method === "keys" && targetIsMap; |
| 1210 | const innerIterator = target[method](...args); |
| 1211 | const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; |
| 1212 | !isReadonly2 && track( |
| 1213 | rawTarget, |
| 1214 | "iterate", |
| 1215 | isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY |
| 1216 | ); |
| 1217 | return extend( |
| 1218 | // inheriting all iterator properties |
| 1219 | Object.create(innerIterator), |
| 1220 | { |
| 1221 | // iterator protocol |
| 1222 | next() { |
| 1223 | const { value, done } = innerIterator.next(); |
| 1224 | return done ? { value, done } : { |
| 1225 | value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), |
| 1226 | done |
| 1227 | }; |
| 1228 | } |
| 1229 | } |
| 1230 | ); |
| 1231 | }; |
| 1232 | } |
| 1233 | function createReadonlyMethod(type) { |
| 1234 | return function(...args) { |
| 1235 | return type === "delete" ? false : type === "clear" ? void 0 : this; |
no test coverage detected