Download pool/shard000/JavaScript/0000038_analyze-view-factory.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000038_analyze-view-factory.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/JavaScript/0000038_analyze-view-factory.js
-
curl -L -o 0000038_analyze-view-factory.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000038_analyze-view-factory.js
1.92 kB
| define(['exports'], function (exports) { | |
| 'use strict'; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| exports.viewsRequireLifecycle = viewsRequireLifecycle; | |
| var lifecycleOptionalBehaviors = exports.lifecycleOptionalBehaviors = ['focus', 'if', 'repeat', 'show', 'with']; | |
| function behaviorRequiresLifecycle(instruction) { | |
| var t = instruction.type; | |
| var name = t.elementName !== null ? t.elementName : t.attributeName; | |
| return lifecycleOptionalBehaviors.indexOf(name) === -1 && (t.handlesAttached || t.handlesBind || t.handlesCreated || t.handlesDetached || t.handlesUnbind) || t.viewFactory && viewsRequireLifecycle(t.viewFactory) || instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory); | |
| } | |
| function targetRequiresLifecycle(instruction) { | |
| var behaviors = instruction.behaviorInstructions; | |
| if (behaviors) { | |
| var i = behaviors.length; | |
| while (i--) { | |
| if (behaviorRequiresLifecycle(behaviors[i])) { | |
| return true; | |
| } | |
| } | |
| } | |
| return instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory); | |
| } | |
| function viewsRequireLifecycle(viewFactory) { | |
| if ('_viewsRequireLifecycle' in viewFactory) { | |
| return viewFactory._viewsRequireLifecycle; | |
| } | |
| viewFactory._viewsRequireLifecycle = false; | |
| if (viewFactory.viewFactory) { | |
| viewFactory._viewsRequireLifecycle = viewsRequireLifecycle(viewFactory.viewFactory); | |
| return viewFactory._viewsRequireLifecycle; | |
| } | |
| if (viewFactory.template.querySelector('.au-animate')) { | |
| viewFactory._viewsRequireLifecycle = true; | |
| return true; | |
| } | |
| for (var id in viewFactory.instructions) { | |
| if (targetRequiresLifecycle(viewFactory.instructions[id])) { | |
| viewFactory._viewsRequireLifecycle = true; | |
| return true; | |
| } | |
| } | |
| viewFactory._viewsRequireLifecycle = false; | |
| return false; | |
| } | |
| }); |