MCPcopy
hub / github.com/microsoft/SandDance / hoistMethods

Function hoistMethods

docs/app/js/sanddance-app.js:25184–25202  ·  view source on GitHub ↗
(// eslint-disable-next-line @typescript-eslint/no-explicit-any
destination, // eslint-disable-next-line @typescript-eslint/no-explicit-any
source, exclusions)

Source from the content-addressed store, hash-verified

25182 "componentWillUnmount",
25183];
25184function hoistMethods(// eslint-disable-next-line @typescript-eslint/no-explicit-any
25185destination, // eslint-disable-next-line @typescript-eslint/no-explicit-any
25186source, exclusions) {
25187 if (exclusions === void 0) exclusions = REACT_LIFECYCLE_EXCLUSIONS;
25188 var hoisted = [];
25189 var _loop_1 = function(methodName) {
25190 if (typeof source[methodName] === "function" && destination[methodName] === undefined && (!exclusions || exclusions.indexOf(methodName) === -1)) {
25191 hoisted.push(methodName);
25192 // eslint-disable-next-line @typescript-eslint/no-explicit-any
25193 destination[methodName] = function() {
25194 var args = [];
25195 for(var _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
25196 source[methodName].apply(source, args);
25197 };
25198 }
25199 };
25200 for(var methodName1 in source)_loop_1(methodName1);
25201 return hoisted;
25202}
25203function unhoistMethods(source, methodNames) {
25204 methodNames.forEach(function(methodName) {
25205 return delete source[methodName];

Callers

nothing calls this directly

Calls 1

_loop_1Function · 0.85

Tested by

no test coverage detected