Comments (8)
А если сделать result: state.items то что получится?
On Fri, Dec 19, 2014 at 11:33 PM, chestozo [email protected] wrote:
Вот для такой ручки:
de.object({
one: de.object(
{ items: { item: [ 'one', 'two' ] } },
{ state: { 'items': '.items.item' } }
),two: de.object( { items: { item: [ 'three', 'four' ] } }, { state: { 'items': '.items.item' } } )
}, {
result: 'state.items'
})Результатом будет:
[
"one",
"two",
"three",
"four"
]Это баг или фича?
Мне кажется, это баг.
Один из state.items-ов должен был в итоге затереть другой state.items./cc @pasaran https://github.com/pasaran @edoroshenko
https://github.com/edoroshenko—
Reply to this email directly or view it on GitHub
#105.
from descript.
Так у меня так и есть result: 'state.items'
...
from descript.
В смысле result: 'state'
On Monday, December 22, 2014, chestozo [email protected] wrote:
Так у меня так и есть result: 'state.items'...
—
Reply to this email directly or view it on GitHub
#105 (comment).
from descript.
Будет так:
{
"items": [
"one",
"two",
"three",
"four"
]
}
from descript.
там используется merge, он так работает. Баг это, или фича - вопрос философский. Но переделывать это место я бы не стал, лучше разрулить этот редкий кейс кастомной функцией. Это не то место, где можно с лёгкостью ломать совместимость
from descript.
А зачем там merge? Вы этим где-то пользуетесь осознанно?
Я это уже разрулил, да, просто поведение было неожиданное.
from descript.
Хмм. Я ничего про merge не помню, если честно )
from descript.
https://github.com/pasaran/descript/blob/master/lib/de.block.js#L337
from descript.
Related Issues (20)
- Не работает extend параметров http-блока HOT 9
- По ссылке на вики в readme — 404
- Лишняя магия — приоритеты блоков HOT 4
- Неравномерная нагрузка на воркеры HOT 4
- Сохранять заголовка ответа http блока HOT 3
- Поддержка асинхронного result() у блоков HOT 4
- Обработка http ошибок в контексте блока. HOT 3
- json в теле пост-запроса не может быть массивом HOT 1
- Выполнять before до guard HOT 3
- Не накладывать шаблон, если вернули 404, 500 или 302 статусы HOT 8
- Ссылка на вики битая HOT 1
- Сленг HOT 1
- 204 No content HOT 2
- PATCH теряет body HOT 1
- FIXME fs.chmodSync HOT 2
- Собрать новую версию
- Не падать, если ответ пуст или сформирован некорректно
- Не переходить по редиректам в de.http HOT 4
- Retry для блоков HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from descript.