corvée(dépendances) ajoute Carbon Fields
This commit is contained in:
parent
135cc65eed
commit
62368587e5
459 changed files with 72750 additions and 26 deletions
14
web/vendor/htmlburger/carbon-fields/packages/blocks/utils/transform-fields-to-attributes.js
vendored
Normal file
14
web/vendor/htmlburger/carbon-fields/packages/blocks/utils/transform-fields-to-attributes.js
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Transforms the fields to an attributes set.
|
||||
*
|
||||
* @param {Object[]} fields
|
||||
* @return {Object}
|
||||
*/
|
||||
export default function transformFieldsToAttributes( fields ) {
|
||||
return fields.reduce( ( attributes, field ) => {
|
||||
return {
|
||||
...attributes,
|
||||
[ field.base_name ]: field.default_value
|
||||
};
|
||||
}, {} );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue