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
16,100
antonmedv/monkberry
monkberry.js
transformArray
function transformArray(array, keys, i, options) { if (options) { var t = {__index__: i}; t[options.value] = array[i]; if (options.key) { t[options.key] = i; } return t; } else { return array[i]; } }
javascript
function transformArray(array, keys, i, options) { if (options) { var t = {__index__: i}; t[options.value] = array[i]; if (options.key) { t[options.key] = i; } return t; } else { return array[i]; } }
[ "function", "transformArray", "(", "array", ",", "keys", ",", "i", ",", "options", ")", "{", "if", "(", "options", ")", "{", "var", "t", "=", "{", "__index__", ":", "i", "}", ";", "t", "[", "options", ".", "value", "]", "=", "array", "[", "i", ...
Helper function for working with foreach loops data. Will transform data for "key, value of array" constructions.
[ "Helper", "function", "for", "working", "with", "foreach", "loops", "data", ".", "Will", "transform", "data", "for", "key", "value", "of", "array", "constructions", "." ]
f9590fe6cd31a1395f12bb3f4f8af50ab7e70e3e
https://github.com/antonmedv/monkberry/blob/f9590fe6cd31a1395f12bb3f4f8af50ab7e70e3e/monkberry.js#L357-L370
16,101
antonmedv/monkberry
src/compiler/unsafe.js
unsafe
function unsafe(root, nodes, html) { var node, j, i = nodes.length, element = document.createElement('div'); element.innerHTML = html; while (i --> 0) nodes[i].parentNode.removeChild(nodes.pop()); for (i = j = element.childNodes.length - 1; j >= 0; j--) nodes.push(element.childNodes[j]); ++i; if ...
javascript
function unsafe(root, nodes, html) { var node, j, i = nodes.length, element = document.createElement('div'); element.innerHTML = html; while (i --> 0) nodes[i].parentNode.removeChild(nodes.pop()); for (i = j = element.childNodes.length - 1; j >= 0; j--) nodes.push(element.childNodes[j]); ++i; if ...
[ "function", "unsafe", "(", "root", ",", "nodes", ",", "html", ")", "{", "var", "node", ",", "j", ",", "i", "=", "nodes", ".", "length", ",", "element", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "element", ".", "innerHTML", "=", ...
This function is being used for unsafe `innerHTML` insertion of HTML into DOM. Code looks strange. I know. But it is possible minimalistic implementation of. @param root {Element} Node there to insert unsafe html. @param nodes {Array} List of already inserted html nodes for remove. @param html {string} Unsafe html to ...
[ "This", "function", "is", "being", "used", "for", "unsafe", "innerHTML", "insertion", "of", "HTML", "into", "DOM", ".", "Code", "looks", "strange", ".", "I", "know", ".", "But", "it", "is", "possible", "minimalistic", "implementation", "of", "." ]
f9590fe6cd31a1395f12bb3f4f8af50ab7e70e3e
https://github.com/antonmedv/monkberry/blob/f9590fe6cd31a1395f12bb3f4f8af50ab7e70e3e/src/compiler/unsafe.js#L55-L77
16,102
macbre/phantomas
bin/phantomas.js
task
function task(callback) { // spawn phantomas process var child = phantomas(url, options, function(err, data, results) { callback( null, // pass null even in case of an error to continue async.series processing (issue #380) [err, results] ); }); child.on('progress', function(progress, inc) { if (bar) { ...
javascript
function task(callback) { // spawn phantomas process var child = phantomas(url, options, function(err, data, results) { callback( null, // pass null even in case of an error to continue async.series processing (issue #380) [err, results] ); }); child.on('progress', function(progress, inc) { if (bar) { ...
[ "function", "task", "(", "callback", ")", "{", "// spawn phantomas process", "var", "child", "=", "phantomas", "(", "url", ",", "options", ",", "function", "(", "err", ",", "data", ",", "results", ")", "{", "callback", "(", "null", ",", "// pass null even in...
perform a single run
[ "perform", "a", "single", "run" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/bin/phantomas.js#L146-L163
16,103
macbre/phantomas
core/scope.js
function(node, callback, depth) { if (this.isSkipped(node)) { return; } var childNode, childNodes = node && node.childNodes || []; depth = (depth || 1); for (var n = 0, len = childNodes.length; n < len; n++) { childNode = childNodes[n]; // callback can return false to stop recursive ...
javascript
function(node, callback, depth) { if (this.isSkipped(node)) { return; } var childNode, childNodes = node && node.childNodes || []; depth = (depth || 1); for (var n = 0, len = childNodes.length; n < len; n++) { childNode = childNodes[n]; // callback can return false to stop recursive ...
[ "function", "(", "node", ",", "callback", ",", "depth", ")", "{", "if", "(", "this", ".", "isSkipped", "(", "node", ")", ")", "{", "return", ";", "}", "var", "childNode", ",", "childNodes", "=", "node", "&&", "node", ".", "childNodes", "||", "[", "...
call callback for each child of node
[ "call", "callback", "for", "each", "child", "of", "node" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/scope.js#L25-L43
16,104
macbre/phantomas
core/scope.js
spyGlobalVar
function spyGlobalVar(varName, callback) { phantomas.log('spy: attaching to %s global variable', varName); window.__defineSetter__(varName, function(val) { phantomas.log('spy: %s global variable has been defined', varName); spiedGlobals[varName] = val; callback(val); }); window.__defineGetter...
javascript
function spyGlobalVar(varName, callback) { phantomas.log('spy: attaching to %s global variable', varName); window.__defineSetter__(varName, function(val) { phantomas.log('spy: %s global variable has been defined', varName); spiedGlobals[varName] = val; callback(val); }); window.__defineGetter...
[ "function", "spyGlobalVar", "(", "varName", ",", "callback", ")", "{", "phantomas", ".", "log", "(", "'spy: attaching to %s global variable'", ",", "varName", ")", ";", "window", ".", "__defineSetter__", "(", "varName", ",", "function", "(", "val", ")", "{", "...
call given callback when "varName" global variable is being defined used by jQuery module
[ "call", "given", "callback", "when", "varName", "global", "variable", "is", "being", "defined", "used", "by", "jQuery", "module" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/scope.js#L220-L234
16,105
macbre/phantomas
modules/requestsStats/requestsStats.js
pushToStack
function pushToStack(type, entry, check) { // no entry of given type if (typeof stack[type] === 'undefined') { stack[type] = entry; } // apply check function else if (check(stack[type], entry) === true) { stack[type] = entry; } }
javascript
function pushToStack(type, entry, check) { // no entry of given type if (typeof stack[type] === 'undefined') { stack[type] = entry; } // apply check function else if (check(stack[type], entry) === true) { stack[type] = entry; } }
[ "function", "pushToStack", "(", "type", ",", "entry", ",", "check", ")", "{", "// no entry of given type", "if", "(", "typeof", "stack", "[", "type", "]", "===", "'undefined'", ")", "{", "stack", "[", "type", "]", "=", "entry", ";", "}", "// apply check fu...
adds given entry under the "type" if given check function returns true
[ "adds", "given", "entry", "under", "the", "type", "if", "given", "check", "function", "returns", "true" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/modules/requestsStats/requestsStats.js#L21-L30
16,106
macbre/phantomas
core/results.js
function(name, value) { if (typeof metricsAvgStorage[name] === 'undefined') { metricsAvgStorage[name] = []; } metricsAvgStorage[name].push(value); this.setMetric(name, getAverage(metricsAvgStorage[name])); }
javascript
function(name, value) { if (typeof metricsAvgStorage[name] === 'undefined') { metricsAvgStorage[name] = []; } metricsAvgStorage[name].push(value); this.setMetric(name, getAverage(metricsAvgStorage[name])); }
[ "function", "(", "name", ",", "value", ")", "{", "if", "(", "typeof", "metricsAvgStorage", "[", "name", "]", "===", "'undefined'", ")", "{", "metricsAvgStorage", "[", "name", "]", "=", "[", "]", ";", "}", "metricsAvgStorage", "[", "name", "]", ".", "pu...
push a value and update the metric if the current average value
[ "push", "a", "value", "and", "update", "the", "metric", "if", "the", "current", "average", "value" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/results.js#L49-L57
16,107
macbre/phantomas
extensions/har/har.js
createHAR
function createHAR(page, creator) { // @see: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html var address = page.address; var title = page.title; var startTime = page.startTime; var resources = page.resources; var entries = []; resources.forEach(function(resource) { var request = resource....
javascript
function createHAR(page, creator) { // @see: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html var address = page.address; var title = page.title; var startTime = page.startTime; var resources = page.resources; var entries = []; resources.forEach(function(resource) { var request = resource....
[ "function", "createHAR", "(", "page", ",", "creator", ")", "{", "// @see: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html", "var", "address", "=", "page", ".", "address", ";", "var", "title", "=", "page", ".", "title", ";", "var", "startTime", "=...
Inspired by phantomHAR @author: Christopher Van (@cvan) @homepage: https://github.com/cvan/phantomHAR @original: https://github.com/cvan/phantomHAR/blob/master/phantomhar.js
[ "Inspired", "by", "phantomHAR" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/extensions/har/har.js#L17-L102
16,108
macbre/phantomas
core/modules/requestsMonitor/requestsMonitor.js
lowerCaseHeaders
function lowerCaseHeaders(headers) { var res = {}; Object.keys(headers).forEach(headerName => { res[headerName.toLowerCase()] = headers[headerName]; }); return res; }
javascript
function lowerCaseHeaders(headers) { var res = {}; Object.keys(headers).forEach(headerName => { res[headerName.toLowerCase()] = headers[headerName]; }); return res; }
[ "function", "lowerCaseHeaders", "(", "headers", ")", "{", "var", "res", "=", "{", "}", ";", "Object", ".", "keys", "(", "headers", ")", ".", "forEach", "(", "headerName", "=>", "{", "res", "[", "headerName", ".", "toLowerCase", "(", ")", "]", "=", "h...
Given key-value set of HTTP headers returns the set with lowercased header names @param {object} headers @returns {object}
[ "Given", "key", "-", "value", "set", "of", "HTTP", "headers", "returns", "the", "set", "with", "lowercased", "header", "names" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/modules/requestsMonitor/requestsMonitor.js#L15-L23
16,109
macbre/phantomas
core/modules/requestsMonitor/requestsMonitor.js
parseEntryUrl
function parseEntryUrl(entry) { const parseUrl = require('url').parse; var parsed; // asset type entry.type = 'other'; if (entry.url.indexOf('data:') !== 0) { // @see http://nodejs.org/api/url.html#url_url parsed = parseUrl(entry.url) || {}; entry.protocol = parsed.protocol.replace(':', ''); entry.domai...
javascript
function parseEntryUrl(entry) { const parseUrl = require('url').parse; var parsed; // asset type entry.type = 'other'; if (entry.url.indexOf('data:') !== 0) { // @see http://nodejs.org/api/url.html#url_url parsed = parseUrl(entry.url) || {}; entry.protocol = parsed.protocol.replace(':', ''); entry.domai...
[ "function", "parseEntryUrl", "(", "entry", ")", "{", "const", "parseUrl", "=", "require", "(", "'url'", ")", ".", "parse", ";", "var", "parsed", ";", "// asset type", "entry", ".", "type", "=", "'other'", ";", "if", "(", "entry", ".", "url", ".", "inde...
parse given URL to get protocol and domain
[ "parse", "given", "URL", "to", "get", "protocol", "and", "domain" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/modules/requestsMonitor/requestsMonitor.js#L26-L53
16,110
macbre/phantomas
core/modules/requestsMonitor/requestsMonitor.js
addContentType
function addContentType(headerValue, entry) { var value = headerValue.split(';').shift().toLowerCase(); entry.contentType = value; switch(value) { case 'text/html': entry.type = 'html'; entry.isHTML = true; break; case 'text/xml': entry.type = 'xml'; entry.isXML = true; break; case 'text/c...
javascript
function addContentType(headerValue, entry) { var value = headerValue.split(';').shift().toLowerCase(); entry.contentType = value; switch(value) { case 'text/html': entry.type = 'html'; entry.isHTML = true; break; case 'text/xml': entry.type = 'xml'; entry.isXML = true; break; case 'text/c...
[ "function", "addContentType", "(", "headerValue", ",", "entry", ")", "{", "var", "value", "=", "headerValue", ".", "split", "(", "';'", ")", ".", "shift", "(", ")", ".", "toLowerCase", "(", ")", ";", "entry", ".", "contentType", "=", "value", ";", "swi...
Detect response content type using "Content-Type header value" @param {string} headerValue @param {object} entry
[ "Detect", "response", "content", "type", "using", "Content", "-", "Type", "header", "value" ]
ce56cdacabba1ab0672389e4e4a83b4e5ead0582
https://github.com/macbre/phantomas/blob/ce56cdacabba1ab0672389e4e4a83b4e5ead0582/core/modules/requestsMonitor/requestsMonitor.js#L61-L153
16,111
elderfo/react-native-storybook-loader
src/paths/multiResolver.js
hasConfigSetting
function hasConfigSetting(pkg, setting) { return pkg.config && pkg.config[appName] && pkg.config[appName][setting]; }
javascript
function hasConfigSetting(pkg, setting) { return pkg.config && pkg.config[appName] && pkg.config[appName][setting]; }
[ "function", "hasConfigSetting", "(", "pkg", ",", "setting", ")", "{", "return", "pkg", ".", "config", "&&", "pkg", ".", "config", "[", "appName", "]", "&&", "pkg", ".", "config", "[", "appName", "]", "[", "setting", "]", ";", "}" ]
Verifies if the specified setting exists. Returns true if the setting exists, otherwise false. @param {object} pkg the contents of the package.json in object form. @param {string} setting Name of the setting to look for
[ "Verifies", "if", "the", "specified", "setting", "exists", ".", "Returns", "true", "if", "the", "setting", "exists", "otherwise", "false", "." ]
206d632682098ba5cbfa9c45fd0e2c20580e980b
https://github.com/elderfo/react-native-storybook-loader/blob/206d632682098ba5cbfa9c45fd0e2c20580e980b/src/paths/multiResolver.js#L29-L31
16,112
elderfo/react-native-storybook-loader
src/paths/multiResolver.js
getConfigSetting
function getConfigSetting(pkg, setting, ensureArray) { if (!hasConfigSetting(pkg, setting)) { return null; } const value = pkg.config[appName][setting]; if (ensureArray && !Array.isArray(value)) { return [value]; } return value; }
javascript
function getConfigSetting(pkg, setting, ensureArray) { if (!hasConfigSetting(pkg, setting)) { return null; } const value = pkg.config[appName][setting]; if (ensureArray && !Array.isArray(value)) { return [value]; } return value; }
[ "function", "getConfigSetting", "(", "pkg", ",", "setting", ",", "ensureArray", ")", "{", "if", "(", "!", "hasConfigSetting", "(", "pkg", ",", "setting", ")", ")", "{", "return", "null", ";", "}", "const", "value", "=", "pkg", ".", "config", "[", "appN...
Gets the value for the specified setting if the setting exists, otherwise null @param {object} pkg pkg the contents of the package.json in object form. @param {string} setting setting Name of the setting to look for @param {bool} ensureArray flag denoting whether to ensure the setting is an array
[ "Gets", "the", "value", "for", "the", "specified", "setting", "if", "the", "setting", "exists", "otherwise", "null" ]
206d632682098ba5cbfa9c45fd0e2c20580e980b
https://github.com/elderfo/react-native-storybook-loader/blob/206d632682098ba5cbfa9c45fd0e2c20580e980b/src/paths/multiResolver.js#L39-L50
16,113
elderfo/react-native-storybook-loader
src/paths/multiResolver.js
getConfigSettings
function getConfigSettings(packageJsonFile) { // Locate and read package.json const pkg = JSON.parse(fs.readFileSync(packageJsonFile)); return { searchDir: getConfigSetting(pkg, 'searchDir', true) || getDefaultValue('searchDir'), outputFile: getConfigSetting(pkg, 'outputFile') || getDefaultVa...
javascript
function getConfigSettings(packageJsonFile) { // Locate and read package.json const pkg = JSON.parse(fs.readFileSync(packageJsonFile)); return { searchDir: getConfigSetting(pkg, 'searchDir', true) || getDefaultValue('searchDir'), outputFile: getConfigSetting(pkg, 'outputFile') || getDefaultVa...
[ "function", "getConfigSettings", "(", "packageJsonFile", ")", "{", "// Locate and read package.json", "const", "pkg", "=", "JSON", ".", "parse", "(", "fs", ".", "readFileSync", "(", "packageJsonFile", ")", ")", ";", "return", "{", "searchDir", ":", "getConfigSetti...
Parses the package.json file and returns a config object @param {string} packageJsonFile Path to the package.json file
[ "Parses", "the", "package", ".", "json", "file", "and", "returns", "a", "config", "object" ]
206d632682098ba5cbfa9c45fd0e2c20580e980b
https://github.com/elderfo/react-native-storybook-loader/blob/206d632682098ba5cbfa9c45fd0e2c20580e980b/src/paths/multiResolver.js#L56-L67
16,114
dwmkerr/angular-modal-service
src/angular-modal-service.js
function (template, templateUrl) { var deferred = $q.defer(); if (template) { deferred.resolve(template); } else if (templateUrl) { $templateRequest(templateUrl, true) .then(function (...
javascript
function (template, templateUrl) { var deferred = $q.defer(); if (template) { deferred.resolve(template); } else if (templateUrl) { $templateRequest(templateUrl, true) .then(function (...
[ "function", "(", "template", ",", "templateUrl", ")", "{", "var", "deferred", "=", "$q", ".", "defer", "(", ")", ";", "if", "(", "template", ")", "{", "deferred", ".", "resolve", "(", "template", ")", ";", "}", "else", "if", "(", "templateUrl", ")", ...
Returns a promise which gets the template, either from the template parameter or via a request to the template url parameter.
[ "Returns", "a", "promise", "which", "gets", "the", "template", "either", "from", "the", "template", "parameter", "or", "via", "a", "request", "to", "the", "template", "url", "parameter", "." ]
4c2a146514c37d43c73f8454ebcba60368ae89c0
https://github.com/dwmkerr/angular-modal-service/blob/4c2a146514c37d43c73f8454ebcba60368ae89c0/src/angular-modal-service.js#L29-L44
16,115
springernature/boomcatch
client/boomerang-rt.js
function(ev) { if (!ev) { ev = w.event; } if (!ev) { ev = { name: "load" }; } if(impl.onloadfired) { return this; } impl.fireEvent("page_ready", ev); impl.onloadfired = true; return this; }
javascript
function(ev) { if (!ev) { ev = w.event; } if (!ev) { ev = { name: "load" }; } if(impl.onloadfired) { return this; } impl.fireEvent("page_ready", ev); impl.onloadfired = true; return this; }
[ "function", "(", "ev", ")", "{", "if", "(", "!", "ev", ")", "{", "ev", "=", "w", ".", "event", ";", "}", "if", "(", "!", "ev", ")", "{", "ev", "=", "{", "name", ":", "\"load\"", "}", ";", "}", "if", "(", "impl", ".", "onloadfired", ")", "...
The page dev calls this method when they determine the page is usable. Only call this if autorun is explicitly set to false
[ "The", "page", "dev", "calls", "this", "method", "when", "they", "determine", "the", "page", "is", "usable", ".", "Only", "call", "this", "if", "autorun", "is", "explicitly", "set", "to", "false" ]
5653b382c01de7cdf22553738e87a492343f9ac4
https://github.com/springernature/boomcatch/blob/5653b382c01de7cdf22553738e87a492343f9ac4/client/boomerang-rt.js#L816-L825
16,116
springernature/boomcatch
client/boomerang-rt.js
function() { var res, k, urls, url, startTime, data; function trimTiming(time, st) { // strip from microseconds to milliseconds only var timeMs = Math.round(time ? time : 0), startTimeMs = Math.round(st ? st : 0); timeMs = (timeMs === 0 ? 0 : (timeMs - startTimeMs)); return timeMs ? timeMs : "...
javascript
function() { var res, k, urls, url, startTime, data; function trimTiming(time, st) { // strip from microseconds to milliseconds only var timeMs = Math.round(time ? time : 0), startTimeMs = Math.round(st ? st : 0); timeMs = (timeMs === 0 ? 0 : (timeMs - startTimeMs)); return timeMs ? timeMs : "...
[ "function", "(", ")", "{", "var", "res", ",", "k", ",", "urls", ",", "url", ",", "startTime", ",", "data", ";", "function", "trimTiming", "(", "time", ",", "st", ")", "{", "// strip from microseconds to milliseconds only", "var", "timeMs", "=", "Math", "."...
Figure out how long boomerang and config.js took to load using resource timing if available, or built in timestamps
[ "Figure", "out", "how", "long", "boomerang", "and", "config", ".", "js", "took", "to", "load", "using", "resource", "timing", "if", "available", "or", "built", "in", "timestamps" ]
5653b382c01de7cdf22553738e87a492343f9ac4
https://github.com/springernature/boomcatch/blob/5653b382c01de7cdf22553738e87a492343f9ac4/client/boomerang-rt.js#L1341-L1409
16,117
springernature/boomcatch
client/boomerang-rt.js
function() { var ti, p, source; if(this.navigationStart) { return; } // Get start time from WebTiming API see: // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html // http://blogs.msdn.com/b/ie/archive/2010/06/28/measuring-web-page-performance.aspx // http://blog.chromi...
javascript
function() { var ti, p, source; if(this.navigationStart) { return; } // Get start time from WebTiming API see: // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html // http://blogs.msdn.com/b/ie/archive/2010/06/28/measuring-web-page-performance.aspx // http://blog.chromi...
[ "function", "(", ")", "{", "var", "ti", ",", "p", ",", "source", ";", "if", "(", "this", ".", "navigationStart", ")", "{", "return", ";", "}", "// Get start time from WebTiming API see:", "// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html...
Initialise timers from the NavigationTiming API. This method looks at various sources for Navigation Timing, and also patches around bugs in various browser implementations. It sets the beacon parameter `rt.start` to the source of the timer
[ "Initialise", "timers", "from", "the", "NavigationTiming", "API", ".", "This", "method", "looks", "at", "various", "sources", "for", "Navigation", "Timing", "and", "also", "patches", "around", "bugs", "in", "various", "browser", "implementations", ".", "It", "se...
5653b382c01de7cdf22553738e87a492343f9ac4
https://github.com/springernature/boomcatch/blob/5653b382c01de7cdf22553738e87a492343f9ac4/client/boomerang-rt.js#L1447-L1506
16,118
springernature/boomcatch
client/boomerang-rt.js
function(t_now, data) { var t_done = t_now; // xhr beacon with detailed timing information if (data && data.timing && data.timing.loadEventEnd) { t_done = data.timing.loadEventEnd; } // Boomerang loaded late and... else if (BOOMR.loadedLate) { // We have navigation timing, if(w.performance && w.pe...
javascript
function(t_now, data) { var t_done = t_now; // xhr beacon with detailed timing information if (data && data.timing && data.timing.loadEventEnd) { t_done = data.timing.loadEventEnd; } // Boomerang loaded late and... else if (BOOMR.loadedLate) { // We have navigation timing, if(w.performance && w.pe...
[ "function", "(", "t_now", ",", "data", ")", "{", "var", "t_done", "=", "t_now", ";", "// xhr beacon with detailed timing information", "if", "(", "data", "&&", "data", ".", "timing", "&&", "data", ".", "timing", ".", "loadEventEnd", ")", "{", "t_done", "=", ...
Validate that the time we think is the load time is correct. This can be wrong if boomerang was loaded after onload, so in that case, if navigation timing is available, we use that instead.
[ "Validate", "that", "the", "time", "we", "think", "is", "the", "load", "time", "is", "correct", ".", "This", "can", "be", "wrong", "if", "boomerang", "was", "loaded", "after", "onload", "so", "in", "that", "case", "if", "navigation", "timing", "is", "ava...
5653b382c01de7cdf22553738e87a492343f9ac4
https://github.com/springernature/boomcatch/blob/5653b382c01de7cdf22553738e87a492343f9ac4/client/boomerang-rt.js#L1512-L1537
16,119
springernature/boomcatch
client/boomerang-rt.js
function(ename, data) { var t_start; if(ename==="xhr") { if(data && data.name && impl.timers[data.name]) { // For xhr timers, t_start is stored in impl.timers.xhr_{page group name} // and xhr.pg is set to {page group name} t_start = impl.timers[data.name].start; } else if(data && data.timing &&...
javascript
function(ename, data) { var t_start; if(ename==="xhr") { if(data && data.name && impl.timers[data.name]) { // For xhr timers, t_start is stored in impl.timers.xhr_{page group name} // and xhr.pg is set to {page group name} t_start = impl.timers[data.name].start; } else if(data && data.timing &&...
[ "function", "(", "ename", ",", "data", ")", "{", "var", "t_start", ";", "if", "(", "ename", "===", "\"xhr\"", ")", "{", "if", "(", "data", "&&", "data", ".", "name", "&&", "impl", ".", "timers", "[", "data", ".", "name", "]", ")", "{", "// For xh...
Determines the best value to use for t_start. If called from an xhr call, then use the start time for that call Else, If we have navigation timing, use that Else, If we have a cookie time, and this isn't the result of a BACK button, use the cookie time Else, if we have a cached timestamp from an earlier call, use that ...
[ "Determines", "the", "best", "value", "to", "use", "for", "t_start", ".", "If", "called", "from", "an", "xhr", "call", "then", "use", "the", "start", "time", "for", "that", "call", "Else", "If", "we", "have", "navigation", "timing", "use", "that", "Else"...
5653b382c01de7cdf22553738e87a492343f9ac4
https://github.com/springernature/boomcatch/blob/5653b382c01de7cdf22553738e87a492343f9ac4/client/boomerang-rt.js#L1645-L1678
16,120
ember-animation/liquid-fire
addon/constraints.js
intersection
function intersection(sets) { let source = sets[0]; let rest = sets.slice(1); let keys = Object.keys(source); let keysLength = keys.length; let restLength = rest.length; let result = []; for (let keyIndex = 0; keyIndex < keysLength; keyIndex++) { let key = keys[keyIndex]; let matched = true; f...
javascript
function intersection(sets) { let source = sets[0]; let rest = sets.slice(1); let keys = Object.keys(source); let keysLength = keys.length; let restLength = rest.length; let result = []; for (let keyIndex = 0; keyIndex < keysLength; keyIndex++) { let key = keys[keyIndex]; let matched = true; f...
[ "function", "intersection", "(", "sets", ")", "{", "let", "source", "=", "sets", "[", "0", "]", ";", "let", "rest", "=", "sets", ".", "slice", "(", "1", ")", ";", "let", "keys", "=", "Object", ".", "keys", "(", "source", ")", ";", "let", "keysLen...
Returns a list of property values from source whose keys also appear in all of the rest objects.
[ "Returns", "a", "list", "of", "property", "values", "from", "source", "whose", "keys", "also", "appear", "in", "all", "of", "the", "rest", "objects", "." ]
ab0ce05b6db2bd96dedaa1917b68460cf4f71a57
https://github.com/ember-animation/liquid-fire/blob/ab0ce05b6db2bd96dedaa1917b68460cf4f71a57/addon/constraints.js#L187-L208
16,121
ember-animation/liquid-fire
addon/running-transition.js
publicAnimationContext
function publicAnimationContext(rt, versions) { let c = {}; addPublicVersion(c, 'new', versions[0]); if (versions[1]) { addPublicVersion(c, 'old', versions[1]); } c.older = versions.slice(2).map((v) => { let context = {}; addPublicVersion(context, null, v); return context; }); // Animatio...
javascript
function publicAnimationContext(rt, versions) { let c = {}; addPublicVersion(c, 'new', versions[0]); if (versions[1]) { addPublicVersion(c, 'old', versions[1]); } c.older = versions.slice(2).map((v) => { let context = {}; addPublicVersion(context, null, v); return context; }); // Animatio...
[ "function", "publicAnimationContext", "(", "rt", ",", "versions", ")", "{", "let", "c", "=", "{", "}", ";", "addPublicVersion", "(", "c", ",", "'new'", ",", "versions", "[", "0", "]", ")", ";", "if", "(", "versions", "[", "1", "]", ")", "{", "addPu...
This defines the public set of things that user's transition implementations can access as `this`.
[ "This", "defines", "the", "public", "set", "of", "things", "that", "user", "s", "transition", "implementations", "can", "access", "as", "this", "." ]
ab0ce05b6db2bd96dedaa1917b68460cf4f71a57
https://github.com/ember-animation/liquid-fire/blob/ab0ce05b6db2bd96dedaa1917b68460cf4f71a57/addon/running-transition.js#L45-L63
16,122
chuckfairy/node-webcam
src/Webcam.js
function( index, callback ) { var scope = this; var shot = scope.shots[ index|0 ]; if( ! shot ) { throw new Error( "Shot number " + index + " not found" ); return; } return shot; }
javascript
function( index, callback ) { var scope = this; var shot = scope.shots[ index|0 ]; if( ! shot ) { throw new Error( "Shot number " + index + " not found" ); return; } return shot; }
[ "function", "(", "index", ",", "callback", ")", "{", "var", "scope", "=", "this", ";", "var", "shot", "=", "scope", ".", "shots", "[", "index", "|", "0", "]", ";", "if", "(", "!", "shot", ")", "{", "throw", "new", "Error", "(", "\"Shot number \"", ...
Get shot instances from cache index @method getShot @param {Number} shot Index of shots called @param {Function} callback Returns a call from FS.readFile data @throws Error if shot at index not found @return {Boolean}
[ "Get", "shot", "instances", "from", "cache", "index" ]
263d66bbab6ccdfd79e31245ca7aefa8f4ee530c
https://github.com/chuckfairy/node-webcam/blob/263d66bbab6ccdfd79e31245ca7aefa8f4ee530c/src/Webcam.js#L281-L299
16,123
chuckfairy/node-webcam
src/Webcam.js
function( shot, callback ) { var scope = this; if( typeof( shot ) === "number" ) { shot = scope.getShot( shot ); } if( shot.location ) { FS.readFile( shot.location, function( err, data ) { callback( err, data ); }); } e...
javascript
function( shot, callback ) { var scope = this; if( typeof( shot ) === "number" ) { shot = scope.getShot( shot ); } if( shot.location ) { FS.readFile( shot.location, function( err, data ) { callback( err, data ); }); } e...
[ "function", "(", "shot", ",", "callback", ")", "{", "var", "scope", "=", "this", ";", "if", "(", "typeof", "(", "shot", ")", "===", "\"number\"", ")", "{", "shot", "=", "scope", ".", "getShot", "(", "shot", ")", ";", "}", "if", "(", "shot", ".", ...
Get shot buffer from location 0 indexed @method getShotBuffer @param {Number} shot Index of shots called @param {Function} callback Returns a call from FS.readFile data @return {Boolean}
[ "Get", "shot", "buffer", "from", "location", "0", "indexed" ]
263d66bbab6ccdfd79e31245ca7aefa8f4ee530c
https://github.com/chuckfairy/node-webcam/blob/263d66bbab6ccdfd79e31245ca7aefa8f4ee530c/src/Webcam.js#L342-L372
16,124
chuckfairy/node-webcam
src/Webcam.js
function( shot, callback ) { var scope = this; scope.getShotBuffer( shot, function( err, data ) { if( err ) { callback( err ); return; } var base64 = scope.getBase64FromBuffer( data ); callback( null, base64 ); ...
javascript
function( shot, callback ) { var scope = this; scope.getShotBuffer( shot, function( err, data ) { if( err ) { callback( err ); return; } var base64 = scope.getBase64FromBuffer( data ); callback( null, base64 ); ...
[ "function", "(", "shot", ",", "callback", ")", "{", "var", "scope", "=", "this", ";", "scope", ".", "getShotBuffer", "(", "shot", ",", "function", "(", "err", ",", "data", ")", "{", "if", "(", "err", ")", "{", "callback", "(", "err", ")", ";", "r...
Get shot base64 as image if passed Number will return a base 64 in the callback @method getBase64 @param {Number|FS.readFile} shot To be converted @param {Function( Error|null, Mixed )} callback Returns base64 string @return {String} Dont use
[ "Get", "shot", "base64", "as", "image", "if", "passed", "Number", "will", "return", "a", "base", "64", "in", "the", "callback" ]
263d66bbab6ccdfd79e31245ca7aefa8f4ee530c
https://github.com/chuckfairy/node-webcam/blob/263d66bbab6ccdfd79e31245ca7aefa8f4ee530c/src/Webcam.js#L410-L430
16,125
chuckfairy/node-webcam
src/Webcam.js
function( shotBuffer ) { var scope = this; var image = "data:image/" + scope.opts.output + ";base64," + new Buffer( shotBuffer ).toString( "base64" ); return image; }
javascript
function( shotBuffer ) { var scope = this; var image = "data:image/" + scope.opts.output + ";base64," + new Buffer( shotBuffer ).toString( "base64" ); return image; }
[ "function", "(", "shotBuffer", ")", "{", "var", "scope", "=", "this", ";", "var", "image", "=", "\"data:image/\"", "+", "scope", ".", "opts", ".", "output", "+", "\";base64,\"", "+", "new", "Buffer", "(", "shotBuffer", ")", ".", "toString", "(", "\"base6...
Get base64 string from bufer @method getBase64 @param {Number|FS.readFile} shot To be converted @param {Function( Error|null, Mixed )} callback Returns base64 string @return {String} Dont use
[ "Get", "base64", "string", "from", "bufer" ]
263d66bbab6ccdfd79e31245ca7aefa8f4ee530c
https://github.com/chuckfairy/node-webcam/blob/263d66bbab6ccdfd79e31245ca7aefa8f4ee530c/src/Webcam.js#L445-L456
16,126
chuckfairy/node-webcam
src/Webcam.js
function( callback ) { var scope = this; if( ! scope.shots.length ) { callback && callback( new Error( "Camera has no last shot" ) ); } scope.getBase64( scope.shots.length - 1, callback ); }
javascript
function( callback ) { var scope = this; if( ! scope.shots.length ) { callback && callback( new Error( "Camera has no last shot" ) ); } scope.getBase64( scope.shots.length - 1, callback ); }
[ "function", "(", "callback", ")", "{", "var", "scope", "=", "this", ";", "if", "(", "!", "scope", ".", "shots", ".", "length", ")", "{", "callback", "&&", "callback", "(", "new", "Error", "(", "\"Camera has no last shot\"", ")", ")", ";", "}", "scope",...
Get last shot taken base 64 string @method getLastShot64 @param {Function} callback
[ "Get", "last", "shot", "taken", "base", "64", "string" ]
263d66bbab6ccdfd79e31245ca7aefa8f4ee530c
https://github.com/chuckfairy/node-webcam/blob/263d66bbab6ccdfd79e31245ca7aefa8f4ee530c/src/Webcam.js#L468-L480
16,127
ruipgil/scraperjs
src/ScraperPromise.js
function(code, callback) { if (typeof code == 'function') { callback = code; this.promises.push(function onGenericStatusCode(done, utils) { done(null, callback(this.scraper.getStatusCode(), utils)); }); } else { this.promises.push(function onStatusCode(done, utils) { if (code === this.scraper.ge...
javascript
function(code, callback) { if (typeof code == 'function') { callback = code; this.promises.push(function onGenericStatusCode(done, utils) { done(null, callback(this.scraper.getStatusCode(), utils)); }); } else { this.promises.push(function onStatusCode(done, utils) { if (code === this.scraper.ge...
[ "function", "(", "code", ",", "callback", ")", "{", "if", "(", "typeof", "code", "==", "'function'", ")", "{", "callback", "=", "code", ";", "this", ".", "promises", ".", "push", "(", "function", "onGenericStatusCode", "(", "done", ",", "utils", ")", "...
Sets a promise for a status code, of a response of a request. @param {!(number|function(number))} code Status code to dispatch the message. Or a callback function, in this case the function's first parameter is the status code, as a number. @param {!function()} callback Callback function for the case where the statu...
[ "Sets", "a", "promise", "for", "a", "status", "code", "of", "a", "response", "of", "a", "request", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L65-L82
16,128
ruipgil/scraperjs
src/ScraperPromise.js
function(scrapeFn, callback) { var stackTrace = new Error().stack; var extraArguments = Array.prototype.slice.call(arguments, 2); callback = callback || function(result) { return result; }; this.promises.push(function scrape(done, utils) { this.scraper.scrape(scrapeFn, function(err, result) { if (e...
javascript
function(scrapeFn, callback) { var stackTrace = new Error().stack; var extraArguments = Array.prototype.slice.call(arguments, 2); callback = callback || function(result) { return result; }; this.promises.push(function scrape(done, utils) { this.scraper.scrape(scrapeFn, function(err, result) { if (e...
[ "function", "(", "scrapeFn", ",", "callback", ")", "{", "var", "stackTrace", "=", "new", "Error", "(", ")", ".", "stack", ";", "var", "extraArguments", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "2", ")", ";", "...
Sets a promise to scrape the retrieved webpage. @param {!function(?, ?)} scrapeFn Function to scrape the webpage. The parameters depend on what kind of scraper. @param {!function(?)=} callback Callback function with the result of the scraping function. If none is provided, the result can be accessed in the next prom...
[ "Sets", "a", "promise", "to", "scrape", "the", "retrieved", "webpage", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L98-L115
16,129
ruipgil/scraperjs
src/ScraperPromise.js
function(time, callback) { callback = callback || function() {}; this.promises.push(function delay(done, utils) { setTimeout(function() { done(null, callback(utils)); }, time); }); return this; }
javascript
function(time, callback) { callback = callback || function() {}; this.promises.push(function delay(done, utils) { setTimeout(function() { done(null, callback(utils)); }, time); }); return this; }
[ "function", "(", "time", ",", "callback", ")", "{", "callback", "=", "callback", "||", "function", "(", ")", "{", "}", ";", "this", ".", "promises", ".", "push", "(", "function", "delay", "(", "done", ",", "utils", ")", "{", "setTimeout", "(", "funct...
Sets a promise to delay the execution of the promises. @param {!number} time Time in milliseconds to delay the execution. @param {!function()=} callback Function to call after the delay. @return {!ScraperPromise} This object, so that new promises can be made. @public
[ "Sets", "a", "promise", "to", "delay", "the", "execution", "of", "the", "promises", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L127-L135
16,130
ruipgil/scraperjs
src/ScraperPromise.js
function(callback) { this.promises.push(function then(done, utils) { done(null, callback(utils.lastReturn, utils)); }); return this; }
javascript
function(callback) { this.promises.push(function then(done, utils) { done(null, callback(utils.lastReturn, utils)); }); return this; }
[ "function", "(", "callback", ")", "{", "this", ".", "promises", ".", "push", "(", "function", "then", "(", "done", ",", "utils", ")", "{", "done", "(", "null", ",", "callback", "(", "utils", ".", "lastReturn", ",", "utils", ")", ")", ";", "}", ")",...
Sets a generic promise. @param {!function()} callback Callback. @return {!ScraperPromise} This object, so that new promises can be made. @public
[ "Sets", "a", "generic", "promise", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L178-L183
16,131
ruipgil/scraperjs
src/ScraperPromise.js
function(callback) { this.promises.push(function async(done, utils) { callback(utils.lastReturn, done, utils); }); return this; }
javascript
function(callback) { this.promises.push(function async(done, utils) { callback(utils.lastReturn, done, utils); }); return this; }
[ "function", "(", "callback", ")", "{", "this", ".", "promises", ".", "push", "(", "function", "async", "(", "done", ",", "utils", ")", "{", "callback", "(", "utils", ".", "lastReturn", ",", "done", ",", "utils", ")", ";", "}", ")", ";", "return", "...
Stops the promise chain and resumes it after a callback function. @param {!function(!function, !Object)} callback Callback. @return {!ScraperPromise} This object, so that new promises can be made. @public
[ "Stops", "the", "promise", "chain", "and", "resumes", "it", "after", "a", "callback", "function", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L193-L198
16,132
ruipgil/scraperjs
src/ScraperPromise.js
function(error) { var that = this, param = this.chainParameter, stopPointer = {}, utils = { stop: null, url: this.scraper.url, scraper: this, params: param, lastReturn: undefined }, keep = true; this.chainParameter = null; if (error) { this.errorCallback(error, utils); th...
javascript
function(error) { var that = this, param = this.chainParameter, stopPointer = {}, utils = { stop: null, url: this.scraper.url, scraper: this, params: param, lastReturn: undefined }, keep = true; this.chainParameter = null; if (error) { this.errorCallback(error, utils); th...
[ "function", "(", "error", ")", "{", "var", "that", "=", "this", ",", "param", "=", "this", ".", "chainParameter", ",", "stopPointer", "=", "{", "}", ",", "utils", "=", "{", "stop", ":", "null", ",", "url", ":", "this", ".", "scraper", ".", "url", ...
Starts the promise chain. @param {?} error Error object, to fire the error callback, from an error that happened before. @param {!Scraper} scraper Scraper to use in the promise chain. @protected
[ "Starts", "the", "promise", "chain", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L270-L319
16,133
ruipgil/scraperjs
src/ScraperPromise.js
function() { var instance = this.scraper.clone(), promise = new ScraperPromise(instance); promise._setPromises(this.promises); promise.done(this.doneCallback); promise.catch(this.errorCallback); return promise; }
javascript
function() { var instance = this.scraper.clone(), promise = new ScraperPromise(instance); promise._setPromises(this.promises); promise.done(this.doneCallback); promise.catch(this.errorCallback); return promise; }
[ "function", "(", ")", "{", "var", "instance", "=", "this", ".", "scraper", ".", "clone", "(", ")", ",", "promise", "=", "new", "ScraperPromise", "(", "instance", ")", ";", "promise", ".", "_setPromises", "(", "this", ".", "promises", ")", ";", "promise...
Clones the promise and the scraper. @return {!ScraperPromise} Scraper promise with an empty scraper clone. @public
[ "Clones", "the", "promise", "and", "the", "scraper", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/ScraperPromise.js#L336-L343
16,134
ruipgil/scraperjs
src/Router.js
function(path) { var callback; if (typeof path === 'function') { callback = path; } this.promises.push({ callback: callback ? function(url) { return callback(url); } : Router.pathMatcher(path), scraper: null, rqMethod: null }); return this.get(); }
javascript
function(path) { var callback; if (typeof path === 'function') { callback = path; } this.promises.push({ callback: callback ? function(url) { return callback(url); } : Router.pathMatcher(path), scraper: null, rqMethod: null }); return this.get(); }
[ "function", "(", "path", ")", "{", "var", "callback", ";", "if", "(", "typeof", "path", "===", "'function'", ")", "{", "callback", "=", "path", ";", "}", "this", ".", "promises", ".", "push", "(", "{", "callback", ":", "callback", "?", "function", "(...
Promise to url match. It's promise will fire only if the path matches with and url being routed. @param {!(string|RegExp|function(string):?)} path The path or regular expression to match an url. Alternatively a function that receives the url to be matched can be passed. If the result is false, or any !!result===false...
[ "Promise", "to", "url", "match", ".", "It", "s", "promise", "will", "fire", "only", "if", "the", "path", "matches", "with", "and", "url", "being", "routed", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/Router.js#L85-L99
16,135
ruipgil/scraperjs
src/Router.js
function(url, callback) { var that = this, atLeastOne = false, stopFlag = {}, lastReturn; callback = callback || function() {}; async.eachSeries(this.promises, function(promiseObj, done) { var matcher = promiseObj.callback, scraper, reqMethod = promiseObj.rqMethod; var result = matcher(url...
javascript
function(url, callback) { var that = this, atLeastOne = false, stopFlag = {}, lastReturn; callback = callback || function() {}; async.eachSeries(this.promises, function(promiseObj, done) { var matcher = promiseObj.callback, scraper, reqMethod = promiseObj.rqMethod; var result = matcher(url...
[ "function", "(", "url", ",", "callback", ")", "{", "var", "that", "=", "this", ",", "atLeastOne", "=", "false", ",", "stopFlag", "=", "{", "}", ",", "lastReturn", ";", "callback", "=", "callback", "||", "function", "(", ")", "{", "}", ";", "async", ...
Routes a url through every path that matches it. @param {!string} url The url to route. @param {!function(boolean)} callback Function to call when the routing is complete. If any of the paths was found the parameter is true, false otherwise. @return {!Router} This router. @public
[ "Routes", "a", "url", "through", "every", "path", "that", "matches", "it", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/Router.js#L221-L253
16,136
ruipgil/scraperjs
src/PhantomPoll.js
function() { /** * The real PhantomJS instance. * * @type {?} * @private */ this.instance = null; /** * The PhantomJS instance is being created. * * @type {!boolean} * @private */ this.creating = false; /** * PhantomJS flags. * * @type {!string} * @private */ this.flags = ''; /** ...
javascript
function() { /** * The real PhantomJS instance. * * @type {?} * @private */ this.instance = null; /** * The PhantomJS instance is being created. * * @type {!boolean} * @private */ this.creating = false; /** * PhantomJS flags. * * @type {!string} * @private */ this.flags = ''; /** ...
[ "function", "(", ")", "{", "/**\n\t * The real PhantomJS instance.\n\t *\n\t * @type {?}\n\t * @private\n\t */", "this", ".", "instance", "=", "null", ";", "/**\n\t * The PhantomJS instance is being created.\n\t *\n\t * @type {!boolean}\n\t * @private\n\t */", "this", ".", "creating", ...
This maintains only one PhantomJS instance. It works like a proxy between the phantom package, and should expose the methods same methods. An additional call to close the phantomJS instance properly is needed. @constructor
[ "This", "maintains", "only", "one", "PhantomJS", "instance", ".", "It", "works", "like", "a", "proxy", "between", "the", "phantom", "package", "and", "should", "expose", "the", "methods", "same", "methods", ".", "An", "additional", "call", "to", "close", "th...
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/PhantomPoll.js#L11-L52
16,137
ruipgil/scraperjs
src/PhantomPoll.js
function(callback) { if (this.instance) { this.instance.createPage(function(page) { callback(page); }); } else { var that = this; this._createInstance(function() { that.createPage(callback); }); } }
javascript
function(callback) { if (this.instance) { this.instance.createPage(function(page) { callback(page); }); } else { var that = this; this._createInstance(function() { that.createPage(callback); }); } }
[ "function", "(", "callback", ")", "{", "if", "(", "this", ".", "instance", ")", "{", "this", ".", "instance", ".", "createPage", "(", "function", "(", "page", ")", "{", "callback", "(", "page", ")", ";", "}", ")", ";", "}", "else", "{", "var", "t...
Creates a PhantomJS page, to be called with a callback, which will receive the page. @param {!function(?)} callback Function to be called after the page is created, it receives the page object. @public
[ "Creates", "a", "PhantomJS", "page", "to", "be", "called", "with", "a", "callback", "which", "will", "receive", "the", "page", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/PhantomPoll.js#L63-L74
16,138
ruipgil/scraperjs
src/PhantomPoll.js
function(callback) { if (this.creating && callback) { this.waiting.push(callback); } else { var that = this; this.creating = true; phantom.create(this.flags, this.options, function(ph) { that.instance = ph; that.creating = false; that.waiting.forEach(function(callback) { callback(ph); ...
javascript
function(callback) { if (this.creating && callback) { this.waiting.push(callback); } else { var that = this; this.creating = true; phantom.create(this.flags, this.options, function(ph) { that.instance = ph; that.creating = false; that.waiting.forEach(function(callback) { callback(ph); ...
[ "function", "(", "callback", ")", "{", "if", "(", "this", ".", "creating", "&&", "callback", ")", "{", "this", ".", "waiting", ".", "push", "(", "callback", ")", ";", "}", "else", "{", "var", "that", "=", "this", ";", "this", ".", "creating", "=", ...
Creates PhantomJS instance if needed be, and when it's done triggers all the callbacks. @param {!function(?)} callback Function to be called when the instance is created, if a phantom instance is waiting to be created the callback will be added to a waiting list. @private
[ "Creates", "PhantomJS", "instance", "if", "needed", "be", "and", "when", "it", "s", "done", "triggers", "all", "the", "callbacks", "." ]
4ae680b84ffb40bc0b5ee70b00a955ea5368bc18
https://github.com/ruipgil/scraperjs/blob/4ae680b84ffb40bc0b5ee70b00a955ea5368bc18/src/PhantomPoll.js#L99-L114
16,139
mapbox/dyno
lib/requests.js
sendAll
function sendAll(requests, fnName, concurrency, callback) { if (typeof concurrency === 'function') { callback = concurrency; concurrency = 1; } var q = queue(concurrency); requests.forEach(function(req) { q.defer(function(next) { if (!req) return next(); req.on('compl...
javascript
function sendAll(requests, fnName, concurrency, callback) { if (typeof concurrency === 'function') { callback = concurrency; concurrency = 1; } var q = queue(concurrency); requests.forEach(function(req) { q.defer(function(next) { if (!req) return next(); req.on('compl...
[ "function", "sendAll", "(", "requests", ",", "fnName", ",", "concurrency", ",", "callback", ")", "{", "if", "(", "typeof", "concurrency", "===", "'function'", ")", "{", "callback", "=", "concurrency", ";", "concurrency", "=", "1", ";", "}", "var", "q", "...
Given a set of requests, this function sends them all at specified concurrency. Generally, this function is not called directly, but is bound to an array of requests with the first two parameters wired to specific values. @private @param {RequestSet} requests - an array of AWS.Request objects @param {string} fnName - ...
[ "Given", "a", "set", "of", "requests", "this", "function", "sends", "them", "all", "at", "specified", "concurrency", ".", "Generally", "this", "function", "is", "not", "called", "directly", "but", "is", "bound", "to", "an", "array", "of", "requests", "with",...
5f5ae2692b165e480c2ae61d11978ad97a40e3aa
https://github.com/mapbox/dyno/blob/5f5ae2692b165e480c2ae61d11978ad97a40e3aa/lib/requests.js#L22-L80
16,140
mapbox/dyno
bin/cli.js
Stringifier
function Stringifier() { var stringifier = new stream.Transform({ highWaterMark: 100 }); stringifier._writableState.objectMode = true; stringifier._readableState.objectMode = false; stringifier._transform = function(record, enc, callback) { var str = Dyno.serialize(record); this.push(str + '\n'); ...
javascript
function Stringifier() { var stringifier = new stream.Transform({ highWaterMark: 100 }); stringifier._writableState.objectMode = true; stringifier._readableState.objectMode = false; stringifier._transform = function(record, enc, callback) { var str = Dyno.serialize(record); this.push(str + '\n'); ...
[ "function", "Stringifier", "(", ")", "{", "var", "stringifier", "=", "new", "stream", ".", "Transform", "(", "{", "highWaterMark", ":", "100", "}", ")", ";", "stringifier", ".", "_writableState", ".", "objectMode", "=", "true", ";", "stringifier", ".", "_r...
Transform stream to stringifies JSON objects and base64 encodes buffers
[ "Transform", "stream", "to", "stringifies", "JSON", "objects", "and", "base64", "encodes", "buffers" ]
5f5ae2692b165e480c2ae61d11978ad97a40e3aa
https://github.com/mapbox/dyno/blob/5f5ae2692b165e480c2ae61d11978ad97a40e3aa/bin/cli.js#L66-L79
16,141
mapbox/dyno
bin/cli.js
Parser
function Parser() { var parser = new stream.Transform({ highWaterMark: 100 }); parser._writableState.objectMode = false; parser._readableState.objectMode = true; var firstline = true; parser._transform = function(record, enc, callback) { if (!record || record.length === 0) return; if (firstline) { ...
javascript
function Parser() { var parser = new stream.Transform({ highWaterMark: 100 }); parser._writableState.objectMode = false; parser._readableState.objectMode = true; var firstline = true; parser._transform = function(record, enc, callback) { if (!record || record.length === 0) return; if (firstline) { ...
[ "function", "Parser", "(", ")", "{", "var", "parser", "=", "new", "stream", ".", "Transform", "(", "{", "highWaterMark", ":", "100", "}", ")", ";", "parser", ".", "_writableState", ".", "objectMode", "=", "false", ";", "parser", ".", "_readableState", "....
Transform stream parses JSON strings and base64 decodes into buffers
[ "Transform", "stream", "parses", "JSON", "strings", "and", "base64", "decodes", "into", "buffers" ]
5f5ae2692b165e480c2ae61d11978ad97a40e3aa
https://github.com/mapbox/dyno/blob/5f5ae2692b165e480c2ae61d11978ad97a40e3aa/bin/cli.js#L82-L107
16,142
mapbox/dyno
bin/cli.js
cleanDescription
function cleanDescription(desc) { var deleteAttributes = [ 'CreationDateTime', 'IndexSizeBytes', 'IndexStatus', 'ItemCount', 'NumberOfDecreasesToday', 'TableSizeBytes', 'TableStatus', 'LastDecreaseDateTime', 'LastIncreaseDateTime' ]; return JSON.stringify(desc.Table, function(...
javascript
function cleanDescription(desc) { var deleteAttributes = [ 'CreationDateTime', 'IndexSizeBytes', 'IndexStatus', 'ItemCount', 'NumberOfDecreasesToday', 'TableSizeBytes', 'TableStatus', 'LastDecreaseDateTime', 'LastIncreaseDateTime' ]; return JSON.stringify(desc.Table, function(...
[ "function", "cleanDescription", "(", "desc", ")", "{", "var", "deleteAttributes", "=", "[", "'CreationDateTime'", ",", "'IndexSizeBytes'", ",", "'IndexStatus'", ",", "'ItemCount'", ",", "'NumberOfDecreasesToday'", ",", "'TableSizeBytes'", ",", "'TableStatus'", ",", "'...
Remove unimportant table metadata from the description
[ "Remove", "unimportant", "table", "metadata", "from", "the", "description" ]
5f5ae2692b165e480c2ae61d11978ad97a40e3aa
https://github.com/mapbox/dyno/blob/5f5ae2692b165e480c2ae61d11978ad97a40e3aa/bin/cli.js#L110-L129
16,143
mapbox/dyno
bin/cli.js
Aggregator
function Aggregator(withTable) { var firstline = !!withTable; var aggregator = new stream.Transform({ objectMode: true, highWaterMark: 100 }); aggregator.records = []; aggregator._transform = function(record, enc, callback) { if (!record) return; if (firstline) { firstline = false; this.pu...
javascript
function Aggregator(withTable) { var firstline = !!withTable; var aggregator = new stream.Transform({ objectMode: true, highWaterMark: 100 }); aggregator.records = []; aggregator._transform = function(record, enc, callback) { if (!record) return; if (firstline) { firstline = false; this.pu...
[ "function", "Aggregator", "(", "withTable", ")", "{", "var", "firstline", "=", "!", "!", "withTable", ";", "var", "aggregator", "=", "new", "stream", ".", "Transform", "(", "{", "objectMode", ":", "true", ",", "highWaterMark", ":", "100", "}", ")", ";", ...
Transform stream that aggregates into sets of 25 objects
[ "Transform", "stream", "that", "aggregates", "into", "sets", "of", "25", "objects" ]
5f5ae2692b165e480c2ae61d11978ad97a40e3aa
https://github.com/mapbox/dyno/blob/5f5ae2692b165e480c2ae61d11978ad97a40e3aa/bin/cli.js#L142-L168
16,144
hobbyquaker/homematic-manager
www/js/homematic-manager.js
rpcDialogShift
function rpcDialogShift() { if (rpcDialogQueue.length === 0) { $dialogRpc.dialog('close'); return; } rpcDialogPending = true; const {daemon, cmd, params, callback} = rpcDialogQueue.shift(); const paramText = JSON.stringify(JSON.parse(JSON.stringify(params).replace(/{"explicitDouble...
javascript
function rpcDialogShift() { if (rpcDialogQueue.length === 0) { $dialogRpc.dialog('close'); return; } rpcDialogPending = true; const {daemon, cmd, params, callback} = rpcDialogQueue.shift(); const paramText = JSON.stringify(JSON.parse(JSON.stringify(params).replace(/{"explicitDouble...
[ "function", "rpcDialogShift", "(", ")", "{", "if", "(", "rpcDialogQueue", ".", "length", "===", "0", ")", "{", "$dialogRpc", ".", "dialog", "(", "'close'", ")", ";", "return", ";", "}", "rpcDialogPending", "=", "true", ";", "const", "{", "daemon", ",", ...
RPC execution Wrappers
[ "RPC", "execution", "Wrappers" ]
14903c5718006ba4c38b7790b5c9171e0f67bb66
https://github.com/hobbyquaker/homematic-manager/blob/14903c5718006ba4c38b7790b5c9171e0f67bb66/www/js/homematic-manager.js#L4467-L4504
16,145
catamphetamine/universal-webpack
source/client configuration.js
create_extract_css_plugin
function create_extract_css_plugin(css_bundle_filename, useMiniCssExtractPlugin) { if (useMiniCssExtractPlugin) { const MiniCssExtractPlugin = require('mini-css-extract-plugin') return new MiniCssExtractPlugin ({ // Options similar to the same options in webpackOptions.output // both options are optional...
javascript
function create_extract_css_plugin(css_bundle_filename, useMiniCssExtractPlugin) { if (useMiniCssExtractPlugin) { const MiniCssExtractPlugin = require('mini-css-extract-plugin') return new MiniCssExtractPlugin ({ // Options similar to the same options in webpackOptions.output // both options are optional...
[ "function", "create_extract_css_plugin", "(", "css_bundle_filename", ",", "useMiniCssExtractPlugin", ")", "{", "if", "(", "useMiniCssExtractPlugin", ")", "{", "const", "MiniCssExtractPlugin", "=", "require", "(", "'mini-css-extract-plugin'", ")", "return", "new", "MiniCss...
Creates an instance of plugin for extracting styles in a file. Either `extract-text-webpack-plugin` or `mini-css-extract-plugin`.
[ "Creates", "an", "instance", "of", "plugin", "for", "extracting", "styles", "in", "a", "file", ".", "Either", "extract", "-", "text", "-", "webpack", "-", "plugin", "or", "mini", "-", "css", "-", "extract", "-", "plugin", "." ]
3b022b50ed211a135525dcca9fe469a480abec69
https://github.com/catamphetamine/universal-webpack/blob/3b022b50ed211a135525dcca9fe469a480abec69/source/client configuration.js#L146-L170
16,146
catamphetamine/universal-webpack
source/client configuration.js
generate_extract_css_loaders
function generate_extract_css_loaders(after_style_loader, development, extract_css_plugin, useMiniCssExtractPlugin) { let extract_css_loaders if (useMiniCssExtractPlugin) { const MiniCssExtractPlugin = require('mini-css-extract-plugin') return [{ loader: MiniCssExtractPlugin.loader }, ...after_style_loa...
javascript
function generate_extract_css_loaders(after_style_loader, development, extract_css_plugin, useMiniCssExtractPlugin) { let extract_css_loaders if (useMiniCssExtractPlugin) { const MiniCssExtractPlugin = require('mini-css-extract-plugin') return [{ loader: MiniCssExtractPlugin.loader }, ...after_style_loa...
[ "function", "generate_extract_css_loaders", "(", "after_style_loader", ",", "development", ",", "extract_css_plugin", ",", "useMiniCssExtractPlugin", ")", "{", "let", "extract_css_loaders", "if", "(", "useMiniCssExtractPlugin", ")", "{", "const", "MiniCssExtractPlugin", "="...
Generates rule.use loaders for extracting styles in a file. Either for `extract-text-webpack-plugin` or `mini-css-extract-plugin`.
[ "Generates", "rule", ".", "use", "loaders", "for", "extracting", "styles", "in", "a", "file", ".", "Either", "for", "extract", "-", "text", "-", "webpack", "-", "plugin", "or", "mini", "-", "css", "-", "extract", "-", "plugin", "." ]
3b022b50ed211a135525dcca9fe469a480abec69
https://github.com/catamphetamine/universal-webpack/blob/3b022b50ed211a135525dcca9fe469a480abec69/source/client configuration.js#L176-L231
16,147
nnajm/orb
src/js/orb.axe.js
fill
function fill() { if (self.pgrid.filteredDataSource != null && self.dimensionsCount > 0) { var datasource = self.pgrid.filteredDataSource; if (datasource != null && utils.isArray(datasource) && datasource.length > 0) { for (var rowIndex = 0, dataLength = datasource.leng...
javascript
function fill() { if (self.pgrid.filteredDataSource != null && self.dimensionsCount > 0) { var datasource = self.pgrid.filteredDataSource; if (datasource != null && utils.isArray(datasource) && datasource.length > 0) { for (var rowIndex = 0, dataLength = datasource.leng...
[ "function", "fill", "(", ")", "{", "if", "(", "self", ".", "pgrid", ".", "filteredDataSource", "!=", "null", "&&", "self", ".", "dimensionsCount", ">", "0", ")", "{", "var", "datasource", "=", "self", ".", "pgrid", ".", "filteredDataSource", ";", "if", ...
Creates all subdimensions using the supplied data
[ "Creates", "all", "subdimensions", "using", "the", "supplied", "data" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.axe.js#L136-L166
16,148
nnajm/orb
src/js/orb.ui.cols.js
getUiInfo
function getUiInfo(depth, headers) { var infos = headers[headers.length - 1]; var parents = self.axe.root.depth === depth ? [null] : headers[self.axe.root.depth - depth - 1].filter(function(p) { return p.type !== uiheaders.HeaderType.SUB_TOTAL; }); for (...
javascript
function getUiInfo(depth, headers) { var infos = headers[headers.length - 1]; var parents = self.axe.root.depth === depth ? [null] : headers[self.axe.root.depth - depth - 1].filter(function(p) { return p.type !== uiheaders.HeaderType.SUB_TOTAL; }); for (...
[ "function", "getUiInfo", "(", "depth", ",", "headers", ")", "{", "var", "infos", "=", "headers", "[", "headers", ".", "length", "-", "1", "]", ";", "var", "parents", "=", "self", ".", "axe", ".", "root", ".", "depth", "===", "depth", "?", "[", "nul...
Fills the infos array given in argument with the dimension layout infos as column. @param {orb.dimension} dimension - the dimension to get ui info for @param {int} depth - the depth of the dimension that it's subdimensions will be returned @param {object} infos - array to fill with ui dimension info
[ "Fills", "the", "infos", "array", "given", "in", "argument", "with", "the", "dimension", "layout", "infos", "as", "column", "." ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.ui.cols.js#L136-L169
16,149
nnajm/orb
src/js/orb.utils.js
function(identifier, parent) { var parts = identifier.split('.'); var i = 0; parent = parent || window; while (i < parts.length) { parent[parts[i]] = parent[parts[i]] || {}; parent = parent[parts[i]]; i++; } return parent; }
javascript
function(identifier, parent) { var parts = identifier.split('.'); var i = 0; parent = parent || window; while (i < parts.length) { parent[parts[i]] = parent[parts[i]] || {}; parent = parent[parts[i]]; i++; } return parent; }
[ "function", "(", "identifier", ",", "parent", ")", "{", "var", "parts", "=", "identifier", ".", "split", "(", "'.'", ")", ";", "var", "i", "=", "0", ";", "parent", "=", "parent", "||", "window", ";", "while", "(", "i", "<", "parts", ".", "length", ...
Creates a namespcae hierarchy if not exists @param {string} identifier - namespace identifier @return {object}
[ "Creates", "a", "namespcae", "hierarchy", "if", "not", "exists" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.utils.js#L12-L22
16,150
nnajm/orb
src/js/orb.utils.js
function(obj) { var arr = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { arr.push(prop); } } return arr; }
javascript
function(obj) { var arr = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { arr.push(prop); } } return arr; }
[ "function", "(", "obj", ")", "{", "var", "arr", "=", "[", "]", ";", "for", "(", "var", "prop", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "prop", ")", ")", "{", "arr", ".", "push", "(", "prop", ")", ";", "}", "}", ...
Returns an array of object own properties @param {Object} obj @return {Array}
[ "Returns", "an", "array", "of", "object", "own", "properties" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.utils.js#L28-L36
16,151
nnajm/orb
src/js/orb.utils.js
function(array, predicate) { if (this.isArray(array) && predicate) { for (var i = 0; i < array.length; i++) { var item = array[i]; if (predicate(item)) { return item; } } } return undefined; }
javascript
function(array, predicate) { if (this.isArray(array) && predicate) { for (var i = 0; i < array.length; i++) { var item = array[i]; if (predicate(item)) { return item; } } } return undefined; }
[ "function", "(", "array", ",", "predicate", ")", "{", "if", "(", "this", ".", "isArray", "(", "array", ")", "&&", "predicate", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "array", ".", "length", ";", "i", "++", ")", "{", "var", ...
Returns the first element in the array that satisfies the given predicate @param {Array} array the array to search @param {function} predicate Function to apply to each element until it returns true @return {Object} The first object in the array that satisfies the predicate or undefined.
[ "Returns", "the", "first", "element", "in", "the", "array", "that", "satisfies", "the", "given", "predicate" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.utils.js#L89-L99
16,152
nnajm/orb
src/js/orb.utils.js
function(obj, censorKeywords) { function censor(key, value) { return censorKeywords && censorKeywords.indexOf(key) > -1 ? undefined : value; } return JSON.stringify(obj, censor, 2); }
javascript
function(obj, censorKeywords) { function censor(key, value) { return censorKeywords && censorKeywords.indexOf(key) > -1 ? undefined : value; } return JSON.stringify(obj, censor, 2); }
[ "function", "(", "obj", ",", "censorKeywords", ")", "{", "function", "censor", "(", "key", ",", "value", ")", "{", "return", "censorKeywords", "&&", "censorKeywords", ".", "indexOf", "(", "key", ")", ">", "-", "1", "?", "undefined", ":", "value", ";", ...
Returns a JSON string represenation of an object @param {object} obj @return {string}
[ "Returns", "a", "JSON", "string", "represenation", "of", "an", "object" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.utils.js#L105-L110
16,153
nnajm/orb
src/js/orb.ui.rows.js
getUiInfo
function getUiInfo(infos, dimension) { if (dimension.values.length > 0) { var infosMaxIndex = infos.length - 1; var lastInfosArray = infos[infosMaxIndex]; var parent = lastInfosArray.length > 0 ? lastInfosArray[lastInfosArray.length - 1] : null; for (var valInde...
javascript
function getUiInfo(infos, dimension) { if (dimension.values.length > 0) { var infosMaxIndex = infos.length - 1; var lastInfosArray = infos[infosMaxIndex]; var parent = lastInfosArray.length > 0 ? lastInfosArray[lastInfosArray.length - 1] : null; for (var valInde...
[ "function", "getUiInfo", "(", "infos", ",", "dimension", ")", "{", "if", "(", "dimension", ".", "values", ".", "length", ">", "0", ")", "{", "var", "infosMaxIndex", "=", "infos", ".", "length", "-", "1", ";", "var", "lastInfosArray", "=", "infos", "[",...
Fills the infos array given in argument with the dimension layout infos as row. @param {orb.dimension} dimension - the dimension to get ui info for @param {object} infos - array to fill with ui dimension info
[ "Fills", "the", "infos", "array", "given", "in", "argument", "with", "the", "dimension", "layout", "infos", "as", "row", "." ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/orb.ui.rows.js#L80-L120
16,154
nnajm/orb
src/js/react/orb.react.compiled.js
setTableWidths
function setTableWidths(tblObject, newWidthArray) { if (tblObject && tblObject.node) { // reset table width (tblObject.size = (tblObject.size || {})).width = 0; var tbl = tblObject.node; // for each row, set its cells width for (var rowIndex = 0; rowIndex < tbl.rows.length...
javascript
function setTableWidths(tblObject, newWidthArray) { if (tblObject && tblObject.node) { // reset table width (tblObject.size = (tblObject.size || {})).width = 0; var tbl = tblObject.node; // for each row, set its cells width for (var rowIndex = 0; rowIndex < tbl.rows.length...
[ "function", "setTableWidths", "(", "tblObject", ",", "newWidthArray", ")", "{", "if", "(", "tblObject", "&&", "tblObject", ".", "node", ")", "{", "// reset table width", "(", "tblObject", ".", "size", "=", "(", "tblObject", ".", "size", "||", "{", "}", ")"...
Sets the width of all cells of a html table element @param {Object} tblObject - object having a table element in its 'node' property @param {Array} newWidthArray - an array of numeric values representing the width of each individual cell. Its length is equal to the greatest number of cells of all rows (in case of c...
[ "Sets", "the", "width", "of", "all", "cells", "of", "a", "html", "table", "element" ]
1c4438fd428f6b0cf2b421cfd5ed0cce436ab580
https://github.com/nnajm/orb/blob/1c4438fd428f6b0cf2b421cfd5ed0cce436ab580/src/js/react/orb.react.compiled.js#L522-L598
16,155
TamkeenLMS/electron-window-manager
index.js
function(name, title, url, setupTemplate, setup, showDevTools){ // Check if the window already exists if(windowManager.windows[name]){ console.log('Window ' + name + ' already exists!'); // Move the focus on it windowManager.focusOn(name); return; } // The window unique...
javascript
function(name, title, url, setupTemplate, setup, showDevTools){ // Check if the window already exists if(windowManager.windows[name]){ console.log('Window ' + name + ' already exists!'); // Move the focus on it windowManager.focusOn(name); return; } // The window unique...
[ "function", "(", "name", ",", "title", ",", "url", ",", "setupTemplate", ",", "setup", ",", "showDevTools", ")", "{", "// Check if the window already exists", "if", "(", "windowManager", ".", "windows", "[", "name", "]", ")", "{", "console", ".", "log", "(",...
Creates a new Window instance @param name [optional] The code name for the window, each window must have a unique name @param title [optional] The window title @param url [optional] The targeted page/url of the window @param setupTemplate [optional] The name of the setup template you want to use with this new window @...
[ "Creates", "a", "new", "Window", "instance" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L38-L79
16,156
TamkeenLMS/electron-window-manager
index.js
function(name, setup){ if(!isObject(setup) || this.templates[name]) return false; this.templates[name] = setup; }
javascript
function(name, setup){ if(!isObject(setup) || this.templates[name]) return false; this.templates[name] = setup; }
[ "function", "(", "name", ",", "setup", ")", "{", "if", "(", "!", "isObject", "(", "setup", ")", "||", "this", ".", "templates", "[", "name", "]", ")", "return", "false", ";", "this", ".", "templates", "[", "name", "]", "=", "setup", ";", "}" ]
Set a new template
[ "Set", "a", "new", "template" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L533-L537
16,157
TamkeenLMS/electron-window-manager
index.js
function(setup){ const screen = Electron.screen; const screenSize = screen.getPrimaryDisplay().workAreaSize; const position = setup.position; let x = 0; let y = 0; const positionMargin = 0; let windowWidth = setup.width; let windowHeight = setup.height; ...
javascript
function(setup){ const screen = Electron.screen; const screenSize = screen.getPrimaryDisplay().workAreaSize; const position = setup.position; let x = 0; let y = 0; const positionMargin = 0; let windowWidth = setup.width; let windowHeight = setup.height; ...
[ "function", "(", "setup", ")", "{", "const", "screen", "=", "Electron", ".", "screen", ";", "const", "screenSize", "=", "screen", ".", "getPrimaryDisplay", "(", ")", ".", "workAreaSize", ";", "const", "position", "=", "setup", ".", "position", ";", "let", ...
Resolves a position name into x & y coordinates. @param setup The window setup object
[ "Resolves", "a", "position", "name", "into", "x", "&", "y", "coordinates", "." ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L595-L719
16,158
TamkeenLMS/electron-window-manager
index.js
function(config){ if(isString(config)){ this.config.appBase = config; }else if(isObject(config)){// If the config object is provided this.config = Object.assign(this.config, config); } // If the app base isn't provided if(!this.config.appBase){ ...
javascript
function(config){ if(isString(config)){ this.config.appBase = config; }else if(isObject(config)){// If the config object is provided this.config = Object.assign(this.config, config); } // If the app base isn't provided if(!this.config.appBase){ ...
[ "function", "(", "config", ")", "{", "if", "(", "isString", "(", "config", ")", ")", "{", "this", ".", "config", ".", "appBase", "=", "config", ";", "}", "else", "if", "(", "isObject", "(", "config", ")", ")", "{", "// If the config object is provided", ...
Initiate the module @param config The configuration for the module
[ "Initiate", "the", "module" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L799-L846
16,159
TamkeenLMS/electron-window-manager
index.js
function(file){ const list = require(utils.getAppLocalPath() + file); if(!isObject(list)) return false; Object.keys(list).forEach(key => { let window = list[key]; this.createNew(key, window.title, window.url, window.setupTemplate, window.setup); }); }
javascript
function(file){ const list = require(utils.getAppLocalPath() + file); if(!isObject(list)) return false; Object.keys(list).forEach(key => { let window = list[key]; this.createNew(key, window.title, window.url, window.setupTemplate, window.setup); }); }
[ "function", "(", "file", ")", "{", "const", "list", "=", "require", "(", "utils", ".", "getAppLocalPath", "(", ")", "+", "file", ")", ";", "if", "(", "!", "isObject", "(", "list", ")", ")", "return", "false", ";", "Object", ".", "keys", "(", "list"...
Using this method you can create more than one window with the setup information retrieved from a JSON file.
[ "Using", "this", "method", "you", "can", "create", "more", "than", "one", "window", "with", "the", "setup", "information", "retrieved", "from", "a", "JSON", "file", "." ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L866-L874
16,160
TamkeenLMS/electron-window-manager
index.js
function(name, title, url, setupTemplate, setup, showDevTools){ // Create the window instance const window = new Window(name, title, url, setupTemplate, setup, showDevTools); // If the window was created return (window == null || Object.keys(window).length === 0) ?false :window; }
javascript
function(name, title, url, setupTemplate, setup, showDevTools){ // Create the window instance const window = new Window(name, title, url, setupTemplate, setup, showDevTools); // If the window was created return (window == null || Object.keys(window).length === 0) ?false :window; }
[ "function", "(", "name", ",", "title", ",", "url", ",", "setupTemplate", ",", "setup", ",", "showDevTools", ")", "{", "// Create the window instance", "const", "window", "=", "new", "Window", "(", "name", ",", "title", ",", "url", ",", "setupTemplate", ",", ...
Create a new window instance. Check the Window object for documentation.
[ "Create", "a", "new", "window", "instance", ".", "Check", "the", "Window", "object", "for", "documentation", "." ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L879-L885
16,161
TamkeenLMS/electron-window-manager
index.js
function(name, title, content, setupTemplate, setup, showDevTools){ const window = this.createNew(name, title, content, setupTemplate, setup, showDevTools); if(window) window.open(); return window; }
javascript
function(name, title, content, setupTemplate, setup, showDevTools){ const window = this.createNew(name, title, content, setupTemplate, setup, showDevTools); if(window) window.open(); return window; }
[ "function", "(", "name", ",", "title", ",", "content", ",", "setupTemplate", ",", "setup", ",", "showDevTools", ")", "{", "const", "window", "=", "this", ".", "createNew", "(", "name", ",", "title", ",", "content", ",", "setupTemplate", ",", "setup", ","...
Opens a new window
[ "Opens", "a", "new", "window" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L890-L894
16,162
TamkeenLMS/electron-window-manager
index.js
function(name){ const window = this.get(name); if(!window) return; return this.createNew(false, false, false, false, this.setup); }
javascript
function(name){ const window = this.get(name); if(!window) return; return this.createNew(false, false, false, false, this.setup); }
[ "function", "(", "name", ")", "{", "const", "window", "=", "this", ".", "get", "(", "name", ")", ";", "if", "(", "!", "window", ")", "return", ";", "return", "this", ".", "createNew", "(", "false", ",", "false", ",", "false", ",", "false", ",", "...
Create a clone of the passed window
[ "Create", "a", "clone", "of", "the", "passed", "window" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L899-L904
16,163
TamkeenLMS/electron-window-manager
index.js
function(id) { let instance; Object.keys(this.windows).forEach(key => { let window = this.windows[key]; if(window.object.id === id){ instance = window; } }); return instance; }
javascript
function(id) { let instance; Object.keys(this.windows).forEach(key => { let window = this.windows[key]; if(window.object.id === id){ instance = window; } }); return instance; }
[ "function", "(", "id", ")", "{", "let", "instance", ";", "Object", ".", "keys", "(", "this", ".", "windows", ")", ".", "forEach", "(", "key", "=>", "{", "let", "window", "=", "this", ".", "windows", "[", "key", "]", ";", "if", "(", "window", ".",...
Get a window instance, by BrowserWindow instance id
[ "Get", "a", "window", "instance", "by", "BrowserWindow", "instance", "id" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L921-L930
16,164
TamkeenLMS/electron-window-manager
index.js
function(){ Object.keys(this.windows).forEach(key => { let window = this.windows[key]; window.close(); }); }
javascript
function(){ Object.keys(this.windows).forEach(key => { let window = this.windows[key]; window.close(); }); }
[ "function", "(", ")", "{", "Object", ".", "keys", "(", "this", ".", "windows", ")", ".", "forEach", "(", "key", "=>", "{", "let", "window", "=", "this", ".", "windows", "[", "key", "]", ";", "window", ".", "close", "(", ")", ";", "}", ")", ";",...
Close all windows created by this module
[ "Close", "all", "windows", "created", "by", "this", "module" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L967-L972
16,165
TamkeenLMS/electron-window-manager
index.js
function(name){ // Get all the windows const windows = BrowserWindow.getAllWindows(); // Get the window through the name const windowID = this.get(name).object.id; if(!windows.length || !windowID) return false; // Loop through the windows, close all of them and focus on...
javascript
function(name){ // Get all the windows const windows = BrowserWindow.getAllWindows(); // Get the window through the name const windowID = this.get(name).object.id; if(!windows.length || !windowID) return false; // Loop through the windows, close all of them and focus on...
[ "function", "(", "name", ")", "{", "// Get all the windows", "const", "windows", "=", "BrowserWindow", ".", "getAllWindows", "(", ")", ";", "// Get the window through the name", "const", "windowID", "=", "this", ".", "get", "(", "name", ")", ".", "object", ".", ...
Close all window except for one
[ "Close", "all", "window", "except", "for", "one" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L977-L994
16,166
TamkeenLMS/electron-window-manager
index.js
function(event, callback){ let id = windowManager.eventEmitter.listenerCount(event); windowManager.eventEmitter.addListener(event, function(event){ callback.call(null, event.data, event.target, event.emittedBy); }); return windowManager.eventEmitter.lis...
javascript
function(event, callback){ let id = windowManager.eventEmitter.listenerCount(event); windowManager.eventEmitter.addListener(event, function(event){ callback.call(null, event.data, event.target, event.emittedBy); }); return windowManager.eventEmitter.lis...
[ "function", "(", "event", ",", "callback", ")", "{", "let", "id", "=", "windowManager", ".", "eventEmitter", ".", "listenerCount", "(", "event", ")", ";", "windowManager", ".", "eventEmitter", ".", "addListener", "(", "event", ",", "function", "(", "event", ...
Sets the callback to trigger whenever an event is emitted @param event The name of the event @param callback The callback to trigger, this callback will be given the data passed (if any), and the name of the targeted window and finally the name of the window that triggered/emitted the event @return the handler that add...
[ "Sets", "the", "callback", "to", "trigger", "whenever", "an", "event", "is", "emitted" ]
40b8fd06d14530c0e6bed1d0d91195f639d7081e
https://github.com/TamkeenLMS/electron-window-manager/blob/40b8fd06d14530c0e6bed1d0d91195f639d7081e/index.js#L1107-L1115
16,167
rofrischmann/inline-style-prefixer
benchmark/packages/302/utils/getBrowserInformation.js
getBrowserInformation
function getBrowserInformation(userAgent) { var browserInfo = _bowser2.default._detect(userAgent); for (var browser in prefixByBrowser) { if (browserInfo.hasOwnProperty(browser)) { var prefix = prefixByBrowser[browser]; browserInfo.jsPrefix = prefix; browserInfo.cssPrefix = '-' + prefix.toLo...
javascript
function getBrowserInformation(userAgent) { var browserInfo = _bowser2.default._detect(userAgent); for (var browser in prefixByBrowser) { if (browserInfo.hasOwnProperty(browser)) { var prefix = prefixByBrowser[browser]; browserInfo.jsPrefix = prefix; browserInfo.cssPrefix = '-' + prefix.toLo...
[ "function", "getBrowserInformation", "(", "userAgent", ")", "{", "var", "browserInfo", "=", "_bowser2", ".", "default", ".", "_detect", "(", "userAgent", ")", ";", "for", "(", "var", "browser", "in", "prefixByBrowser", ")", "{", "if", "(", "browserInfo", "."...
Uses bowser to get default browser browserInformation such as version and name Evaluates bowser browserInfo and adds vendorPrefix browserInformation @param {string} userAgent - userAgent that gets evaluated
[ "Uses", "bowser", "to", "get", "default", "browser", "browserInformation", "such", "as", "version", "and", "name", "Evaluates", "bowser", "browserInfo", "and", "adds", "vendorPrefix", "browserInformation" ]
07f2d5239e305e9e3ce89276e20ce088eb4940ac
https://github.com/rofrischmann/inline-style-prefixer/blob/07f2d5239e305e9e3ce89276e20ce088eb4940ac/benchmark/packages/302/utils/getBrowserInformation.js#L73-L126
16,168
baalexander/node-xmlrpc
lib/cookies.js
function(name) { var cookie = this.cookies[name] if (cookie && this.checkNotExpired(name)) { return this.cookies[name].value } return null }
javascript
function(name) { var cookie = this.cookies[name] if (cookie && this.checkNotExpired(name)) { return this.cookies[name].value } return null }
[ "function", "(", "name", ")", "{", "var", "cookie", "=", "this", ".", "cookies", "[", "name", "]", "if", "(", "cookie", "&&", "this", ".", "checkNotExpired", "(", "name", ")", ")", "{", "return", "this", ".", "cookies", "[", "name", "]", ".", "valu...
Obtains value of the cookie with specified name. This call checks expiration dates and does not return expired cookies. @param {String} name cookie name @return {String} cookie value or null
[ "Obtains", "value", "of", "the", "cookie", "with", "specified", "name", ".", "This", "call", "checks", "expiration", "dates", "and", "does", "not", "return", "expired", "cookies", "." ]
d9c88c4185e16637ed5a22c1b91c80e958e8d69e
https://github.com/baalexander/node-xmlrpc/blob/d9c88c4185e16637ed5a22c1b91c80e958e8d69e/lib/cookies.js#L17-L23
16,169
baalexander/node-xmlrpc
lib/cookies.js
function(name, value, options) { var cookie = typeof options == 'object' ? {value: value, expires: options.expires, secure: options.secure || false, new: options.new || false} : {value: value} if (this.checkNotExpired(name, cookie)) { this.cookies[name] = cookie } }
javascript
function(name, value, options) { var cookie = typeof options == 'object' ? {value: value, expires: options.expires, secure: options.secure || false, new: options.new || false} : {value: value} if (this.checkNotExpired(name, cookie)) { this.cookies[name] = cookie } }
[ "function", "(", "name", ",", "value", ",", "options", ")", "{", "var", "cookie", "=", "typeof", "options", "==", "'object'", "?", "{", "value", ":", "value", ",", "expires", ":", "options", ".", "expires", ",", "secure", ":", "options", ".", "secure",...
Sets cookie's value and optional options @param {String} name cookie's name @param {String} value value @param {Object} options with the following fields: - {Boolean} secure - is cookie secure or not (does not mean anything for now) - {Date} expires - cookie's expiration date. If specified then cookie will disappear af...
[ "Sets", "cookie", "s", "value", "and", "optional", "options" ]
d9c88c4185e16637ed5a22c1b91c80e958e8d69e
https://github.com/baalexander/node-xmlrpc/blob/d9c88c4185e16637ed5a22c1b91c80e958e8d69e/lib/cookies.js#L33-L40
16,170
baalexander/node-xmlrpc
lib/cookies.js
function(headers) { var cookies = headers['set-cookie'] if (cookies) { cookies.forEach(function(c) { var cookiesParams = c.split(';') var cookiePair = cookiesParams.shift().split('=') var options = {} cookiesParams.forEach(function(param) { param = param.trim() ...
javascript
function(headers) { var cookies = headers['set-cookie'] if (cookies) { cookies.forEach(function(c) { var cookiesParams = c.split(';') var cookiePair = cookiesParams.shift().split('=') var options = {} cookiesParams.forEach(function(param) { param = param.trim() ...
[ "function", "(", "headers", ")", "{", "var", "cookies", "=", "headers", "[", "'set-cookie'", "]", "if", "(", "cookies", ")", "{", "cookies", ".", "forEach", "(", "function", "(", "c", ")", "{", "var", "cookiesParams", "=", "c", ".", "split", "(", "';...
Parses headers from server's response for 'set-cookie' header and store cookie's values. Also parses expiration date @param headers
[ "Parses", "headers", "from", "server", "s", "response", "for", "set", "-", "cookie", "header", "and", "store", "cookie", "s", "values", ".", "Also", "parses", "expiration", "date" ]
d9c88c4185e16637ed5a22c1b91c80e958e8d69e
https://github.com/baalexander/node-xmlrpc/blob/d9c88c4185e16637ed5a22c1b91c80e958e8d69e/lib/cookies.js#L66-L83
16,171
baalexander/node-xmlrpc
lib/server.js
Server
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
javascript
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
[ "function", "Server", "(", "options", ",", "isSecure", ",", "onListening", ")", "{", "if", "(", "false", "===", "(", "this", "instanceof", "Server", ")", ")", "{", "return", "new", "Server", "(", "options", ",", "isSecure", ")", "}", "onListening", "=", ...
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
[ "Creates", "a", "new", "Server", "object", ".", "Also", "creates", "an", "HTTP", "server", "to", "start", "listening", "for", "XML", "-", "RPC", "method", "calls", ".", "Will", "emit", "an", "event", "with", "the", "XML", "-", "RPC", "call", "s", "meth...
d9c88c4185e16637ed5a22c1b91c80e958e8d69e
https://github.com/baalexander/node-xmlrpc/blob/d9c88c4185e16637ed5a22c1b91c80e958e8d69e/lib/server.js#L23-L72
16,172
baalexander/node-xmlrpc
lib/client.js
Client
function Client(options, isSecure) { // Invokes with new if called without if (false === (this instanceof Client)) { return new Client(options, isSecure) } // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.parse(options) options.host = optio...
javascript
function Client(options, isSecure) { // Invokes with new if called without if (false === (this instanceof Client)) { return new Client(options, isSecure) } // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.parse(options) options.host = optio...
[ "function", "Client", "(", "options", ",", "isSecure", ")", "{", "// Invokes with new if called without", "if", "(", "false", "===", "(", "this", "instanceof", "Client", ")", ")", "{", "return", "new", "Client", "(", "options", ",", "isSecure", ")", "}", "//...
Creates a Client object for making XML-RPC method calls. @constructor @param {Object|String} options - Server options to make the HTTP request to. Either a URI string (e.g. 'http://localhost:9090') or an object with fields: - {String} host - (optional) - {Number} port - {String} url - (optio...
[ "Creates", "a", "Client", "object", "for", "making", "XML", "-", "RPC", "method", "calls", "." ]
d9c88c4185e16637ed5a22c1b91c80e958e8d69e
https://github.com/baalexander/node-xmlrpc/blob/d9c88c4185e16637ed5a22c1b91c80e958e8d69e/lib/client.js#L25-L88
16,173
kyma-project/console
core/src/luigi-config/luigi-config.js
getNamespace
async function getNamespace(namespaceName) { const cacheName = '_console_namespace_promise_cache_'; if (!window[cacheName]) { window[cacheName] = {}; } const cache = window[cacheName]; if (!cache[namespaceName]) { cache[namespaceName] = fetchFromKyma( `${k8sServerUrl}/api/v1/namespaces/${namespa...
javascript
async function getNamespace(namespaceName) { const cacheName = '_console_namespace_promise_cache_'; if (!window[cacheName]) { window[cacheName] = {}; } const cache = window[cacheName]; if (!cache[namespaceName]) { cache[namespaceName] = fetchFromKyma( `${k8sServerUrl}/api/v1/namespaces/${namespa...
[ "async", "function", "getNamespace", "(", "namespaceName", ")", "{", "const", "cacheName", "=", "'_console_namespace_promise_cache_'", ";", "if", "(", "!", "window", "[", "cacheName", "]", ")", "{", "window", "[", "cacheName", "]", "=", "{", "}", ";", "}", ...
We're using Promise based caching approach, since we often execute getNamespace twice at the same time and we only want to do one rest call. @param {string} namespaceName @returns {Promise} nsPromise
[ "We", "re", "using", "Promise", "based", "caching", "approach", "since", "we", "often", "execute", "getNamespace", "twice", "at", "the", "same", "time", "and", "we", "only", "want", "to", "do", "one", "rest", "call", "." ]
23b3d5a1809ffc806f9657a4e91f6701bf6a88ea
https://github.com/kyma-project/console/blob/23b3d5a1809ffc806f9657a4e91f6701bf6a88ea/core/src/luigi-config/luigi-config.js#L239-L251
16,174
jeff-collins/ment.io
ment.io/scripts.js
function(scope, element, attrs, ngModel) { function read() { var html = element.html(); // When we clear the content editable the browser leaves a <br> behind // If strip-br attribute is provided then we strip this out if (a...
javascript
function(scope, element, attrs, ngModel) { function read() { var html = element.html(); // When we clear the content editable the browser leaves a <br> behind // If strip-br attribute is provided then we strip this out if (a...
[ "function", "(", "scope", ",", "element", ",", "attrs", ",", "ngModel", ")", "{", "function", "read", "(", ")", "{", "var", "html", "=", "element", ".", "html", "(", ")", ";", "// When we clear the content editable the browser leaves a <br> behind", "// If strip-b...
get a hold of NgModelController
[ "get", "a", "hold", "of", "NgModelController" ]
ad2a0a98cee5f7779a78c62e9f9f4f8105bfa759
https://github.com/jeff-collins/ment.io/blob/ad2a0a98cee5f7779a78c62e9f9f4f8105bfa759/ment.io/scripts.js#L144-L169
16,175
Breeze/breeze.js
src/a40_entityMetadata.js
MetadataStore
function MetadataStore(config) { config = config || { }; assertConfig(config) .whereParam("namingConvention").isOptional().isInstanceOf(NamingConvention).withDefault(NamingConvention.defaultInstance) .whereParam("localQueryComparisonOptions").isOptional().isInstanceOf(LocalQueryComparisonOptions...
javascript
function MetadataStore(config) { config = config || { }; assertConfig(config) .whereParam("namingConvention").isOptional().isInstanceOf(NamingConvention).withDefault(NamingConvention.defaultInstance) .whereParam("localQueryComparisonOptions").isOptional().isInstanceOf(LocalQueryComparisonOptions...
[ "function", "MetadataStore", "(", "config", ")", "{", "config", "=", "config", "||", "{", "}", ";", "assertConfig", "(", "config", ")", ".", "whereParam", "(", "\"namingConvention\"", ")", ".", "isOptional", "(", ")", ".", "isInstanceOf", "(", "NamingConvent...
Constructs a new MetadataStore. @example var ms = new MetadataStore(); The store can then be associated with an EntityManager @example var entityManager = new EntityManager( { serviceName: "breeze/NorthwindIBModel", metadataStore: ms }); or for an existing EntityManager @example Assume em1 is an existing EntityManager ...
[ "Constructs", "a", "new", "MetadataStore", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/src/a40_entityMetadata.js#L69-L86
16,176
Breeze/breeze.js
src/a40_entityMetadata.js
parseTypeNameWithSchema
function parseTypeNameWithSchema(entityTypeName, schema) { var result = parseTypeName(entityTypeName); if (schema && schema.cSpaceOSpaceMapping) { var ns = getNamespaceFor(result.shortTypeName, schema); if (ns) { result = makeTypeHash(result.shortTypeName, ns); } } return resul...
javascript
function parseTypeNameWithSchema(entityTypeName, schema) { var result = parseTypeName(entityTypeName); if (schema && schema.cSpaceOSpaceMapping) { var ns = getNamespaceFor(result.shortTypeName, schema); if (ns) { result = makeTypeHash(result.shortTypeName, ns); } } return resul...
[ "function", "parseTypeNameWithSchema", "(", "entityTypeName", ",", "schema", ")", "{", "var", "result", "=", "parseTypeName", "(", "entityTypeName", ")", ";", "if", "(", "schema", "&&", "schema", ".", "cSpaceOSpaceMapping", ")", "{", "var", "ns", "=", "getName...
schema is only needed for navProperty type name
[ "schema", "is", "only", "needed", "for", "navProperty", "type", "name" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/src/a40_entityMetadata.js#L1124-L1133
16,177
Breeze/breeze.js
src/a40_entityMetadata.js
ComplexType
function ComplexType(config) { if (arguments.length > 1) { throw new Error("The ComplexType ctor has a single argument that is a configuration object."); } assertConfig(config) .whereParam("shortName").isNonEmptyString() .whereParam("namespace").isString().isOptional().withDefault("")...
javascript
function ComplexType(config) { if (arguments.length > 1) { throw new Error("The ComplexType ctor has a single argument that is a configuration object."); } assertConfig(config) .whereParam("shortName").isNonEmptyString() .whereParam("namespace").isString().isOptional().withDefault("")...
[ "function", "ComplexType", "(", "config", ")", "{", "if", "(", "arguments", ".", "length", ">", "1", ")", "{", "throw", "new", "Error", "(", "\"The ComplexType ctor has a single argument that is a configuration object.\"", ")", ";", "}", "assertConfig", "(", "config...
Container for all of the metadata about a specific type of Complex object. @class ComplexType @example var complexType = new ComplexType( { shortName: "address", namespace: "myAppNamespace" }); @method <ctor> ComplexType @param config {Object} Configuration settings @param config.shortName {String} @param [config.nam...
[ "Container", "for", "all", "of", "the", "metadata", "about", "a", "specific", "type", "of", "Complex", "object", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/src/a40_entityMetadata.js#L2168-L2192
16,178
Breeze/breeze.js
src/a40_entityMetadata.js
parseTypeName
function parseTypeName(entityTypeName) { if (!entityTypeName) { return null; } var typeParts = entityTypeName.split(":#"); if (typeParts.length > 1) { return makeTypeHash(typeParts[0], typeParts[1]); } if (__stringStartsWith(entityTypeName, MetadataStore.ANONTYPE_PREFIX)) { var typeHash = make...
javascript
function parseTypeName(entityTypeName) { if (!entityTypeName) { return null; } var typeParts = entityTypeName.split(":#"); if (typeParts.length > 1) { return makeTypeHash(typeParts[0], typeParts[1]); } if (__stringStartsWith(entityTypeName, MetadataStore.ANONTYPE_PREFIX)) { var typeHash = make...
[ "function", "parseTypeName", "(", "entityTypeName", ")", "{", "if", "(", "!", "entityTypeName", ")", "{", "return", "null", ";", "}", "var", "typeParts", "=", "entityTypeName", ".", "split", "(", "\":#\"", ")", ";", "if", "(", "typeParts", ".", "length", ...
functions shared between classes related to Metadata
[ "functions", "shared", "between", "classes", "related", "to", "Metadata" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/src/a40_entityMetadata.js#L3158-L3183
16,179
Breeze/breeze.js
src/a40_entityMetadata.js
addProperties
function addProperties(entityType, propObj, ctor) { if (!propObj) return; if (Array.isArray(propObj)) { propObj.forEach(entityType._addPropertyCore.bind(entityType)); } else if (typeof (propObj) === 'object') { for (var key in propObj) { if (__hasOwnProperty(propObj, key)) { var value = pro...
javascript
function addProperties(entityType, propObj, ctor) { if (!propObj) return; if (Array.isArray(propObj)) { propObj.forEach(entityType._addPropertyCore.bind(entityType)); } else if (typeof (propObj) === 'object') { for (var key in propObj) { if (__hasOwnProperty(propObj, key)) { var value = pro...
[ "function", "addProperties", "(", "entityType", ",", "propObj", ",", "ctor", ")", "{", "if", "(", "!", "propObj", ")", "return", ";", "if", "(", "Array", ".", "isArray", "(", "propObj", ")", ")", "{", "propObj", ".", "forEach", "(", "entityType", ".", ...
Used by both ComplexType and EntityType
[ "Used", "by", "both", "ComplexType", "and", "EntityType" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/src/a40_entityMetadata.js#L3206-L3223
16,180
Breeze/breeze.js
build/breeze.debug.js
__getOwnPropertyValues
function __getOwnPropertyValues(source) { var result = []; for (var name in source) { if (__hasOwnProperty(source, name)) { result.push(source[name]); } } return result; }
javascript
function __getOwnPropertyValues(source) { var result = []; for (var name in source) { if (__hasOwnProperty(source, name)) { result.push(source[name]); } } return result; }
[ "function", "__getOwnPropertyValues", "(", "source", ")", "{", "var", "result", "=", "[", "]", ";", "for", "(", "var", "name", "in", "source", ")", "{", "if", "(", "__hasOwnProperty", "(", "source", ",", "name", ")", ")", "{", "result", ".", "push", ...
end functional extensions
[ "end", "functional", "extensions" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L114-L122
16,181
Breeze/breeze.js
build/breeze.debug.js
__toJSONSafe
function __toJSONSafe(obj, replacer) { if (obj !== Object(obj)) return obj; // primitive value if (obj._$visited) return undefined; replacer = replacer || __safeReplacer; if (obj.toJSON) { var newObj = obj.toJSON(); if (newObj !== Object(newObj)) return newObj; // primitive value if (newObj !== obj)...
javascript
function __toJSONSafe(obj, replacer) { if (obj !== Object(obj)) return obj; // primitive value if (obj._$visited) return undefined; replacer = replacer || __safeReplacer; if (obj.toJSON) { var newObj = obj.toJSON(); if (newObj !== Object(newObj)) return newObj; // primitive value if (newObj !== obj)...
[ "function", "__toJSONSafe", "(", "obj", ",", "replacer", ")", "{", "if", "(", "obj", "!==", "Object", "(", "obj", ")", ")", "return", "obj", ";", "// primitive value", "if", "(", "obj", ".", "_$visited", ")", "return", "undefined", ";", "replacer", "=", ...
safely perform toJSON logic on objects with cycles.
[ "safely", "perform", "toJSON", "logic", "on", "objects", "with", "cycles", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L216-L251
16,182
Breeze/breeze.js
build/breeze.debug.js
__resolveProperties
function __resolveProperties(sources, propertyNames) { var r = {}; var length = sources.length; propertyNames.forEach(function (pn) { for (var i = 0; i < length; i++) { var src = sources[i]; if (src) { var val = src[pn]; if (val !== undefined) { r[pn] = val; bre...
javascript
function __resolveProperties(sources, propertyNames) { var r = {}; var length = sources.length; propertyNames.forEach(function (pn) { for (var i = 0; i < length; i++) { var src = sources[i]; if (src) { var val = src[pn]; if (val !== undefined) { r[pn] = val; bre...
[ "function", "__resolveProperties", "(", "sources", ",", "propertyNames", ")", "{", "var", "r", "=", "{", "}", ";", "var", "length", "=", "sources", ".", "length", ";", "propertyNames", ".", "forEach", "(", "function", "(", "pn", ")", "{", "for", "(", "...
resolves the values of a list of properties by checking each property in multiple sources until a value is found.
[ "resolves", "the", "values", "of", "a", "list", "of", "properties", "by", "checking", "each", "property", "in", "multiple", "sources", "until", "a", "value", "is", "found", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L254-L270
16,183
Breeze/breeze.js
build/breeze.debug.js
__map
function __map(items, fn, includeNull) { // whether to return nulls in array of results; default = true; includeNull = includeNull == null ? true : includeNull; if (items == null) return items; var result; if (Array.isArray(items)) { result = []; items.forEach(function (v, ix) { var r = fn(v, ix...
javascript
function __map(items, fn, includeNull) { // whether to return nulls in array of results; default = true; includeNull = includeNull == null ? true : includeNull; if (items == null) return items; var result; if (Array.isArray(items)) { result = []; items.forEach(function (v, ix) { var r = fn(v, ix...
[ "function", "__map", "(", "items", ",", "fn", ",", "includeNull", ")", "{", "// whether to return nulls in array of results; default = true;", "includeNull", "=", "includeNull", "==", "null", "?", "true", ":", "includeNull", ";", "if", "(", "items", "==", "null", ...
a version of Array.map that doesn't require an array, i.e. works on arrays and scalars.
[ "a", "version", "of", "Array", ".", "map", "that", "doesn", "t", "require", "an", "array", "i", ".", "e", ".", "works", "on", "arrays", "and", "scalars", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L286-L303
16,184
Breeze/breeze.js
build/breeze.debug.js
__getArray
function __getArray(source, propName) { var arr = source[propName]; if (!arr) { arr = []; source[propName] = arr; } return arr; }
javascript
function __getArray(source, propName) { var arr = source[propName]; if (!arr) { arr = []; source[propName] = arr; } return arr; }
[ "function", "__getArray", "(", "source", ",", "propName", ")", "{", "var", "arr", "=", "source", "[", "propName", "]", ";", "if", "(", "!", "arr", ")", "{", "arr", "=", "[", "]", ";", "source", "[", "propName", "]", "=", "arr", ";", "}", "return"...
end of array functions returns and array for a source and a prop, and creates the prop if needed.
[ "end", "of", "array", "functions", "returns", "and", "array", "for", "a", "source", "and", "a", "prop", "and", "creates", "the", "prop", "if", "needed", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L402-L409
16,185
Breeze/breeze.js
build/breeze.debug.js
__requireLibCore
function __requireLibCore(libName) { var window = global.window; if (!window) return; // Must run in a browser. Todo: add commonjs support // get library from browser globals if we can var lib = window[libName]; if (lib) return lib; // if require exists, maybe require can get it. // This method is synch...
javascript
function __requireLibCore(libName) { var window = global.window; if (!window) return; // Must run in a browser. Todo: add commonjs support // get library from browser globals if we can var lib = window[libName]; if (lib) return lib; // if require exists, maybe require can get it. // This method is synch...
[ "function", "__requireLibCore", "(", "libName", ")", "{", "var", "window", "=", "global", ".", "window", ";", "if", "(", "!", "window", ")", "return", ";", "// Must run in a browser. Todo: add commonjs support", "// get library from browser globals if we can", "var", "l...
Returns the 'libName' module if loaded or else returns undefined
[ "Returns", "the", "libName", "module", "if", "loaded", "or", "else", "returns", "undefined" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L423-L454
16,186
Breeze/breeze.js
build/breeze.debug.js
__isPrimitive
function __isPrimitive(obj) { if (obj == null) return false; // true for numbers, strings, booleans and null, false for objects if (obj != Object(obj)) return true; return __isDate(obj); }
javascript
function __isPrimitive(obj) { if (obj == null) return false; // true for numbers, strings, booleans and null, false for objects if (obj != Object(obj)) return true; return __isDate(obj); }
[ "function", "__isPrimitive", "(", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "return", "false", ";", "// true for numbers, strings, booleans and null, false for objects", "if", "(", "obj", "!=", "Object", "(", "obj", ")", ")", "return", "true", ";", ...
returns true for booleans, numbers, strings and dates false for null, and non-date objects, functions, and arrays
[ "returns", "true", "for", "booleans", "numbers", "strings", "and", "dates", "false", "for", "null", "and", "non", "-", "date", "objects", "functions", "and", "arrays" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L609-L614
16,187
Breeze/breeze.js
build/breeze.debug.js
__stringStartsWith
function __stringStartsWith(str, prefix) { // returns true for empty string or null prefix if ((!str)) return false; if (prefix == "" || prefix == null) return true; return str.indexOf(prefix, 0) === 0; }
javascript
function __stringStartsWith(str, prefix) { // returns true for empty string or null prefix if ((!str)) return false; if (prefix == "" || prefix == null) return true; return str.indexOf(prefix, 0) === 0; }
[ "function", "__stringStartsWith", "(", "str", ",", "prefix", ")", "{", "// returns true for empty string or null prefix", "if", "(", "(", "!", "str", ")", ")", "return", "false", ";", "if", "(", "prefix", "==", "\"\"", "||", "prefix", "==", "null", ")", "ret...
end of is Functions string functions
[ "end", "of", "is", "Functions", "string", "functions" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L620-L625
16,188
Breeze/breeze.js
build/breeze.debug.js
Enum
function Enum(name, methodObj) { this.name = name; var prototype = new EnumSymbol(methodObj); prototype.parentEnum = this; this._symbolPrototype = prototype; if (methodObj) { Object.keys(methodObj).forEach(function (key) { prototype[key] = methodObj[key]; }); } }
javascript
function Enum(name, methodObj) { this.name = name; var prototype = new EnumSymbol(methodObj); prototype.parentEnum = this; this._symbolPrototype = prototype; if (methodObj) { Object.keys(methodObj).forEach(function (key) { prototype[key] = methodObj[key]; }); } }
[ "function", "Enum", "(", "name", ",", "methodObj", ")", "{", "this", ".", "name", "=", "name", ";", "var", "prototype", "=", "new", "EnumSymbol", "(", "methodObj", ")", ";", "prototype", ".", "parentEnum", "=", "this", ";", "this", ".", "_symbolPrototype...
Base class for all Breeze enumerations, such as EntityState, DataType, FetchStrategy, MergeStrategy etc. A Breeze Enum is a namespaced set of constant values. Each Enum consists of a group of related constants, called 'symbols'. Unlike enums in some other environments, each 'symbol' can have both methods and propertie...
[ "Base", "class", "for", "all", "Breeze", "enumerations", "such", "as", "EntityState", "DataType", "FetchStrategy", "MergeStrategy", "etc", ".", "A", "Breeze", "Enum", "is", "a", "namespaced", "set", "of", "constant", "values", ".", "Each", "Enum", "consists", ...
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L1148-L1158
16,189
Breeze/breeze.js
build/breeze.debug.js
EntityAspect
function EntityAspect(entity) { if (entity === null) { var nullInstance = EntityAspect._nullInstance; if (nullInstance) return nullInstance; EntityAspect._nullInstance = this; } else if (entity === undefined) { throw new Error("The EntityAspect ctor requires an entity as its only argumen...
javascript
function EntityAspect(entity) { if (entity === null) { var nullInstance = EntityAspect._nullInstance; if (nullInstance) return nullInstance; EntityAspect._nullInstance = this; } else if (entity === undefined) { throw new Error("The EntityAspect ctor requires an entity as its only argumen...
[ "function", "EntityAspect", "(", "entity", ")", "{", "if", "(", "entity", "===", "null", ")", "{", "var", "nullInstance", "=", "EntityAspect", ".", "_nullInstance", ";", "if", "(", "nullInstance", ")", "return", "nullInstance", ";", "EntityAspect", ".", "_nu...
An EntityAspect instance is associated with every attached entity and is accessed via the entity's 'entityAspect' property. The EntityAspect itself provides properties to determine and modify the EntityState of the entity and has methods that provide a variety of services including validation and change tracking. An ...
[ "An", "EntityAspect", "instance", "is", "associated", "with", "every", "attached", "entity", "and", "is", "accessed", "via", "the", "entity", "s", "entityAspect", "property", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L3499-L3547
16,190
Breeze/breeze.js
build/breeze.debug.js
validateTarget
function validateTarget(target, coIndex) { var ok = true; var stype = target.entityType || target.complexType; var aspect = target.entityAspect || target.complexAspect; var entityAspect = target.entityAspect || target.complexAspect.getEntityAspect(); var context = { entity: entityAspect.entity }; ...
javascript
function validateTarget(target, coIndex) { var ok = true; var stype = target.entityType || target.complexType; var aspect = target.entityAspect || target.complexAspect; var entityAspect = target.entityAspect || target.complexAspect.getEntityAspect(); var context = { entity: entityAspect.entity }; ...
[ "function", "validateTarget", "(", "target", ",", "coIndex", ")", "{", "var", "ok", "=", "true", ";", "var", "stype", "=", "target", ".", "entityType", "||", "target", ".", "complexType", ";", "var", "aspect", "=", "target", ".", "entityAspect", "||", "t...
coIndex is only used where target is a complex object that is part of an array of complex objects in which case ctIndex is the index of the target within the array.
[ "coIndex", "is", "only", "used", "where", "target", "is", "a", "complex", "object", "that", "is", "part", "of", "an", "array", "of", "complex", "objects", "in", "which", "case", "ctIndex", "is", "the", "index", "of", "the", "target", "within", "the", "ar...
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L3993-L4028
16,191
Breeze/breeze.js
build/breeze.debug.js
ComplexAspect
function ComplexAspect(complexObject, parent, parentProperty) { if (!complexObject) { throw new Error("The ComplexAspect ctor requires an entity as its only argument."); } if (complexObject.complexAspect) { return complexObject.complexAspect; } // if called without new if (!(this in...
javascript
function ComplexAspect(complexObject, parent, parentProperty) { if (!complexObject) { throw new Error("The ComplexAspect ctor requires an entity as its only argument."); } if (complexObject.complexAspect) { return complexObject.complexAspect; } // if called without new if (!(this in...
[ "function", "ComplexAspect", "(", "complexObject", ",", "parent", ",", "parentProperty", ")", "{", "if", "(", "!", "complexObject", ")", "{", "throw", "new", "Error", "(", "\"The ComplexAspect ctor requires an entity as its only argument.\"", ")", ";", "}", "if", "...
An ComplexAspect instance is associated with every complex object instance and is accessed via the complex object's 'complexAspect' property. The ComplexAspect itself provides properties to determine the parent object, parent property and original values for the complex object. A ComplexAspect will almost never need ...
[ "An", "ComplexAspect", "instance", "is", "associated", "with", "every", "complex", "object", "instance", "and", "is", "accessed", "via", "the", "complex", "object", "s", "complexAspect", "property", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L4332-L4369
16,192
Breeze/breeze.js
build/breeze.debug.js
EntityKey
function EntityKey(entityType, keyValues) { assertParam(entityType, "entityType").isInstanceOf(EntityType).check(); var subtypes = entityType.getSelfAndSubtypes(); if (subtypes.length > 1) { this._subtypes = subtypes.filter(function (st) { return st.isAbstract === false; }); } i...
javascript
function EntityKey(entityType, keyValues) { assertParam(entityType, "entityType").isInstanceOf(EntityType).check(); var subtypes = entityType.getSelfAndSubtypes(); if (subtypes.length > 1) { this._subtypes = subtypes.filter(function (st) { return st.isAbstract === false; }); } i...
[ "function", "EntityKey", "(", "entityType", ",", "keyValues", ")", "{", "assertParam", "(", "entityType", ",", "\"entityType\"", ")", ".", "isInstanceOf", "(", "EntityType", ")", ".", "check", "(", ")", ";", "var", "subtypes", "=", "entityType", ".", "getSel...
An EntityKey is an object that represents the unique identity of an entity. EntityKey's are immutable. @class EntityKey Constructs a new EntityKey. Each entity within an EntityManager will have a unique EntityKey. @example assume em1 is an EntityManager containing a number of existing entities. var empType = em1.m...
[ "An", "EntityKey", "is", "an", "object", "that", "represents", "the", "unique", "identity", "of", "an", "entity", ".", "EntityKey", "s", "are", "immutable", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L4474-L4498
16,193
Breeze/breeze.js
build/breeze.debug.js
JsonResultsAdapter
function JsonResultsAdapter(config) { if (arguments.length !== 1) { throw new Error("The JsonResultsAdapter ctor should be called with a single argument that is a configuration object."); } assertConfig(config) .whereParam("name").isNonEmptyString() .whereParam("extractResults").i...
javascript
function JsonResultsAdapter(config) { if (arguments.length !== 1) { throw new Error("The JsonResultsAdapter ctor should be called with a single argument that is a configuration object."); } assertConfig(config) .whereParam("name").isNonEmptyString() .whereParam("extractResults").i...
[ "function", "JsonResultsAdapter", "(", "config", ")", "{", "if", "(", "arguments", ".", "length", "!==", "1", ")", "{", "throw", "new", "Error", "(", "\"The JsonResultsAdapter ctor should be called with a single argument that is a configuration object.\"", ")", ";", "}", ...
A JsonResultsAdapter instance is used to provide custom extraction and parsing logic on the json results returned by any web service. This facility makes it possible for breeze to talk to virtually any web service and return objects that will be first class 'breeze' citizens. @class JsonResultsAdapter JsonResultsAda...
[ "A", "JsonResultsAdapter", "instance", "is", "used", "to", "provide", "custom", "extraction", "and", "parsing", "logic", "on", "the", "json", "results", "returned", "by", "any", "web", "service", ".", "This", "facility", "makes", "it", "possible", "for", "bree...
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L6332-L6346
16,194
Breeze/breeze.js
build/breeze.debug.js
LocalQueryComparisonOptions
function LocalQueryComparisonOptions(config) { assertConfig(config || {}) .whereParam("name").isOptional().isString() .whereParam("isCaseSensitive").isOptional().isBoolean() .whereParam("usesSql92CompliantStringComparison").isBoolean() .applyAll(this); if (!this.name) { thi...
javascript
function LocalQueryComparisonOptions(config) { assertConfig(config || {}) .whereParam("name").isOptional().isString() .whereParam("isCaseSensitive").isOptional().isBoolean() .whereParam("usesSql92CompliantStringComparison").isBoolean() .applyAll(this); if (!this.name) { thi...
[ "function", "LocalQueryComparisonOptions", "(", "config", ")", "{", "assertConfig", "(", "config", "||", "{", "}", ")", ".", "whereParam", "(", "\"name\"", ")", ".", "isOptional", "(", ")", ".", "isString", "(", ")", ".", "whereParam", "(", "\"isCaseSensitiv...
A LocalQueryComparisonOptions instance is used to specify the "comparison rules" used when performing "local queries" in order to match the semantics of these same queries when executed against a remote service. These options should be set based on the manner in which your remote service interprets certain comparison ...
[ "A", "LocalQueryComparisonOptions", "instance", "is", "used", "to", "specify", "the", "comparison", "rules", "used", "when", "performing", "local", "queries", "in", "order", "to", "match", "the", "semantics", "of", "these", "same", "queries", "when", "executed", ...
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L9767-L9777
16,195
Breeze/breeze.js
build/breeze.debug.js
NamingConvention
function NamingConvention(config) { assertConfig(config || {}) .whereParam("name").isOptional().isString() .whereParam("serverPropertyNameToClient").isFunction() .whereParam("clientPropertyNameToServer").isFunction() .applyAll(this); if (!this.name) { this.name = __getUuid(...
javascript
function NamingConvention(config) { assertConfig(config || {}) .whereParam("name").isOptional().isString() .whereParam("serverPropertyNameToClient").isFunction() .whereParam("clientPropertyNameToServer").isFunction() .applyAll(this); if (!this.name) { this.name = __getUuid(...
[ "function", "NamingConvention", "(", "config", ")", "{", "assertConfig", "(", "config", "||", "{", "}", ")", ".", "whereParam", "(", "\"name\"", ")", ".", "isOptional", "(", ")", ".", "isString", "(", ")", ".", "whereParam", "(", "\"serverPropertyNameToClien...
A NamingConvention instance is used to specify the naming conventions under which a MetadataStore will translate property names between the server and the javascript client. The default NamingConvention does not perform any translation, it simply passes property names thru unchanged. @class NamingConvention NamingC...
[ "A", "NamingConvention", "instance", "is", "used", "to", "specify", "the", "naming", "conventions", "under", "which", "a", "MetadataStore", "will", "translate", "property", "names", "between", "the", "server", "and", "the", "javascript", "client", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L9858-L9868
16,196
Breeze/breeze.js
build/breeze.debug.js
function () { // empty ctor is used by all subclasses. if (arguments.length === 0) return; if (arguments.length === 1) { // 3 possibilities: // Predicate(aPredicate) // Predicate([ aPredicate ]) // Predicate(["freight", ">", 100"]) // Predica...
javascript
function () { // empty ctor is used by all subclasses. if (arguments.length === 0) return; if (arguments.length === 1) { // 3 possibilities: // Predicate(aPredicate) // Predicate([ aPredicate ]) // Predicate(["freight", ">", 100"]) // Predica...
[ "function", "(", ")", "{", "// empty ctor is used by all subclasses.", "if", "(", "arguments", ".", "length", "===", "0", ")", "return", ";", "if", "(", "arguments", ".", "length", "===", "1", ")", "{", "// 3 possibilities:", "// Predicate(aPredicate)", "// ...
Used to define a 'where' predicate for an EntityQuery. Predicates are immutable, which means that any method that would modify a Predicate actually returns a new Predicate. @class Predicate Predicate constructor @example var p1 = new Predicate("CompanyName", "StartsWith", "B"); var query = new EntityQuery("Customers...
[ "Used", "to", "define", "a", "where", "predicate", "for", "an", "EntityQuery", ".", "Predicates", "are", "immutable", "which", "means", "that", "any", "method", "that", "would", "modify", "a", "Predicate", "actually", "returns", "a", "new", "Predicate", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L9983-L10014
16,197
Breeze/breeze.js
build/breeze.debug.js
getPropertyPathValue
function getPropertyPathValue(obj, propertyPath) { var properties = Array.isArray(propertyPath) ? propertyPath : propertyPath.split("."); if (properties.length === 1) { return obj.getProperty(propertyPath); } else { var nextValue = obj; // hack use of some to perform mapFirst operation. properties...
javascript
function getPropertyPathValue(obj, propertyPath) { var properties = Array.isArray(propertyPath) ? propertyPath : propertyPath.split("."); if (properties.length === 1) { return obj.getProperty(propertyPath); } else { var nextValue = obj; // hack use of some to perform mapFirst operation. properties...
[ "function", "getPropertyPathValue", "(", "obj", ",", "propertyPath", ")", "{", "var", "properties", "=", "Array", ".", "isArray", "(", "propertyPath", ")", "?", "propertyPath", ":", "propertyPath", ".", "split", "(", "\".\"", ")", ";", "if", "(", "properties...
used by EntityQuery and Predicate
[ "used", "by", "EntityQuery", "and", "Predicate" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L12510-L12523
16,198
Breeze/breeze.js
build/breeze.debug.js
EntityManager
function EntityManager(config) { if (arguments.length > 1) { throw new Error("The EntityManager ctor has a single optional argument that is either a 'serviceName' or a configuration object."); } if (arguments.length === 0) { config = { serviceName: "" }; } else if (typeof config === 'string...
javascript
function EntityManager(config) { if (arguments.length > 1) { throw new Error("The EntityManager ctor has a single optional argument that is either a 'serviceName' or a configuration object."); } if (arguments.length === 0) { config = { serviceName: "" }; } else if (typeof config === 'string...
[ "function", "EntityManager", "(", "config", ")", "{", "if", "(", "arguments", ".", "length", ">", "1", ")", "{", "throw", "new", "Error", "(", "\"The EntityManager ctor has a single optional argument that is either a 'serviceName' or a configuration object.\"", ")", ";", ...
Instances of the EntityManager contain and manage collections of entities, either retrieved from a backend datastore or created on the client. @class EntityManager At its most basic an EntityManager can be constructed with just a service name @example var entityManager = new EntityManager( "breeze/NorthwindIBModel");...
[ "Instances", "of", "the", "EntityManager", "contain", "and", "manage", "collections", "of", "entities", "either", "retrieved", "from", "a", "backend", "datastore", "or", "created", "on", "the", "client", "." ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L13015-L13034
16,199
Breeze/breeze.js
build/breeze.debug.js
checkEntityTypes
function checkEntityTypes(em, entityTypes) { assertParam(entityTypes, "entityTypes").isString().isOptional().or().isNonEmptyArray().isString() .or().isInstanceOf(EntityType).or().isNonEmptyArray().isInstanceOf(EntityType).check(); if (typeof entityTypes === "string") { entityTypes = em.metadataSto...
javascript
function checkEntityTypes(em, entityTypes) { assertParam(entityTypes, "entityTypes").isString().isOptional().or().isNonEmptyArray().isString() .or().isInstanceOf(EntityType).or().isNonEmptyArray().isInstanceOf(EntityType).check(); if (typeof entityTypes === "string") { entityTypes = em.metadataSto...
[ "function", "checkEntityTypes", "(", "em", ",", "entityTypes", ")", "{", "assertParam", "(", "entityTypes", ",", "\"entityTypes\"", ")", ".", "isString", "(", ")", ".", "isOptional", "(", ")", ".", "or", "(", ")", ".", "isNonEmptyArray", "(", ")", ".", "...
takes in entityTypes as either strings or entityTypes or arrays of either and returns either an entityType or an array of entityTypes or throws an error
[ "takes", "in", "entityTypes", "as", "either", "strings", "or", "entityTypes", "or", "arrays", "of", "either", "and", "returns", "either", "an", "entityType", "or", "an", "array", "of", "entityTypes", "or", "throws", "an", "error" ]
06b4919202bd20388847ce7d0cf57b6011cca158
https://github.com/Breeze/breeze.js/blob/06b4919202bd20388847ce7d0cf57b6011cca158/build/breeze.debug.js#L14667-L14678