@lowdefy/docs 4.7.3 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,11 @@ function custom_filter_default_value({ params }) {
27
27
  };
28
28
  const filterObject = ({ obj, path })=>{
29
29
  Object.keys(obj).forEach((key)=>{
30
+ // Strip internal build markers from display
31
+ if (key === '~k' || key === '~r' || key === '~l') {
32
+ delete obj[key];
33
+ return;
34
+ }
30
35
  const propPath = path.concat([
31
36
  key
32
37
  ]);
@@ -40,7 +45,10 @@ function custom_filter_default_value({ params }) {
40
45
  if (obj[key] === dv) {
41
46
  delete obj[key];
42
47
  }
43
- if (obj[key] === null || isEmptyObject(obj[key])) {
48
+ if (obj[key] === null || obj[key] === undefined) {
49
+ delete obj[key];
50
+ }
51
+ if (isEmptyObject(obj[key])) {
44
52
  delete obj[key];
45
53
  }
46
54
  });
@@ -0,0 +1,27 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import YAML from 'yaml';
16
+ function custom_yaml_parse({ params }) {
17
+ const input = Array.isArray(params) ? params[0] : params;
18
+ if (!input || typeof input !== 'string') return {};
19
+ try {
20
+ const result = YAML.parse(input);
21
+ if (result === null || typeof result !== 'object' || Array.isArray(result)) return {};
22
+ return result;
23
+ } catch {
24
+ return {};
25
+ }
26
+ }
27
+ export default custom_yaml_parse;
@@ -0,0 +1,57 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import YAML from 'yaml';
16
+ function isMarkerKey(key) {
17
+ return typeof key === 'string' && key.length >= 2 && key[0] === '~';
18
+ }
19
+ function stripMarkers(value) {
20
+ if (typeof value === 'function' || typeof value === 'symbol') {
21
+ return undefined;
22
+ }
23
+ if (Array.isArray(value)) {
24
+ return value.map(stripMarkers);
25
+ }
26
+ if (value !== null && typeof value === 'object') {
27
+ if (value instanceof Date) {
28
+ return value.toISOString();
29
+ }
30
+ const clean = {};
31
+ for (const key of Object.keys(value)){
32
+ if (!isMarkerKey(key)) {
33
+ const stripped = stripMarkers(value[key]);
34
+ if (stripped !== undefined) {
35
+ clean[key] = stripped;
36
+ }
37
+ }
38
+ }
39
+ return clean;
40
+ }
41
+ return value;
42
+ }
43
+ function custom_yaml_stringify({ params }) {
44
+ let input;
45
+ let options;
46
+ if (Array.isArray(params)) {
47
+ [input, options] = params;
48
+ } else if (params !== null && typeof params === 'object' && 'on' in params) {
49
+ input = params.on;
50
+ options = params.options;
51
+ } else {
52
+ input = params;
53
+ }
54
+ if (input === undefined || input === null) return '';
55
+ return YAML.stringify(stripMarkers(input), options);
56
+ }
57
+ export default custom_yaml_stringify;
@@ -13,3 +13,5 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ export { default as _custom_filter_default_value } from './operators/client/filter_default_value.js';
16
+ export { default as _custom_yaml_parse } from './operators/client/yaml_parse.js';
17
+ export { default as _custom_yaml_stringify } from './operators/client/yaml_stringify.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/docs",
3
- "version": "4.7.3",
3
+ "version": "5.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -36,20 +36,22 @@
36
36
  "dist/*"
37
37
  ],
38
38
  "dependencies": {
39
- "@lowdefy/helpers": "4.7.3"
39
+ "@lowdefy/helpers": "5.0.0",
40
+ "minisearch": "^7.0.0",
41
+ "yaml": "2.3.4"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@jest/globals": "28.1.3",
43
- "@swc/cli": "0.1.63",
44
- "@swc/core": "1.3.99",
45
- "@swc/jest": "0.2.29",
45
+ "@swc/cli": "0.8.0",
46
+ "@swc/core": "1.15.18",
47
+ "@swc/jest": "0.2.39",
46
48
  "jest": "28.1.3"
47
49
  },
48
50
  "publishConfig": {
49
51
  "access": "public"
50
52
  },
51
53
  "scripts": {
52
- "build": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
54
+ "build": "swc src --out-dir dist --config-file ../../.swcrc --cli-config-file ../../.swc-cli.json",
53
55
  "clean": "rm -rf .lowdefy",
54
56
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
55
57
  }