@sealcode/sealgen 0.11.5 → 0.11.6
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.
- package/lib/build.js +0 -1
- package/lib/page/stateful-page.js +2 -15
- package/package.json +1 -1
- package/src/build.ts +0 -1
- package/src/page/stateful-page.ts +3 -22
package/lib/build.js
CHANGED
|
@@ -110,7 +110,6 @@ async function build_ts() {
|
|
|
110
110
|
}
|
|
111
111
|
async function complex_build(watch) {
|
|
112
112
|
const loader = Object.fromEntries(["png", "svg", "jpg", "gif", "jpeg", "otf", "ttf"].map((ext) => ["." + ext, "file"]));
|
|
113
|
-
console.log({ loader });
|
|
114
113
|
let css_build = await (0, esbuild_1.context)({
|
|
115
114
|
entryPoints: ["./src/main.css"],
|
|
116
115
|
sourcemap: true,
|
|
@@ -62,22 +62,9 @@ class StatefulPage extends mountable_1.Mountable {
|
|
|
62
62
|
// the "$" key is parsed as dot notation and overrides the state
|
|
63
63
|
const original_state = JSON.parse((0, base64_1.from_base64)(ctx.$body.state));
|
|
64
64
|
const modified_state = (0, deepmerge_1.default)(original_state, ctx.$body.$ || {}, {
|
|
65
|
-
arrayMerge: (
|
|
65
|
+
arrayMerge: (_target, source, _options) => {
|
|
66
66
|
// https://github.com/TehShrike/deepmerge#user-content-arraymerge-example-combine-arrays
|
|
67
|
-
|
|
68
|
-
source.forEach((item, index) => {
|
|
69
|
-
if (typeof destination[index] === "undefined") {
|
|
70
|
-
destination[index] =
|
|
71
|
-
options.cloneUnlessOtherwiseSpecified(item, options);
|
|
72
|
-
}
|
|
73
|
-
else if (options.isMergeableObject(item)) {
|
|
74
|
-
destination[index] = (0, deepmerge_1.default)(target[index], item, options);
|
|
75
|
-
}
|
|
76
|
-
else if (target.indexOf(item) === -1) {
|
|
77
|
-
destination.push(item);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return destination;
|
|
67
|
+
return source;
|
|
81
68
|
},
|
|
82
69
|
});
|
|
83
70
|
if (ctx.$body.action && ctx.$body.args) {
|
package/package.json
CHANGED
package/src/build.ts
CHANGED
|
@@ -128,31 +128,12 @@ export abstract class StatefulPage<
|
|
|
128
128
|
|
|
129
129
|
const modified_state = deepmerge(original_state, ctx.$body.$ || {}, {
|
|
130
130
|
arrayMerge: (
|
|
131
|
-
|
|
131
|
+
_target: any[],
|
|
132
132
|
source: any[],
|
|
133
|
-
|
|
133
|
+
_options: ArrayMergeOptions
|
|
134
134
|
) => {
|
|
135
135
|
// https://github.com/TehShrike/deepmerge#user-content-arraymerge-example-combine-arrays
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
source.forEach((item, index) => {
|
|
139
|
-
if (typeof destination[index] === "undefined") {
|
|
140
|
-
destination[index] =
|
|
141
|
-
options.cloneUnlessOtherwiseSpecified(
|
|
142
|
-
item,
|
|
143
|
-
options
|
|
144
|
-
);
|
|
145
|
-
} else if (options.isMergeableObject(item)) {
|
|
146
|
-
destination[index] = deepmerge(
|
|
147
|
-
target[index],
|
|
148
|
-
item,
|
|
149
|
-
options
|
|
150
|
-
);
|
|
151
|
-
} else if (target.indexOf(item) === -1) {
|
|
152
|
-
destination.push(item);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
return destination;
|
|
136
|
+
return source;
|
|
156
137
|
},
|
|
157
138
|
}) as State;
|
|
158
139
|
|