fix(docs): Update docs to use _js operator.

This commit is contained in:
Gervwyk 2021-04-07 13:01:37 +02:00
parent 6cf5ac78c1
commit 91dda91eea
2 changed files with 12 additions and 12 deletions

View File

@ -14,9 +14,7 @@
limitations under the License.
*/
function filterDefaultValue(...args) {
const [value, defaultValue] = args;
function filterDefaultValue(value, defaultValue) {
const isObject = (obj) => typeof obj === 'object' && obj !== null && !Array.isArray(obj);
const isEmptyObject = (obj) => isObject(obj) && Object.keys(obj).length === 0;
@ -47,4 +45,4 @@ function filterDefaultValue(...args) {
return filterObject({ obj: value, path: [] });
}
export default filterDefaultValue;
module.exports = filterDefaultValue;

View File

@ -181,9 +181,10 @@ areas:
required:
_state: block.required
properties:
_experimental_unsafe_js.evaluate:
file:
_ref: templates/blocks/filterDefaultValue.js
_js.evaluate:
code:
_ref:
eval: templates/blocks/filterDefaultValue.js
args:
- _ref:
path:
@ -221,7 +222,7 @@ areas:
properties:
title: Methods
{% for method in methods %}
- id: method_button
- id: method_button_{{ method.name }}
type: Button
layout:
span: 12
@ -232,7 +233,7 @@ areas:
events:
onClick:
_var: methods.{{ loop.index0 }}.onClick
- id: method_args
- id: method_args_{{ method.name }}
type: MarkdownWithCode
layout:
span: 12
@ -301,9 +302,10 @@ areas:
options:
sortKeys: false
on:
_experimental_unsafe_js.evaluate:
file:
_ref: templates/blocks/filterDefaultValue.js
_js.evaluate:
code:
_ref:
eval: templates/blocks/filterDefaultValue.js
args:
- id: block_id
type: {{ block_type }}