@player-ui/async-node-plugin 0.11.0-next.0 → 0.11.0-next.2
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/AsyncNodePlugin.native.js +36 -14
- package/dist/AsyncNodePlugin.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +13 -5
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/index.test.ts +150 -4
- package/src/index.ts +14 -1
- package/src/transform.ts +1 -1
- package/types/index.d.ts +2 -1
|
@@ -2522,7 +2522,6 @@ var AsyncNodePlugin = function() {
|
|
|
2522
2522
|
try {
|
|
2523
2523
|
for(var _iterator = Object.keys(object)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2524
2524
|
var key = _step.value;
|
|
2525
|
-
"";
|
|
2526
2525
|
var val = object[key];
|
|
2527
2526
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2528
2527
|
key
|
|
@@ -4327,18 +4326,18 @@ var AsyncNodePlugin = function() {
|
|
|
4327
4326
|
]);
|
|
4328
4327
|
return ValidatorRegistry;
|
|
4329
4328
|
}();
|
|
4330
|
-
var NodeType = /* @__PURE__ */ function(
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
return
|
|
4329
|
+
var NodeType = /* @__PURE__ */ function(NodeType2) {
|
|
4330
|
+
NodeType2["Asset"] = "asset";
|
|
4331
|
+
NodeType2["View"] = "view";
|
|
4332
|
+
NodeType2["Applicability"] = "applicability";
|
|
4333
|
+
NodeType2["Template"] = "template";
|
|
4334
|
+
NodeType2["Value"] = "value";
|
|
4335
|
+
NodeType2["MultiNode"] = "multi-node";
|
|
4336
|
+
NodeType2["Switch"] = "switch";
|
|
4337
|
+
NodeType2["Async"] = "async";
|
|
4338
|
+
NodeType2["Unknown"] = "unknown";
|
|
4339
|
+
NodeType2["Empty"] = "empty";
|
|
4340
|
+
return NodeType2;
|
|
4342
4341
|
}(NodeType || {});
|
|
4343
4342
|
var EMPTY_NODE = {
|
|
4344
4343
|
type: "empty"
|
|
@@ -7630,7 +7629,7 @@ var AsyncNodePlugin = function() {
|
|
|
7630
7629
|
};
|
|
7631
7630
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
|
|
7632
7631
|
var AsyncNodePlugin = /*#__PURE__*/ function() {
|
|
7633
|
-
function AsyncNodePlugin(options) {
|
|
7632
|
+
function AsyncNodePlugin(options, asyncHandler) {
|
|
7634
7633
|
var _this = this;
|
|
7635
7634
|
_class_call_check(this, AsyncNodePlugin);
|
|
7636
7635
|
this.hooks = {
|
|
@@ -7643,6 +7642,29 @@ var AsyncNodePlugin = function() {
|
|
|
7643
7642
|
plugin.applyPlugin(_this);
|
|
7644
7643
|
});
|
|
7645
7644
|
}
|
|
7645
|
+
if (asyncHandler) {
|
|
7646
|
+
this.hooks.onAsyncNode.tap("async", function() {
|
|
7647
|
+
var _ref = _async_to_generator(function(node, callback) {
|
|
7648
|
+
return _ts_generator(this, function(_state) {
|
|
7649
|
+
switch(_state.label){
|
|
7650
|
+
case 0:
|
|
7651
|
+
return [
|
|
7652
|
+
4,
|
|
7653
|
+
asyncHandler(node, callback)
|
|
7654
|
+
];
|
|
7655
|
+
case 1:
|
|
7656
|
+
return [
|
|
7657
|
+
2,
|
|
7658
|
+
_state.sent()
|
|
7659
|
+
];
|
|
7660
|
+
}
|
|
7661
|
+
});
|
|
7662
|
+
});
|
|
7663
|
+
return function(node, callback) {
|
|
7664
|
+
return _ref.apply(this, arguments);
|
|
7665
|
+
};
|
|
7666
|
+
}());
|
|
7667
|
+
}
|
|
7646
7668
|
}
|
|
7647
7669
|
_create_class(AsyncNodePlugin, [
|
|
7648
7670
|
{
|