@rkmodules/rules 0.0.112 → 0.0.113
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/dist/index.cjs.js +10 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/DataTree/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -236,6 +236,12 @@ function isTree(value) {
|
|
|
236
236
|
Object.keys(value).length > 0 &&
|
|
237
237
|
Object.values(value).every(function (v) { return Array.isArray(v); }));
|
|
238
238
|
}
|
|
239
|
+
function isEmptyTree(value) {
|
|
240
|
+
return (typeof value === "object" &&
|
|
241
|
+
value !== null &&
|
|
242
|
+
!Array.isArray(value) &&
|
|
243
|
+
Object.keys(value).length === 0);
|
|
244
|
+
}
|
|
239
245
|
function isSingleTon(value) {
|
|
240
246
|
return (Object.keys(value).length === 1 && Object.values(value)[0].length === 1);
|
|
241
247
|
}
|
|
@@ -252,6 +258,9 @@ function broadCast(value) {
|
|
|
252
258
|
if (isTree(value)) {
|
|
253
259
|
return value;
|
|
254
260
|
}
|
|
261
|
+
if (isEmptyTree(value)) {
|
|
262
|
+
return {};
|
|
263
|
+
}
|
|
255
264
|
return { "0": [value] };
|
|
256
265
|
}
|
|
257
266
|
function getBranch(tree, path) {
|
|
@@ -7591,6 +7600,7 @@ exports.getVariable = getVariable;
|
|
|
7591
7600
|
exports.graftTree = graftTree;
|
|
7592
7601
|
exports.hasReference = hasReference;
|
|
7593
7602
|
exports.interpolate = interpolate;
|
|
7603
|
+
exports.isEmptyTree = isEmptyTree;
|
|
7594
7604
|
exports.isReference = isReference;
|
|
7595
7605
|
exports.isSingleTon = isSingleTon;
|
|
7596
7606
|
exports.isTree = isTree;
|