Skip to content

Commit fa770d2

Browse files
committed
chore: bump json merge patch version to 0.1.1
Signed-off-by: peefy <[email protected]>
1 parent f155988 commit fa770d2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

json_merge_patch/kcl.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
22
name = "json_merge_patch"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "`json_merge_patch` is a module for applying JSON merge patches (RFC 7368) for KCL values."
55

json_merge_patch/main.k

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
KCL_BUILTIN_TYPES = ["int", "str", "bool", "float", "None", "UndefinedType", "any", "list", "dict", "function", "number_multiplier"]
1+
KCL_BUILTIN_TYPES = ["int", "str", "bool", "float", "None", "UndefinedType", "any", "list", "dict", "type", "function", "number_multiplier"]
22
NULL_CONSTANTS = [Undefined, None]
3-
43
is_schema = lambda obj: any -> bool {
54
typeof(obj) not in KCL_BUILTIN_TYPES
6-
75
}
6+
87
is_config = lambda obj: any -> bool {
98
typeof(obj) == "dict" or is_schema(obj)
109
}
1110

12-
_looper_n = lambda elements: [any], n: int, func: (any, any) -> any, initial: any-> any {
11+
_looper_n = lambda elements: [any], n: int, func: (any, any) -> any, initial: any -> any {
1312
assert n >= 0
1413
result = initial
1514
if n < len(elements):
1615
result = _looper_n(elements, n + 1, func, func(result, elements[n]))
16+
1717
result
1818
}
1919

@@ -37,6 +37,7 @@ merge = lambda src: any, obj: any -> any {
3737
result = src
3838
if not is_config(src):
3939
result = {}
40+
4041
if not is_config(obj):
4142
result = obj
4243
else:

0 commit comments

Comments
 (0)