mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
fix(docs): Update docs to use _js operator.
This commit is contained in:
parent
6cf5ac78c1
commit
91dda91eea
@ -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;
|
||||
|
18
packages/docs/templates/blocks/template.yaml.njk
vendored
18
packages/docs/templates/blocks/template.yaml.njk
vendored
@ -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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user