id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
4,700
SAP/openui5
src/sap.ui.core/src/ui5loader.js
handleConfigObject
function handleConfigObject(oCfg, mHandlers) { function processConfig(key, value) { var handler = mHandlers[key]; if ( typeof handler === 'function' ) { if ( handler.length === 1) { handler(value); } else if ( value != null ) { forEach(value, handler); } } else { log.warning("confi...
javascript
function handleConfigObject(oCfg, mHandlers) { function processConfig(key, value) { var handler = mHandlers[key]; if ( typeof handler === 'function' ) { if ( handler.length === 1) { handler(value); } else if ( value != null ) { forEach(value, handler); } } else { log.warning("confi...
[ "function", "handleConfigObject", "(", "oCfg", ",", "mHandlers", ")", "{", "function", "processConfig", "(", "key", ",", "value", ")", "{", "var", "handler", "=", "mHandlers", "[", "key", "]", ";", "if", "(", "typeof", "handler", "===", "'function'", ")", ...
Executes all available handlers which are defined in the config object @param {object} oCfg config to handle @param {map} mHandlers all available handlers
[ "Executes", "all", "available", "handlers", "which", "are", "defined", "in", "the", "config", "object" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/ui5loader.js#L2200-L2227
4,701
SAP/openui5
src/sap.ui.core/src/sap/ui/debug/LogViewer.js
function(oWindow, sRootId) { this.oWindow = oWindow; this.oDomNode = oWindow.document.getElementById(sRootId); if (!this.oDomNode) { var oDiv = this.oWindow.document.createElement("DIV"); oDiv.setAttribute("id", sRootId); oDiv.style.overflow = "auto"; oDiv.style.tabIndex = "-1"; oDiv.style.position...
javascript
function(oWindow, sRootId) { this.oWindow = oWindow; this.oDomNode = oWindow.document.getElementById(sRootId); if (!this.oDomNode) { var oDiv = this.oWindow.document.createElement("DIV"); oDiv.setAttribute("id", sRootId); oDiv.style.overflow = "auto"; oDiv.style.tabIndex = "-1"; oDiv.style.position...
[ "function", "(", "oWindow", ",", "sRootId", ")", "{", "this", ".", "oWindow", "=", "oWindow", ";", "this", ".", "oDomNode", "=", "oWindow", ".", "document", ".", "getElementById", "(", "sRootId", ")", ";", "if", "(", "!", "this", ".", "oDomNode", ")", ...
Constructs a LogViewer in the given window, embedded into the given DOM element. If the DOM element doesn't exist, a DIV is created. @param {Window} oTargetWindow the window where the log will be displayed in @param {sRootId} sRootId id of the top level element that will contain the log entries @class HTML LogViewer ...
[ "Constructs", "a", "LogViewer", "in", "the", "given", "window", "embedded", "into", "the", "given", "DOM", "element", ".", "If", "the", "DOM", "element", "doesn", "t", "exist", "a", "DIV", "is", "created", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/debug/LogViewer.js#L20-L44
4,702
SAP/openui5
src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js
processPlaceholder
function processPlaceholder (sPlaceholder, oParam) { var sISODate = new Date().toISOString(); var sProcessed = sPlaceholder.replace("{{parameters.NOW_ISO}}", sISODate); sProcessed = sProcessed.replace("{{parameters.TODAY_ISO}}", sISODate.slice(0, 10)); if (oParam) { for (var oProperty in oParam) { sProce...
javascript
function processPlaceholder (sPlaceholder, oParam) { var sISODate = new Date().toISOString(); var sProcessed = sPlaceholder.replace("{{parameters.NOW_ISO}}", sISODate); sProcessed = sProcessed.replace("{{parameters.TODAY_ISO}}", sISODate.slice(0, 10)); if (oParam) { for (var oProperty in oParam) { sProce...
[ "function", "processPlaceholder", "(", "sPlaceholder", ",", "oParam", ")", "{", "var", "sISODate", "=", "new", "Date", "(", ")", ".", "toISOString", "(", ")", ";", "var", "sProcessed", "=", "sPlaceholder", ".", "replace", "(", "\"{{parameters.NOW_ISO}}\"", ","...
Replace all placeholders inside the string. @private @param {string} sPlaceholder The value to process. @param {Object} oParam The parameter from the configuration. @returns {string} The string with replaced placeholders.
[ "Replace", "all", "placeholders", "inside", "the", "string", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js#L212-L223
4,703
SAP/openui5
src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js
process
function process (oObject, oTranslator, iCurrentLevel, iMaxLevel, oParams) { if (iCurrentLevel === iMaxLevel) { return; } if (Array.isArray(oObject)) { oObject.forEach(function (vItem, iIndex, aArray) { if (typeof vItem === "object") { process(vItem, oTranslator, iCurrentLevel + 1, iMaxLevel, oPar...
javascript
function process (oObject, oTranslator, iCurrentLevel, iMaxLevel, oParams) { if (iCurrentLevel === iMaxLevel) { return; } if (Array.isArray(oObject)) { oObject.forEach(function (vItem, iIndex, aArray) { if (typeof vItem === "object") { process(vItem, oTranslator, iCurrentLevel + 1, iMaxLevel, oPar...
[ "function", "process", "(", "oObject", ",", "oTranslator", ",", "iCurrentLevel", ",", "iMaxLevel", ",", "oParams", ")", "{", "if", "(", "iCurrentLevel", "===", "iMaxLevel", ")", "{", "return", ";", "}", "if", "(", "Array", ".", "isArray", "(", "oObject", ...
Process a manifest. @private @param {Object} oObject The Manifest to process. @param {Object} oTranslator The translator. @param {number} iCurrentLevel The current level of recursion. @param {number} iMaxLevel The maximum level of recursion. @param {Object} oParams The parameters to be replaced in the manifest.
[ "Process", "a", "manifest", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/util/CardManifest.js#L235-L261
4,704
SAP/openui5
src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js
_getElementTreeLeftColumnOfListItem
function _getElementTreeLeftColumnOfListItem(controls, paddingLeft) { var html = "<offset style=\"padding-left:" + paddingLeft + "px\" >"; if (controls.content.length > 0) { html += "<arrow down=\"true\"></arrow>"; } else { html += "<place-holder></place-holder>"; } html += "</offset>"; ret...
javascript
function _getElementTreeLeftColumnOfListItem(controls, paddingLeft) { var html = "<offset style=\"padding-left:" + paddingLeft + "px\" >"; if (controls.content.length > 0) { html += "<arrow down=\"true\"></arrow>"; } else { html += "<place-holder></place-holder>"; } html += "</offset>"; ret...
[ "function", "_getElementTreeLeftColumnOfListItem", "(", "controls", ",", "paddingLeft", ")", "{", "var", "html", "=", "\"<offset style=\\\"padding-left:\"", "+", "paddingLeft", "+", "\"px\\\" >\"", ";", "if", "(", "controls", ".", "content", ".", "length", ">", "0",...
Create HTML for the left part of the ElementTree list item. @param {ElementTreeOptions.controls} controls @param {number} paddingLeft @returns {string} @private
[ "Create", "HTML", "for", "the", "left", "part", "of", "the", "ElementTree", "list", "item", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js#L60-L72
4,705
SAP/openui5
src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js
_getElementTreeRightColumnOfListItem
function _getElementTreeRightColumnOfListItem(control, numberOfIssues) { var splitControlName = control.name.split("."); var name = splitControlName[splitControlName.length - 1]; var nameSpace = control.name.replace(name, ""); var hideShowClass = (numberOfIssues > 0) ? "showNumbOfIssues" : "hideNumbOfIssues...
javascript
function _getElementTreeRightColumnOfListItem(control, numberOfIssues) { var splitControlName = control.name.split("."); var name = splitControlName[splitControlName.length - 1]; var nameSpace = control.name.replace(name, ""); var hideShowClass = (numberOfIssues > 0) ? "showNumbOfIssues" : "hideNumbOfIssues...
[ "function", "_getElementTreeRightColumnOfListItem", "(", "control", ",", "numberOfIssues", ")", "{", "var", "splitControlName", "=", "control", ".", "name", ".", "split", "(", "\".\"", ")", ";", "var", "name", "=", "splitControlName", "[", "splitControlName", ".",...
Create HTML for the right part of the ElementTree list item. @param {Object} control - JSON object form {ElementTreeOptions.controls} @returns {string} @private
[ "Create", "HTML", "for", "the", "right", "part", "of", "the", "ElementTree", "list", "item", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js#L80-L93
4,706
SAP/openui5
src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js
_findNearestDOMParent
function _findNearestDOMParent(element, parentNodeName) { while (element.nodeName !== parentNodeName) { if (element.nodeName === "CONTROL-TREE") { break; } element = element.parentNode; } return element; }
javascript
function _findNearestDOMParent(element, parentNodeName) { while (element.nodeName !== parentNodeName) { if (element.nodeName === "CONTROL-TREE") { break; } element = element.parentNode; } return element; }
[ "function", "_findNearestDOMParent", "(", "element", ",", "parentNodeName", ")", "{", "while", "(", "element", ".", "nodeName", "!==", "parentNodeName", ")", "{", "if", "(", "element", ".", "nodeName", "===", "\"CONTROL-TREE\"", ")", "{", "break", ";", "}", ...
Search for the nearest parent Node. @param {element} element - HTML DOM element that will be the root of the search @param {string} parentNodeName - The desired HTML parent element nodeName @returns {Object} HTML DOM element @private
[ "Search", "for", "the", "nearest", "parent", "Node", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js#L102-L111
4,707
SAP/openui5
src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js
ElementTree
function ElementTree(id, instantiationOptions) { var areInstantiationOptionsAnObject = _isObject(instantiationOptions); var options; /** * Make sure that the options parameter is Object and * that the ElementTree can be instantiate without initial options. */ if (areInstantiationOptionsAnObject...
javascript
function ElementTree(id, instantiationOptions) { var areInstantiationOptionsAnObject = _isObject(instantiationOptions); var options; /** * Make sure that the options parameter is Object and * that the ElementTree can be instantiate without initial options. */ if (areInstantiationOptionsAnObject...
[ "function", "ElementTree", "(", "id", ",", "instantiationOptions", ")", "{", "var", "areInstantiationOptionsAnObject", "=", "_isObject", "(", "instantiationOptions", ")", ";", "var", "options", ";", "/**\n\t\t\t * Make sure that the options parameter is Object and\n\t\t\t * tha...
ElementTree constructor. @param {string} id - The id of the DOM container @param {ElementTree} instantiationOptions @constructor
[ "ElementTree", "constructor", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/ElementTree.js#L119-L165
4,708
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/Support.js
_storeBreakpoints
function _storeBreakpoints() { if (bHasLocalStorage) { localStorage.setItem("sap-ui-support.aSupportInfosBreakpoints/" + document.location.href, JSON.stringify(aSupportInfosBreakpoints)); } }
javascript
function _storeBreakpoints() { if (bHasLocalStorage) { localStorage.setItem("sap-ui-support.aSupportInfosBreakpoints/" + document.location.href, JSON.stringify(aSupportInfosBreakpoints)); } }
[ "function", "_storeBreakpoints", "(", ")", "{", "if", "(", "bHasLocalStorage", ")", "{", "localStorage", ".", "setItem", "(", "\"sap-ui-support.aSupportInfosBreakpoints/\"", "+", "document", ".", "location", ".", "href", ",", "JSON", ".", "stringify", "(", "aSuppo...
store breakpoints to local storage
[ "store", "breakpoints", "to", "local", "storage" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/Support.js#L645-L649
4,709
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/Support.js
_storeXMLModifications
function _storeXMLModifications() { if (bHasLocalStorage) { localStorage.setItem("sap-ui-support.aSupportXMLModifications/" + document.location.href, JSON.stringify(aSupportXMLModifications)); } }
javascript
function _storeXMLModifications() { if (bHasLocalStorage) { localStorage.setItem("sap-ui-support.aSupportXMLModifications/" + document.location.href, JSON.stringify(aSupportXMLModifications)); } }
[ "function", "_storeXMLModifications", "(", ")", "{", "if", "(", "bHasLocalStorage", ")", "{", "localStorage", ".", "setItem", "(", "\"sap-ui-support.aSupportXMLModifications/\"", "+", "document", ".", "location", ".", "href", ",", "JSON", ".", "stringify", "(", "a...
store xml modification to local storage
[ "store", "xml", "modification", "to", "local", "storage" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/Support.js#L652-L656
4,710
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function (oConfig, oParent) { if (!oConfig.name) { Log.error("A name has to be specified for every route", this); } if (this._oRoutes[oConfig.name]) { Log.error("Route with name " + oConfig.name + " already exists", this); } this._oRoutes[oConfig.name] = this._createRoute(this, oConfig, o...
javascript
function (oConfig, oParent) { if (!oConfig.name) { Log.error("A name has to be specified for every route", this); } if (this._oRoutes[oConfig.name]) { Log.error("Route with name " + oConfig.name + " already exists", this); } this._oRoutes[oConfig.name] = this._createRoute(this, oConfig, o...
[ "function", "(", "oConfig", ",", "oParent", ")", "{", "if", "(", "!", "oConfig", ".", "name", ")", "{", "Log", ".", "error", "(", "\"A name has to be specified for every route\"", ",", "this", ")", ";", "}", "if", "(", "this", ".", "_oRoutes", "[", "oCon...
Adds a route to the router @param {object} oConfig configuration object for the route @see sap.ui.core.routing.Route#constructor @param {sap.ui.core.routing.Route} oParent The parent route - if a parent route is given, the routeMatched event of this route will also trigger the route matched of the parent and it will a...
[ "Adds", "a", "route", "to", "the", "router" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L287-L296
4,711
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function (sName, oParameters) { if (oParameters === undefined) { //even if there are only optional parameters crossroads cannot navigate with undefined oParameters = {}; } var oRoute = this.getRoute(sName); if (!oRoute) { Log.warning("Route with name " + sName + " does not exist", this);...
javascript
function (sName, oParameters) { if (oParameters === undefined) { //even if there are only optional parameters crossroads cannot navigate with undefined oParameters = {}; } var oRoute = this.getRoute(sName); if (!oRoute) { Log.warning("Route with name " + sName + " does not exist", this);...
[ "function", "(", "sName", ",", "oParameters", ")", "{", "if", "(", "oParameters", "===", "undefined", ")", "{", "//even if there are only optional parameters crossroads cannot navigate with undefined", "oParameters", "=", "{", "}", ";", "}", "var", "oRoute", "=", "thi...
Returns the URL for the route and replaces the placeholders with the values in oParameters @param {string} sName Name of the route @param {object} [oParameters] Parameters for the route @return {string} the unencoded pattern with interpolated arguments @public
[ "Returns", "the", "URL", "for", "the", "route", "and", "replaces", "the", "placeholders", "with", "the", "values", "in", "oParameters" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L513-L525
4,712
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function (sHash) { return Object.keys(this._oRoutes).some(function(sRouteName) { return this._oRoutes[sRouteName].match(sHash); }.bind(this)); }
javascript
function (sHash) { return Object.keys(this._oRoutes).some(function(sRouteName) { return this._oRoutes[sRouteName].match(sHash); }.bind(this)); }
[ "function", "(", "sHash", ")", "{", "return", "Object", ".", "keys", "(", "this", ".", "_oRoutes", ")", ".", "some", "(", "function", "(", "sRouteName", ")", "{", "return", "this", ".", "_oRoutes", "[", "sRouteName", "]", ".", "match", "(", "sHash", ...
Returns whether the given hash can be matched by any one of the Route in the Router. @param {string} hash which will be tested by the Router @return {boolean} whether the hash can be matched @public @since 1.58.0
[ "Returns", "whether", "the", "given", "hash", "can", "be", "matched", "by", "any", "one", "of", "the", "Route", "in", "the", "Router", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L535-L539
4,713
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function (sViewName, sViewType, sViewId) { Log.warning("Deprecated API Router#getView called - use Router#getViews instead.", this); var oView = this._oViews._getViewWithGlobalId({ viewName: sViewName, type: sViewType, id: sViewId }); this.fireViewCreated({ view: oView, viewNa...
javascript
function (sViewName, sViewType, sViewId) { Log.warning("Deprecated API Router#getView called - use Router#getViews instead.", this); var oView = this._oViews._getViewWithGlobalId({ viewName: sViewName, type: sViewType, id: sViewId }); this.fireViewCreated({ view: oView, viewNa...
[ "function", "(", "sViewName", ",", "sViewType", ",", "sViewId", ")", "{", "Log", ".", "warning", "(", "\"Deprecated API Router#getView called - use Router#getViews instead.\"", ",", "this", ")", ";", "var", "oView", "=", "this", ".", "_oViews", ".", "_getViewWithGlo...
Returns a cached view for a given name or creates it if it does not yet exists @deprecated Since 1.28.1 use {@link #getViews} instead. @param {string} sViewName Name of the view @param {string} sViewType Type of the view @param {string} sViewId Optional view id @return {sap.ui.core.mvc.View} the view instance @public
[ "Returns", "a", "cached", "view", "for", "a", "given", "name", "or", "creates", "it", "if", "it", "does", "not", "yet", "exists" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L586-L602
4,714
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function(oData, fnFunction, oListener) { return this.attachEvent(Router.M_EVENTS.BYPASSED, oData, fnFunction, oListener); }
javascript
function(oData, fnFunction, oListener) { return this.attachEvent(Router.M_EVENTS.BYPASSED, oData, fnFunction, oListener); }
[ "function", "(", "oData", ",", "fnFunction", ",", "oListener", ")", "{", "return", "this", ".", "attachEvent", "(", "Router", ".", "M_EVENTS", ".", "BYPASSED", ",", "oData", ",", "fnFunction", ",", "oListener", ")", ";", "}" ]
The 'bypassed' event is fired, when no route of the router matches the changed URL hash @name sap.ui.core.routing.Router#bypassed @event @param {sap.ui.base.Event} oEvent @param {sap.ui.base.EventProvider} oEvent.getSource @param {object} oEvent.getParameters @param {string} oEvent.getParameters.hash the current URL h...
[ "The", "bypassed", "event", "is", "fired", "when", "no", "route", "of", "the", "router", "matches", "the", "changed", "URL", "hash" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L949-L951
4,715
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function(oData, fnFunction, oListener) { this.attachEvent(Router.M_EVENTS.TITLE_CHANGED, oData, fnFunction, oListener); return this; }
javascript
function(oData, fnFunction, oListener) { this.attachEvent(Router.M_EVENTS.TITLE_CHANGED, oData, fnFunction, oListener); return this; }
[ "function", "(", "oData", ",", "fnFunction", ",", "oListener", ")", "{", "this", ".", "attachEvent", "(", "Router", ".", "M_EVENTS", ".", "TITLE_CHANGED", ",", "oData", ",", "fnFunction", ",", "oListener", ")", ";", "return", "this", ";", "}" ]
Will be fired when the title of the "TitleTarget" in the currently matching Route has been changed. <pre> A "TitleTarget" is resolved as the following: 1. When the Route only has one target configured, the "TitleTarget" is resolved with this target when its {@link sap.ui.core.routing.Targets#constructor|title} options...
[ "Will", "be", "fired", "when", "the", "title", "of", "the", "TitleTarget", "in", "the", "currently", "matching", "Route", "has", "been", "changed", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L1014-L1017
4,716
SAP/openui5
src/sap.ui.core/src/sap/ui/dom/patch.js
patch
function patch(oOldDom, oNewDom) { // start checking with most common use case and backwards compatible if (oOldDom.childElementCount != oNewDom.childElementCount || oOldDom.tagName != oNewDom.tagName) { oOldDom.parentNode.replaceChild(oNewDom, oOldDom); return false; } // go with native... if nodes ...
javascript
function patch(oOldDom, oNewDom) { // start checking with most common use case and backwards compatible if (oOldDom.childElementCount != oNewDom.childElementCount || oOldDom.tagName != oNewDom.tagName) { oOldDom.parentNode.replaceChild(oNewDom, oOldDom); return false; } // go with native... if nodes ...
[ "function", "patch", "(", "oOldDom", ",", "oNewDom", ")", "{", "// start checking with most common use case and backwards compatible", "if", "(", "oOldDom", ".", "childElementCount", "!=", "oNewDom", ".", "childElementCount", "||", "oOldDom", ".", "tagName", "!=", "oNew...
This method tries to patch two HTML elements according to changed attributes. As a fallback it replaces DOM nodes. @function @since 1.58 @param {HTMLElement} oOldDom Existing element to be patched @param {HTMLElement} oNewDom The new node to patch old dom @return {boolean} true when patch is applied correctly or false...
[ "This", "method", "tries", "to", "patch", "two", "HTML", "elements", "according", "to", "changed", "attributes", ".", "As", "a", "fallback", "it", "replaces", "DOM", "nodes", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/patch.js#L24-L103
4,717
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/ODataModel.js
_submit
function _submit(){ // execute the request and use the metadata if available if (that.bUseBatch) { that.updateSecurityToken(); // batch requests only need the path without the service URL // extract query of url and combine it with the path... var sUriQuery = URI.parse(oRequest.requestUri).query;...
javascript
function _submit(){ // execute the request and use the metadata if available if (that.bUseBatch) { that.updateSecurityToken(); // batch requests only need the path without the service URL // extract query of url and combine it with the path... var sUriQuery = URI.parse(oRequest.requestUri).query;...
[ "function", "_submit", "(", ")", "{", "// execute the request and use the metadata if available", "if", "(", "that", ".", "bUseBatch", ")", "{", "that", ".", "updateSecurityToken", "(", ")", ";", "// batch requests only need the path without the service URL", "// extract quer...
this method is used to retrieve all desired data. It triggers additional read requests if the server paging size permits to return all the requested data. This could only happen for servers with support for oData > 2.0.
[ "this", "method", "is", "used", "to", "retrieve", "all", "desired", "data", ".", "It", "triggers", "additional", "read", "requests", "if", "the", "server", "paging", "size", "permits", "to", "return", "all", "the", "requested", "data", ".", "This", "could", ...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataModel.js#L831-L860
4,718
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js
function (sUrl, bAnnotations, bPrefetch) { var oPromise; function convertXMLMetadata(oJSON) { var Converter = sODataVersion === "4.0" || bAnnotations ? _V4MetadataConverter : _V2MetadataConverter, oData = oJSON.$XML; delete oJSON.$XML; // be nice to the garbage collector ...
javascript
function (sUrl, bAnnotations, bPrefetch) { var oPromise; function convertXMLMetadata(oJSON) { var Converter = sODataVersion === "4.0" || bAnnotations ? _V4MetadataConverter : _V2MetadataConverter, oData = oJSON.$XML; delete oJSON.$XML; // be nice to the garbage collector ...
[ "function", "(", "sUrl", ",", "bAnnotations", ",", "bPrefetch", ")", "{", "var", "oPromise", ";", "function", "convertXMLMetadata", "(", "oJSON", ")", "{", "var", "Converter", "=", "sODataVersion", "===", "\"4.0\"", "||", "bAnnotations", "?", "_V4MetadataConvert...
Reads a metadata document from the given URL. @param {string} sUrl The URL of a metadata document, it must not contain a query string or a fragment part @param {boolean} [bAnnotations=false] <code>true</code> if an additional annotation file is read, otherwise it is expected to be a metadata document in the correct ODa...
[ "Reads", "a", "metadata", "document", "from", "the", "given", "URL", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js#L56-L112
4,719
SAP/openui5
src/sap.ui.core/src/sap/ui/core/rules/Model.support.js
_fnFindBestMatch
function _fnFindBestMatch(aValues, sBindingPath) { var iJsonModelMin = -1; var sJsonModelBestMatch = false; aValues.forEach(function(sKey) { var iCurrDest = StringAnalyzer.calculateLevenshteinDistance(sBindingPath, sKey); if (iJsonModelMin === -1 || iCurrDest < iJsonModelMin) { iJsonModelMin = iCurrDest...
javascript
function _fnFindBestMatch(aValues, sBindingPath) { var iJsonModelMin = -1; var sJsonModelBestMatch = false; aValues.forEach(function(sKey) { var iCurrDest = StringAnalyzer.calculateLevenshteinDistance(sBindingPath, sKey); if (iJsonModelMin === -1 || iCurrDest < iJsonModelMin) { iJsonModelMin = iCurrDest...
[ "function", "_fnFindBestMatch", "(", "aValues", ",", "sBindingPath", ")", "{", "var", "iJsonModelMin", "=", "-", "1", ";", "var", "sJsonModelBestMatch", "=", "false", ";", "aValues", ".", "forEach", "(", "function", "(", "sKey", ")", "{", "var", "iCurrDest",...
Control, Internal, Application
[ "Control", "Internal", "Application" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/rules/Model.support.js#L31-L42
4,720
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js
function (vRawValue, oDetails) { var sPath = typeof vRawValue === "string" ? "/" + oDetails.schemaChildName + "/" + vRawValue : oDetails.context.getPath(); return oDetails.$$valueAsPromise ? oDetails.context.getModel().fetchValueListType(sPath).unwrap() : oDetails.context.getModel().getVa...
javascript
function (vRawValue, oDetails) { var sPath = typeof vRawValue === "string" ? "/" + oDetails.schemaChildName + "/" + vRawValue : oDetails.context.getPath(); return oDetails.$$valueAsPromise ? oDetails.context.getModel().fetchValueListType(sPath).unwrap() : oDetails.context.getModel().getVa...
[ "function", "(", "vRawValue", ",", "oDetails", ")", "{", "var", "sPath", "=", "typeof", "vRawValue", "===", "\"string\"", "?", "\"/\"", "+", "oDetails", ".", "schemaChildName", "+", "\"/\"", "+", "vRawValue", ":", "oDetails", ".", "context", ".", "getPath", ...
Determines which type of value list exists for the given property. @param {any} vRawValue The raw value from the meta model; must be either a property or a path pointing to a property (relative to <code>oDetails.schemaChildName</code>) @param {object} oDetails The details object @param {boolean} [oDetails.$$valueAsPro...
[ "Determines", "which", "type", "of", "value", "list", "exists", "for", "the", "given", "property", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js#L331-L339
4,721
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js
function (oOperand1, oOperand2) { if (oOperand1.result !== "constant" && oOperand1.category === "number" && oOperand2.result === "constant" && oOperand2.type === "Edm.Int64") { // adjust an integer constant of type "Edm.Int64" to the number oOperand2.category = "number"; } if (oOperand1.result !==...
javascript
function (oOperand1, oOperand2) { if (oOperand1.result !== "constant" && oOperand1.category === "number" && oOperand2.result === "constant" && oOperand2.type === "Edm.Int64") { // adjust an integer constant of type "Edm.Int64" to the number oOperand2.category = "number"; } if (oOperand1.result !==...
[ "function", "(", "oOperand1", ",", "oOperand2", ")", "{", "if", "(", "oOperand1", ".", "result", "!==", "\"constant\"", "&&", "oOperand1", ".", "category", "===", "\"number\"", "&&", "oOperand2", ".", "result", "===", "\"constant\"", "&&", "oOperand2", ".", ...
Adjusts the second operand so that both have the same category, if possible. @param {object} oOperand1 the operand 1 (as a result object with category) @param {object} oOperand2 the operand 2 (as a result object with category) - may be modified
[ "Adjusts", "the", "second", "operand", "so", "that", "both", "have", "the", "same", "category", "if", "possible", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L144-L156
4,722
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js
function (oPathValue) { if (oPathValue.value === undefined) { return undefined; } Measurement.average(sPerformanceGetExpression, "", aPerformanceCategories); if (!bSimpleParserWarningLogged && ManagedObject.bindingParser === BindingParser.simpleParser) { Log.warning("Complex binding syntax no...
javascript
function (oPathValue) { if (oPathValue.value === undefined) { return undefined; } Measurement.average(sPerformanceGetExpression, "", aPerformanceCategories); if (!bSimpleParserWarningLogged && ManagedObject.bindingParser === BindingParser.simpleParser) { Log.warning("Complex binding syntax no...
[ "function", "(", "oPathValue", ")", "{", "if", "(", "oPathValue", ".", "value", "===", "undefined", ")", "{", "return", "undefined", ";", "}", "Measurement", ".", "average", "(", "sPerformanceGetExpression", ",", "\"\"", ",", "aPerformanceCategories", ")", ";"...
Calculates an expression. Ensures that errors that are thrown while processing are handled accordingly. @param {object} oPathValue path and value information pointing to the expression (see Expression object) @returns {Promise|string} the expression value or "Unsupported: oRawValue" in case of an error or <code>undefi...
[ "Calculates", "an", "expression", ".", "Ensures", "that", "errors", "that", "are", "thrown", "while", "processing", "are", "handled", "accordingly", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js#L566-L590
4,723
SAP/openui5
src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js
getAllLibraries
function getAllLibraries(aExcludedLibraries, bIncludeDistLayer) { var mLibraries = sap.ui.getCore().getLoadedLibraries(), sInfoLibName, bNewLibrary, oInfo, i; // discover what is available in order to also test other libraries than those loaded in bootstrap oInfo = sap.ui.getVersionInfo(); for (i =...
javascript
function getAllLibraries(aExcludedLibraries, bIncludeDistLayer) { var mLibraries = sap.ui.getCore().getLoadedLibraries(), sInfoLibName, bNewLibrary, oInfo, i; // discover what is available in order to also test other libraries than those loaded in bootstrap oInfo = sap.ui.getVersionInfo(); for (i =...
[ "function", "getAllLibraries", "(", "aExcludedLibraries", ",", "bIncludeDistLayer", ")", "{", "var", "mLibraries", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getLoadedLibraries", "(", ")", ",", "sInfoLibName", ",", "bNewLibrary", ",", "oInfo", ",",...
Returns a map with all libraries found, depending on the given arguments @param {Array} aExcludedLibraries the list of libraries to exclude @param {boolean} bIncludeDistLayer whether the list of libraries should be restricted to known runtime-layer libraries (superset of the OpenUI5 libraries) or include any dist-laye...
[ "Returns", "a", "map", "with", "all", "libraries", "found", "depending", "on", "the", "given", "arguments" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js#L239-L281
4,724
SAP/openui5
src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js
getRequestedLibraries
function getRequestedLibraries(aLibrariesToTest) { var mLibraries = sap.ui.getCore().getLoadedLibraries(), bNewLibrary, i; // make sure the explicitly requested libraries are there for (i = 0; i < aLibrariesToTest.length; i++) { if (!mLibraries[aLibrariesToTest[i]]) { sap.ui.getCore().loadLibrary(aL...
javascript
function getRequestedLibraries(aLibrariesToTest) { var mLibraries = sap.ui.getCore().getLoadedLibraries(), bNewLibrary, i; // make sure the explicitly requested libraries are there for (i = 0; i < aLibrariesToTest.length; i++) { if (!mLibraries[aLibrariesToTest[i]]) { sap.ui.getCore().loadLibrary(aL...
[ "function", "getRequestedLibraries", "(", "aLibrariesToTest", ")", "{", "var", "mLibraries", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getLoadedLibraries", "(", ")", ",", "bNewLibrary", ",", "i", ";", "// make sure the explicitly requested libraries are...
Returns a map with library infos for the requested libraries @param {Array} aLibrariesToTest list of libraries to load @returns a map of library infos
[ "Returns", "a", "map", "with", "library", "infos", "for", "the", "requested", "libraries" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js#L290-L314
4,725
SAP/openui5
src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js
function(aLibrariesToTest, aExcludedLibraries, bIncludeDistLayer, QUnit) { var mLibraries = aLibrariesToTest ? getRequestedLibraries(aLibrariesToTest) : getAllLibraries(aExcludedLibraries, bIncludeDistLayer); QUnit.test("Should load at least one library and some controls", function(assert) { assert....
javascript
function(aLibrariesToTest, aExcludedLibraries, bIncludeDistLayer, QUnit) { var mLibraries = aLibrariesToTest ? getRequestedLibraries(aLibrariesToTest) : getAllLibraries(aExcludedLibraries, bIncludeDistLayer); QUnit.test("Should load at least one library and some controls", function(assert) { assert....
[ "function", "(", "aLibrariesToTest", ",", "aExcludedLibraries", ",", "bIncludeDistLayer", ",", "QUnit", ")", "{", "var", "mLibraries", "=", "aLibrariesToTest", "?", "getRequestedLibraries", "(", "aLibrariesToTest", ")", ":", "getAllLibraries", "(", "aExcludedLibraries",...
Returns a map of libraries - either exactly those requested in aLibrariesToTest, if defined, or all discoverable libraries under the given conditions.
[ "Returns", "a", "map", "of", "libraries", "-", "either", "exactly", "those", "requested", "in", "aLibrariesToTest", "if", "defined", "or", "all", "discoverable", "libraries", "under", "the", "given", "conditions", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js#L321-L348
4,726
SAP/openui5
src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js
function(aControls, aControlsToTest, aExcludedControls, bIncludeNonRenderable, bIncludeNonInstantiable, fnCallback) { return new Promise(function(resolve, reject){ var iControlCountInLib = 0; var loop = function(i) { if (i < aControls.length) { var sControlName = aControls[i]; handleControl(sCon...
javascript
function(aControls, aControlsToTest, aExcludedControls, bIncludeNonRenderable, bIncludeNonInstantiable, fnCallback) { return new Promise(function(resolve, reject){ var iControlCountInLib = 0; var loop = function(i) { if (i < aControls.length) { var sControlName = aControls[i]; handleControl(sCon...
[ "function", "(", "aControls", ",", "aControlsToTest", ",", "aExcludedControls", ",", "bIncludeNonRenderable", ",", "bIncludeNonInstantiable", ",", "fnCallback", ")", "{", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "var", ...
Calls the callback function for all controls in the given array, unless they are explicitly excluded
[ "Calls", "the", "callback", "function", "for", "all", "controls", "in", "the", "given", "array", "unless", "they", "are", "explicitly", "excluded" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/utils/ControlIterator.js#L380-L401
4,727
SAP/openui5
src/sap.ui.integration/src/sap/ui/integration/host/HostConfigurationCompiler.js
loadResource
function loadResource(sUrl, sType) { return new Promise(function (resolve, reject) { jQuery.ajax({ url: sUrl, async: true, dataType: sType, success: function (oJson) { resolve(oJson); }, error: function () { reject(); } }); }); }
javascript
function loadResource(sUrl, sType) { return new Promise(function (resolve, reject) { jQuery.ajax({ url: sUrl, async: true, dataType: sType, success: function (oJson) { resolve(oJson); }, error: function () { reject(); } }); }); }
[ "function", "loadResource", "(", "sUrl", ",", "sType", ")", "{", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "jQuery", ".", "ajax", "(", "{", "url", ":", "sUrl", ",", "async", ":", "true", ",", "dataType", ":...
Loads a resource of a given type async and returns a promise @param {string} sUrl the URL to load @param {string} sType the expected type of response "json" or "text" @retunrs {Promise} @private
[ "Loads", "a", "resource", "of", "a", "given", "type", "async", "and", "returns", "a", "promise" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.integration/src/sap/ui/integration/host/HostConfigurationCompiler.js#L29-L43
4,728
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js
MetadataConverter
function MetadataConverter() { this.aliases = {}; // maps alias -> namespace this.oAnnotatable = null; // the current annotatable, see function annotatable this.entityContainer = null; // the current EntityContainer this.entitySet = null; // the current EntitySet/Singleton this.namespace = null; // the namesp...
javascript
function MetadataConverter() { this.aliases = {}; // maps alias -> namespace this.oAnnotatable = null; // the current annotatable, see function annotatable this.entityContainer = null; // the current EntityContainer this.entitySet = null; // the current EntitySet/Singleton this.namespace = null; // the namesp...
[ "function", "MetadataConverter", "(", ")", "{", "this", ".", "aliases", "=", "{", "}", ";", "// maps alias -> namespace", "this", ".", "oAnnotatable", "=", "null", ";", "// the current annotatable, see function annotatable", "this", ".", "entityContainer", "=", "null"...
Creates the base class for the metadata converters. @constructor
[ "Creates", "the", "base", "class", "for", "the", "metadata", "converters", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js#L17-L30
4,729
SAP/openui5
src/sap.ui.core/src/sap/ui/performance/Measurement.js
Measurement
function Measurement(sId, sInfo, iStart, iEnd, aCategories) { this.id = sId; this.info = sInfo; this.start = iStart; this.end = iEnd; this.pause = 0; this.resume = 0; this.duration = 0; // used time this.time = 0; // time from start to end this.categories = aCategories; this.average = fals...
javascript
function Measurement(sId, sInfo, iStart, iEnd, aCategories) { this.id = sId; this.info = sInfo; this.start = iStart; this.end = iEnd; this.pause = 0; this.resume = 0; this.duration = 0; // used time this.time = 0; // time from start to end this.categories = aCategories; this.average = fals...
[ "function", "Measurement", "(", "sId", ",", "sInfo", ",", "iStart", ",", "iEnd", ",", "aCategories", ")", "{", "this", ".", "id", "=", "sId", ";", "this", ".", "info", "=", "sInfo", ";", "this", ".", "start", "=", "iStart", ";", "this", ".", "end",...
Single Measurement Entry @public @typedef {object} module:sap/ui/performance/Measurement.Entry @property {string} sId ID of the measurement @property {string} sInfo Info for the measurement @property {int} iStart Start time @property {int} iEnd End time @property {string | string[]} [aCategories="javascript"] An optio...
[ "Single", "Measurement", "Entry" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/Measurement.js#L37-L50
4,730
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js
function (sTopicId, oModel) { var oTree = this.byId("tree"), oData = oModel.getData(); // Find the path to the new node, traversing the model var aTopicIds = this._oTreeUtil.getPathToNode(sTopicId, oData); // Expand all nodes on the path to the target node var oLastItem; aTopicIds.forEach...
javascript
function (sTopicId, oModel) { var oTree = this.byId("tree"), oData = oModel.getData(); // Find the path to the new node, traversing the model var aTopicIds = this._oTreeUtil.getPathToNode(sTopicId, oData); // Expand all nodes on the path to the target node var oLastItem; aTopicIds.forEach...
[ "function", "(", "sTopicId", ",", "oModel", ")", "{", "var", "oTree", "=", "this", ".", "byId", "(", "\"tree\"", ")", ",", "oData", "=", "oModel", ".", "getData", "(", ")", ";", "// Find the path to the new node, traversing the model", "var", "aTopicIds", "=",...
Makes the tree open all nodes up to the node with "sTopicId" and then selects it @private
[ "Makes", "the", "tree", "open", "all", "nodes", "up", "to", "the", "node", "with", "sTopicId", "and", "then", "selects", "it" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js#L35-L66
4,731
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js
function (oEvent) { // Update filter value this._sFilter = oEvent.getParameter("newValue").trim(); if (this._filterTimeout) { clearTimeout(this._filterTimeout); } this._filterTimeout = setTimeout(function () { if (this.buildAndApplyFilters()) { this._expandAllNodes(); } else ...
javascript
function (oEvent) { // Update filter value this._sFilter = oEvent.getParameter("newValue").trim(); if (this._filterTimeout) { clearTimeout(this._filterTimeout); } this._filterTimeout = setTimeout(function () { if (this.buildAndApplyFilters()) { this._expandAllNodes(); } else ...
[ "function", "(", "oEvent", ")", "{", "// Update filter value", "this", ".", "_sFilter", "=", "oEvent", ".", "getParameter", "(", "\"newValue\"", ")", ".", "trim", "(", ")", ";", "if", "(", "this", ".", "_filterTimeout", ")", "{", "clearTimeout", "(", "this...
Handler for the SearchField @param oEvent
[ "Handler", "for", "the", "SearchField" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js#L95-L117
4,732
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js
function () { var oBinding = this.byId("tree").getBinding("items"); if (this._sFilter) { oBinding.filter(new Filter({ path: "name", operator: FilterOperator.Contains, value1: this._sFilter })); return true; } else { oBinding.filter(); return false; } }
javascript
function () { var oBinding = this.byId("tree").getBinding("items"); if (this._sFilter) { oBinding.filter(new Filter({ path: "name", operator: FilterOperator.Contains, value1: this._sFilter })); return true; } else { oBinding.filter(); return false; } }
[ "function", "(", ")", "{", "var", "oBinding", "=", "this", ".", "byId", "(", "\"tree\"", ")", ".", "getBinding", "(", "\"items\"", ")", ";", "if", "(", "this", ".", "_sFilter", ")", "{", "oBinding", ".", "filter", "(", "new", "Filter", "(", "{", "p...
Build and apply filters to the tree model. @returns {boolean} if search filter is applied
[ "Build", "and", "apply", "filters", "to", "the", "tree", "model", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js#L123-L136
4,733
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (oPathValue, sMessage, sComponent) { sMessage = oPathValue.path + ": " + sMessage; Log.error(sMessage, Basics.toErrorString(oPathValue.value), sComponent || sAnnotationHelper); throw new SyntaxError(sMessage); }
javascript
function (oPathValue, sMessage, sComponent) { sMessage = oPathValue.path + ": " + sMessage; Log.error(sMessage, Basics.toErrorString(oPathValue.value), sComponent || sAnnotationHelper); throw new SyntaxError(sMessage); }
[ "function", "(", "oPathValue", ",", "sMessage", ",", "sComponent", ")", "{", "sMessage", "=", "oPathValue", ".", "path", "+", "\": \"", "+", "sMessage", ";", "Log", ".", "error", "(", "sMessage", ",", "Basics", ".", "toErrorString", "(", "oPathValue", ".",...
Logs the error message for the given path and throws a SyntaxError. @param {object} oPathValue a path/value pair @param {string} sMessage the message to log @param {string} [sComponent="sap.ui.model.odata.AnnotationHelper"] Name of the component that produced the log entry
[ "Logs", "the", "error", "message", "for", "the", "given", "path", "and", "throws", "a", "SyntaxError", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L91-L96
4,734
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (oPathValue, sExpectedType) { var bError, vValue = oPathValue.value; if (sExpectedType === "array") { bError = !Array.isArray(vValue); } else { bError = typeof vValue !== sExpectedType || vValue === null || Array.isArray(vValue); } if (bError) { Basics.error(oPathValue...
javascript
function (oPathValue, sExpectedType) { var bError, vValue = oPathValue.value; if (sExpectedType === "array") { bError = !Array.isArray(vValue); } else { bError = typeof vValue !== sExpectedType || vValue === null || Array.isArray(vValue); } if (bError) { Basics.error(oPathValue...
[ "function", "(", "oPathValue", ",", "sExpectedType", ")", "{", "var", "bError", ",", "vValue", "=", "oPathValue", ".", "value", ";", "if", "(", "sExpectedType", "===", "\"array\"", ")", "{", "bError", "=", "!", "Array", ".", "isArray", "(", "vValue", ")"...
Logs an error and throws an error if the value is not of the expected type. @param {object} oPathValue a path/value pair @param {string} oPathValue.path the meta model path to start at @param {any} oPathValue.value the value at this path @param {string} sExpectedType the expected type (tested w/ typeof) or the special...
[ "Logs", "an", "error", "and", "throws", "an", "error", "if", "the", "value", "is", "not", "of", "the", "expected", "type", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L112-L126
4,735
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (oResult, bExpression, bWithType) { var vValue = oResult.value; function binding(bAddType) { var sConstraints, sResult; bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type; if (bAddType || rBadChars.test(vValue)) { sResult = "{path:" + Basics.toJSON(vValue); if (bAddT...
javascript
function (oResult, bExpression, bWithType) { var vValue = oResult.value; function binding(bAddType) { var sConstraints, sResult; bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type; if (bAddType || rBadChars.test(vValue)) { sResult = "{path:" + Basics.toJSON(vValue); if (bAddT...
[ "function", "(", "oResult", ",", "bExpression", ",", "bWithType", ")", "{", "var", "vValue", "=", "oResult", ".", "value", ";", "function", "binding", "(", "bAddType", ")", "{", "var", "sConstraints", ",", "sResult", ";", "bAddType", "=", "bAddType", "&&",...
Converts the result's value to a string. @param {object} oResult an object with the following properties: result: "constant", "binding", "composite" or "expression" value: {any} the value to write into the resulting string depending on result: when "constant": the constant value as a string (from the annotation) when ...
[ "Converts", "the", "result", "s", "value", "to", "a", "string", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L333-L392
4,736
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (vValue) { var sJSON; if (typeof vValue !== "function") { try { sJSON = Basics.toJSON(vValue); // undefined --> undefined // null, NaN, Infinity --> "null" // all are correctly handled by String if (sJSON !== undefined && sJSON !== "null") { return sJSON; } } ...
javascript
function (vValue) { var sJSON; if (typeof vValue !== "function") { try { sJSON = Basics.toJSON(vValue); // undefined --> undefined // null, NaN, Infinity --> "null" // all are correctly handled by String if (sJSON !== undefined && sJSON !== "null") { return sJSON; } } ...
[ "function", "(", "vValue", ")", "{", "var", "sJSON", ";", "if", "(", "typeof", "vValue", "!==", "\"function\"", ")", "{", "try", "{", "sJSON", "=", "Basics", ".", "toJSON", "(", "vValue", ")", ";", "// undefined --> undefined", "// null, NaN, Infinity --> \"nu...
Stringifies the value for usage in an error message. Special handling for functions and object trees with circular references. @param {any} vValue the value @returns {string} the stringified value
[ "Stringifies", "the", "value", "for", "usage", "in", "an", "error", "message", ".", "Special", "handling", "for", "functions", "and", "object", "trees", "with", "circular", "references", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L401-L418
4,737
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (vValue) { var sStringified, bEscaped = false, sResult = "", i, c; sStringified = JSON.stringify(vValue); if (sStringified === undefined) { return undefined; } for (i = 0; i < sStringified.length; i += 1) { switch (c = sStringified.charAt(i)) { case "'": // a single quo...
javascript
function (vValue) { var sStringified, bEscaped = false, sResult = "", i, c; sStringified = JSON.stringify(vValue); if (sStringified === undefined) { return undefined; } for (i = 0; i < sStringified.length; i += 1) { switch (c = sStringified.charAt(i)) { case "'": // a single quo...
[ "function", "(", "vValue", ")", "{", "var", "sStringified", ",", "bEscaped", "=", "false", ",", "sResult", "=", "\"\"", ",", "i", ",", "c", ";", "sStringified", "=", "JSON", ".", "stringify", "(", "vValue", ")", ";", "if", "(", "sStringified", "===", ...
Converts the value to a JSON string. Prefers the single quote over the double quote. This suits better for usage in an XML attribute. @param {any} vValue the value @returns {string} the stringified value
[ "Converts", "the", "value", "to", "a", "JSON", "string", ".", "Prefers", "the", "single", "quote", "over", "the", "double", "quote", ".", "This", "suits", "better", "for", "usage", "in", "an", "XML", "attribute", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js#L427-L465
4,738
SAP/openui5
src/sap.m/src/sap/m/DateRangeSelection.js
_trim
function _trim(sValue, aParams) { var i = 0, aTrims = aParams; if (!aTrims) { aTrims = [" "]; } while (i < aTrims.length) { if (_endsWith(sValue, aTrims[i])) { sValue = sValue.substring(0, sValue.length - aTrims[i].length); i = 0; continue; } i++; } i = 0; while (i < aTrims.l...
javascript
function _trim(sValue, aParams) { var i = 0, aTrims = aParams; if (!aTrims) { aTrims = [" "]; } while (i < aTrims.length) { if (_endsWith(sValue, aTrims[i])) { sValue = sValue.substring(0, sValue.length - aTrims[i].length); i = 0; continue; } i++; } i = 0; while (i < aTrims.l...
[ "function", "_trim", "(", "sValue", ",", "aParams", ")", "{", "var", "i", "=", "0", ",", "aTrims", "=", "aParams", ";", "if", "(", "!", "aTrims", ")", "{", "aTrims", "=", "[", "\" \"", "]", ";", "}", "while", "(", "i", "<", "aTrims", ".", "leng...
Trims all occurrences of the given string values from both ends of the specified string. @param {string} sValue The value to be trimmed @param {string[]} aParams All values to be removed @returns {string} The trimmed value @private
[ "Trims", "all", "occurrences", "of", "the", "given", "string", "values", "from", "both", "ends", "of", "the", "specified", "string", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/DateRangeSelection.js#L1148-L1176
4,739
SAP/openui5
src/sap.ui.core/src/sap/base/util/includes.js
function (vCollection, vValue, iFromIndex) { if (typeof iFromIndex !== 'number') { iFromIndex = 0; } // Use native (Array.prototype.includes, String.prototype.includes) includes functions if available if (Array.isArray(vCollection)) { if (typeof vCollection.includes === 'function') { return vCollecti...
javascript
function (vCollection, vValue, iFromIndex) { if (typeof iFromIndex !== 'number') { iFromIndex = 0; } // Use native (Array.prototype.includes, String.prototype.includes) includes functions if available if (Array.isArray(vCollection)) { if (typeof vCollection.includes === 'function') { return vCollecti...
[ "function", "(", "vCollection", ",", "vValue", ",", "iFromIndex", ")", "{", "if", "(", "typeof", "iFromIndex", "!==", "'number'", ")", "{", "iFromIndex", "=", "0", ";", "}", "// Use native (Array.prototype.includes, String.prototype.includes) includes functions if availab...
Checks if value is included in collection @example sap.ui.require(["sap/base/util/includes"], function(includes){ // arrays includes(["1", "8", "7"], "8"); // true includes(["1", "8", "7"], "8", 0); // true includes(["1", "8", "7"], "8", 1); // true includes(["1", "8", "7"], "8", 2); // false i...
[ "Checks", "if", "value", "is", "included", "in", "collection" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/util/includes.js#L65-L95
4,740
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js
function (oEvent) { var oSource = oEvent.getSource(); var sLayerBindingPath = oSource.getBindingContextPath().substring(1); var oLayerModelData = this.getView().getModel("layers").getData(); var sLayerName = oLayerModelData[sLayerBindingPath].name; var oRouter = sap.ui.core.UIComponent.getRouterFor(this...
javascript
function (oEvent) { var oSource = oEvent.getSource(); var sLayerBindingPath = oSource.getBindingContextPath().substring(1); var oLayerModelData = this.getView().getModel("layers").getData(); var sLayerName = oLayerModelData[sLayerBindingPath].name; var oRouter = sap.ui.core.UIComponent.getRouterFor(this...
[ "function", "(", "oEvent", ")", "{", "var", "oSource", "=", "oEvent", ".", "getSource", "(", ")", ";", "var", "sLayerBindingPath", "=", "oSource", ".", "getBindingContextPath", "(", ")", ".", "substring", "(", "1", ")", ";", "var", "oLayerModelData", "=", ...
Handler for triggering the navigation to a selected layer. @param {Object} oEvent @public
[ "Handler", "for", "triggering", "the", "navigation", "to", "a", "selected", "layer", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js#L26-L34
4,741
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LabelEnablement.js
refreshMapping
function refreshMapping(oLabel, bDestroy){ var sLabelId = oLabel.getId(); var sOldId = oLabel.__sLabeledControl; var sNewId = bDestroy ? null : findLabelForControl(oLabel); if (sOldId == sNewId) { return; } //Invalidate the label itself (see setLabelFor, setAlternativeLabelFor) if (!bDestroy) { oL...
javascript
function refreshMapping(oLabel, bDestroy){ var sLabelId = oLabel.getId(); var sOldId = oLabel.__sLabeledControl; var sNewId = bDestroy ? null : findLabelForControl(oLabel); if (sOldId == sNewId) { return; } //Invalidate the label itself (see setLabelFor, setAlternativeLabelFor) if (!bDestroy) { oL...
[ "function", "refreshMapping", "(", "oLabel", ",", "bDestroy", ")", "{", "var", "sLabelId", "=", "oLabel", ".", "getId", "(", ")", ";", "var", "sOldId", "=", "oLabel", ".", "__sLabeledControl", ";", "var", "sNewId", "=", "bDestroy", "?", "null", ":", "fin...
Updates the mapping tables for the given label, in destroy case only a cleanup is done
[ "Updates", "the", "mapping", "tables", "for", "the", "given", "label", "in", "destroy", "case", "only", "a", "cleanup", "is", "done" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LabelEnablement.js#L40-L94
4,742
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LabelEnablement.js
checkLabelEnablementPreconditions
function checkLabelEnablementPreconditions(oControl) { if (!oControl) { throw new Error("sap.ui.core.LabelEnablement cannot enrich null"); } var oMetadata = oControl.getMetadata(); if (!oMetadata.isInstanceOf("sap.ui.core.Label")) { throw new Error("sap.ui.core.LabelEnablement only supports Controls with ...
javascript
function checkLabelEnablementPreconditions(oControl) { if (!oControl) { throw new Error("sap.ui.core.LabelEnablement cannot enrich null"); } var oMetadata = oControl.getMetadata(); if (!oMetadata.isInstanceOf("sap.ui.core.Label")) { throw new Error("sap.ui.core.LabelEnablement only supports Controls with ...
[ "function", "checkLabelEnablementPreconditions", "(", "oControl", ")", "{", "if", "(", "!", "oControl", ")", "{", "throw", "new", "Error", "(", "\"sap.ui.core.LabelEnablement cannot enrich null\"", ")", ";", "}", "var", "oMetadata", "=", "oControl", ".", "getMetadat...
Checks whether enrich function can be applied on the given control or prototype.
[ "Checks", "whether", "enrich", "function", "can", "be", "applied", "on", "the", "given", "control", "or", "prototype", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LabelEnablement.js#L97-L110
4,743
SAP/openui5
src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js
function() { if (!this.metaPath) { this.oMetaContext = this.oMetaModel.getMetaContext(this.path); this.metaPath = this.oMetaContext.getPath(); } else { this.oMetaContext = this.oMetaModel.createBindingContext(this.metaPath); } }
javascript
function() { if (!this.metaPath) { this.oMetaContext = this.oMetaModel.getMetaContext(this.path); this.metaPath = this.oMetaContext.getPath(); } else { this.oMetaContext = this.oMetaModel.createBindingContext(this.metaPath); } }
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "metaPath", ")", "{", "this", ".", "oMetaContext", "=", "this", ".", "oMetaModel", ".", "getMetaContext", "(", "this", ".", "path", ")", ";", "this", ".", "metaPath", "=", "this", ".", "oMetaCon...
Individual init method for Adapters @protected
[ "Individual", "init", "method", "for", "Adapters" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js#L76-L83
4,744
SAP/openui5
src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js
function(sProperty, vGetter, aArgs, caller) { if (!vGetter) { return; } if (!caller) { caller = this; } Object.defineProperty(this, sProperty, { configurable: true, get: function() { if (this._mCustomPropertyBag[sProperty]) { return this._mCustomPropertyBag[sProperty]; }...
javascript
function(sProperty, vGetter, aArgs, caller) { if (!vGetter) { return; } if (!caller) { caller = this; } Object.defineProperty(this, sProperty, { configurable: true, get: function() { if (this._mCustomPropertyBag[sProperty]) { return this._mCustomPropertyBag[sProperty]; }...
[ "function", "(", "sProperty", ",", "vGetter", ",", "aArgs", ",", "caller", ")", "{", "if", "(", "!", "vGetter", ")", "{", "return", ";", "}", "if", "(", "!", "caller", ")", "{", "caller", "=", "this", ";", "}", "Object", ".", "defineProperty", "(",...
Puts a deferred property to the corresponding adapter @param {string} sProperty the name of an adapters property @param {object} vGetter a getter which can be either an object or a function @param {array} aArgs an optional array of arguments used if vGetter is a function @param {object} the caller that inhabits the vG...
[ "Puts", "a", "deferred", "property", "to", "the", "corresponding", "adapter" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js#L100-L133
4,745
SAP/openui5
src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js
function(sValuePath, sType) { var sPath = "{"; if (this.modelName) { sPath = sPath + "model: '" + this.modelName + "',"; } if (this.sContextPath && sValuePath.startsWith(this.sContextPath)) { sValuePath = sValuePath.replace(this.sContextPath,""); } sPath = sPath + "path: '" + escape(sValueP...
javascript
function(sValuePath, sType) { var sPath = "{"; if (this.modelName) { sPath = sPath + "model: '" + this.modelName + "',"; } if (this.sContextPath && sValuePath.startsWith(this.sContextPath)) { sValuePath = sValuePath.replace(this.sContextPath,""); } sPath = sPath + "path: '" + escape(sValueP...
[ "function", "(", "sValuePath", ",", "sType", ")", "{", "var", "sPath", "=", "\"{\"", ";", "if", "(", "this", ".", "modelName", ")", "{", "sPath", "=", "sPath", "+", "\"model: '\"", "+", "this", ".", "modelName", "+", "\"',\"", ";", "}", "if", "(", ...
The binding as a path within the model name @param {string} sValuePath the path to the property value, e.g 'Payed' @param {string} sType the optional name of the UI5 model type, e.g. 'sap.ui.model.type.string' @returns {string} the representation of a simple binding syntax
[ "The", "binding", "as", "a", "path", "within", "the", "model", "name" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/meta/BaseAdapter.js#L141-L161
4,746
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js
function(mTargetAnnotations, mSourceAnnotations) { // Merge must be done on Term level, this is why the original line does not suffice any more: // jQuery.extend(true, this.oAnnotations, mAnnotations); // Terms are defined on different levels, the main one is below the target level, which is directly // ad...
javascript
function(mTargetAnnotations, mSourceAnnotations) { // Merge must be done on Term level, this is why the original line does not suffice any more: // jQuery.extend(true, this.oAnnotations, mAnnotations); // Terms are defined on different levels, the main one is below the target level, which is directly // ad...
[ "function", "(", "mTargetAnnotations", ",", "mSourceAnnotations", ")", "{", "// Merge must be done on Term level, this is why the original line does not suffice any more:", "// jQuery.extend(true, this.oAnnotations, mAnnotations);", "// Terms are defined on different levels, the main one is be...
Merges the given parsed annotation map into the given target annotation map. @param {map} mTargetAnnotations The target annotation map into which the source annotations should be merged @param {map} mSourceAnnotations The source annotation map that should be merged into the target annotation map @static @protected
[ "Merges", "the", "given", "parsed", "annotation", "map", "into", "the", "given", "target", "annotation", "map", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L92-L133
4,747
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js
function (mAnnotations) { if (mAnnotations.annotationsAtArrays) { mAnnotations.annotationsAtArrays.forEach(function (aSegments) { AnnotationParser.syncAnnotationsAtArrays(mAnnotations, aSegments); }); } }
javascript
function (mAnnotations) { if (mAnnotations.annotationsAtArrays) { mAnnotations.annotationsAtArrays.forEach(function (aSegments) { AnnotationParser.syncAnnotationsAtArrays(mAnnotations, aSegments); }); } }
[ "function", "(", "mAnnotations", ")", "{", "if", "(", "mAnnotations", ".", "annotationsAtArrays", ")", "{", "mAnnotations", ".", "annotationsAtArrays", ".", "forEach", "(", "function", "(", "aSegments", ")", "{", "AnnotationParser", ".", "syncAnnotationsAtArrays", ...
Restores annotations at arrays which might have been lost due to serialization. @param {object} mAnnotations - The annotation map @protected @see AnnotationParser.backupAnnotationAtArray @see AnnotationParser.syncAnnotationsAtArrays @static
[ "Restores", "annotations", "at", "arrays", "which", "might", "have", "been", "lost", "due", "to", "serialization", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L504-L510
4,748
SAP/openui5
src/sap.ui.core/src/sap/ui/core/theming/Parameters.js
getParam
function getParam(mOptions) { var oParams = getParameters(); if (mOptions.scopeName) { oParams = oParams["scopes"][mOptions.scopeName]; } else { oParams = oParams["default"]; } var sParam = oParams[mOptions.parameterName]; if (typeof sParam === "undefined" && typeof mOptions.parameterName ==...
javascript
function getParam(mOptions) { var oParams = getParameters(); if (mOptions.scopeName) { oParams = oParams["scopes"][mOptions.scopeName]; } else { oParams = oParams["default"]; } var sParam = oParams[mOptions.parameterName]; if (typeof sParam === "undefined" && typeof mOptions.parameterName ==...
[ "function", "getParam", "(", "mOptions", ")", "{", "var", "oParams", "=", "getParameters", "(", ")", ";", "if", "(", "mOptions", ".", "scopeName", ")", "{", "oParams", "=", "oParams", "[", "\"scopes\"", "]", "[", "mOptions", ".", "scopeName", "]", ";", ...
Returns parameter value from given map and handles legacy parameter names @param {object} mOptions options map @param {string} mOptions.parameterName Parameter name / key @param {string} mOptions.scopeName Scope name @param {boolean} mOptions.loadPendingParameters If set to "true" and no parameter value is found, all ...
[ "Returns", "parameter", "value", "from", "given", "map", "and", "handles", "legacy", "parameter", "names" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/theming/Parameters.js#L261-L290
4,749
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/plugin/RenameHandler.js
function (bRestoreFocus, oEvent) { if (!this._bBlurOrKeyDownStarted) { this._bBlurOrKeyDownStarted = true; if (oEvent) { RenameHandler._preventDefault.call(this, oEvent); RenameHandler._stopPropagation.call(this, oEvent); } return this._emitLabelChangeEvent() .then(function (fnErrorHan...
javascript
function (bRestoreFocus, oEvent) { if (!this._bBlurOrKeyDownStarted) { this._bBlurOrKeyDownStarted = true; if (oEvent) { RenameHandler._preventDefault.call(this, oEvent); RenameHandler._stopPropagation.call(this, oEvent); } return this._emitLabelChangeEvent() .then(function (fnErrorHan...
[ "function", "(", "bRestoreFocus", ",", "oEvent", ")", "{", "if", "(", "!", "this", ".", "_bBlurOrKeyDownStarted", ")", "{", "this", ".", "_bBlurOrKeyDownStarted", "=", "true", ";", "if", "(", "oEvent", ")", "{", "RenameHandler", ".", "_preventDefault", ".", ...
Handles events after rename has been performed @param {boolean} bRestoreFocus - to restore focus to overlay after rename completes @private
[ "Handles", "events", "after", "rename", "has", "been", "performed" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/RenameHandler.js#L291-L307
4,750
SAP/openui5
src/sap.ui.core/src/sap/ui/events/jquery/EventExtension.js
function(oEvent) { while (oEvent && oEvent.originalEvent && oEvent !== oEvent.originalEvent) { oEvent = oEvent.originalEvent; } return oEvent; }
javascript
function(oEvent) { while (oEvent && oEvent.originalEvent && oEvent !== oEvent.originalEvent) { oEvent = oEvent.originalEvent; } return oEvent; }
[ "function", "(", "oEvent", ")", "{", "while", "(", "oEvent", "&&", "oEvent", ".", "originalEvent", "&&", "oEvent", "!==", "oEvent", ".", "originalEvent", ")", "{", "oEvent", "=", "oEvent", ".", "originalEvent", ";", "}", "return", "oEvent", ";", "}" ]
Get the real native browser event from a jQuery event object
[ "Get", "the", "real", "native", "browser", "event", "from", "a", "jQuery", "event", "object" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/jquery/EventExtension.js#L178-L183
4,751
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(rm, oRoadMap, bStart){ var sType = bStart ? "Start" : "End"; rm.write("<div"); rm.writeAttribute("id", oRoadMap.getId() + "-" + sType); rm.writeAttribute("tabindex", "-1"); var hasHiddenSteps = true; //Simply assume that there are hidden steps -> updated later (see function updateScrollState) rm.ad...
javascript
function(rm, oRoadMap, bStart){ var sType = bStart ? "Start" : "End"; rm.write("<div"); rm.writeAttribute("id", oRoadMap.getId() + "-" + sType); rm.writeAttribute("tabindex", "-1"); var hasHiddenSteps = true; //Simply assume that there are hidden steps -> updated later (see function updateScrollState) rm.ad...
[ "function", "(", "rm", ",", "oRoadMap", ",", "bStart", ")", "{", "var", "sType", "=", "bStart", "?", "\"Start\"", ":", "\"End\"", ";", "rm", ".", "write", "(", "\"<div\"", ")", ";", "rm", ".", "writeAttribute", "(", "\"id\"", ",", "oRoadMap", ".", "g...
Writes the delimiter HTML into the rendermanger
[ "Writes", "the", "delimiter", "HTML", "into", "the", "rendermanger" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L540-L551
4,752
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(rm, oRoadMap, oStep, aAdditionalClasses, fAddAdditionalBoxContent, sId){ rm.write("<li"); if (sId) { //Write the given Id if available, otherwise use writeControlData rm.writeAttribute("id", sId); } else { rm.writeElementData(oStep); } var sStepName = getStepName(oRoadMap, oStep); oStep.__ste...
javascript
function(rm, oRoadMap, oStep, aAdditionalClasses, fAddAdditionalBoxContent, sId){ rm.write("<li"); if (sId) { //Write the given Id if available, otherwise use writeControlData rm.writeAttribute("id", sId); } else { rm.writeElementData(oStep); } var sStepName = getStepName(oRoadMap, oStep); oStep.__ste...
[ "function", "(", "rm", ",", "oRoadMap", ",", "oStep", ",", "aAdditionalClasses", ",", "fAddAdditionalBoxContent", ",", "sId", ")", "{", "rm", ".", "write", "(", "\"<li\"", ")", ";", "if", "(", "sId", ")", "{", "//Write the given Id if available, otherwise use wr...
Writes the step HTML into the rendermanger
[ "Writes", "the", "step", "HTML", "into", "the", "rendermanger" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L555-L624
4,753
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oStep){ var sTooltip = oStep.getTooltip_AsString(); if (!sTooltip && !oStep.getTooltip() && sap.ui.getCore().getConfiguration().getAccessibility()) { sTooltip = getText("RDMP_DEFAULT_STEP_TOOLTIP", [oStep.__stepName]); } return sTooltip || ""; }
javascript
function(oStep){ var sTooltip = oStep.getTooltip_AsString(); if (!sTooltip && !oStep.getTooltip() && sap.ui.getCore().getConfiguration().getAccessibility()) { sTooltip = getText("RDMP_DEFAULT_STEP_TOOLTIP", [oStep.__stepName]); } return sTooltip || ""; }
[ "function", "(", "oStep", ")", "{", "var", "sTooltip", "=", "oStep", ".", "getTooltip_AsString", "(", ")", ";", "if", "(", "!", "sTooltip", "&&", "!", "oStep", ".", "getTooltip", "(", ")", "&&", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "get...
Returns the tooltip of the given step
[ "Returns", "the", "tooltip", "of", "the", "given", "step" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L628-L634
4,754
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(rm, oRoadMap, oStep, bIsExpandable){ if (!sap.ui.getCore().getConfiguration().getAccessibility()) { return; } rm.writeAttribute("role", "treeitem"); if (oStep.getEnabled()) { rm.writeAttribute("aria-checked", oRoadMap.getSelectedStep() == oStep.getId()); } else { rm.writeAttribute("aria-di...
javascript
function(rm, oRoadMap, oStep, bIsExpandable){ if (!sap.ui.getCore().getConfiguration().getAccessibility()) { return; } rm.writeAttribute("role", "treeitem"); if (oStep.getEnabled()) { rm.writeAttribute("aria-checked", oRoadMap.getSelectedStep() == oStep.getId()); } else { rm.writeAttribute("aria-di...
[ "function", "(", "rm", ",", "oRoadMap", ",", "oStep", ",", "bIsExpandable", ")", "{", "if", "(", "!", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getConfiguration", "(", ")", ".", "getAccessibility", "(", ")", ")", "{", "return", ";", "}", "r...
Writes the ARIA properties of a step
[ "Writes", "the", "ARIA", "properties", "of", "a", "step" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L648-L672
4,755
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oStep, sLabel){ var bIsExpandable = oStep.getParent() instanceof sap.ui.commons.RoadMap && oStep.getSubSteps().length > 0; var sResult = sLabel || ""; if (oStep.getEnabled()) { sResult = getText(bIsExpandable ? "RDMP_ARIA_EXPANDABLE_STEP" : "RDMP_ARIA_STANDARD_STEP", [sResult]); } return sResult...
javascript
function(oStep, sLabel){ var bIsExpandable = oStep.getParent() instanceof sap.ui.commons.RoadMap && oStep.getSubSteps().length > 0; var sResult = sLabel || ""; if (oStep.getEnabled()) { sResult = getText(bIsExpandable ? "RDMP_ARIA_EXPANDABLE_STEP" : "RDMP_ARIA_STANDARD_STEP", [sResult]); } return sResult...
[ "function", "(", "oStep", ",", "sLabel", ")", "{", "var", "bIsExpandable", "=", "oStep", ".", "getParent", "(", ")", "instanceof", "sap", ".", "ui", ".", "commons", ".", "RoadMap", "&&", "oStep", ".", "getSubSteps", "(", ")", ".", "length", ">", "0", ...
Computes how the aria-label property should be set for the given step
[ "Computes", "how", "the", "aria", "-", "label", "property", "should", "be", "set", "for", "the", "given", "step" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L676-L685
4,756
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var iIdx = oStep.getParent()[bIsTopLevel ? "indexOfStep" : "indexOfSubStep"](oStep); var iCountInvisible = 0; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); for (var i = 0; i < iIdx; i++) { ...
javascript
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var iIdx = oStep.getParent()[bIsTopLevel ? "indexOfStep" : "indexOfSubStep"](oStep); var iCountInvisible = 0; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); for (var i = 0; i < iIdx; i++) { ...
[ "function", "(", "oStep", ")", "{", "var", "bIsTopLevel", "=", "oStep", ".", "getParent", "(", ")", "instanceof", "sap", ".", "ui", ".", "commons", ".", "RoadMap", ";", "var", "iIdx", "=", "oStep", ".", "getParent", "(", ")", "[", "bIsTopLevel", "?", ...
Computes how the aria-posinset property should be set for the given step
[ "Computes", "how", "the", "aria", "-", "posinset", "property", "should", "be", "set", "for", "the", "given", "step" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L689-L700
4,757
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); var iCount = aSteps.length; for (var i = 0; i < aSteps.length; i++) { if (!aSteps[i].getVisible()) { iCount--; } } return iCount; }
javascript
function(oStep){ var bIsTopLevel = oStep.getParent() instanceof sap.ui.commons.RoadMap; var aSteps = oStep.getParent()[bIsTopLevel ? "getSteps" : "getSubSteps"](); var iCount = aSteps.length; for (var i = 0; i < aSteps.length; i++) { if (!aSteps[i].getVisible()) { iCount--; } } return iCount; }
[ "function", "(", "oStep", ")", "{", "var", "bIsTopLevel", "=", "oStep", ".", "getParent", "(", ")", "instanceof", "sap", ".", "ui", ".", "commons", ".", "RoadMap", ";", "var", "aSteps", "=", "oStep", ".", "getParent", "(", ")", "[", "bIsTopLevel", "?",...
Computes how the aria-setsize property should be set for the given step
[ "Computes", "how", "the", "aria", "-", "setsize", "property", "should", "be", "set", "for", "the", "given", "step" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L704-L714
4,758
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(rm, oRoadMap, oStep){ var fCreateIcon = function(rm, oRoadMap, sId, sIcon, sAdditonalClass){ rm.write("<div"); rm.writeAttribute("id", sId + "-ico"); rm.addClass("sapUiRoadMapStepIco"); if (sAdditonalClass) { rm.addClass(sAdditonalClass); } rm.writeClasses(); rm.write("></div>"); }...
javascript
function(rm, oRoadMap, oStep){ var fCreateIcon = function(rm, oRoadMap, sId, sIcon, sAdditonalClass){ rm.write("<div"); rm.writeAttribute("id", sId + "-ico"); rm.addClass("sapUiRoadMapStepIco"); if (sAdditonalClass) { rm.addClass(sAdditonalClass); } rm.writeClasses(); rm.write("></div>"); }...
[ "function", "(", "rm", ",", "oRoadMap", ",", "oStep", ")", "{", "var", "fCreateIcon", "=", "function", "(", "rm", ",", "oRoadMap", ",", "sId", ",", "sIcon", ",", "sAdditonalClass", ")", "{", "rm", ".", "write", "(", "\"<div\"", ")", ";", "rm", ".", ...
Writes the step HTML of the expandable step and its children into the rendermanger
[ "Writes", "the", "step", "HTML", "of", "the", "expandable", "step", "and", "its", "children", "into", "the", "rendermanger" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L718-L755
4,759
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oRoadMap){ var iRTLFactor = getRTLFactor(); var jStepArea = oRoadMap.$("steparea"); var iScrollLeft = getScrollLeft(jStepArea); var jStartDelim = oRoadMap.$("Start"); jStartDelim.removeClass("sapUiRoadMapStartScroll").removeClass("sapUiRoadMapStartFixed"); jStartDelim.addClass(iRTLFactor * iScro...
javascript
function(oRoadMap){ var iRTLFactor = getRTLFactor(); var jStepArea = oRoadMap.$("steparea"); var iScrollLeft = getScrollLeft(jStepArea); var jStartDelim = oRoadMap.$("Start"); jStartDelim.removeClass("sapUiRoadMapStartScroll").removeClass("sapUiRoadMapStartFixed"); jStartDelim.addClass(iRTLFactor * iScro...
[ "function", "(", "oRoadMap", ")", "{", "var", "iRTLFactor", "=", "getRTLFactor", "(", ")", ";", "var", "jStepArea", "=", "oRoadMap", ".", "$", "(", "\"steparea\"", ")", ";", "var", "iScrollLeft", "=", "getScrollLeft", "(", "jStepArea", ")", ";", "var", "...
Refreshs the delimiters according to the current scroll state
[ "Refreshs", "the", "delimiters", "according", "to", "the", "current", "scroll", "state" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L779-L794
4,760
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(jStepArea, jStep){ var iPos = jStep.position().left; if (sap.ui.getCore().getConfiguration().getRTL()) { //Recompute in RTL case iPos = jStepArea.width() - iPos - jStep.outerWidth(); } return iPos; }
javascript
function(jStepArea, jStep){ var iPos = jStep.position().left; if (sap.ui.getCore().getConfiguration().getRTL()) { //Recompute in RTL case iPos = jStepArea.width() - iPos - jStep.outerWidth(); } return iPos; }
[ "function", "(", "jStepArea", ",", "jStep", ")", "{", "var", "iPos", "=", "jStep", ".", "position", "(", ")", ".", "left", ";", "if", "(", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getConfiguration", "(", ")", ".", "getRTL", "(", ")", ")"...
Returns the position left attribute of the given step within the scroll area
[ "Returns", "the", "position", "left", "attribute", "of", "the", "given", "step", "within", "the", "scroll", "area" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L831-L837
4,761
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js
function(oRoadMap, iNewPos, bSkipAnim, fEndCallBack){ var jStepArea = oRoadMap.$("steparea"); jStepArea.stop(false, true); if (iNewPos == "next") { iNewPos = jStepArea.scrollLeft() + oRoadMap.iStepWidth * getRTLFactor(); } else if (iNewPos == "prev") { iNewPos = jStepArea.scrollLeft() - oRoadMap.iStepWid...
javascript
function(oRoadMap, iNewPos, bSkipAnim, fEndCallBack){ var jStepArea = oRoadMap.$("steparea"); jStepArea.stop(false, true); if (iNewPos == "next") { iNewPos = jStepArea.scrollLeft() + oRoadMap.iStepWidth * getRTLFactor(); } else if (iNewPos == "prev") { iNewPos = jStepArea.scrollLeft() - oRoadMap.iStepWid...
[ "function", "(", "oRoadMap", ",", "iNewPos", ",", "bSkipAnim", ",", "fEndCallBack", ")", "{", "var", "jStepArea", "=", "oRoadMap", ".", "$", "(", "\"steparea\"", ")", ";", "jStepArea", ".", "stop", "(", "false", ",", "true", ")", ";", "if", "(", "iNewP...
Scrolls to the given position
[ "Scrolls", "to", "the", "given", "position" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L872-L901
4,762
SAP/openui5
src/sap.m/src/sap/m/TileContainer.js
handleAriaSize
function handleAriaSize (aVisibleTiles) { var iTilesCount, i, oTile; aVisibleTiles = aVisibleTiles || this._getVisibleTiles(); iTilesCount = aVisibleTiles.length; for (i = 0; i < iTilesCount; i++) { oTile = aVisibleTiles[i]; if (oTile._rendered && oTile.getDomRef()) { oTile.getDomRef().setAttr...
javascript
function handleAriaSize (aVisibleTiles) { var iTilesCount, i, oTile; aVisibleTiles = aVisibleTiles || this._getVisibleTiles(); iTilesCount = aVisibleTiles.length; for (i = 0; i < iTilesCount; i++) { oTile = aVisibleTiles[i]; if (oTile._rendered && oTile.getDomRef()) { oTile.getDomRef().setAttr...
[ "function", "handleAriaSize", "(", "aVisibleTiles", ")", "{", "var", "iTilesCount", ",", "i", ",", "oTile", ";", "aVisibleTiles", "=", "aVisibleTiles", "||", "this", ".", "_getVisibleTiles", "(", ")", ";", "iTilesCount", "=", "aVisibleTiles", ".", "length", ";...
Handles the WAI ARIA property aria-setsize after a change in the TileContainer. @private
[ "Handles", "the", "WAI", "ARIA", "property", "aria", "-", "setsize", "after", "a", "change", "in", "the", "TileContainer", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TileContainer.js#L2141-L2155
4,763
SAP/openui5
src/sap.m/src/sap/m/TileContainer.js
handleAriaPositionInSet
function handleAriaPositionInSet(iStartIndex, iEndIndex, aVisibleTiles) { var i, oTile = null; aVisibleTiles = aVisibleTiles || this._getVisibleTiles(); for (i = iStartIndex; i < iEndIndex; i++) { oTile = aVisibleTiles[i]; if (oTile) { oTile.$().attr('aria-posinset', this._indexOfVisibleTile(oTile,...
javascript
function handleAriaPositionInSet(iStartIndex, iEndIndex, aVisibleTiles) { var i, oTile = null; aVisibleTiles = aVisibleTiles || this._getVisibleTiles(); for (i = iStartIndex; i < iEndIndex; i++) { oTile = aVisibleTiles[i]; if (oTile) { oTile.$().attr('aria-posinset', this._indexOfVisibleTile(oTile,...
[ "function", "handleAriaPositionInSet", "(", "iStartIndex", ",", "iEndIndex", ",", "aVisibleTiles", ")", "{", "var", "i", ",", "oTile", "=", "null", ";", "aVisibleTiles", "=", "aVisibleTiles", "||", "this", ".", "_getVisibleTiles", "(", ")", ";", "for", "(", ...
Handles the WAI ARIA property aria-posinset after a change in the TileContainer. @param {int} iStartIndex The index of the Tile to start with @param {int} iEndIndex The index of the Tile to complete with @param {sap.m.Tile[]} [aVisibleTiles] optional list of visible tiles in order to avoid filtering them again. @privat...
[ "Handles", "the", "WAI", "ARIA", "property", "aria", "-", "posinset", "after", "a", "change", "in", "the", "TileContainer", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TileContainer.js#L2163-L2175
4,764
moleculerjs/moleculer
src/transporters/index.js
resolve
function resolve(opt) { if (opt instanceof Transporters.Base) { return opt; } else if (_.isString(opt)) { let TransporterClass = getByName(opt); if (TransporterClass) return new TransporterClass(); if (opt.startsWith("nats://")) TransporterClass = Transporters.NATS; else if (opt.startsWith("mqtt://")...
javascript
function resolve(opt) { if (opt instanceof Transporters.Base) { return opt; } else if (_.isString(opt)) { let TransporterClass = getByName(opt); if (TransporterClass) return new TransporterClass(); if (opt.startsWith("nats://")) TransporterClass = Transporters.NATS; else if (opt.startsWith("mqtt://")...
[ "function", "resolve", "(", "opt", ")", "{", "if", "(", "opt", "instanceof", "Transporters", ".", "Base", ")", "{", "return", "opt", ";", "}", "else", "if", "(", "_", ".", "isString", "(", "opt", ")", ")", "{", "let", "TransporterClass", "=", "getByN...
Resolve transporter by name @param {object|string} opt @returns {Transporter}
[ "Resolve", "transporter", "by", "name" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/transporters/index.js#L40-L78
4,765
moleculerjs/moleculer
src/cachers/index.js
resolve
function resolve(opt) { if (opt instanceof Cachers.Base) { return opt; } else if (opt === true) { return new Cachers.Memory(); } else if (_.isString(opt)) { let CacherClass = getByName(opt); if (CacherClass) return new CacherClass(); if (opt.startsWith("redis://")) CacherClass = Cachers.Redis; if...
javascript
function resolve(opt) { if (opt instanceof Cachers.Base) { return opt; } else if (opt === true) { return new Cachers.Memory(); } else if (_.isString(opt)) { let CacherClass = getByName(opt); if (CacherClass) return new CacherClass(); if (opt.startsWith("redis://")) CacherClass = Cachers.Redis; if...
[ "function", "resolve", "(", "opt", ")", "{", "if", "(", "opt", "instanceof", "Cachers", ".", "Base", ")", "{", "return", "opt", ";", "}", "else", "if", "(", "opt", "===", "true", ")", "{", "return", "new", "Cachers", ".", "Memory", "(", ")", ";", ...
Resolve cacher by name @param {object|string} opt @returns {Cacher}
[ "Resolve", "cacher", "by", "name" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/cachers/index.js#L35-L62
4,766
moleculerjs/moleculer
src/strategies/index.js
resolve
function resolve(opt) { if (Strategies.Base.isPrototypeOf(opt)) { return opt; } else if (_.isString(opt)) { let SerializerClass = getByName(opt); if (SerializerClass) return SerializerClass; else throw new BrokerOptionsError(`Invalid strategy type '${opt}'.`, { type: opt }); } else if (_.isObject(opt)...
javascript
function resolve(opt) { if (Strategies.Base.isPrototypeOf(opt)) { return opt; } else if (_.isString(opt)) { let SerializerClass = getByName(opt); if (SerializerClass) return SerializerClass; else throw new BrokerOptionsError(`Invalid strategy type '${opt}'.`, { type: opt }); } else if (_.isObject(opt)...
[ "function", "resolve", "(", "opt", ")", "{", "if", "(", "Strategies", ".", "Base", ".", "isPrototypeOf", "(", "opt", ")", ")", "{", "return", "opt", ";", "}", "else", "if", "(", "_", ".", "isString", "(", "opt", ")", ")", "{", "let", "SerializerCla...
Resolve strategy by name @param {object|string} opt @returns {Strategy} @memberof ServiceBroker
[ "Resolve", "strategy", "by", "name" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/strategies/index.js#L37-L56
4,767
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketEvent
function PacketEvent(properties) { this.groups = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketEvent(properties) { this.groups = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketEvent", "(", "properties", ")", "{", "this", ".", "groups", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "ke...
Properties of a PacketEvent. @memberof packets @interface IPacketEvent @property {string} ver PacketEvent ver @property {string} sender PacketEvent sender @property {string} event PacketEvent event @property {string|null} [data] PacketEvent data @property {Array.<string>|null} [groups] PacketEvent groups @property {boo...
[ "Properties", "of", "a", "PacketEvent", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L44-L50
4,768
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketRequest
function PacketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of a PacketRequest. @memberof packets @interface IPacketRequest @property {string} ver PacketRequest ver @property {string} sender PacketRequest sender @property {string} id PacketRequest id @property {string} action PacketRequest action @property {Uint8Array|null} [params] PacketRequest params @property {st...
[ "Properties", "of", "a", "PacketRequest", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L365-L370
4,769
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketResponse
function PacketResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketResponse", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of a PacketResponse. @memberof packets @interface IPacketResponse @property {string} ver PacketResponse ver @property {string} sender PacketResponse sender @property {string} id PacketResponse id @property {boolean} success PacketResponse success @property {Uint8Array|null} [data] PacketResponse data @proper...
[ "Properties", "of", "a", "PacketResponse", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L800-L805
4,770
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketDiscover
function PacketDiscover(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketDiscover(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketDiscover", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of a PacketDiscover. @memberof packets @interface IPacketDiscover @property {string} ver PacketDiscover ver @property {string} sender PacketDiscover sender Constructs a new PacketDiscover. @memberof packets @classdesc Represents a PacketDiscover. @implements IPacketDiscover @constructor @param {packets.IPa...
[ "Properties", "of", "a", "PacketDiscover", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1145-L1150
4,771
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketInfo
function PacketInfo(properties) { this.ipList = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketInfo(properties) { this.ipList = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketInfo", "(", "properties", ")", "{", "this", ".", "ipList", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "key...
Properties of a PacketInfo. @memberof packets @interface IPacketInfo @property {string} ver PacketInfo ver @property {string} sender PacketInfo sender @property {string} services PacketInfo services @property {string} config PacketInfo config @property {Array.<string>|null} [ipList] PacketInfo ipList @property {string}...
[ "Properties", "of", "a", "PacketInfo", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1361-L1367
4,772
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
Client
function Client(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function Client(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "Client", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "if", ...
Properties of a Client. @memberof packets.PacketInfo @interface IClient @property {string} type Client type @property {string} version Client version @property {string} langVersion Client langVersion Constructs a new Client. @memberof packets.PacketInfo @classdesc Represents a Client. @implements IClient @constructor...
[ "Properties", "of", "a", "Client", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1718-L1723
4,773
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketDisconnect
function PacketDisconnect(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketDisconnect(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketDisconnect", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")",...
Properties of a PacketDisconnect. @memberof packets @interface IPacketDisconnect @property {string} ver PacketDisconnect ver @property {string} sender PacketDisconnect sender Constructs a new PacketDisconnect. @memberof packets @classdesc Represents a PacketDisconnect. @implements IPacketDisconnect @constructor @para...
[ "Properties", "of", "a", "PacketDisconnect", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1952-L1957
4,774
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketHeartbeat
function PacketHeartbeat(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketHeartbeat(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketHeartbeat", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of a PacketHeartbeat. @memberof packets @interface IPacketHeartbeat @property {string} ver PacketHeartbeat ver @property {string} sender PacketHeartbeat sender @property {number} cpu PacketHeartbeat cpu Constructs a new PacketHeartbeat. @memberof packets @classdesc Represents a PacketHeartbeat. @implements...
[ "Properties", "of", "a", "PacketHeartbeat", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L2163-L2168
4,775
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketPing
function PacketPing(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketPing(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketPing", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "if...
Properties of a PacketPing. @memberof packets @interface IPacketPing @property {string} ver PacketPing ver @property {string} sender PacketPing sender @property {number|Long} time PacketPing time Constructs a new PacketPing. @memberof packets @classdesc Represents a PacketPing. @implements IPacketPing @constructor @p...
[ "Properties", "of", "a", "PacketPing", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L2395-L2400
4,776
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketPong
function PacketPong(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketPong(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketPong", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "if...
Properties of a PacketPong. @memberof packets @interface IPacketPong @property {string} ver PacketPong ver @property {string} sender PacketPong sender @property {number|Long} time PacketPong time @property {number|Long} arrived PacketPong arrived Constructs a new PacketPong. @memberof packets @classdesc Represents a ...
[ "Properties", "of", "a", "PacketPong", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L2642-L2647
4,777
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketGossipHello
function PacketGossipHello(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketGossipHello(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketGossipHello", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")"...
Properties of a PacketGossipHello. @memberof packets @interface IPacketGossipHello @property {string} ver PacketGossipHello ver @property {string} sender PacketGossipHello sender @property {string} host PacketGossipHello host @property {number} port PacketGossipHello port Constructs a new PacketGossipHello. @memberof...
[ "Properties", "of", "a", "PacketGossipHello", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L2924-L2929
4,778
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketGossipRequest
function PacketGossipRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketGossipRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketGossipRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", "...
Properties of a PacketGossipRequest. @memberof packets @interface IPacketGossipRequest @property {string} ver PacketGossipRequest ver @property {string} sender PacketGossipRequest sender @property {string|null} [online] PacketGossipRequest online @property {string|null} [offline] PacketGossipRequest offline Construct...
[ "Properties", "of", "a", "PacketGossipRequest", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L3178-L3183
4,779
moleculerjs/moleculer
src/serializers/proto/packets.proto.js
PacketGossipResponse
function PacketGossipResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function PacketGossipResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "PacketGossipResponse", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ...
Properties of a PacketGossipResponse. @memberof packets @interface IPacketGossipResponse @property {string} ver PacketGossipResponse ver @property {string} sender PacketGossipResponse sender @property {string|null} [online] PacketGossipResponse online @property {string|null} [offline] PacketGossipResponse offline Con...
[ "Properties", "of", "a", "PacketGossipResponse", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L3432-L3437
4,780
moleculerjs/moleculer
src/middlewares/metrics.js
shouldMetric
function shouldMetric(ctx) { if (ctx.broker.options.metrics) { sampleCounter++; if (sampleCounter * ctx.broker.options.metricsRate >= 1.0) { sampleCounter = 0; return true; } } return false; }
javascript
function shouldMetric(ctx) { if (ctx.broker.options.metrics) { sampleCounter++; if (sampleCounter * ctx.broker.options.metricsRate >= 1.0) { sampleCounter = 0; return true; } } return false; }
[ "function", "shouldMetric", "(", "ctx", ")", "{", "if", "(", "ctx", ".", "broker", ".", "options", ".", "metrics", ")", "{", "sampleCounter", "++", ";", "if", "(", "sampleCounter", "*", "ctx", ".", "broker", ".", "options", ".", "metricsRate", ">=", "1...
Check should metric the current context @param {Context} ctx @returns {Boolean} @memberof ServiceBroker
[ "Check", "should", "metric", "the", "current", "context" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L21-L31
4,781
moleculerjs/moleculer
src/middlewares/metrics.js
metricStart
function metricStart(ctx) { ctx.startTime = Date.now(); ctx.startHrTime = process.hrtime(); ctx.duration = 0; if (ctx.metrics) { const payload = generateMetricPayload(ctx); ctx.broker.emit("metrics.trace.span.start", payload); } }
javascript
function metricStart(ctx) { ctx.startTime = Date.now(); ctx.startHrTime = process.hrtime(); ctx.duration = 0; if (ctx.metrics) { const payload = generateMetricPayload(ctx); ctx.broker.emit("metrics.trace.span.start", payload); } }
[ "function", "metricStart", "(", "ctx", ")", "{", "ctx", ".", "startTime", "=", "Date", ".", "now", "(", ")", ";", "ctx", ".", "startHrTime", "=", "process", ".", "hrtime", "(", ")", ";", "ctx", ".", "duration", "=", "0", ";", "if", "(", "ctx", "....
Start metrics & send metric event. @param {Context} ctx @private
[ "Start", "metrics", "&", "send", "metric", "event", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L40-L49
4,782
moleculerjs/moleculer
src/middlewares/metrics.js
generateMetricPayload
function generateMetricPayload(ctx) { let payload = { id: ctx.id, requestID: ctx.requestID, level: ctx.level, startTime: ctx.startTime, remoteCall: ctx.nodeID !== ctx.broker.nodeID }; // Process extra metrics processExtraMetrics(ctx, payload); if (ctx.action) { payload.action = { name: ctx.action....
javascript
function generateMetricPayload(ctx) { let payload = { id: ctx.id, requestID: ctx.requestID, level: ctx.level, startTime: ctx.startTime, remoteCall: ctx.nodeID !== ctx.broker.nodeID }; // Process extra metrics processExtraMetrics(ctx, payload); if (ctx.action) { payload.action = { name: ctx.action....
[ "function", "generateMetricPayload", "(", "ctx", ")", "{", "let", "payload", "=", "{", "id", ":", "ctx", ".", "id", ",", "requestID", ":", "ctx", ".", "requestID", ",", "level", ":", "ctx", ".", "level", ",", "startTime", ":", "ctx", ".", "startTime", ...
Generate metrics payload @param {Context} ctx @returns {Object}
[ "Generate", "metrics", "payload" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L57-L89
4,783
moleculerjs/moleculer
src/middlewares/metrics.js
metricFinish
function metricFinish(ctx, error) { if (ctx.startHrTime) { let diff = process.hrtime(ctx.startHrTime); ctx.duration = (diff[0] * 1e3) + (diff[1] / 1e6); // milliseconds } ctx.stopTime = ctx.startTime + ctx.duration; if (ctx.metrics) { const payload = generateMetricPayload(ctx); payload.endTime = ctx.stopTi...
javascript
function metricFinish(ctx, error) { if (ctx.startHrTime) { let diff = process.hrtime(ctx.startHrTime); ctx.duration = (diff[0] * 1e3) + (diff[1] / 1e6); // milliseconds } ctx.stopTime = ctx.startTime + ctx.duration; if (ctx.metrics) { const payload = generateMetricPayload(ctx); payload.endTime = ctx.stopTi...
[ "function", "metricFinish", "(", "ctx", ",", "error", ")", "{", "if", "(", "ctx", ".", "startHrTime", ")", "{", "let", "diff", "=", "process", ".", "hrtime", "(", "ctx", ".", "startHrTime", ")", ";", "ctx", ".", "duration", "=", "(", "diff", "[", "...
Stop metrics & send finish metric event. @param {Context} ctx @param {Error} error @private
[ "Stop", "metrics", "&", "send", "finish", "metric", "event", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L99-L123
4,784
moleculerjs/moleculer
src/middlewares/metrics.js
assignExtraMetrics
function assignExtraMetrics(ctx, name, payload) { let def = ctx.action.metrics[name]; // if metrics definitions is boolean do default, metrics=true if (def === true) { payload[name] = ctx[name]; } else if (_.isArray(def)) { payload[name] = _.pick(ctx[name], def); } else if (_.isFunction(def)) { payload[name]...
javascript
function assignExtraMetrics(ctx, name, payload) { let def = ctx.action.metrics[name]; // if metrics definitions is boolean do default, metrics=true if (def === true) { payload[name] = ctx[name]; } else if (_.isArray(def)) { payload[name] = _.pick(ctx[name], def); } else if (_.isFunction(def)) { payload[name]...
[ "function", "assignExtraMetrics", "(", "ctx", ",", "name", ",", "payload", ")", "{", "let", "def", "=", "ctx", ".", "action", ".", "metrics", "[", "name", "]", ";", "// if metrics definitions is boolean do default, metrics=true", "if", "(", "def", "===", "true",...
Assign extra metrics taking into account action definitions @param {Context} ctx @param {string} name Field of the context to be assigned. @param {any} payload Object for assignment. @private
[ "Assign", "extra", "metrics", "taking", "into", "account", "action", "definitions" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L134-L144
4,785
moleculerjs/moleculer
src/middlewares/metrics.js
processExtraMetrics
function processExtraMetrics(ctx, payload) { // extra metrics (params and meta) if (_.isObject(ctx.action.metrics)) { // custom metrics def assignExtraMetrics(ctx, "params", payload); assignExtraMetrics(ctx, "meta", payload); } }
javascript
function processExtraMetrics(ctx, payload) { // extra metrics (params and meta) if (_.isObject(ctx.action.metrics)) { // custom metrics def assignExtraMetrics(ctx, "params", payload); assignExtraMetrics(ctx, "meta", payload); } }
[ "function", "processExtraMetrics", "(", "ctx", ",", "payload", ")", "{", "// extra metrics (params and meta)", "if", "(", "_", ".", "isObject", "(", "ctx", ".", "action", ".", "metrics", ")", ")", "{", "// custom metrics def", "assignExtraMetrics", "(", "ctx", "...
Decide and process extra metrics taking into account action definitions @param {Context} ctx @param {any} payload Object for assignment. @private
[ "Decide", "and", "process", "extra", "metrics", "taking", "into", "account", "action", "definitions" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/metrics.js#L154-L161
4,786
moleculerjs/moleculer
src/middlewares/action-hook.js
sanitizeHooks
function sanitizeHooks(hooks, service) { if (_.isString(hooks)) return service && _.isFunction(service[hooks]) ? service[hooks] : null; if (Array.isArray(hooks)) { return _.compact(hooks.map(h => { if (_.isString(h)) return service && _.isFunction(service[h]) ? service[h] : null; return h; })); } ...
javascript
function sanitizeHooks(hooks, service) { if (_.isString(hooks)) return service && _.isFunction(service[hooks]) ? service[hooks] : null; if (Array.isArray(hooks)) { return _.compact(hooks.map(h => { if (_.isString(h)) return service && _.isFunction(service[h]) ? service[h] : null; return h; })); } ...
[ "function", "sanitizeHooks", "(", "hooks", ",", "service", ")", "{", "if", "(", "_", ".", "isString", "(", "hooks", ")", ")", "return", "service", "&&", "_", ".", "isFunction", "(", "service", "[", "hooks", "]", ")", "?", "service", "[", "hooks", "]"...
Sanitize hooks. If the hook is a string, convert it to Service method calling. @param {Function|String|Array<any>} hooks @param {Service?} service @returns
[ "Sanitize", "hooks", ".", "If", "the", "hook", "is", "a", "string", "convert", "it", "to", "Service", "method", "calling", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/action-hook.js#L35-L49
4,787
moleculerjs/moleculer
src/serializers/index.js
resolve
function resolve(opt) { if (opt instanceof Serializers.Base) { return opt; } else if (_.isString(opt)) { let SerializerClass = getByName(opt); if (SerializerClass) return new SerializerClass(); else throw new BrokerOptionsError(`Invalid serializer type '${opt}'.`, { type: opt }); } else if (_.isObject...
javascript
function resolve(opt) { if (opt instanceof Serializers.Base) { return opt; } else if (_.isString(opt)) { let SerializerClass = getByName(opt); if (SerializerClass) return new SerializerClass(); else throw new BrokerOptionsError(`Invalid serializer type '${opt}'.`, { type: opt }); } else if (_.isObject...
[ "function", "resolve", "(", "opt", ")", "{", "if", "(", "opt", "instanceof", "Serializers", ".", "Base", ")", "{", "return", "opt", ";", "}", "else", "if", "(", "_", ".", "isString", "(", "opt", ")", ")", "{", "let", "SerializerClass", "=", "getByNam...
Resolve serializer by name @param {object|string} opt @returns {Serializer} @memberof ServiceBroker
[ "Resolve", "serializer", "by", "name" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/index.js#L39-L58
4,788
moleculerjs/moleculer
src/middlewares/bulkhead.js
callNext
function callNext() { /* istanbul ignore next */ if (queue.length == 0) return; /* istanbul ignore next */ if (currentInFlight >= opts.concurrency) return; const item = queue.shift(); currentInFlight++; handler(item.ctx) .then(res => { currentInFlight--; item.resolve(res); cal...
javascript
function callNext() { /* istanbul ignore next */ if (queue.length == 0) return; /* istanbul ignore next */ if (currentInFlight >= opts.concurrency) return; const item = queue.shift(); currentInFlight++; handler(item.ctx) .then(res => { currentInFlight--; item.resolve(res); cal...
[ "function", "callNext", "(", ")", "{", "/* istanbul ignore next */", "if", "(", "queue", ".", "length", "==", "0", ")", "return", ";", "/* istanbul ignore next */", "if", "(", "currentInFlight", ">=", "opts", ".", "concurrency", ")", "return", ";", "const", "i...
Call the next request from the queue
[ "Call", "the", "next", "request", "from", "the", "queue" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/bulkhead.js#L19-L40
4,789
moleculerjs/moleculer
src/errors.js
recreateError
function recreateError(err) { const Class = module.exports[err.name]; if (Class) { switch(err.name) { case "MoleculerError": return new Class(err.message, err.code, err.type, err.data); case "MoleculerRetryableError": return new Class(err.message, err.code, err.type, err.data); case "MoleculerServerError":...
javascript
function recreateError(err) { const Class = module.exports[err.name]; if (Class) { switch(err.name) { case "MoleculerError": return new Class(err.message, err.code, err.type, err.data); case "MoleculerRetryableError": return new Class(err.message, err.code, err.type, err.data); case "MoleculerServerError":...
[ "function", "recreateError", "(", "err", ")", "{", "const", "Class", "=", "module", ".", "exports", "[", "err", ".", "name", "]", ";", "if", "(", "Class", ")", "{", "switch", "(", "err", ".", "name", ")", "{", "case", "\"MoleculerError\"", ":", "retu...
Recreate an error from a transferred payload `err` @param {Error} err @returns {MoleculerError}
[ "Recreate", "an", "error", "from", "a", "transferred", "payload", "err" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/errors.js#L370-L396
4,790
moleculerjs/moleculer
dev/param-mixin.js
paramConverterMiddleware
function paramConverterMiddleware(handler, action) { function convertProperties(obj, schema) { Object.keys(schema).forEach(key => { const s = schema[key]; const val = obj[key]; if (val == null) return; if (s.type == "string" && typeof val !== "string") { obj[key] = "" + val; } else if (s.typ...
javascript
function paramConverterMiddleware(handler, action) { function convertProperties(obj, schema) { Object.keys(schema).forEach(key => { const s = schema[key]; const val = obj[key]; if (val == null) return; if (s.type == "string" && typeof val !== "string") { obj[key] = "" + val; } else if (s.typ...
[ "function", "paramConverterMiddleware", "(", "handler", ",", "action", ")", "{", "function", "convertProperties", "(", "obj", ",", "schema", ")", "{", "Object", ".", "keys", "(", "schema", ")", ".", "forEach", "(", "key", "=>", "{", "const", "s", "=", "s...
Proof-of-Concept middleware to convert context params @param {Function} handler @param {Action} action
[ "Proof", "-", "of", "-", "Concept", "middleware", "to", "convert", "context", "params" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/dev/param-mixin.js#L10-L41
4,791
moleculerjs/moleculer
benchmark/suites/transporters.js
createBrokers
function createBrokers(transporter) { let b1 = new ServiceBroker({ transporter, //requestTimeout: 0, logger: false, //logLevel: "debug", nodeID: "node-1" }); let b2 = new ServiceBroker({ transporter, //requestTimeout: 0, logger: false, //logLevel: "debug", nodeID: "node-2" }); b2.createServic...
javascript
function createBrokers(transporter) { let b1 = new ServiceBroker({ transporter, //requestTimeout: 0, logger: false, //logLevel: "debug", nodeID: "node-1" }); let b2 = new ServiceBroker({ transporter, //requestTimeout: 0, logger: false, //logLevel: "debug", nodeID: "node-2" }); b2.createServic...
[ "function", "createBrokers", "(", "transporter", ")", "{", "let", "b1", "=", "new", "ServiceBroker", "(", "{", "transporter", ",", "//requestTimeout: 0,", "logger", ":", "false", ",", "//logLevel: \"debug\",", "nodeID", ":", "\"node-1\"", "}", ")", ";", "let", ...
, "150", "1k", "10k", "50k", "100k", "1M"];
[ "150", "1k", "10k", "50k", "100k", "1M", "]", ";" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/benchmark/suites/transporters.js#L14-L44
4,792
moleculerjs/moleculer
bin/moleculer-runner.js
processFlags
function processFlags() { Args .option("config", "Load the configuration from a file") .option("repl", "Start REPL mode", false) .option(["H", "hot"], "Hot reload services if changed", false) .option("silent", "Silent mode. No logger", false) .option("env", "Load .env file from the current directory") .opt...
javascript
function processFlags() { Args .option("config", "Load the configuration from a file") .option("repl", "Start REPL mode", false) .option(["H", "hot"], "Hot reload services if changed", false) .option("silent", "Silent mode. No logger", false) .option("env", "Load .env file from the current directory") .opt...
[ "function", "processFlags", "(", ")", "{", "Args", ".", "option", "(", "\"config\"", ",", "\"Load the configuration from a file\"", ")", ".", "option", "(", "\"repl\"", ",", "\"Start REPL mode\"", ",", "false", ")", ".", "option", "(", "[", "\"H\"", ",", "\"ho...
Process command line arguments Available options: -c, --config Load the configuration from a file -e, --env Load .env file from the current directory -E, --envfile Load a specified .env file -h, --help Output usage information -H, --hot Hot reload services if changed (disabled by default) -i...
[ "Process", "command", "line", "arguments" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L67-L96
4,793
moleculerjs/moleculer
bin/moleculer-runner.js
loadEnvFile
function loadEnvFile() { if (flags.env || flags.envfile) { try { const dotenv = require("dotenv"); if (flags.envfile) dotenv.config({ path: flags.envfile }); else dotenv.config(); } catch(err) { throw new Error("The 'dotenv' package is missing! Please install it with 'npm install dotenv --save...
javascript
function loadEnvFile() { if (flags.env || flags.envfile) { try { const dotenv = require("dotenv"); if (flags.envfile) dotenv.config({ path: flags.envfile }); else dotenv.config(); } catch(err) { throw new Error("The 'dotenv' package is missing! Please install it with 'npm install dotenv --save...
[ "function", "loadEnvFile", "(", ")", "{", "if", "(", "flags", ".", "env", "||", "flags", ".", "envfile", ")", "{", "try", "{", "const", "dotenv", "=", "require", "(", "\"dotenv\"", ")", ";", "if", "(", "flags", ".", "envfile", ")", "dotenv", ".", "...
Load environment variables from '.env' file
[ "Load", "environment", "variables", "from", ".", "env", "file" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L101-L114
4,794
moleculerjs/moleculer
bin/moleculer-runner.js
mergeOptions
function mergeOptions() { config = _.defaultsDeep(configFile, Moleculer.ServiceBroker.defaultOptions); if (config.logger == null && !flags.silent) config.logger = console; function normalizeEnvValue(value) { if (value.toLowerCase() === "true" || value.toLowerCase() === "false") { // Convert to boolean va...
javascript
function mergeOptions() { config = _.defaultsDeep(configFile, Moleculer.ServiceBroker.defaultOptions); if (config.logger == null && !flags.silent) config.logger = console; function normalizeEnvValue(value) { if (value.toLowerCase() === "true" || value.toLowerCase() === "false") { // Convert to boolean va...
[ "function", "mergeOptions", "(", ")", "{", "config", "=", "_", ".", "defaultsDeep", "(", "configFile", ",", "Moleculer", ".", "ServiceBroker", ".", "defaultOptions", ")", ";", "if", "(", "config", ".", "logger", "==", "null", "&&", "!", "flags", ".", "si...
Merge broker options Merge options from environment variables and config file. First load the config file if exists. After it overwrite the vars from the environment values. Example options: Original broker option: `logLevel` Config file property: `logLevel` Env variable: `LOGLEVEL` Original broker option: `circ...
[ "Merge", "broker", "options" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L172-L243
4,795
moleculerjs/moleculer
bin/moleculer-runner.js
loadServices
function loadServices() { const fileMask = flags.mask || "**/*.service.js"; const serviceDir = process.env.SERVICEDIR || ""; const svcDir = path.isAbsolute(serviceDir) ? serviceDir : path.resolve(process.cwd(), serviceDir); let patterns = servicePaths; if (process.env.SERVICES || process.env.SERVICEDIR) { if...
javascript
function loadServices() { const fileMask = flags.mask || "**/*.service.js"; const serviceDir = process.env.SERVICEDIR || ""; const svcDir = path.isAbsolute(serviceDir) ? serviceDir : path.resolve(process.cwd(), serviceDir); let patterns = servicePaths; if (process.env.SERVICES || process.env.SERVICEDIR) { if...
[ "function", "loadServices", "(", ")", "{", "const", "fileMask", "=", "flags", ".", "mask", "||", "\"**/*.service.js\"", ";", "const", "serviceDir", "=", "process", ".", "env", ".", "SERVICEDIR", "||", "\"\"", ";", "const", "svcDir", "=", "path", ".", "isAb...
Load services from files or directories 1. If find `SERVICEDIR` env var and not find `SERVICES` env var, load all services from the `SERVICEDIR` directory 2. If find `SERVICEDIR` env var and `SERVICES` env var, load the specified services from the `SERVICEDIR` directory 3. If not find `SERVICEDIR` env var but find `SE...
[ "Load", "services", "from", "files", "or", "directories" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L292-L354
4,796
moleculerjs/moleculer
bin/moleculer-runner.js
startBroker
function startBroker() { let worker = cluster.worker; if (worker) { Object.assign(config, { nodeID: (config.nodeID || utils.getNodeID()) + "-" + worker.id }); } // Create service broker broker = new Moleculer.ServiceBroker(Object.assign({}, config)); loadServices(); return broker.start() .then(() =>...
javascript
function startBroker() { let worker = cluster.worker; if (worker) { Object.assign(config, { nodeID: (config.nodeID || utils.getNodeID()) + "-" + worker.id }); } // Create service broker broker = new Moleculer.ServiceBroker(Object.assign({}, config)); loadServices(); return broker.start() .then(() =>...
[ "function", "startBroker", "(", ")", "{", "let", "worker", "=", "cluster", ".", "worker", ";", "if", "(", "worker", ")", "{", "Object", ".", "assign", "(", "config", ",", "{", "nodeID", ":", "(", "config", ".", "nodeID", "||", "utils", ".", "getNodeI...
Start Moleculer broker
[ "Start", "Moleculer", "broker" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/bin/moleculer-runner.js#L410-L429
4,797
moleculerjs/moleculer
src/middlewares/circuit-breaker.js
resetStore
function resetStore() { if (!logger) return; logger.debug("Reset circuit-breaker endpoint states..."); store.forEach((item, key) => { if (item.count == 0) { logger.debug(`Remove '${key}' endpoint state because it is not used`); store.delete(key); return; } logger.debug(`Clean '${key}' endpo...
javascript
function resetStore() { if (!logger) return; logger.debug("Reset circuit-breaker endpoint states..."); store.forEach((item, key) => { if (item.count == 0) { logger.debug(`Remove '${key}' endpoint state because it is not used`); store.delete(key); return; } logger.debug(`Clean '${key}' endpo...
[ "function", "resetStore", "(", ")", "{", "if", "(", "!", "logger", ")", "return", ";", "logger", ".", "debug", "(", "\"Reset circuit-breaker endpoint states...\"", ")", ";", "store", ".", "forEach", "(", "(", "item", ",", "key", ")", "=>", "{", "if", "("...
Clear endpoint state store
[ "Clear", "endpoint", "state", "store" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L33-L48
4,798
moleculerjs/moleculer
src/middlewares/circuit-breaker.js
getEpState
function getEpState(ep, opts) { let item = store.get(ep.name); if (!item) { item = { ep, opts, count: 0, failures: 0, state: C.CIRCUIT_CLOSE, cbTimer: null }; store.set(ep.name, item); } return item; }
javascript
function getEpState(ep, opts) { let item = store.get(ep.name); if (!item) { item = { ep, opts, count: 0, failures: 0, state: C.CIRCUIT_CLOSE, cbTimer: null }; store.set(ep.name, item); } return item; }
[ "function", "getEpState", "(", "ep", ",", "opts", ")", "{", "let", "item", "=", "store", ".", "get", "(", "ep", ".", "name", ")", ";", "if", "(", "!", "item", ")", "{", "item", "=", "{", "ep", ",", "opts", ",", "count", ":", "0", ",", "failur...
Get Endpoint state from store. If not exists, create it. @param {Endpoint} ep @param {Object} opts @returns {Object}
[ "Get", "Endpoint", "state", "from", "store", ".", "If", "not", "exists", "create", "it", "." ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L57-L71
4,799
moleculerjs/moleculer
src/middlewares/circuit-breaker.js
failure
function failure(item, err, ctx) { item.count++; item.failures++; checkThreshold(item, ctx); }
javascript
function failure(item, err, ctx) { item.count++; item.failures++; checkThreshold(item, ctx); }
[ "function", "failure", "(", "item", ",", "err", ",", "ctx", ")", "{", "item", ".", "count", "++", ";", "item", ".", "failures", "++", ";", "checkThreshold", "(", "item", ",", "ctx", ")", ";", "}" ]
Increment failure counter @param {Object} item @param {Error} err @param {Context} ctx
[ "Increment", "failure", "counter" ]
f95aadc2d61b0d0e3c643a43c3ed28bca6425cde
https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/middlewares/circuit-breaker.js#L80-L85