L

Size: a a a
L
GK
K
K
L
L
L
class MyArray {ты что то такое делаешь?
constructor(...args) {
const array = new Array(...args)
const indexes = {}
return new Proxy(array, {
get(target, prop) {
console.log("get fierd", prop);
switch (prop) {
case "getElementByIndex":
return (indx) => indexes[indx]
case "push":
return (el) => {
target.push(el)
indexes[el.id] = el
}
default:
return target[prop];
}
}
})
}
}
S
class MyArray {ты что то такое делаешь?
constructor(...args) {
const array = new Array(...args)
const indexes = {}
return new Proxy(array, {
get(target, prop) {
console.log("get fierd", prop);
switch (prop) {
case "getElementByIndex":
return (indx) => indexes[indx]
case "push":
return (el) => {
target.push(el)
indexes[el.id] = el
}
default:
return target[prop];
}
}
})
}
}
K
СЧ
{'items': '[{"model": "www.contract", "pk": 'то он почему то получает это так
'"472631ce-3a47-4551-ad9e-a83271769414", "fields": {"type": '
'"Сервисный Договор", "date": 1598907600000, "client_uid": '
'"e88eac7a-5a58-11e6-bfa3-002590080dfb", "firm_uid": '
'"c37831b1-5f23-f688-10d9-c98344720e32", "number": "1"}}]',
'msg': 'Новый договор # 1 от 1598907600000 создан!',
'request': {'datalist': 'Сервисный '
'Договор,c37831b1-5f23-f688-10d9-c98344720e32,e88eac7a-5a58-11e6-bfa3-002590080dfb,1598907600000,1',
'filter': '',
'model': 'Contract',
'subAction': 'add'},
'status': 'OK',
'status_code': 200}
"statusstatus_codemsgrequestitems"тобишь стройкой только ключи. Проблемма уходит когда по ключам только строки но не массивы и словари? Уже голову сломал
FL
L
FL
L
FL
K
CM