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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,100 | jacomyal/sigma.js | src/captors/sigma.captors.touch.js | _handleLeave | function _handleLeave(e) {
if (_settings('touchEnabled')) {
_downTouches = e.touches;
var inertiaRatio = _settings('touchInertiaRatio');
if (_movingTimeoutId) {
_isMoving = false;
clearTimeout(_movingTimeoutId);
}
switch (_touchMode) {
case 2... | javascript | function _handleLeave(e) {
if (_settings('touchEnabled')) {
_downTouches = e.touches;
var inertiaRatio = _settings('touchInertiaRatio');
if (_movingTimeoutId) {
_isMoving = false;
clearTimeout(_movingTimeoutId);
}
switch (_touchMode) {
case 2... | [
"function",
"_handleLeave",
"(",
"e",
")",
"{",
"if",
"(",
"_settings",
"(",
"'touchEnabled'",
")",
")",
"{",
"_downTouches",
"=",
"e",
".",
"touches",
";",
"var",
"inertiaRatio",
"=",
"_settings",
"(",
"'touchInertiaRatio'",
")",
";",
"if",
"(",
"_movingT... | The handler listening to the 'touchend', 'touchcancel' and 'touchleave'
event. It will update the touch mode if there are still at least one
finger, and stop dragging else.
@param {event} e A touch event. | [
"The",
"handler",
"listening",
"to",
"the",
"touchend",
"touchcancel",
"and",
"touchleave",
"event",
".",
"It",
"will",
"update",
"the",
"touch",
"mode",
"if",
"there",
"are",
"still",
"at",
"least",
"one",
"finger",
"and",
"stop",
"dragging",
"else",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.touch.js#L172-L217 |
6,101 | jacomyal/sigma.js | src/captors/sigma.captors.touch.js | _doubleTapHandler | function _doubleTapHandler(e) {
var pos,
ratio,
animation;
if (e.touches && e.touches.length === 1 && _settings('touchEnabled')) {
_doubleTap = true;
ratio = 1 / _settings('doubleClickZoomingRatio');
pos = position(e.touches[0]);
_self.dispatchEvent('do... | javascript | function _doubleTapHandler(e) {
var pos,
ratio,
animation;
if (e.touches && e.touches.length === 1 && _settings('touchEnabled')) {
_doubleTap = true;
ratio = 1 / _settings('doubleClickZoomingRatio');
pos = position(e.touches[0]);
_self.dispatchEvent('do... | [
"function",
"_doubleTapHandler",
"(",
"e",
")",
"{",
"var",
"pos",
",",
"ratio",
",",
"animation",
";",
"if",
"(",
"e",
".",
"touches",
"&&",
"e",
".",
"touches",
".",
"length",
"===",
"1",
"&&",
"_settings",
"(",
"'touchEnabled'",
")",
")",
"{",
"_d... | The handler listening to the double tap custom event. It will
basically zoom into the graph.
@param {event} e A touch event. | [
"The",
"handler",
"listening",
"to",
"the",
"double",
"tap",
"custom",
"event",
".",
"It",
"will",
"basically",
"zoom",
"into",
"the",
"graph",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.touch.js#L369-L408 |
6,102 | jacomyal/sigma.js | plugins/sigma.parsers.gexf/gexf-parser.js | Edge | function Edge(properties) {
// Possible Properties
var edge = {
id: properties.id,
type: properties.type || 'undirected',
label: properties.label || '',
source: properties.source,
target: properties.target,
weight: +properties.weight || 1.0
};
if (properties.viz)
... | javascript | function Edge(properties) {
// Possible Properties
var edge = {
id: properties.id,
type: properties.type || 'undirected',
label: properties.label || '',
source: properties.source,
target: properties.target,
weight: +properties.weight || 1.0
};
if (properties.viz)
... | [
"function",
"Edge",
"(",
"properties",
")",
"{",
"// Possible Properties",
"var",
"edge",
"=",
"{",
"id",
":",
"properties",
".",
"id",
",",
"type",
":",
"properties",
".",
"type",
"||",
"'undirected'",
",",
"label",
":",
"properties",
".",
"label",
"||",
... | Edge structure.
A function returning an object guarded with default value.
@param {object} properties The edge properties.
@return {object} The guarded edge object. | [
"Edge",
"structure",
".",
"A",
"function",
"returning",
"an",
"object",
"guarded",
"with",
"default",
"value",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L170-L189 |
6,103 | jacomyal/sigma.js | plugins/sigma.parsers.gexf/gexf-parser.js | _data | function _data(model, node_or_edge) {
var data = {};
var attvalues_els = node_or_edge.getElementsByTagName('attvalue');
// Getting Node Indicated Attributes
var ah = _helpers.nodeListToHash(attvalues_els, function(el) {
var attributes = _helpers.namedNodeMapToObject(el.attributes);
... | javascript | function _data(model, node_or_edge) {
var data = {};
var attvalues_els = node_or_edge.getElementsByTagName('attvalue');
// Getting Node Indicated Attributes
var ah = _helpers.nodeListToHash(attvalues_els, function(el) {
var attributes = _helpers.namedNodeMapToObject(el.attributes);
... | [
"function",
"_data",
"(",
"model",
",",
"node_or_edge",
")",
"{",
"var",
"data",
"=",
"{",
"}",
";",
"var",
"attvalues_els",
"=",
"node_or_edge",
".",
"getElementsByTagName",
"(",
"'attvalue'",
")",
";",
"// Getting Node Indicated Attributes",
"var",
"ah",
"=",
... | Data from nodes or edges | [
"Data",
"from",
"nodes",
"or",
"edges"
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L271-L297 |
6,104 | jacomyal/sigma.js | plugins/sigma.parsers.gexf/gexf-parser.js | _nodeViz | function _nodeViz(node) {
var viz = {};
// Color
var color_el = _helpers.getFirstElementByTagNS(node, 'viz', 'color');
if (color_el) {
var color = ['r', 'g', 'b', 'a'].map(function(c) {
return color_el.getAttribute(c);
});
viz.color = _helpers.getRGB(color);
... | javascript | function _nodeViz(node) {
var viz = {};
// Color
var color_el = _helpers.getFirstElementByTagNS(node, 'viz', 'color');
if (color_el) {
var color = ['r', 'g', 'b', 'a'].map(function(c) {
return color_el.getAttribute(c);
});
viz.color = _helpers.getRGB(color);
... | [
"function",
"_nodeViz",
"(",
"node",
")",
"{",
"var",
"viz",
"=",
"{",
"}",
";",
"// Color",
"var",
"color_el",
"=",
"_helpers",
".",
"getFirstElementByTagNS",
"(",
"node",
",",
"'viz'",
",",
"'color'",
")",
";",
"if",
"(",
"color_el",
")",
"{",
"var",... | Viz information from nodes | [
"Viz",
"information",
"from",
"nodes"
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L328-L364 |
6,105 | jacomyal/sigma.js | plugins/sigma.parsers.gexf/gexf-parser.js | _edgeViz | function _edgeViz(edge) {
var viz = {};
// Color
var color_el = _helpers.getFirstElementByTagNS(edge, 'viz', 'color');
if (color_el) {
var color = ['r', 'g', 'b', 'a'].map(function(c) {
return color_el.getAttribute(c);
});
viz.color = _helpers.getRGB(color);
... | javascript | function _edgeViz(edge) {
var viz = {};
// Color
var color_el = _helpers.getFirstElementByTagNS(edge, 'viz', 'color');
if (color_el) {
var color = ['r', 'g', 'b', 'a'].map(function(c) {
return color_el.getAttribute(c);
});
viz.color = _helpers.getRGB(color);
... | [
"function",
"_edgeViz",
"(",
"edge",
")",
"{",
"var",
"viz",
"=",
"{",
"}",
";",
"// Color",
"var",
"color_el",
"=",
"_helpers",
".",
"getFirstElementByTagNS",
"(",
"edge",
",",
"'viz'",
",",
"'color'",
")",
";",
"if",
"(",
"color_el",
")",
"{",
"var",... | Viz information from edges | [
"Viz",
"information",
"from",
"edges"
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L395-L420 |
6,106 | jacomyal/sigma.js | plugins/sigma.parsers.gexf/gexf-parser.js | fetchAndParse | function fetchAndParse(gexf_url, callback) {
if (typeof callback === 'function') {
return fetch(gexf_url, function(gexf) {
callback(Graph(gexf));
});
} else
return Graph(fetch(gexf_url));
} | javascript | function fetchAndParse(gexf_url, callback) {
if (typeof callback === 'function') {
return fetch(gexf_url, function(gexf) {
callback(Graph(gexf));
});
} else
return Graph(fetch(gexf_url));
} | [
"function",
"fetchAndParse",
"(",
"gexf_url",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"callback",
"===",
"'function'",
")",
"{",
"return",
"fetch",
"(",
"gexf_url",
",",
"function",
"(",
"gexf",
")",
"{",
"callback",
"(",
"Graph",
"(",
"gexf",
")... | Fetch and parse the GEXF File | [
"Fetch",
"and",
"parse",
"the",
"GEXF",
"File"
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L521-L528 |
6,107 | jacomyal/sigma.js | plugins/sigma.plugins.dragNodes/sigma.plugins.dragNodes.js | calculateOffset | function calculateOffset(element) {
var style = window.getComputedStyle(element);
var getCssProperty = function(prop) {
return parseInt(style.getPropertyValue(prop).replace('px', '')) || 0;
};
return {
left: element.getBoundingClientRect().left + getCssProperty('padding-left'),
... | javascript | function calculateOffset(element) {
var style = window.getComputedStyle(element);
var getCssProperty = function(prop) {
return parseInt(style.getPropertyValue(prop).replace('px', '')) || 0;
};
return {
left: element.getBoundingClientRect().left + getCssProperty('padding-left'),
... | [
"function",
"calculateOffset",
"(",
"element",
")",
"{",
"var",
"style",
"=",
"window",
".",
"getComputedStyle",
"(",
"element",
")",
";",
"var",
"getCssProperty",
"=",
"function",
"(",
"prop",
")",
"{",
"return",
"parseInt",
"(",
"style",
".",
"getPropertyV... | Calculates the global offset of the given element more accurately than element.offsetTop and element.offsetLeft. | [
"Calculates",
"the",
"global",
"offset",
"of",
"the",
"given",
"element",
"more",
"accurately",
"than",
"element",
".",
"offsetTop",
"and",
"element",
".",
"offsetLeft",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.plugins.dragNodes/sigma.plugins.dragNodes.js#L96-L105 |
6,108 | jacomyal/sigma.js | plugins/sigma.layout.forceAtlas2/worker.js | function(e) {
switch (e.data.action) {
case 'start':
init(
new Float32Array(e.data.nodes),
new Float32Array(e.data.edges),
e.data.config
);
// First iteration(s)
run(W.settings.startingIterations);
break;
case ... | javascript | function(e) {
switch (e.data.action) {
case 'start':
init(
new Float32Array(e.data.nodes),
new Float32Array(e.data.edges),
e.data.config
);
// First iteration(s)
run(W.settings.startingIterations);
break;
case ... | [
"function",
"(",
"e",
")",
"{",
"switch",
"(",
"e",
".",
"data",
".",
"action",
")",
"{",
"case",
"'start'",
":",
"init",
"(",
"new",
"Float32Array",
"(",
"e",
".",
"data",
".",
"nodes",
")",
",",
"new",
"Float32Array",
"(",
"e",
".",
"data",
"."... | On supervisor message | [
"On",
"supervisor",
"message"
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.layout.forceAtlas2/worker.js#L993-L1029 | |
6,109 | jacomyal/sigma.js | src/conrad.js | _dispatch | function _dispatch(events, data) {
var i,
j,
i_end,
j_end,
event,
eventName,
eArray = Array.isArray(events) ?
events :
events.split(/ /);
data = data === undefined ? {} : data;
for (i = 0, i_end = eArray.length; i !== i_... | javascript | function _dispatch(events, data) {
var i,
j,
i_end,
j_end,
event,
eventName,
eArray = Array.isArray(events) ?
events :
events.split(/ /);
data = data === undefined ? {} : data;
for (i = 0, i_end = eArray.length; i !== i_... | [
"function",
"_dispatch",
"(",
"events",
",",
"data",
")",
"{",
"var",
"i",
",",
"j",
",",
"i_end",
",",
"j_end",
",",
"event",
",",
"eventName",
",",
"eArray",
"=",
"Array",
".",
"isArray",
"(",
"events",
")",
"?",
"events",
":",
"events",
".",
"sp... | Executes each handler bound to the event.
@param {string} events The name of the event (or the events separated
by spaces).
@param {?Object} data The content of the event (optional).
@return {Object} Returns conrad. | [
"Executes",
"each",
"handler",
"bound",
"to",
"the",
"event",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L225-L253 |
6,110 | jacomyal/sigma.js | src/conrad.js | _activateJob | function _activateJob(job) {
var l = _sortedByPriorityJobs.length;
// Add the job to the running jobs:
_runningJobs[job.id] = job;
job.status = 'running';
// Add the job to the priorities:
if (l) {
job.weightTime = _sortedByPriorityJobs[l - 1].weightTime;
job.currentTime = job.weig... | javascript | function _activateJob(job) {
var l = _sortedByPriorityJobs.length;
// Add the job to the running jobs:
_runningJobs[job.id] = job;
job.status = 'running';
// Add the job to the priorities:
if (l) {
job.weightTime = _sortedByPriorityJobs[l - 1].weightTime;
job.currentTime = job.weig... | [
"function",
"_activateJob",
"(",
"job",
")",
"{",
"var",
"l",
"=",
"_sortedByPriorityJobs",
".",
"length",
";",
"// Add the job to the running jobs:",
"_runningJobs",
"[",
"job",
".",
"id",
"]",
"=",
"job",
";",
"job",
".",
"status",
"=",
"'running'",
";",
"... | Activates a job, by adding it to the _runningJobs object and the
_sortedByPriorityJobs array. It also initializes its currentTime value.
@param {Object} job The job to activate. | [
"Activates",
"a",
"job",
"by",
"adding",
"it",
"to",
"the",
"_runningJobs",
"object",
"and",
"the",
"_sortedByPriorityJobs",
"array",
".",
"It",
"also",
"initializes",
"its",
"currentTime",
"value",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L306-L324 |
6,111 | jacomyal/sigma.js | src/conrad.js | _addJob | function _addJob(v1, v2) {
var i,
l,
o;
// Array of jobs:
if (Array.isArray(v1)) {
// Keep conrad to start until the last job is added:
_noStart = true;
for (i = 0, l = v1.length; i < l; i++)
_addJob(v1[i].id, __extend(v1[i], v2));
_noStart = false;
i... | javascript | function _addJob(v1, v2) {
var i,
l,
o;
// Array of jobs:
if (Array.isArray(v1)) {
// Keep conrad to start until the last job is added:
_noStart = true;
for (i = 0, l = v1.length; i < l; i++)
_addJob(v1[i].id, __extend(v1[i], v2));
_noStart = false;
i... | [
"function",
"_addJob",
"(",
"v1",
",",
"v2",
")",
"{",
"var",
"i",
",",
"l",
",",
"o",
";",
"// Array of jobs:",
"if",
"(",
"Array",
".",
"isArray",
"(",
"v1",
")",
")",
"{",
"// Keep conrad to start until the last job is added:",
"_noStart",
"=",
"true",
... | Adds one or more jobs, and starts the loop if no job was running before. A
job is at least a unique string "id" and a function, and there are some
parameters that you can specify for each job to modify the way conrad will
execute it. If a job is added with the "id" of another job that is waiting
or still running, an er... | [
"Adds",
"one",
"or",
"more",
"jobs",
"and",
"starts",
"the",
"loop",
"if",
"no",
"job",
"was",
"running",
"before",
".",
"A",
"job",
"is",
"at",
"least",
"a",
"unique",
"string",
"id",
"and",
"a",
"function",
"and",
"there",
"are",
"some",
"parameters"... | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L473-L579 |
6,112 | jacomyal/sigma.js | src/conrad.js | _killJob | function _killJob(v1) {
var i,
l,
k,
a,
job,
found = false;
// Array of job ids:
if (Array.isArray(v1))
for (i = 0, l = v1.length; i < l; i++)
_killJob(v1[i]);
// One job's id:
else if (typeof v1 === 'string') {
a = [_runningJobs, _waitin... | javascript | function _killJob(v1) {
var i,
l,
k,
a,
job,
found = false;
// Array of job ids:
if (Array.isArray(v1))
for (i = 0, l = v1.length; i < l; i++)
_killJob(v1[i]);
// One job's id:
else if (typeof v1 === 'string') {
a = [_runningJobs, _waitin... | [
"function",
"_killJob",
"(",
"v1",
")",
"{",
"var",
"i",
",",
"l",
",",
"k",
",",
"a",
",",
"job",
",",
"found",
"=",
"false",
";",
"// Array of job ids:",
"if",
"(",
"Array",
".",
"isArray",
"(",
"v1",
")",
")",
"for",
"(",
"i",
"=",
"0",
",",... | Kills one or more jobs, indicated by their ids. It is only possible to
kill running jobs or waiting jobs. If you try to kill a job that does not
exist or that is already killed, a warning will be thrown.
@param {Array|String} v1 A string job id or an array of job ids.
@return {Object} Returns conrad. | [
"Kills",
"one",
"or",
"more",
"jobs",
"indicated",
"by",
"their",
"ids",
".",
"It",
"is",
"only",
"possible",
"to",
"kill",
"running",
"jobs",
"or",
"waiting",
"jobs",
".",
"If",
"you",
"try",
"to",
"kill",
"a",
"job",
"that",
"does",
"not",
"exist",
... | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L589-L641 |
6,113 | jacomyal/sigma.js | src/conrad.js | _killAll | function _killAll() {
var k,
jobs = __extend(_jobs, _runningJobs, _waitingJobs);
// Take every jobs and push them into the _doneJobs object:
if (_parameters.history)
for (k in jobs) {
jobs[k].status = 'done';
_doneJobs.push(jobs[k]);
if (typeof jobs[k].end === 'functi... | javascript | function _killAll() {
var k,
jobs = __extend(_jobs, _runningJobs, _waitingJobs);
// Take every jobs and push them into the _doneJobs object:
if (_parameters.history)
for (k in jobs) {
jobs[k].status = 'done';
_doneJobs.push(jobs[k]);
if (typeof jobs[k].end === 'functi... | [
"function",
"_killAll",
"(",
")",
"{",
"var",
"k",
",",
"jobs",
"=",
"__extend",
"(",
"_jobs",
",",
"_runningJobs",
",",
"_waitingJobs",
")",
";",
"// Take every jobs and push them into the _doneJobs object:",
"if",
"(",
"_parameters",
".",
"history",
")",
"for",
... | Kills every running, waiting, and just added jobs.
@return {Object} Returns conrad. | [
"Kills",
"every",
"running",
"waiting",
"and",
"just",
"added",
"jobs",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L648-L672 |
6,114 | jacomyal/sigma.js | src/conrad.js | _hasJob | function _hasJob(id) {
var job = _jobs[id] || _runningJobs[id] || _waitingJobs[id];
return job ? __extend(job) : null;
} | javascript | function _hasJob(id) {
var job = _jobs[id] || _runningJobs[id] || _waitingJobs[id];
return job ? __extend(job) : null;
} | [
"function",
"_hasJob",
"(",
"id",
")",
"{",
"var",
"job",
"=",
"_jobs",
"[",
"id",
"]",
"||",
"_runningJobs",
"[",
"id",
"]",
"||",
"_waitingJobs",
"[",
"id",
"]",
";",
"return",
"job",
"?",
"__extend",
"(",
"job",
")",
":",
"null",
";",
"}"
] | Returns true if a job with the specified id is currently running or
waiting, and false else.
@param {String} id The id of the job.
@return {?Object} Returns the job object if it exists. | [
"Returns",
"true",
"if",
"a",
"job",
"with",
"the",
"specified",
"id",
"is",
"currently",
"running",
"or",
"waiting",
"and",
"false",
"else",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L681-L684 |
6,115 | jacomyal/sigma.js | src/conrad.js | _settings | function _settings(v1, v2) {
var o;
if (typeof a1 === 'string' && arguments.length === 1)
return _parameters[a1];
else {
o = (typeof a1 === 'object' && arguments.length === 1) ?
a1 || {} :
{};
if (typeof a1 === 'string')
o[a1] = a2;
for (var k in o)
... | javascript | function _settings(v1, v2) {
var o;
if (typeof a1 === 'string' && arguments.length === 1)
return _parameters[a1];
else {
o = (typeof a1 === 'object' && arguments.length === 1) ?
a1 || {} :
{};
if (typeof a1 === 'string')
o[a1] = a2;
for (var k in o)
... | [
"function",
"_settings",
"(",
"v1",
",",
"v2",
")",
"{",
"var",
"o",
";",
"if",
"(",
"typeof",
"a1",
"===",
"'string'",
"&&",
"arguments",
".",
"length",
"===",
"1",
")",
"return",
"_parameters",
"[",
"a1",
"]",
";",
"else",
"{",
"o",
"=",
"(",
"... | This method will set the setting specified by "v1" to the value specified
by "v2" if both are given, and else return the current value of the
settings "v1".
@param {String} v1 The name of the property.
@param {?*} v2 Eventually, a value to set to the specified
property.
@return {Object|*} Returns the specifi... | [
"This",
"method",
"will",
"set",
"the",
"setting",
"specified",
"by",
"v1",
"to",
"the",
"value",
"specified",
"by",
"v2",
"if",
"both",
"are",
"given",
"and",
"else",
"return",
"the",
"current",
"value",
"of",
"the",
"settings",
"v1",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L697-L717 |
6,116 | jacomyal/sigma.js | src/conrad.js | _getStats | function _getStats(v1, v2) {
var a,
k,
i,
l,
stats,
pattern,
isPatternString;
if (!arguments.length) {
stats = [];
for (k in _jobs)
stats.push(_jobs[k]);
for (k in _waitingJobs)
stats.push(_waitingJobs[k]);
for (k in _ru... | javascript | function _getStats(v1, v2) {
var a,
k,
i,
l,
stats,
pattern,
isPatternString;
if (!arguments.length) {
stats = [];
for (k in _jobs)
stats.push(_jobs[k]);
for (k in _waitingJobs)
stats.push(_waitingJobs[k]);
for (k in _ru... | [
"function",
"_getStats",
"(",
"v1",
",",
"v2",
")",
"{",
"var",
"a",
",",
"k",
",",
"i",
",",
"l",
",",
"stats",
",",
"pattern",
",",
"isPatternString",
";",
"if",
"(",
"!",
"arguments",
".",
"length",
")",
"{",
"stats",
"=",
"[",
"]",
";",
"fo... | Returns a snapshot of every data about jobs that wait to be started, are
currently running or are done.
It is possible to get only running, waiting or done jobs by giving
"running", "waiting" or "done" as fist argument.
It is also possible to get every job with a specified id by giving it as
first argument. Also, usi... | [
"Returns",
"a",
"snapshot",
"of",
"every",
"data",
"about",
"jobs",
"that",
"wait",
"to",
"be",
"started",
"are",
"currently",
"running",
"or",
"are",
"done",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L764-L842 |
6,117 | jacomyal/sigma.js | src/conrad.js | __clone | function __clone(item) {
var result, i, k, l;
if (!item)
return item;
if (Array.isArray(item)) {
result = [];
for (i = 0, l = item.length; i < l; i++)
result.push(__clone(item[i]));
} else if (typeof item === 'object') {
result = {};
for (i in item)
result... | javascript | function __clone(item) {
var result, i, k, l;
if (!item)
return item;
if (Array.isArray(item)) {
result = [];
for (i = 0, l = item.length; i < l; i++)
result.push(__clone(item[i]));
} else if (typeof item === 'object') {
result = {};
for (i in item)
result... | [
"function",
"__clone",
"(",
"item",
")",
"{",
"var",
"result",
",",
"i",
",",
"k",
",",
"l",
";",
"if",
"(",
"!",
"item",
")",
"return",
"item",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"item",
")",
")",
"{",
"result",
"=",
"[",
"]",
";"... | This function simply clones an object. This object must contain only
objects, arrays and immutable values. Since it is not public, it does not
deal with cyclic references, DOM elements and instantiated objects - so
use it carefully.
@param {Object} The object to clone.
@return {Object} The clone. | [
"This",
"function",
"simply",
"clones",
"an",
"object",
".",
"This",
"object",
"must",
"contain",
"only",
"objects",
"arrays",
"and",
"immutable",
"values",
".",
"Since",
"it",
"is",
"not",
"public",
"it",
"does",
"not",
"deal",
"with",
"cyclic",
"references... | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L902-L920 |
6,118 | jacomyal/sigma.js | src/conrad.js | __objectValues | function __objectValues(o) {
var k,
a = [];
for (k in o)
a.push(o[k]);
return a;
} | javascript | function __objectValues(o) {
var k,
a = [];
for (k in o)
a.push(o[k]);
return a;
} | [
"function",
"__objectValues",
"(",
"o",
")",
"{",
"var",
"k",
",",
"a",
"=",
"[",
"]",
";",
"for",
"(",
"k",
"in",
"o",
")",
"a",
".",
"push",
"(",
"o",
"[",
"k",
"]",
")",
";",
"return",
"a",
";",
"}"
] | Returns an array containing the values of an object.
@param {Object} The object.
@return {Array} The array of values. | [
"Returns",
"an",
"array",
"containing",
"the",
"values",
"of",
"an",
"object",
"."
] | c49589f2419ca98542fd21b82b926dea21bb9fef | https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L928-L936 |
6,119 | typicode/hotel | src/cli/daemon.js | start | function start() {
const node = process.execPath
const daemonFile = path.join(__dirname, '../daemon')
const startupFile = startup.getFile('hotel')
startup.create('hotel', node, [daemonFile], common.logFile)
// Save startup file path in ~/.hotel
// Will be used later by uninstall script
mkdirp.sync(commo... | javascript | function start() {
const node = process.execPath
const daemonFile = path.join(__dirname, '../daemon')
const startupFile = startup.getFile('hotel')
startup.create('hotel', node, [daemonFile], common.logFile)
// Save startup file path in ~/.hotel
// Will be used later by uninstall script
mkdirp.sync(commo... | [
"function",
"start",
"(",
")",
"{",
"const",
"node",
"=",
"process",
".",
"execPath",
"const",
"daemonFile",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../daemon'",
")",
"const",
"startupFile",
"=",
"startup",
".",
"getFile",
"(",
"'hotel'",
")",
... | Start daemon in background | [
"Start",
"daemon",
"in",
"background"
] | cd4711ad46573f0cdeb59a839aa9f34b43172df5 | https://github.com/typicode/hotel/blob/cd4711ad46573f0cdeb59a839aa9f34b43172df5/src/cli/daemon.js#L15-L28 |
6,120 | marcj/css-element-queries | src/ElementQueries.js | queueQuery | function queueQuery(selector, mode, property, value) {
if (typeof(allQueries[selector]) === 'undefined') {
allQueries[selector] = [];
// add animation to trigger animationstart event, so we know exactly when a element appears in the DOM
var id = idToSelectorM... | javascript | function queueQuery(selector, mode, property, value) {
if (typeof(allQueries[selector]) === 'undefined') {
allQueries[selector] = [];
// add animation to trigger animationstart event, so we know exactly when a element appears in the DOM
var id = idToSelectorM... | [
"function",
"queueQuery",
"(",
"selector",
",",
"mode",
",",
"property",
",",
"value",
")",
"{",
"if",
"(",
"typeof",
"(",
"allQueries",
"[",
"selector",
"]",
")",
"===",
"'undefined'",
")",
"{",
"allQueries",
"[",
"selector",
"]",
"=",
"[",
"]",
";",
... | Stores rules to the selector that should be applied once resized.
@param {String} selector
@param {String} mode min|max
@param {String} property width|height
@param {String} value | [
"Stores",
"rules",
"to",
"the",
"selector",
"that",
"should",
"be",
"applied",
"once",
"resized",
"."
] | 31cabb56fb2af08470159251f6e535e2c3577758 | https://github.com/marcj/css-element-queries/blob/31cabb56fb2af08470159251f6e535e2c3577758/src/ElementQueries.js#L190-L206 |
6,121 | marcj/css-element-queries | src/ElementQueries.js | findElementQueriesElements | function findElementQueriesElements(container) {
var query = getQuery(container);
for (var selector in allQueries) if (allQueries.hasOwnProperty(selector)) {
// find all elements based on the extract query selector from the element query rule
var elements = query... | javascript | function findElementQueriesElements(container) {
var query = getQuery(container);
for (var selector in allQueries) if (allQueries.hasOwnProperty(selector)) {
// find all elements based on the extract query selector from the element query rule
var elements = query... | [
"function",
"findElementQueriesElements",
"(",
"container",
")",
"{",
"var",
"query",
"=",
"getQuery",
"(",
"container",
")",
";",
"for",
"(",
"var",
"selector",
"in",
"allQueries",
")",
"if",
"(",
"allQueries",
".",
"hasOwnProperty",
"(",
"selector",
")",
"... | If animationStart didn't catch a new element in the DOM, we can manually search for it | [
"If",
"animationStart",
"didn",
"t",
"catch",
"a",
"new",
"element",
"in",
"the",
"DOM",
"we",
"can",
"manually",
"search",
"for",
"it"
] | 31cabb56fb2af08470159251f6e535e2c3577758 | https://github.com/marcj/css-element-queries/blob/31cabb56fb2af08470159251f6e535e2c3577758/src/ElementQueries.js#L224-L235 |
6,122 | TypeStrong/typedoc | scripts/rebuild_specs.js | getFiles | function getFiles(base, dir = '', results = []) {
const files = fs.readdirSync(path.join(base, dir));
for (const file of files) {
const relativeToBase = path.join(dir, file);
if (fs.statSync(path.join(base, relativeToBase)).isDirectory()) {
get... | javascript | function getFiles(base, dir = '', results = []) {
const files = fs.readdirSync(path.join(base, dir));
for (const file of files) {
const relativeToBase = path.join(dir, file);
if (fs.statSync(path.join(base, relativeToBase)).isDirectory()) {
get... | [
"function",
"getFiles",
"(",
"base",
",",
"dir",
"=",
"''",
",",
"results",
"=",
"[",
"]",
")",
"{",
"const",
"files",
"=",
"fs",
".",
"readdirSync",
"(",
"path",
".",
"join",
"(",
"base",
",",
"dir",
")",
")",
";",
"for",
"(",
"const",
"file",
... | Rewrite GitHub urls
Avoiding sync methods here is... difficult.
@param {string} base
@param {string} dir
@param {string[]} results
@returns {string[]} | [
"Rewrite",
"GitHub",
"urls",
"Avoiding",
"sync",
"methods",
"here",
"is",
"...",
"difficult",
"."
] | 185ca2fdbf489325edb9880ca90668372232ce03 | https://github.com/TypeStrong/typedoc/blob/185ca2fdbf489325edb9880ca90668372232ce03/scripts/rebuild_specs.js#L66-L77 |
6,123 | hiloteam/Hilo | build/amd/hilo-amd.js | function(font){
var me = this;
if(me.font !== font){
me.font = font;
me._fontHeight = Text.measureFontHeight(font);
}
return me;
} | javascript | function(font){
var me = this;
if(me.font !== font){
me.font = font;
me._fontHeight = Text.measureFontHeight(font);
}
return me;
} | [
"function",
"(",
"font",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"me",
".",
"font",
"!==",
"font",
")",
"{",
"me",
".",
"font",
"=",
"font",
";",
"me",
".",
"_fontHeight",
"=",
"Text",
".",
"measureFontHeight",
"(",
"font",
")",
";",
... | read-only
@language=en
Set text CSS font style.
@param {String} font Text CSS font style to set.
@returns {Text} the Text object, chained call supported. | [
"read",
"-",
"only"
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/amd/hilo-amd.js#L4577-L4585 | |
6,124 | hiloteam/Hilo | build/amd/hilo-amd.js | rotateX | function rotateX(x, y, z, ca, sa) {//rotate x
return {
x: x,
y: y * ca - z * sa,
z: y * sa + z * ca
};
} | javascript | function rotateX(x, y, z, ca, sa) {//rotate x
return {
x: x,
y: y * ca - z * sa,
z: y * sa + z * ca
};
} | [
"function",
"rotateX",
"(",
"x",
",",
"y",
",",
"z",
",",
"ca",
",",
"sa",
")",
"{",
"//rotate x",
"return",
"{",
"x",
":",
"x",
",",
"y",
":",
"y",
"*",
"ca",
"-",
"z",
"*",
"sa",
",",
"z",
":",
"y",
"*",
"sa",
"+",
"z",
"*",
"ca",
"}"... | Rotate the axis. | [
"Rotate",
"the",
"axis",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/amd/hilo-amd.js#L7627-L7633 |
6,125 | hiloteam/Hilo | build/physics/physics.js | function(p1, p2, r1, r2)
{
var mindist = r1 + r2;
var delta = vsub(p2, p1);
var distsq = vlengthsq(delta);
if(distsq >= mindist*mindist) return;
var dist = Math.sqrt(distsq);
// Allocate and initialize the contact.
return new Contact(
vadd(p1, vmult(delta, 0.5 + (r1 - 0.5*mindi... | javascript | function(p1, p2, r1, r2)
{
var mindist = r1 + r2;
var delta = vsub(p2, p1);
var distsq = vlengthsq(delta);
if(distsq >= mindist*mindist) return;
var dist = Math.sqrt(distsq);
// Allocate and initialize the contact.
return new Contact(
vadd(p1, vmult(delta, 0.5 + (r1 - 0.5*mindi... | [
"function",
"(",
"p1",
",",
"p2",
",",
"r1",
",",
"r2",
")",
"{",
"var",
"mindist",
"=",
"r1",
"+",
"r2",
";",
"var",
"delta",
"=",
"vsub",
"(",
"p2",
",",
"p1",
")",
";",
"var",
"distsq",
"=",
"vlengthsq",
"(",
"delta",
")",
";",
"if",
"(",
... | Add contact points for circle to circle collisions. Used by several collision tests. | [
"Add",
"contact",
"points",
"for",
"circle",
"to",
"circle",
"collisions",
".",
"Used",
"by",
"several",
"collision",
"tests",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3247-L3263 | |
6,126 | hiloteam/Hilo | build/physics/physics.js | function(circ1, circ2)
{
var contact = circle2circleQuery(circ1.tc, circ2.tc, circ1.r, circ2.r);
return contact ? [contact] : NONE;
} | javascript | function(circ1, circ2)
{
var contact = circle2circleQuery(circ1.tc, circ2.tc, circ1.r, circ2.r);
return contact ? [contact] : NONE;
} | [
"function",
"(",
"circ1",
",",
"circ2",
")",
"{",
"var",
"contact",
"=",
"circle2circleQuery",
"(",
"circ1",
".",
"tc",
",",
"circ2",
".",
"tc",
",",
"circ1",
".",
"r",
",",
"circ2",
".",
"r",
")",
";",
"return",
"contact",
"?",
"[",
"contact",
"]"... | Collide circle shapes. | [
"Collide",
"circle",
"shapes",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3266-L3270 | |
6,127 | hiloteam/Hilo | build/physics/physics.js | function(poly1, poly2, n, dist)
{
var arr = [];
var verts1 = poly1.tVerts;
for(var i=0; i<verts1.length; i+=2){
var vx = verts1[i];
var vy = verts1[i+1];
if(poly2.containsVert(vx, vy)){
arr.push(new Contact(new Vect(vx, vy), n, dist, hashPair(poly1.hashid, i>>1)));
... | javascript | function(poly1, poly2, n, dist)
{
var arr = [];
var verts1 = poly1.tVerts;
for(var i=0; i<verts1.length; i+=2){
var vx = verts1[i];
var vy = verts1[i+1];
if(poly2.containsVert(vx, vy)){
arr.push(new Contact(new Vect(vx, vy), n, dist, hashPair(poly1.hashid, i>>1)));
... | [
"function",
"(",
"poly1",
",",
"poly2",
",",
"n",
",",
"dist",
")",
"{",
"var",
"arr",
"=",
"[",
"]",
";",
"var",
"verts1",
"=",
"poly1",
".",
"tVerts",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"verts1",
".",
"length",
";",
"i",
... | Add contacts for penetrating vertexes. | [
"Add",
"contacts",
"for",
"penetrating",
"vertexes",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3353-L3376 | |
6,128 | hiloteam/Hilo | build/physics/physics.js | function(poly1, poly2)
{
var mini1 = findMSA(poly2, poly1.tPlanes);
if(mini1 == -1) return NONE;
var min1 = last_MSA_min;
var mini2 = findMSA(poly1, poly2.tPlanes);
if(mini2 == -1) return NONE;
var min2 = last_MSA_min;
// There is overlap, find the penetrating verts
if(min1 > m... | javascript | function(poly1, poly2)
{
var mini1 = findMSA(poly2, poly1.tPlanes);
if(mini1 == -1) return NONE;
var min1 = last_MSA_min;
var mini2 = findMSA(poly1, poly2.tPlanes);
if(mini2 == -1) return NONE;
var min2 = last_MSA_min;
// There is overlap, find the penetrating verts
if(min1 > m... | [
"function",
"(",
"poly1",
",",
"poly2",
")",
"{",
"var",
"mini1",
"=",
"findMSA",
"(",
"poly2",
",",
"poly1",
".",
"tPlanes",
")",
";",
"if",
"(",
"mini1",
"==",
"-",
"1",
")",
"return",
"NONE",
";",
"var",
"min1",
"=",
"last_MSA_min",
";",
"var",
... | Collide poly shapes together. | [
"Collide",
"poly",
"shapes",
"together",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3379-L3394 | |
6,129 | hiloteam/Hilo | build/physics/physics.js | function(arr, seg, poly, pDist, coef)
{
var dta = vcross(seg.tn, seg.ta);
var dtb = vcross(seg.tn, seg.tb);
var n = vmult(seg.tn, coef);
var verts = poly.tVerts;
for(var i=0; i<verts.length; i+=2){
var vx = verts[i];
var vy = verts[i+1];
if(vdot2(vx, vy, n.x, n.y) < vdo... | javascript | function(arr, seg, poly, pDist, coef)
{
var dta = vcross(seg.tn, seg.ta);
var dtb = vcross(seg.tn, seg.tb);
var n = vmult(seg.tn, coef);
var verts = poly.tVerts;
for(var i=0; i<verts.length; i+=2){
var vx = verts[i];
var vy = verts[i+1];
if(vdot2(vx, vy, n.x, n.y) < vdo... | [
"function",
"(",
"arr",
",",
"seg",
",",
"poly",
",",
"pDist",
",",
"coef",
")",
"{",
"var",
"dta",
"=",
"vcross",
"(",
"seg",
".",
"tn",
",",
"seg",
".",
"ta",
")",
";",
"var",
"dtb",
"=",
"vcross",
"(",
"seg",
".",
"tn",
",",
"seg",
".",
... | Identify vertexes that have penetrated the segment. | [
"Identify",
"vertexes",
"that",
"have",
"penetrated",
"the",
"segment",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3405-L3422 | |
6,130 | hiloteam/Hilo | build/physics/physics.js | function(a, b, r1, r2, k1, k2)
{
// calculate mass matrix
// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...
var k11, k12, k21, k22;
var m_sum = a.m_inv + b.m_inv;
// start with I*m_sum
k11 = m_sum; k12 = 0;
k21 = 0; k22 = m_sum;
// add the in... | javascript | function(a, b, r1, r2, k1, k2)
{
// calculate mass matrix
// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...
var k11, k12, k21, k22;
var m_sum = a.m_inv + b.m_inv;
// start with I*m_sum
k11 = m_sum; k12 = 0;
k21 = 0; k22 = m_sum;
// add the in... | [
"function",
"(",
"a",
",",
"b",
",",
"r1",
",",
"r2",
",",
"k1",
",",
"k2",
")",
"{",
"// calculate mass matrix",
"// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...",
"var",
"k11",
",",
"k12",
",",
"k21",
",",
"k22",
";",
"var",
"... | k1 and k2 are modified by the function to contain the outputs. | [
"k1",
"and",
"k2",
"are",
"modified",
"by",
"the",
"function",
"to",
"contain",
"the",
"outputs",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L5083-L5118 | |
6,131 | hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/frame/Opt.js | function(args, optNames) {
var opt = {"_": []}; // the unnamed option allows multiple values
for (var i = 0; i < args.length; i++) {
var arg = new String(args[i]);
var name;
var value;
if (arg.charAt(0) == "-") {
if (arg.charAt(1) == "-") { // it's a longname like --foo
arg = arg.substring(2);
... | javascript | function(args, optNames) {
var opt = {"_": []}; // the unnamed option allows multiple values
for (var i = 0; i < args.length; i++) {
var arg = new String(args[i]);
var name;
var value;
if (arg.charAt(0) == "-") {
if (arg.charAt(1) == "-") { // it's a longname like --foo
arg = arg.substring(2);
... | [
"function",
"(",
"args",
",",
"optNames",
")",
"{",
"var",
"opt",
"=",
"{",
"\"_\"",
":",
"[",
"]",
"}",
";",
"// the unnamed option allows multiple values",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",... | Get commandline option values.
@param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"]
@param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}.
@return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true} | [
"Get",
"commandline",
"option",
"values",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/frame/Opt.js#L9-L60 | |
6,132 | hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/run.js | function(/**Array*/ path) {
if (path.constructor != Array) path = path.split(/[\\\/]/);
var make = "";
for (var i = 0, l = path.length; i < l; i++) {
make += path[i] + SYS.slash;
if (! IO.exists(make)) {
IO.makeDir(make);
}
}
} | javascript | function(/**Array*/ path) {
if (path.constructor != Array) path = path.split(/[\\\/]/);
var make = "";
for (var i = 0, l = path.length; i < l; i++) {
make += path[i] + SYS.slash;
if (! IO.exists(make)) {
IO.makeDir(make);
}
}
} | [
"function",
"(",
"/**Array*/",
"path",
")",
"{",
"if",
"(",
"path",
".",
"constructor",
"!=",
"Array",
")",
"path",
"=",
"path",
".",
"split",
"(",
"/",
"[\\\\\\/]",
"/",
")",
";",
"var",
"make",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"0"... | Creates a series of nested directories. | [
"Creates",
"a",
"series",
"of",
"nested",
"directories",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/run.js#L220-L229 | |
6,133 | hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/run.js | function(path) {
if (!path) return;
for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
if (/\.js$/i.test(lib[i])) load(lib[i]);
} | javascript | function(path) {
if (!path) return;
for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
if (/\.js$/i.test(lib[i])) load(lib[i]);
} | [
"function",
"(",
"path",
")",
"{",
"if",
"(",
"!",
"path",
")",
"return",
";",
"for",
"(",
"var",
"lib",
"=",
"IO",
".",
"ls",
"(",
"SYS",
".",
"pwd",
"+",
"path",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"lib",
".",
"length",
";",
"i",
"+... | Loads all scripts from the given directory path. | [
"Loads",
"all",
"scripts",
"from",
"the",
"given",
"directory",
"path",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/run.js#L336-L341 | |
6,134 | hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/frame/Link.js | Link | function Link() {
this.alias = "";
this.src = "";
this.file = "";
this.text = "";
this.innerName = "";
this.classLink = false;
this.targetName = "";
this.target = function(targetName) {
if (defined(targetName)) this.targetName = targetName;
return this;
}
this.inner = function(inner) {
if (defined(inn... | javascript | function Link() {
this.alias = "";
this.src = "";
this.file = "";
this.text = "";
this.innerName = "";
this.classLink = false;
this.targetName = "";
this.target = function(targetName) {
if (defined(targetName)) this.targetName = targetName;
return this;
}
this.inner = function(inner) {
if (defined(inn... | [
"function",
"Link",
"(",
")",
"{",
"this",
".",
"alias",
"=",
"\"\"",
";",
"this",
".",
"src",
"=",
"\"\"",
";",
"this",
".",
"file",
"=",
"\"\"",
";",
"this",
".",
"text",
"=",
"\"\"",
";",
"this",
".",
"innerName",
"=",
"\"\"",
";",
"this",
"... | Handle the creation of HTML links to documented symbols.
@constructor | [
"Handle",
"the",
"creation",
"of",
"HTML",
"links",
"to",
"documented",
"symbols",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/frame/Link.js#L4-L68 |
6,135 | react-native-community/react-native-svg | index.web.js | prepare | function prepare(props) {
const {
translate,
scale,
rotation,
skewX,
skewY,
originX,
originY,
fontFamily,
fontSize,
fontWeight,
fontStyle,
style,
...clean
} = props;
const transform = [];
if (originX != null || originY != null) {
transform.push(`translat... | javascript | function prepare(props) {
const {
translate,
scale,
rotation,
skewX,
skewY,
originX,
originY,
fontFamily,
fontSize,
fontWeight,
fontStyle,
style,
...clean
} = props;
const transform = [];
if (originX != null || originY != null) {
transform.push(`translat... | [
"function",
"prepare",
"(",
"props",
")",
"{",
"const",
"{",
"translate",
",",
"scale",
",",
"rotation",
",",
"skewX",
",",
"skewY",
",",
"originX",
",",
"originY",
",",
"fontFamily",
",",
"fontSize",
",",
"fontWeight",
",",
"fontStyle",
",",
"style",
",... | `react-native-svg` supports additional props that aren't defined in the spec.
This function replaces them in a spec conforming manner.
@param {Object} props Properties given to us.
@returns {Object} Cleaned object.
@private | [
"react",
"-",
"native",
"-",
"svg",
"supports",
"additional",
"props",
"that",
"aren",
"t",
"defined",
"in",
"the",
"spec",
".",
"This",
"function",
"replaces",
"them",
"in",
"a",
"spec",
"conforming",
"manner",
"."
] | 235ded3d09e1b0a05957d3ba8a42424916d34f38 | https://github.com/react-native-community/react-native-svg/blob/235ded3d09e1b0a05957d3ba8a42424916d34f38/index.web.js#L13-L77 |
6,136 | garris/BackstopJS | core/util/runPuppet.js | translateUrl | function translateUrl (url) {
const RE = new RegExp('^[./]');
if (RE.test(url)) {
const fileUrl = 'file://' + path.join(process.cwd(), url);
console.log('Relative filename detected -- translating to ' + fileUrl);
return fileUrl;
} else {
return url;
}
} | javascript | function translateUrl (url) {
const RE = new RegExp('^[./]');
if (RE.test(url)) {
const fileUrl = 'file://' + path.join(process.cwd(), url);
console.log('Relative filename detected -- translating to ' + fileUrl);
return fileUrl;
} else {
return url;
}
} | [
"function",
"translateUrl",
"(",
"url",
")",
"{",
"const",
"RE",
"=",
"new",
"RegExp",
"(",
"'^[./]'",
")",
";",
"if",
"(",
"RE",
".",
"test",
"(",
"url",
")",
")",
"{",
"const",
"fileUrl",
"=",
"'file://'",
"+",
"path",
".",
"join",
"(",
"process"... | handle relative file name | [
"handle",
"relative",
"file",
"name"
] | d0a5ade11c1d8732158e6218a6f8a288f0bfc4db | https://github.com/garris/BackstopJS/blob/d0a5ade11c1d8732158e6218a6f8a288f0bfc4db/core/util/runPuppet.js#L397-L406 |
6,137 | prebid/Prebid.js | modules/consentManagement.js | processCmpData | function processCmpData(consentObject, hookConfig) {
let gdprApplies = consentObject && consentObject.getConsentData && consentObject.getConsentData.gdprApplies;
if (
(typeof gdprApplies !== 'boolean') ||
(gdprApplies === true &&
!(utils.isStr(consentObject.getConsentData.consentData) &&
utils... | javascript | function processCmpData(consentObject, hookConfig) {
let gdprApplies = consentObject && consentObject.getConsentData && consentObject.getConsentData.gdprApplies;
if (
(typeof gdprApplies !== 'boolean') ||
(gdprApplies === true &&
!(utils.isStr(consentObject.getConsentData.consentData) &&
utils... | [
"function",
"processCmpData",
"(",
"consentObject",
",",
"hookConfig",
")",
"{",
"let",
"gdprApplies",
"=",
"consentObject",
"&&",
"consentObject",
".",
"getConsentData",
"&&",
"consentObject",
".",
"getConsentData",
".",
"gdprApplies",
";",
"if",
"(",
"(",
"typeo... | This function checks the consent data provided by CMP to ensure it's in an expected state.
If it's bad, we exit the module depending on config settings.
If it's good, then we store the value and exits the module.
@param {object} consentObject required; object returned by CMP that contains user's consent choices
@param ... | [
"This",
"function",
"checks",
"the",
"consent",
"data",
"provided",
"by",
"CMP",
"to",
"ensure",
"it",
"s",
"in",
"an",
"expected",
"state",
".",
"If",
"it",
"s",
"bad",
"we",
"exit",
"the",
"module",
"depending",
"on",
"config",
"settings",
".",
"If",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L234-L252 |
6,138 | prebid/Prebid.js | modules/consentManagement.js | cmpFailed | function cmpFailed(errMsg, hookConfig, extraArgs) {
clearTimeout(hookConfig.timer);
// still set the consentData to undefined when there is a problem as per config options
if (allowAuction) {
storeConsentData(undefined);
}
exitModule(errMsg, hookConfig, extraArgs);
} | javascript | function cmpFailed(errMsg, hookConfig, extraArgs) {
clearTimeout(hookConfig.timer);
// still set the consentData to undefined when there is a problem as per config options
if (allowAuction) {
storeConsentData(undefined);
}
exitModule(errMsg, hookConfig, extraArgs);
} | [
"function",
"cmpFailed",
"(",
"errMsg",
",",
"hookConfig",
",",
"extraArgs",
")",
"{",
"clearTimeout",
"(",
"hookConfig",
".",
"timer",
")",
";",
"// still set the consentData to undefined when there is a problem as per config options",
"if",
"(",
"allowAuction",
")",
"{"... | This function contains the controlled steps to perform when there's a problem with CMP.
@param {string} errMsg required; should be a short descriptive message for why the failure/issue happened.
@param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
@param {object} extraA... | [
"This",
"function",
"contains",
"the",
"controlled",
"steps",
"to",
"perform",
"when",
"there",
"s",
"a",
"problem",
"with",
"CMP",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L267-L275 |
6,139 | prebid/Prebid.js | modules/consentManagement.js | exitModule | function exitModule(errMsg, hookConfig, extraArgs) {
if (hookConfig.haveExited === false) {
hookConfig.haveExited = true;
let context = hookConfig.context;
let args = hookConfig.args;
let nextFn = hookConfig.nextFn;
if (errMsg) {
if (allowAuction) {
utils.logWarn(errMsg + ' Resumin... | javascript | function exitModule(errMsg, hookConfig, extraArgs) {
if (hookConfig.haveExited === false) {
hookConfig.haveExited = true;
let context = hookConfig.context;
let args = hookConfig.args;
let nextFn = hookConfig.nextFn;
if (errMsg) {
if (allowAuction) {
utils.logWarn(errMsg + ' Resumin... | [
"function",
"exitModule",
"(",
"errMsg",
",",
"hookConfig",
",",
"extraArgs",
")",
"{",
"if",
"(",
"hookConfig",
".",
"haveExited",
"===",
"false",
")",
"{",
"hookConfig",
".",
"haveExited",
"=",
"true",
";",
"let",
"context",
"=",
"hookConfig",
".",
"cont... | This function handles the exit logic for the module.
There are several paths in the module's logic to call this function and we only allow 1 of the 3 potential exits to happen before suppressing others.
We prevent multiple exits to avoid conflicting messages in the console depending on certain scenarios.
One scenario ... | [
"This",
"function",
"handles",
"the",
"exit",
"logic",
"for",
"the",
"module",
".",
"There",
"are",
"several",
"paths",
"in",
"the",
"module",
"s",
"logic",
"to",
"call",
"this",
"function",
"and",
"we",
"only",
"allow",
"1",
"of",
"the",
"3",
"potential... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L307-L331 |
6,140 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | function (bidRequests, bidderRequest) {
return {
data: bidToTag(bidRequests, bidderRequest),
bidderRequest,
method: 'GET',
url: URL
};
} | javascript | function (bidRequests, bidderRequest) {
return {
data: bidToTag(bidRequests, bidderRequest),
bidderRequest,
method: 'GET',
url: URL
};
} | [
"function",
"(",
"bidRequests",
",",
"bidderRequest",
")",
"{",
"return",
"{",
"data",
":",
"bidToTag",
"(",
"bidRequests",
",",
"bidderRequest",
")",
",",
"bidderRequest",
",",
"method",
":",
"'GET'",
",",
"url",
":",
"URL",
"}",
";",
"}"
] | Make a server request from the list of BidRequests
@param bidRequests
@param bidderRequest | [
"Make",
"a",
"server",
"request",
"from",
"the",
"list",
"of",
"BidRequests"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L64-L71 | |
6,141 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | function (serverResponse, {bidderRequest}) {
serverResponse = serverResponse.body;
let bids = [];
if (!utils.isArray(serverResponse)) {
return parseRTBResponse(serverResponse, bidderRequest);
}
serverResponse.forEach(serverBidResponse => {
bids = utils.flatten(bids, parseRTBResponse(se... | javascript | function (serverResponse, {bidderRequest}) {
serverResponse = serverResponse.body;
let bids = [];
if (!utils.isArray(serverResponse)) {
return parseRTBResponse(serverResponse, bidderRequest);
}
serverResponse.forEach(serverBidResponse => {
bids = utils.flatten(bids, parseRTBResponse(se... | [
"function",
"(",
"serverResponse",
",",
"{",
"bidderRequest",
"}",
")",
"{",
"serverResponse",
"=",
"serverResponse",
".",
"body",
";",
"let",
"bids",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"utils",
".",
"isArray",
"(",
"serverResponse",
")",
")",
"{",
"r... | Unpack the response from the server into a list of bids
@param serverResponse
@param bidderRequest
@return {Bid[]} An array of bids which were nested inside the server | [
"Unpack",
"the",
"response",
"from",
"the",
"server",
"into",
"a",
"list",
"of",
"bids"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L79-L92 | |
6,142 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | getMediaType | function getMediaType(bidderRequest) {
const videoMediaType = utils.deepAccess(bidderRequest, 'mediaTypes.video');
const context = utils.deepAccess(bidderRequest, 'mediaTypes.video.context');
return !videoMediaType ? DISPLAY : context === OUTSTREAM ? OUTSTREAM : VIDEO;
} | javascript | function getMediaType(bidderRequest) {
const videoMediaType = utils.deepAccess(bidderRequest, 'mediaTypes.video');
const context = utils.deepAccess(bidderRequest, 'mediaTypes.video.context');
return !videoMediaType ? DISPLAY : context === OUTSTREAM ? OUTSTREAM : VIDEO;
} | [
"function",
"getMediaType",
"(",
"bidderRequest",
")",
"{",
"const",
"videoMediaType",
"=",
"utils",
".",
"deepAccess",
"(",
"bidderRequest",
",",
"'mediaTypes.video'",
")",
";",
"const",
"context",
"=",
"utils",
".",
"deepAccess",
"(",
"bidderRequest",
",",
"'m... | Prepare all parameters for request
@param bidderRequest {object}
@returns {object} | [
"Prepare",
"all",
"parameters",
"for",
"request"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L164-L169 |
6,143 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | createBid | function createBid(bidResponse, mediaType) {
let bid = {
requestId: bidResponse.requestId,
creativeId: bidResponse.cmpId,
height: bidResponse.height,
currency: bidResponse.cur,
width: bidResponse.width,
cpm: bidResponse.cpm,
netRevenue: true,
mediaType,
ttl: 3600
};
if (mediaT... | javascript | function createBid(bidResponse, mediaType) {
let bid = {
requestId: bidResponse.requestId,
creativeId: bidResponse.cmpId,
height: bidResponse.height,
currency: bidResponse.cur,
width: bidResponse.width,
cpm: bidResponse.cpm,
netRevenue: true,
mediaType,
ttl: 3600
};
if (mediaT... | [
"function",
"createBid",
"(",
"bidResponse",
",",
"mediaType",
")",
"{",
"let",
"bid",
"=",
"{",
"requestId",
":",
"bidResponse",
".",
"requestId",
",",
"creativeId",
":",
"bidResponse",
".",
"cmpId",
",",
"height",
":",
"bidResponse",
".",
"height",
",",
... | Configure new bid by response
@param bidResponse {object}
@param mediaType {Object}
@returns {object} | [
"Configure",
"new",
"bid",
"by",
"response"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L177-L209 |
6,144 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | newRenderer | function newRenderer(requestId) {
const renderer = Renderer.install({
id: requestId,
url: OUTSTREAM_SRC,
loaded: false
});
renderer.setRender(outstreamRender);
return renderer;
} | javascript | function newRenderer(requestId) {
const renderer = Renderer.install({
id: requestId,
url: OUTSTREAM_SRC,
loaded: false
});
renderer.setRender(outstreamRender);
return renderer;
} | [
"function",
"newRenderer",
"(",
"requestId",
")",
"{",
"const",
"renderer",
"=",
"Renderer",
".",
"install",
"(",
"{",
"id",
":",
"requestId",
",",
"url",
":",
"OUTSTREAM_SRC",
",",
"loaded",
":",
"false",
"}",
")",
";",
"renderer",
".",
"setRender",
"("... | Create Adtelligent renderer
@param requestId
@returns {*} | [
"Create",
"Adtelligent",
"renderer"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L216-L226 |
6,145 | prebid/Prebid.js | modules/adtelligentBidAdapter.js | outstreamRender | function outstreamRender(bid) {
bid.renderer.push(() => {
window.VOutstreamAPI.initOutstreams([{
width: bid.width,
height: bid.height,
vastUrl: bid.vastUrl,
elId: bid.adUnitCode
}]);
});
} | javascript | function outstreamRender(bid) {
bid.renderer.push(() => {
window.VOutstreamAPI.initOutstreams([{
width: bid.width,
height: bid.height,
vastUrl: bid.vastUrl,
elId: bid.adUnitCode
}]);
});
} | [
"function",
"outstreamRender",
"(",
"bid",
")",
"{",
"bid",
".",
"renderer",
".",
"push",
"(",
"(",
")",
"=>",
"{",
"window",
".",
"VOutstreamAPI",
".",
"initOutstreams",
"(",
"[",
"{",
"width",
":",
"bid",
".",
"width",
",",
"height",
":",
"bid",
".... | Initialise Adtelligent outstream
@param bid | [
"Initialise",
"Adtelligent",
"outstream"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L232-L241 |
6,146 | prebid/Prebid.js | modules/lifestreetBidAdapter.js | formatBidRequest | function formatBidRequest(bid, bidderRequest) {
let url = urlTemplate({
adapter: 'prebid',
slot: bid.params.slot,
adkey: bid.params.adkey,
ad_size: bid.params.ad_size,
location: encodeURIComponent(utils.getTopWindowLocation()),
referrer: encodeURIComponent(utils.getTopWindowReferrer()),
wn... | javascript | function formatBidRequest(bid, bidderRequest) {
let url = urlTemplate({
adapter: 'prebid',
slot: bid.params.slot,
adkey: bid.params.adkey,
ad_size: bid.params.ad_size,
location: encodeURIComponent(utils.getTopWindowLocation()),
referrer: encodeURIComponent(utils.getTopWindowReferrer()),
wn... | [
"function",
"formatBidRequest",
"(",
"bid",
",",
"bidderRequest",
")",
"{",
"let",
"url",
"=",
"urlTemplate",
"(",
"{",
"adapter",
":",
"'prebid'",
",",
"slot",
":",
"bid",
".",
"params",
".",
"slot",
",",
"adkey",
":",
"bid",
".",
"params",
".",
"adke... | Creates a bid requests for a given bid.
@param {BidRequest} bid The bid params to use for formatting a request | [
"Creates",
"a",
"bid",
"requests",
"for",
"a",
"given",
"bid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L15-L46 |
6,147 | prebid/Prebid.js | modules/lifestreetBidAdapter.js | template | function template(strings, ...keys) {
return function(...values) {
let dict = values[values.length - 1] || {};
let result = [strings[0]];
keys.forEach(function(key, i) {
let value = isInteger(key) ? values[key] : dict[key];
result.push(value, strings[i + 1]);
});
return result.join('')... | javascript | function template(strings, ...keys) {
return function(...values) {
let dict = values[values.length - 1] || {};
let result = [strings[0]];
keys.forEach(function(key, i) {
let value = isInteger(key) ? values[key] : dict[key];
result.push(value, strings[i + 1]);
});
return result.join('')... | [
"function",
"template",
"(",
"strings",
",",
"...",
"keys",
")",
"{",
"return",
"function",
"(",
"...",
"values",
")",
"{",
"let",
"dict",
"=",
"values",
"[",
"values",
".",
"length",
"-",
"1",
"]",
"||",
"{",
"}",
";",
"let",
"result",
"=",
"[",
... | A helper function to form URL from the template | [
"A",
"helper",
"function",
"to",
"form",
"URL",
"from",
"the",
"template"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L51-L61 |
6,148 | prebid/Prebid.js | modules/lifestreetBidAdapter.js | isResponseValid | function isResponseValid(response) {
return !/^\s*\{\s*"advertisementAvailable"\s*:\s*false/i.test(response.content) &&
response.content.indexOf('<VAST version="2.0"></VAST>') === -1 && (typeof response.cpm !== 'undefined') &&
response.status === 1;
} | javascript | function isResponseValid(response) {
return !/^\s*\{\s*"advertisementAvailable"\s*:\s*false/i.test(response.content) &&
response.content.indexOf('<VAST version="2.0"></VAST>') === -1 && (typeof response.cpm !== 'undefined') &&
response.status === 1;
} | [
"function",
"isResponseValid",
"(",
"response",
")",
"{",
"return",
"!",
"/",
"^\\s*\\{\\s*\"advertisementAvailable\"\\s*:\\s*false",
"/",
"i",
".",
"test",
"(",
"response",
".",
"content",
")",
"&&",
"response",
".",
"content",
".",
"indexOf",
"(",
"'<VAST versio... | Validates response from Lifestreet AD server | [
"Validates",
"response",
"from",
"Lifestreet",
"AD",
"server"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L81-L85 |
6,149 | prebid/Prebid.js | modules/lifestreetBidAdapter.js | function(bid) {
return !!(bid.params.slot && bid.params.adkey && bid.params.ad_size);
} | javascript | function(bid) {
return !!(bid.params.slot && bid.params.adkey && bid.params.ad_size);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
".",
"params",
".",
"slot",
"&&",
"bid",
".",
"params",
".",
"adkey",
"&&",
"bid",
".",
"params",
".",
"ad_size",
")",
";",
"}"
] | Lifestreet supports banner and video media types
Determines whether or not the given bid request is valid.
@param {BidRequest} bid The bid params to validate.
@return boolean True if this is a valid bid, and false otherwise. | [
"Lifestreet",
"supports",
"banner",
"and",
"video",
"media",
"types",
"Determines",
"whether",
"or",
"not",
"the",
"given",
"bid",
"request",
"is",
"valid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L98-L100 | |
6,150 | prebid/Prebid.js | modules/telariaBidAdapter.js | function (bid) {
return !!(bid && bid.params && bid.params.adCode && bid.params.supplyCode);
} | javascript | function (bid) {
return !!(bid && bid.params && bid.params.adCode && bid.params.supplyCode);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
"&&",
"bid",
".",
"params",
"&&",
"bid",
".",
"params",
".",
"adCode",
"&&",
"bid",
".",
"params",
".",
"supplyCode",
")",
";",
"}"
] | Determines if the request is valid
@param bid
@returns {*|string} | [
"Determines",
"if",
"the",
"request",
"is",
"valid"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L19-L21 | |
6,151 | prebid/Prebid.js | modules/telariaBidAdapter.js | function (syncOptions, serverResponses) {
const syncs = [];
if (syncOptions.pixelEnabled && serverResponses.length) {
try {
serverResponses[0].body.ext.telaria.userSync.forEach(url => syncs.push({type: 'image', url: url}));
} catch (e) {}
}
return syncs;
} | javascript | function (syncOptions, serverResponses) {
const syncs = [];
if (syncOptions.pixelEnabled && serverResponses.length) {
try {
serverResponses[0].body.ext.telaria.userSync.forEach(url => syncs.push({type: 'image', url: url}));
} catch (e) {}
}
return syncs;
} | [
"function",
"(",
"syncOptions",
",",
"serverResponses",
")",
"{",
"const",
"syncs",
"=",
"[",
"]",
";",
"if",
"(",
"syncOptions",
".",
"pixelEnabled",
"&&",
"serverResponses",
".",
"length",
")",
"{",
"try",
"{",
"serverResponses",
"[",
"0",
"]",
".",
"b... | We support pixel syncing only at the moment. Telaria ad server returns 'ext'
as an optional parameter if the tag has 'incIdSync' parameter set to true
@param syncOptions
@param serverResponses
@returns {Array} | [
"We",
"support",
"pixel",
"syncing",
"only",
"at",
"the",
"moment",
".",
"Telaria",
"ad",
"server",
"returns",
"ext",
"as",
"an",
"optional",
"parameter",
"if",
"the",
"tag",
"has",
"incIdSync",
"parameter",
"set",
"to",
"true"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L100-L108 | |
6,152 | prebid/Prebid.js | modules/telariaBidAdapter.js | createBid | function createBid(status, reqBid, response, width, height, bidderCode) {
let bid = createBidFactory(status, reqBid);
// TTL 5 mins by default, future support for extended imp wait time
if (response) {
Object.assign(bid, {
requestId: reqBid.bidId,
cpm: response.price,
creativeId: response.c... | javascript | function createBid(status, reqBid, response, width, height, bidderCode) {
let bid = createBidFactory(status, reqBid);
// TTL 5 mins by default, future support for extended imp wait time
if (response) {
Object.assign(bid, {
requestId: reqBid.bidId,
cpm: response.price,
creativeId: response.c... | [
"function",
"createBid",
"(",
"status",
",",
"reqBid",
",",
"response",
",",
"width",
",",
"height",
",",
"bidderCode",
")",
"{",
"let",
"bid",
"=",
"createBidFactory",
"(",
"status",
",",
"reqBid",
")",
";",
"// TTL 5 mins by default, future support for extended ... | Create and return a bid object based on status and tag
@param status
@param reqBid
@param response
@param width
@param height
@param bidderCode | [
"Create",
"and",
"return",
"a",
"bid",
"object",
"based",
"on",
"status",
"and",
"tag"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L186-L210 |
6,153 | prebid/Prebid.js | modules/iasBidAdapter.js | stringifySlotSizes | function stringifySlotSizes(sizes) {
let result = '';
if (utils.isArray(sizes)) {
result = sizes.reduce((acc, size) => {
acc.push(size.join('.'));
return acc;
}, []);
result = '[' + result.join(',') + ']';
}
return result;
} | javascript | function stringifySlotSizes(sizes) {
let result = '';
if (utils.isArray(sizes)) {
result = sizes.reduce((acc, size) => {
acc.push(size.join('.'));
return acc;
}, []);
result = '[' + result.join(',') + ']';
}
return result;
} | [
"function",
"stringifySlotSizes",
"(",
"sizes",
")",
"{",
"let",
"result",
"=",
"''",
";",
"if",
"(",
"utils",
".",
"isArray",
"(",
"sizes",
")",
")",
"{",
"result",
"=",
"sizes",
".",
"reduce",
"(",
"(",
"acc",
",",
"size",
")",
"=>",
"{",
"acc",
... | Converts GPT-style size array into a string
@param {Array} sizes: list of GPT-style sizes, e.g. [[300, 250], [300, 300]]
@return {String} a string containing sizes, e.g. '[300.250,300.300]' | [
"Converts",
"GPT",
"-",
"style",
"size",
"array",
"into",
"a",
"string"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/iasBidAdapter.js#L18-L28 |
6,154 | prebid/Prebid.js | modules/adpod.js | attachPriceIndustryDurationKeyToBid | function attachPriceIndustryDurationKeyToBid(bid, brandCategoryExclusion) {
let initialCacheKey = bidCacheRegistry.getInitialCacheKey(bid);
let duration = utils.deepAccess(bid, 'video.durationBucket');
let cpmFixed = bid.cpm.toFixed(2);
let pcd;
if (brandCategoryExclusion) {
let category = utils.deepAcce... | javascript | function attachPriceIndustryDurationKeyToBid(bid, brandCategoryExclusion) {
let initialCacheKey = bidCacheRegistry.getInitialCacheKey(bid);
let duration = utils.deepAccess(bid, 'video.durationBucket');
let cpmFixed = bid.cpm.toFixed(2);
let pcd;
if (brandCategoryExclusion) {
let category = utils.deepAcce... | [
"function",
"attachPriceIndustryDurationKeyToBid",
"(",
"bid",
",",
"brandCategoryExclusion",
")",
"{",
"let",
"initialCacheKey",
"=",
"bidCacheRegistry",
".",
"getInitialCacheKey",
"(",
"bid",
")",
";",
"let",
"duration",
"=",
"utils",
".",
"deepAccess",
"(",
"bid"... | This function reads certain fields from the bid to generate a specific key used for caching the bid in Prebid Cache
@param {Object} bid bid object to update
@param {Boolean} brandCategoryExclusion value read from setConfig; influences whether category is required or not | [
"This",
"function",
"reads",
"certain",
"fields",
"from",
"the",
"bid",
"to",
"generate",
"a",
"specific",
"key",
"used",
"for",
"caching",
"the",
"bid",
"in",
"Prebid",
"Cache"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L117-L137 |
6,155 | prebid/Prebid.js | modules/adpod.js | updateBidQueue | function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) {
let bidListIter = bidCacheRegistry.getBids(bidResponse);
if (bidListIter) {
let bidListArr = from(bidListIter);
let callDispatcher = bidCacheRegistry.getQueueDispatcher(bidResponse);
let killQueue = !!(auctionInstance.getAuctionStat... | javascript | function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) {
let bidListIter = bidCacheRegistry.getBids(bidResponse);
if (bidListIter) {
let bidListArr = from(bidListIter);
let callDispatcher = bidCacheRegistry.getQueueDispatcher(bidResponse);
let killQueue = !!(auctionInstance.getAuctionStat... | [
"function",
"updateBidQueue",
"(",
"auctionInstance",
",",
"bidResponse",
",",
"afterBidAdded",
")",
"{",
"let",
"bidListIter",
"=",
"bidCacheRegistry",
".",
"getBids",
"(",
"bidResponse",
")",
";",
"if",
"(",
"bidListIter",
")",
"{",
"let",
"bidListArr",
"=",
... | Updates the running queue for the associated auction.
Does a check to ensure the auction is still running; if it's not - the previously running queue is killed.
@param {*} auctionInstance running context of the auction
@param {Object} bidResponse bid object being added to queue
@param {Function} afterBidAdded callback ... | [
"Updates",
"the",
"running",
"queue",
"for",
"the",
"associated",
"auction",
".",
"Does",
"a",
"check",
"to",
"ensure",
"the",
"auction",
"is",
"still",
"running",
";",
"if",
"it",
"s",
"not",
"-",
"the",
"previously",
"running",
"queue",
"is",
"killed",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L146-L157 |
6,156 | prebid/Prebid.js | modules/adpod.js | firePrebidCacheCall | function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) {
// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list
removeBidsFromStorage(bidList);
store(bidList, function (error, cacheIds) {
if (error) {
... | javascript | function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) {
// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list
removeBidsFromStorage(bidList);
store(bidList, function (error, cacheIds) {
if (error) {
... | [
"function",
"firePrebidCacheCall",
"(",
"auctionInstance",
",",
"bidList",
",",
"afterBidAdded",
")",
"{",
"// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list",
"removeBidsFromStorage",
"(",
"b... | This function will send a list of bids to Prebid Cache. It also removes the same bids from the internal bidCacheRegistry
to maintain which bids are in queue.
If the bids are successfully cached, they will be added to the respective auction.
@param {*} auctionInstance running context of the auction
@param {Array[Object... | [
"This",
"function",
"will",
"send",
"a",
"list",
"of",
"bids",
"to",
"Prebid",
"Cache",
".",
"It",
"also",
"removes",
"the",
"same",
"bids",
"from",
"the",
"internal",
"bidCacheRegistry",
"to",
"maintain",
"which",
"bids",
"are",
"in",
"queue",
".",
"If",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L177-L199 |
6,157 | prebid/Prebid.js | modules/getintentBidAdapter.js | function(serverResponse) {
let responseBody = serverResponse.body;
const bids = [];
if (responseBody && responseBody.no_bid !== 1) {
let size = parseSize(responseBody.size);
let bid = {
requestId: responseBody.bid_id,
ttl: BID_RESPONSE_TTL_SEC,
netRevenue: IS_NET_REVENUE,... | javascript | function(serverResponse) {
let responseBody = serverResponse.body;
const bids = [];
if (responseBody && responseBody.no_bid !== 1) {
let size = parseSize(responseBody.size);
let bid = {
requestId: responseBody.bid_id,
ttl: BID_RESPONSE_TTL_SEC,
netRevenue: IS_NET_REVENUE,... | [
"function",
"(",
"serverResponse",
")",
"{",
"let",
"responseBody",
"=",
"serverResponse",
".",
"body",
";",
"const",
"bids",
"=",
"[",
"]",
";",
"if",
"(",
"responseBody",
"&&",
"responseBody",
".",
"no_bid",
"!==",
"1",
")",
"{",
"let",
"size",
"=",
... | Callback for bids, after the call to DSP completes.
Parse the response from the server into a list of bids.
@param {object} serverResponse A response from the GetIntent's server.
@return {Bid[]} An array of bids which were nested inside the server. | [
"Callback",
"for",
"bids",
"after",
"the",
"call",
"to",
"DSP",
"completes",
".",
"Parse",
"the",
"response",
"from",
"the",
"server",
"into",
"a",
"list",
"of",
"bids",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/getintentBidAdapter.js#L56-L81 | |
6,158 | prebid/Prebid.js | modules/getintentBidAdapter.js | buildGiBidRequest | function buildGiBidRequest(bidRequest) {
let giBidRequest = {
bid_id: bidRequest.bidId,
pid: bidRequest.params.pid, // required
tid: bidRequest.params.tid, // required
known: bidRequest.params.known || 1,
is_video: bidRequest.mediaType === 'video',
resp_type: 'JSON',
provider: 'direct.preb... | javascript | function buildGiBidRequest(bidRequest) {
let giBidRequest = {
bid_id: bidRequest.bidId,
pid: bidRequest.params.pid, // required
tid: bidRequest.params.tid, // required
known: bidRequest.params.known || 1,
is_video: bidRequest.mediaType === 'video',
resp_type: 'JSON',
provider: 'direct.preb... | [
"function",
"buildGiBidRequest",
"(",
"bidRequest",
")",
"{",
"let",
"giBidRequest",
"=",
"{",
"bid_id",
":",
"bidRequest",
".",
"bidId",
",",
"pid",
":",
"bidRequest",
".",
"params",
".",
"pid",
",",
"// required",
"tid",
":",
"bidRequest",
".",
"params",
... | Builds GI bid request from BidRequest.
@param {BidRequest} bidRequest.
@return {object} GI bid request. | [
"Builds",
"GI",
"bid",
"request",
"from",
"BidRequest",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/getintentBidAdapter.js#L95-L111 |
6,159 | prebid/Prebid.js | modules/c1xBidAdapter.js | function(bid) {
const siteId = bid.params.siteId || '';
if (!siteId) {
utils.logError(LOG_MSG.noSite);
}
return !!(bid.adUnitCode && siteId);
} | javascript | function(bid) {
const siteId = bid.params.siteId || '';
if (!siteId) {
utils.logError(LOG_MSG.noSite);
}
return !!(bid.adUnitCode && siteId);
} | [
"function",
"(",
"bid",
")",
"{",
"const",
"siteId",
"=",
"bid",
".",
"params",
".",
"siteId",
"||",
"''",
";",
"if",
"(",
"!",
"siteId",
")",
"{",
"utils",
".",
"logError",
"(",
"LOG_MSG",
".",
"noSite",
")",
";",
"}",
"return",
"!",
"!",
"(",
... | check the bids sent to c1x bidder | [
"check",
"the",
"bids",
"sent",
"to",
"c1x",
"bidder"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/c1xBidAdapter.js#L24-L30 | |
6,160 | prebid/Prebid.js | modules/express.js | defaultSlots | function defaultSlots(slots) {
return Array.isArray(slots)
? slots.slice()
: googletag.pubads().getSlots().slice();
} | javascript | function defaultSlots(slots) {
return Array.isArray(slots)
? slots.slice()
: googletag.pubads().getSlots().slice();
} | [
"function",
"defaultSlots",
"(",
"slots",
")",
"{",
"return",
"Array",
".",
"isArray",
"(",
"slots",
")",
"?",
"slots",
".",
"slice",
"(",
")",
":",
"googletag",
".",
"pubads",
"(",
")",
".",
"getSlots",
"(",
")",
".",
"slice",
"(",
")",
";",
"}"
] | a helper function to verify slots or get slots if not present | [
"a",
"helper",
"function",
"to",
"verify",
"slots",
"or",
"get",
"slots",
"if",
"not",
"present"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/express.js#L61-L65 |
6,161 | prebid/Prebid.js | modules/express.js | pickAdUnits | function pickAdUnits(gptSlots) {
var adUnits = [];
// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots
for (var i = gptSlots.length - 1; i > -1; i--) {
const gptSlot = gptSlots[i];
const elemId = gptSlot.getSlotElementId();
con... | javascript | function pickAdUnits(gptSlots) {
var adUnits = [];
// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots
for (var i = gptSlots.length - 1; i > -1; i--) {
const gptSlot = gptSlots[i];
const elemId = gptSlot.getSlotElementId();
con... | [
"function",
"pickAdUnits",
"(",
"gptSlots",
")",
"{",
"var",
"adUnits",
"=",
"[",
"]",
";",
"// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots",
"for",
"(",
"var",
"i",
"=",
"gptSlots",
".",
"length",
"-",
"1",
";",
... | maps gpt slots to adUnits, matches are copied to new array and removed from passed array. | [
"maps",
"gpt",
"slots",
"to",
"adUnits",
"matches",
"are",
"copied",
"to",
"new",
"array",
"and",
"removed",
"from",
"passed",
"array",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/express.js#L68-L85 |
6,162 | prebid/Prebid.js | src/utils.js | tryConvertType | function tryConvertType(typeToConvert, value) {
if (typeToConvert === 'string') {
return value && value.toString();
} else if (typeToConvert === 'number') {
return Number(value);
} else {
return value;
}
} | javascript | function tryConvertType(typeToConvert, value) {
if (typeToConvert === 'string') {
return value && value.toString();
} else if (typeToConvert === 'number') {
return Number(value);
} else {
return value;
}
} | [
"function",
"tryConvertType",
"(",
"typeToConvert",
",",
"value",
")",
"{",
"if",
"(",
"typeToConvert",
"===",
"'string'",
")",
"{",
"return",
"value",
"&&",
"value",
".",
"toString",
"(",
")",
";",
"}",
"else",
"if",
"(",
"typeToConvert",
"===",
"'number'... | Try to convert a value to a type.
If it can't be done, the value will be returned.
@param {string} typeToConvert The target type. e.g. "string", "number", etc.
@param {*} value The value to be converted into typeToConvert. | [
"Try",
"to",
"convert",
"a",
"value",
"to",
"a",
"type",
".",
"If",
"it",
"can",
"t",
"be",
"done",
"the",
"value",
"will",
"be",
"returned",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/utils.js#L1193-L1201 |
6,163 | prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getAdPodAdUnits | function getAdPodAdUnits(codes) {
return auctionManager.getAdUnits()
.filter((adUnit) => deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD)
.filter((adUnit) => (codes.length > 0) ? codes.indexOf(adUnit.code) != -1 : true);
} | javascript | function getAdPodAdUnits(codes) {
return auctionManager.getAdUnits()
.filter((adUnit) => deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD)
.filter((adUnit) => (codes.length > 0) ? codes.indexOf(adUnit.code) != -1 : true);
} | [
"function",
"getAdPodAdUnits",
"(",
"codes",
")",
"{",
"return",
"auctionManager",
".",
"getAdUnits",
"(",
")",
".",
"filter",
"(",
"(",
"adUnit",
")",
"=>",
"deepAccess",
"(",
"adUnit",
",",
"'mediaTypes.video.context'",
")",
"===",
"ADPOD",
")",
".",
"filt... | This function returns the adunit of mediaType adpod
@param {Array} codes adUnitCodes
@returns {Array[Object]} adunits of mediaType adpod | [
"This",
"function",
"returns",
"the",
"adunit",
"of",
"mediaType",
"adpod"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L116-L120 |
6,164 | prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getExclusiveBids | function getExclusiveBids(bidsReceived) {
let bids = bidsReceived
.map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
let filteredBids = [];
Object.keys(bids).forEach((targetingKey) => {
bid... | javascript | function getExclusiveBids(bidsReceived) {
let bids = bidsReceived
.map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
let filteredBids = [];
Object.keys(bids).forEach((targetingKey) => {
bid... | [
"function",
"getExclusiveBids",
"(",
"bidsReceived",
")",
"{",
"let",
"bids",
"=",
"bidsReceived",
".",
"map",
"(",
"(",
"bid",
")",
"=>",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"bid",
",",
"{",
"[",
"TARGETING_KEY_PB_CAT_DUR",
"]",
":",
"bid",
"... | This function removes bids of same freewheel category. It will be used when competitive exclusion is enabled.
@param {Array[Object]} bidsReceived
@returns {Array[Object]} unique freewheel category bids | [
"This",
"function",
"removes",
"bids",
"of",
"same",
"freewheel",
"category",
".",
"It",
"will",
"be",
"used",
"when",
"competitive",
"exclusion",
"is",
"enabled",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L127-L137 |
6,165 | prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getBidsForAdpod | function getBidsForAdpod(bidsReceived, adPodAdUnits) {
let adUnitCodes = adPodAdUnits.map((adUnit) => adUnit.code);
return bidsReceived
.filter((bid) => adUnitCodes.indexOf(bid.adUnitCode) != -1 && (bid.video && bid.video.context === ADPOD))
} | javascript | function getBidsForAdpod(bidsReceived, adPodAdUnits) {
let adUnitCodes = adPodAdUnits.map((adUnit) => adUnit.code);
return bidsReceived
.filter((bid) => adUnitCodes.indexOf(bid.adUnitCode) != -1 && (bid.video && bid.video.context === ADPOD))
} | [
"function",
"getBidsForAdpod",
"(",
"bidsReceived",
",",
"adPodAdUnits",
")",
"{",
"let",
"adUnitCodes",
"=",
"adPodAdUnits",
".",
"map",
"(",
"(",
"adUnit",
")",
"=>",
"adUnit",
".",
"code",
")",
";",
"return",
"bidsReceived",
".",
"filter",
"(",
"(",
"bi... | This function returns bids for adpod adunits
@param {Array[Object]} bidsReceived
@param {Array[Object]} adPodAdUnits
@returns {Array[Object]} bids of mediaType adpod | [
"This",
"function",
"returns",
"bids",
"for",
"adpod",
"adunits"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L145-L149 |
6,166 | prebid/Prebid.js | src/bidfactory.js | Bid | function Bid(statusCode, bidRequest) {
var _bidSrc = (bidRequest && bidRequest.src) || 'client';
var _statusCode = statusCode || 0;
this.bidderCode = (bidRequest && bidRequest.bidder) || '';
this.width = 0;
this.height = 0;
this.statusMessage = _getStatus();
this.adId = utils.getUniqueIdentifierStr();
... | javascript | function Bid(statusCode, bidRequest) {
var _bidSrc = (bidRequest && bidRequest.src) || 'client';
var _statusCode = statusCode || 0;
this.bidderCode = (bidRequest && bidRequest.bidder) || '';
this.width = 0;
this.height = 0;
this.statusMessage = _getStatus();
this.adId = utils.getUniqueIdentifierStr();
... | [
"function",
"Bid",
"(",
"statusCode",
",",
"bidRequest",
")",
"{",
"var",
"_bidSrc",
"=",
"(",
"bidRequest",
"&&",
"bidRequest",
".",
"src",
")",
"||",
"'client'",
";",
"var",
"_statusCode",
"=",
"statusCode",
"||",
"0",
";",
"this",
".",
"bidderCode",
"... | Required paramaters
bidderCode,
height,
width,
statusCode
Optional paramaters
adId,
cpm,
ad,
adUrl,
dealId,
priceKeyString; | [
"Required",
"paramaters",
"bidderCode",
"height",
"width",
"statusCode",
"Optional",
"paramaters",
"adId",
"cpm",
"ad",
"adUrl",
"dealId",
"priceKeyString",
";"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/bidfactory.js#L17-L51 |
6,167 | prebid/Prebid.js | modules/adkernelBidAdapter.js | dispatchImps | function dispatchImps(bidRequests, refererInfo) {
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
return bidRequests.map(bidRequest => buildImp(bidRequest, secure))
.reduce((acc, curr, index) => {
let bidRequest = bidRequests[index];
let zoneId = bidRequest.params.zoneId;
... | javascript | function dispatchImps(bidRequests, refererInfo) {
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
return bidRequests.map(bidRequest => buildImp(bidRequest, secure))
.reduce((acc, curr, index) => {
let bidRequest = bidRequests[index];
let zoneId = bidRequest.params.zoneId;
... | [
"function",
"dispatchImps",
"(",
"bidRequests",
",",
"refererInfo",
")",
"{",
"let",
"secure",
"=",
"(",
"refererInfo",
"&&",
"refererInfo",
".",
"referer",
".",
"indexOf",
"(",
"'https:'",
")",
"===",
"0",
")",
";",
"return",
"bidRequests",
".",
"map",
"(... | Dispatch impressions by ad network host and zone | [
"Dispatch",
"impressions",
"by",
"ad",
"network",
"host",
"and",
"zone"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L96-L108 |
6,168 | prebid/Prebid.js | modules/adkernelBidAdapter.js | createSite | function createSite(refInfo) {
let url = parseUrl(refInfo.referer);
let result = {
'domain': url.hostname,
'page': url.protocol + '://' + url.hostname + url.pathname
};
if (self === top && document.referrer) {
result.ref = document.referrer;
}
let keywords = document.getElementsByTagName('meta')... | javascript | function createSite(refInfo) {
let url = parseUrl(refInfo.referer);
let result = {
'domain': url.hostname,
'page': url.protocol + '://' + url.hostname + url.pathname
};
if (self === top && document.referrer) {
result.ref = document.referrer;
}
let keywords = document.getElementsByTagName('meta')... | [
"function",
"createSite",
"(",
"refInfo",
")",
"{",
"let",
"url",
"=",
"parseUrl",
"(",
"refInfo",
".",
"referer",
")",
";",
"let",
"result",
"=",
"{",
"'domain'",
":",
"url",
".",
"hostname",
",",
"'page'",
":",
"url",
".",
"protocol",
"+",
"'://'",
... | Creates site description object | [
"Creates",
"site",
"description",
"object"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L199-L213 |
6,169 | prebid/Prebid.js | modules/adkernelBidAdapter.js | formatAdMarkup | function formatAdMarkup(bid) {
let adm = bid.adm;
if ('nurl' in bid) {
adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
}
return adm;
} | javascript | function formatAdMarkup(bid) {
let adm = bid.adm;
if ('nurl' in bid) {
adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
}
return adm;
} | [
"function",
"formatAdMarkup",
"(",
"bid",
")",
"{",
"let",
"adm",
"=",
"bid",
".",
"adm",
";",
"if",
"(",
"'nurl'",
"in",
"bid",
")",
"{",
"adm",
"+=",
"utils",
".",
"createTrackPixelHtml",
"(",
"`",
"${",
"bid",
".",
"nurl",
"}",
"`",
")",
";",
... | Format creative with optional nurl call
@param bid rtb Bid object | [
"Format",
"creative",
"with",
"optional",
"nurl",
"call"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L219-L225 |
6,170 | prebid/Prebid.js | modules/gjirafaBidAdapter.js | generateSizeParam | function generateSizeParam(sizes) {
return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);
} | javascript | function generateSizeParam(sizes) {
return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);
} | [
"function",
"generateSizeParam",
"(",
"sizes",
")",
"{",
"return",
"sizes",
".",
"map",
"(",
"size",
"=>",
"size",
".",
"join",
"(",
"DIMENSION_SEPARATOR",
")",
")",
".",
"join",
"(",
"SIZE_SEPARATOR",
")",
";",
"}"
] | Generate size param for bid request using sizes array
@param {Array} sizes Possible sizes for the ad unit.
@return {string} Processed sizes param to be used for the bid request. | [
"Generate",
"size",
"param",
"for",
"bid",
"request",
"using",
"sizes",
"array"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/gjirafaBidAdapter.js#L91-L93 |
6,171 | prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(slot) {
const hbAdIdTargeting = slot.getTargeting('hb_adid');
if (hbAdIdTargeting.length > 0) {
const hbAdId = hbAdIdTargeting[0];
return typeof this.prebidWinnersCache[hbAdId] !== 'undefined';
}
return false;
} | javascript | function(slot) {
const hbAdIdTargeting = slot.getTargeting('hb_adid');
if (hbAdIdTargeting.length > 0) {
const hbAdId = hbAdIdTargeting[0];
return typeof this.prebidWinnersCache[hbAdId] !== 'undefined';
}
return false;
} | [
"function",
"(",
"slot",
")",
"{",
"const",
"hbAdIdTargeting",
"=",
"slot",
".",
"getTargeting",
"(",
"'hb_adid'",
")",
";",
"if",
"(",
"hbAdIdTargeting",
".",
"length",
">",
"0",
")",
"{",
"const",
"hbAdId",
"=",
"hbAdIdTargeting",
"[",
"0",
"]",
";",
... | Decides if the GPT slot contains prebid ad impression or not.
When BID_WON event is emitted adid is added to prebidWinnersCache,
then we check if prebidWinnersCache contains slot.hb_adid.
This function is optional and used only when googlePublisherTag is provided.
Default implementation uses slot's `hb_adid` targeti... | [
"Decides",
"if",
"the",
"GPT",
"slot",
"contains",
"prebid",
"ad",
"impression",
"or",
"not",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L76-L83 | |
6,172 | prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
// this is bid response event has `bidder` while bid won has bidderCode property
return bid ? bid.bidderCode || bid.bidder : null;
} | javascript | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
// this is bid response event has `bidder` while bid won has bidderCode property
return bid ? bid.bidderCode || bid.bidder : null;
} | [
"function",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
"{",
"const",
"bid",
"=",
"getHighestPrebidBidResponseBySlotTargeting",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
";",
"// this is bid response event has `bidder` while bid won has bidderCod... | If isPrebidAdImpression decides that slot contain prebid ad impression,
this function should return prebids highest ad impression partner for that
slot.
Default implementation uses slot's `hb_adid` targeting value to find
highest bid response and when present then returns `bidder`.
@param instanceConfig merged analyt... | [
"If",
"isPrebidAdImpression",
"decides",
"that",
"slot",
"contain",
"prebid",
"ad",
"impression",
"this",
"function",
"should",
"return",
"prebids",
"highest",
"ad",
"impression",
"partner",
"for",
"that",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L98-L107 | |
6,173 | prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
return bid ? bid.cpm : null;
} | javascript | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
return bid ? bid.cpm : null;
} | [
"function",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
"{",
"const",
"bid",
"=",
"getHighestPrebidBidResponseBySlotTargeting",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
";",
"return",
"bid",
"?",
"bid",
".",
"cpm",
":",
"null",
"... | If isPrebidAdImpression decides that slot contain prebid ad impression,
this function should return prebids highest ad impression value for that
slot.
Default implementation uses slot's `hb_adid` targeting value to find
highest bid response and when present then returns `cpm`.
@param instanceConfig merged analytics a... | [
"If",
"isPrebidAdImpression",
"decides",
"that",
"slot",
"contain",
"prebid",
"ad",
"impression",
"this",
"function",
"should",
"return",
"prebids",
"highest",
"ad",
"impression",
"value",
"for",
"that",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L122-L130 | |
6,174 | prebid/Prebid.js | modules/yieldmoBidAdapter.js | function(serverResponse) {
let bids = [];
let data = serverResponse.body;
if (data.length > 0) {
data.forEach((response) => {
if (response.cpm && response.cpm > 0) {
bids.push(createNewBid(response));
}
});
}
return bids;
} | javascript | function(serverResponse) {
let bids = [];
let data = serverResponse.body;
if (data.length > 0) {
data.forEach((response) => {
if (response.cpm && response.cpm > 0) {
bids.push(createNewBid(response));
}
});
}
return bids;
} | [
"function",
"(",
"serverResponse",
")",
"{",
"let",
"bids",
"=",
"[",
"]",
";",
"let",
"data",
"=",
"serverResponse",
".",
"body",
";",
"if",
"(",
"data",
".",
"length",
">",
"0",
")",
"{",
"data",
".",
"forEach",
"(",
"(",
"response",
")",
"=>",
... | Makes Yieldmo Ad Server response compatible to Prebid specs
@param serverResponse successful response from Ad Server
@param bidderRequest original bidRequest
@return {Bid[]} an array of bids | [
"Makes",
"Yieldmo",
"Ad",
"Server",
"response",
"compatible",
"to",
"Prebid",
"specs"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/yieldmoBidAdapter.js#L67-L78 | |
6,175 | prebid/Prebid.js | modules/yieldmoBidAdapter.js | createNewBid | function createNewBid(response) {
return {
requestId: response['callback_id'],
cpm: response.cpm,
width: response.width,
height: response.height,
creativeId: response.creative_id,
currency: CURRENCY,
netRevenue: NET_REVENUE,
ttl: TIME_TO_LIVE,
ad: response.ad
};
} | javascript | function createNewBid(response) {
return {
requestId: response['callback_id'],
cpm: response.cpm,
width: response.width,
height: response.height,
creativeId: response.creative_id,
currency: CURRENCY,
netRevenue: NET_REVENUE,
ttl: TIME_TO_LIVE,
ad: response.ad
};
} | [
"function",
"createNewBid",
"(",
"response",
")",
"{",
"return",
"{",
"requestId",
":",
"response",
"[",
"'callback_id'",
"]",
",",
"cpm",
":",
"response",
".",
"cpm",
",",
"width",
":",
"response",
".",
"width",
",",
"height",
":",
"response",
".",
"hei... | creates a new bid with response information
@param response server response | [
"creates",
"a",
"new",
"bid",
"with",
"response",
"information"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/yieldmoBidAdapter.js#L116-L128 |
6,176 | prebid/Prebid.js | gulpfile.js | viewCoverage | function viewCoverage(done) {
var coveragePort = 1999;
var mylocalhost = (argv.host) ? argv.host : 'localhost';
connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
livereload: false
});
opens('http://' + mylocalhost + ':' + coveragePort);
done();
} | javascript | function viewCoverage(done) {
var coveragePort = 1999;
var mylocalhost = (argv.host) ? argv.host : 'localhost';
connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
livereload: false
});
opens('http://' + mylocalhost + ':' + coveragePort);
done();
} | [
"function",
"viewCoverage",
"(",
"done",
")",
"{",
"var",
"coveragePort",
"=",
"1999",
";",
"var",
"mylocalhost",
"=",
"(",
"argv",
".",
"host",
")",
"?",
"argv",
".",
"host",
":",
"'localhost'",
";",
"connect",
".",
"server",
"(",
"{",
"port",
":",
... | View the code coverage report in the browser. | [
"View",
"the",
"code",
"coverage",
"report",
"in",
"the",
"browser",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/gulpfile.js#L78-L89 |
6,177 | prebid/Prebid.js | gulpfile.js | watch | function watch(done) {
var mainWatcher = gulp.watch([
'src/**/*.js',
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
]);
var loaderWatcher = gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
]);
connect.server({
https: argv.https,
port: port,
... | javascript | function watch(done) {
var mainWatcher = gulp.watch([
'src/**/*.js',
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
]);
var loaderWatcher = gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
]);
connect.server({
https: argv.https,
port: port,
... | [
"function",
"watch",
"(",
"done",
")",
"{",
"var",
"mainWatcher",
"=",
"gulp",
".",
"watch",
"(",
"[",
"'src/**/*.js'",
",",
"'modules/**/*.js'",
",",
"'test/spec/**/*.js'",
",",
"'!test/spec/loaders/**/*.js'",
"]",
")",
";",
"var",
"loaderWatcher",
"=",
"gulp",... | Watch Task with Live Reload | [
"Watch",
"Task",
"with",
"Live",
"Reload"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/gulpfile.js#L94-L116 |
6,178 | prebid/Prebid.js | src/adUnits.js | incrementCounter | function incrementCounter(adunit) {
adUnits[adunit] = adUnits[adunit] || {};
adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;
return adUnits[adunit].counter;
} | javascript | function incrementCounter(adunit) {
adUnits[adunit] = adUnits[adunit] || {};
adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;
return adUnits[adunit].counter;
} | [
"function",
"incrementCounter",
"(",
"adunit",
")",
"{",
"adUnits",
"[",
"adunit",
"]",
"=",
"adUnits",
"[",
"adunit",
"]",
"||",
"{",
"}",
";",
"adUnits",
"[",
"adunit",
"]",
".",
"counter",
"=",
"(",
"deepAccess",
"(",
"adUnits",
",",
"`",
"${",
"a... | Increments and returns current Adunit counter
@param {string} adunit id
@returns {number} current adunit count | [
"Increments",
"and",
"returns",
"current",
"Adunit",
"counter"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/adUnits.js#L10-L14 |
6,179 | prebid/Prebid.js | modules/brainyBidAdapter.js | _getFlash | function _getFlash() {
try {
var _mac = (navigator.userAgent.indexOf('Mac') != -1);
if (document.all) {
if (_mac) {
if (window['sample']) {
return ((window['sample'].FlashVersion() & 0xffff0000) >> 16);
}
} else {
var _axo = new ActiveXObject('ShockwaveFlash.Shock... | javascript | function _getFlash() {
try {
var _mac = (navigator.userAgent.indexOf('Mac') != -1);
if (document.all) {
if (_mac) {
if (window['sample']) {
return ((window['sample'].FlashVersion() & 0xffff0000) >> 16);
}
} else {
var _axo = new ActiveXObject('ShockwaveFlash.Shock... | [
"function",
"_getFlash",
"(",
")",
"{",
"try",
"{",
"var",
"_mac",
"=",
"(",
"navigator",
".",
"userAgent",
".",
"indexOf",
"(",
"'Mac'",
")",
"!=",
"-",
"1",
")",
";",
"if",
"(",
"document",
".",
"all",
")",
"{",
"if",
"(",
"_mac",
")",
"{",
"... | Check if the browser supports flash
0 is return if it dosen't support flash
@return {int} Flash version
接続元のブラウザがフラッシュに対応しているか判定
対応していなければ0を返す
@return {int} フラッシュのバージョン | [
"Check",
"if",
"the",
"browser",
"supports",
"flash",
"0",
"is",
"return",
"if",
"it",
"dosen",
"t",
"support",
"flash"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L18-L41 |
6,180 | prebid/Prebid.js | modules/brainyBidAdapter.js | function(bid) {
return !!(bid && bid.params && bid.params.accountID && bid.params.slotID);
} | javascript | function(bid) {
return !!(bid && bid.params && bid.params.accountID && bid.params.slotID);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
"&&",
"bid",
".",
"params",
"&&",
"bid",
".",
"params",
".",
"accountID",
"&&",
"bid",
".",
"params",
".",
"slotID",
")",
";",
"}"
] | Check if the bid account ID and slotID is valid
@param {object} bid the brainy bid to validate
@return {boolean}
adUnits.bidに値が入っているかを判断する
@param {object} bid 検証する入札リクエスト
@return {boolean} | [
"Check",
"if",
"the",
"bid",
"account",
"ID",
"and",
"slotID",
"is",
"valid"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L57-L59 | |
6,181 | prebid/Prebid.js | modules/brainyBidAdapter.js | function(validBidRequests) {
var bidRequests = [];
for (var i = 0, len = validBidRequests.length; i < len; i++) {
var bid = validBidRequests[i];
var accountID = utils.getBidIdParameter('accountID', bid.params);
var slotID = utils.getBidIdParameter('slotID', bid.params);
var url = utils.g... | javascript | function(validBidRequests) {
var bidRequests = [];
for (var i = 0, len = validBidRequests.length; i < len; i++) {
var bid = validBidRequests[i];
var accountID = utils.getBidIdParameter('accountID', bid.params);
var slotID = utils.getBidIdParameter('slotID', bid.params);
var url = utils.g... | [
"function",
"(",
"validBidRequests",
")",
"{",
"var",
"bidRequests",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"validBidRequests",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"var",
"bid",
"=",
"val... | Format the bid request object for our endpoint
@param {BidRequest[]} bidRequests Array of brainy bidders
@return object of parameters for Prebid AJAX request
入札リクエストをbrainyに対応するように整形する
@param {BidRequest[]} bidRequests 入札のための配列
@return Prebid AJAX用に整形したオブジェクト | [
"Format",
"the",
"bid",
"request",
"object",
"for",
"our",
"endpoint"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L71-L96 | |
6,182 | prebid/Prebid.js | modules/brainyBidAdapter.js | function (brainyResponseObj, request) {
var bidResponses = [];
var bidRequest = request.bidRequest;
var responseBody = brainyResponseObj ? brainyResponseObj.body : {};
bidResponses.push({
requestId: bidRequest.bidId,
cpm: responseBody.cpm || 0,
width: responseBody.width,
height:... | javascript | function (brainyResponseObj, request) {
var bidResponses = [];
var bidRequest = request.bidRequest;
var responseBody = brainyResponseObj ? brainyResponseObj.body : {};
bidResponses.push({
requestId: bidRequest.bidId,
cpm: responseBody.cpm || 0,
width: responseBody.width,
height:... | [
"function",
"(",
"brainyResponseObj",
",",
"request",
")",
"{",
"var",
"bidResponses",
"=",
"[",
"]",
";",
"var",
"bidRequest",
"=",
"request",
".",
"bidRequest",
";",
"var",
"responseBody",
"=",
"brainyResponseObj",
"?",
"brainyResponseObj",
".",
"body",
":",... | Format brainy responses as Prebid bid responses
@param {String} brainyResponseObj A successful response from brainy.
@param {object} request Object received from web page
@return {object} An array of formatted bids.
brainySSPからのレスポンスを解釈するメソッド
@param {String} brainyResponseObj SSPから受け取った... | [
"Format",
"brainy",
"responses",
"as",
"Prebid",
"bid",
"responses"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L110-L129 | |
6,183 | prebid/Prebid.js | modules/onetagBidAdapter.js | getPageInfo | function getPageInfo() {
var w, d, l, r, m, p, e, t, s;
for (w = window, d = w.document, l = d.location.href, r = d.referrer, m = 0, e = encodeURIComponent, t = new Date(), s = screen; w !== w.parent;) {
try {
p = w.parent; l = p.location.href; r = p.document.referrer; w = p;
} catch (e) {
m = t... | javascript | function getPageInfo() {
var w, d, l, r, m, p, e, t, s;
for (w = window, d = w.document, l = d.location.href, r = d.referrer, m = 0, e = encodeURIComponent, t = new Date(), s = screen; w !== w.parent;) {
try {
p = w.parent; l = p.location.href; r = p.document.referrer; w = p;
} catch (e) {
m = t... | [
"function",
"getPageInfo",
"(",
")",
"{",
"var",
"w",
",",
"d",
",",
"l",
",",
"r",
",",
"m",
",",
"p",
",",
"e",
",",
"t",
",",
"s",
";",
"for",
"(",
"w",
"=",
"window",
",",
"d",
"=",
"w",
".",
"document",
",",
"l",
"=",
"d",
".",
"lo... | Returns information about the page needed by the server in an object to be converted in JSON
@returns {{location: *, referrer: (*|string), masked: *, wWidth: (*|Number), wHeight: (*|Number), sWidth, sHeight, date: string, timeOffset: number}} | [
"Returns",
"information",
"about",
"the",
"page",
"needed",
"by",
"the",
"server",
"in",
"an",
"object",
"to",
"be",
"converted",
"in",
"JSON"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/onetagBidAdapter.js#L105-L130 |
6,184 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | bidResponseAvailable | function bidResponseAvailable(bidRequest, bidResponse) {
const idToImpMap = {};
const idToBidMap = {};
bidResponse = bidResponse.body
// extract the request bids and the response bids, keyed by impr-id
const ortbRequest = parse(bidRequest.data);
ortbRequest.imp.forEach(imp => {
idToImpMap[imp.id] = imp;... | javascript | function bidResponseAvailable(bidRequest, bidResponse) {
const idToImpMap = {};
const idToBidMap = {};
bidResponse = bidResponse.body
// extract the request bids and the response bids, keyed by impr-id
const ortbRequest = parse(bidRequest.data);
ortbRequest.imp.forEach(imp => {
idToImpMap[imp.id] = imp;... | [
"function",
"bidResponseAvailable",
"(",
"bidRequest",
",",
"bidResponse",
")",
"{",
"const",
"idToImpMap",
"=",
"{",
"}",
";",
"const",
"idToBidMap",
"=",
"{",
"}",
";",
"bidResponse",
"=",
"bidResponse",
".",
"body",
"// extract the request bids and the response b... | Callback for bids, after the call to PulsePoint completes. | [
"Callback",
"for",
"bids",
"after",
"the",
"call",
"to",
"PulsePoint",
"completes",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L82-L122 |
6,185 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | impression | function impression(slot) {
return {
id: slot.bidId,
banner: banner(slot),
'native': nativeImpression(slot),
tagid: slot.params.ct.toString(),
};
} | javascript | function impression(slot) {
return {
id: slot.bidId,
banner: banner(slot),
'native': nativeImpression(slot),
tagid: slot.params.ct.toString(),
};
} | [
"function",
"impression",
"(",
"slot",
")",
"{",
"return",
"{",
"id",
":",
"slot",
".",
"bidId",
",",
"banner",
":",
"banner",
"(",
"slot",
")",
",",
"'native'",
":",
"nativeImpression",
"(",
"slot",
")",
",",
"tagid",
":",
"slot",
".",
"params",
"."... | Produces an OpenRTBImpression from a slot config. | [
"Produces",
"an",
"OpenRTBImpression",
"from",
"a",
"slot",
"config",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L135-L142 |
6,186 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | banner | function banner(slot) {
const size = adSize(slot);
return slot.nativeParams ? null : {
w: size[0],
h: size[1],
};
} | javascript | function banner(slot) {
const size = adSize(slot);
return slot.nativeParams ? null : {
w: size[0],
h: size[1],
};
} | [
"function",
"banner",
"(",
"slot",
")",
"{",
"const",
"size",
"=",
"adSize",
"(",
"slot",
")",
";",
"return",
"slot",
".",
"nativeParams",
"?",
"null",
":",
"{",
"w",
":",
"size",
"[",
"0",
"]",
",",
"h",
":",
"size",
"[",
"1",
"]",
",",
"}",
... | Produces an OpenRTB Banner object for the slot given. | [
"Produces",
"an",
"OpenRTB",
"Banner",
"object",
"for",
"the",
"slot",
"given",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L147-L153 |
6,187 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | site | function site(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (!appParams) {
return {
publisher: {
id: pubId.toString(),
},
ref: referrer(),
page: utils.getTopWindowLo... | javascript | function site(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (!appParams) {
return {
publisher: {
id: pubId.toString(),
},
ref: referrer(),
page: utils.getTopWindowLo... | [
"function",
"site",
"(",
"bidderRequest",
")",
"{",
"const",
"pubId",
"=",
"bidderRequest",
"&&",
"bidderRequest",
".",
"length",
">",
"0",
"?",
"bidderRequest",
"[",
"0",
"]",
".",
"params",
".",
"cp",
":",
"'0'",
";",
"const",
"appParams",
"=",
"bidder... | Produces an OpenRTB site object. | [
"Produces",
"an",
"OpenRTB",
"site",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L231-L244 |
6,188 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | app | function app(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (appParams) {
return {
publisher: {
id: pubId.toString(),
},
bundle: appParams.bundle,
storeurl: appParams... | javascript | function app(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (appParams) {
return {
publisher: {
id: pubId.toString(),
},
bundle: appParams.bundle,
storeurl: appParams... | [
"function",
"app",
"(",
"bidderRequest",
")",
"{",
"const",
"pubId",
"=",
"bidderRequest",
"&&",
"bidderRequest",
".",
"length",
">",
"0",
"?",
"bidderRequest",
"[",
"0",
"]",
".",
"params",
".",
"cp",
":",
"'0'",
";",
"const",
"appParams",
"=",
"bidderR... | Produces an OpenRTB App object. | [
"Produces",
"an",
"OpenRTB",
"App",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L249-L263 |
6,189 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | device | function device() {
return {
ua: navigator.userAgent,
language: (navigator.language || navigator.browserLanguage || navigator.userLanguage || navigator.systemLanguage),
};
} | javascript | function device() {
return {
ua: navigator.userAgent,
language: (navigator.language || navigator.browserLanguage || navigator.userLanguage || navigator.systemLanguage),
};
} | [
"function",
"device",
"(",
")",
"{",
"return",
"{",
"ua",
":",
"navigator",
".",
"userAgent",
",",
"language",
":",
"(",
"navigator",
".",
"language",
"||",
"navigator",
".",
"browserLanguage",
"||",
"navigator",
".",
"userLanguage",
"||",
"navigator",
".",
... | Produces an OpenRTB Device object. | [
"Produces",
"an",
"OpenRTB",
"Device",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L279-L284 |
6,190 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | parse | function parse(rawResponse) {
try {
if (rawResponse) {
return JSON.parse(rawResponse);
}
} catch (ex) {
utils.logError('pulsepointLite.safeParse', 'ERROR', ex);
}
return null;
} | javascript | function parse(rawResponse) {
try {
if (rawResponse) {
return JSON.parse(rawResponse);
}
} catch (ex) {
utils.logError('pulsepointLite.safeParse', 'ERROR', ex);
}
return null;
} | [
"function",
"parse",
"(",
"rawResponse",
")",
"{",
"try",
"{",
"if",
"(",
"rawResponse",
")",
"{",
"return",
"JSON",
".",
"parse",
"(",
"rawResponse",
")",
";",
"}",
"}",
"catch",
"(",
"ex",
")",
"{",
"utils",
".",
"logError",
"(",
"'pulsepointLite.saf... | Safely parses the input given. Returns null on
parsing failure. | [
"Safely",
"parses",
"the",
"input",
"given",
".",
"Returns",
"null",
"on",
"parsing",
"failure",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L290-L299 |
6,191 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | adSize | function adSize(slot) {
if (slot.params.cf) {
const size = slot.params.cf.toUpperCase().split('X');
const width = parseInt(slot.params.cw || size[0], 10);
const height = parseInt(slot.params.ch || size[1], 10);
return [width, height];
}
return [1, 1];
} | javascript | function adSize(slot) {
if (slot.params.cf) {
const size = slot.params.cf.toUpperCase().split('X');
const width = parseInt(slot.params.cw || size[0], 10);
const height = parseInt(slot.params.ch || size[1], 10);
return [width, height];
}
return [1, 1];
} | [
"function",
"adSize",
"(",
"slot",
")",
"{",
"if",
"(",
"slot",
".",
"params",
".",
"cf",
")",
"{",
"const",
"size",
"=",
"slot",
".",
"params",
".",
"cf",
".",
"toUpperCase",
"(",
")",
".",
"split",
"(",
"'X'",
")",
";",
"const",
"width",
"=",
... | Determines the AdSize for the slot. | [
"Determines",
"the",
"AdSize",
"for",
"the",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L304-L312 |
6,192 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | applyGdpr | function applyGdpr(bidderRequest, ortbRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
ortbRequest.regs = { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } };
ortbRequest.user = { ext: { consent: bidderRequest.gdprConsent.consentString } };
}
} | javascript | function applyGdpr(bidderRequest, ortbRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
ortbRequest.regs = { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } };
ortbRequest.user = { ext: { consent: bidderRequest.gdprConsent.consentString } };
}
} | [
"function",
"applyGdpr",
"(",
"bidderRequest",
",",
"ortbRequest",
")",
"{",
"if",
"(",
"bidderRequest",
"&&",
"bidderRequest",
".",
"gdprConsent",
")",
"{",
"ortbRequest",
".",
"regs",
"=",
"{",
"ext",
":",
"{",
"gdpr",
":",
"bidderRequest",
".",
"gdprConse... | Applies GDPR parameters to request. | [
"Applies",
"GDPR",
"parameters",
"to",
"request",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L317-L322 |
6,193 | prebid/Prebid.js | modules/pulsepointBidAdapter.js | nativeResponse | function nativeResponse(imp, bid) {
if (imp['native']) {
const nativeAd = parse(bid.adm);
const keys = {};
if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
nativeAd['native'].assets.forEach(asset => {
keys.title = asset.title ? asset.title.text : keys.title;
keys.bo... | javascript | function nativeResponse(imp, bid) {
if (imp['native']) {
const nativeAd = parse(bid.adm);
const keys = {};
if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
nativeAd['native'].assets.forEach(asset => {
keys.title = asset.title ? asset.title.text : keys.title;
keys.bo... | [
"function",
"nativeResponse",
"(",
"imp",
",",
"bid",
")",
"{",
"if",
"(",
"imp",
"[",
"'native'",
"]",
")",
"{",
"const",
"nativeAd",
"=",
"parse",
"(",
"bid",
".",
"adm",
")",
";",
"const",
"keys",
"=",
"{",
"}",
";",
"if",
"(",
"nativeAd",
"&&... | Parses the native response from the Bid given. | [
"Parses",
"the",
"native",
"response",
"from",
"the",
"Bid",
"given",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L327-L347 |
6,194 | prebid/Prebid.js | modules/33acrossBidAdapter.js | _createBidResponse | function _createBidResponse(response) {
return {
requestId: response.id,
bidderCode: BIDDER_CODE,
cpm: response.seatbid[0].bid[0].price,
width: response.seatbid[0].bid[0].w,
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,... | javascript | function _createBidResponse(response) {
return {
requestId: response.id,
bidderCode: BIDDER_CODE,
cpm: response.seatbid[0].bid[0].price,
width: response.seatbid[0].bid[0].w,
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,... | [
"function",
"_createBidResponse",
"(",
"response",
")",
"{",
"return",
"{",
"requestId",
":",
"response",
".",
"id",
",",
"bidderCode",
":",
"BIDDER_CODE",
",",
"cpm",
":",
"response",
".",
"seatbid",
"[",
"0",
"]",
".",
"bid",
"[",
"0",
"]",
".",
"pri... | All this assumes that only one bid is ever returned by ttx | [
"All",
"this",
"assumes",
"that",
"only",
"one",
"bid",
"is",
"ever",
"returned",
"by",
"ttx"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L15-L28 |
6,195 | prebid/Prebid.js | modules/33acrossBidAdapter.js | _createSync | function _createSync(siteId) {
const ttxSettings = config.getConfig('ttxSettings');
const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;
return {
type: 'iframe',
url: `${syncUrl}&id=${siteId}`
}
} | javascript | function _createSync(siteId) {
const ttxSettings = config.getConfig('ttxSettings');
const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;
return {
type: 'iframe',
url: `${syncUrl}&id=${siteId}`
}
} | [
"function",
"_createSync",
"(",
"siteId",
")",
"{",
"const",
"ttxSettings",
"=",
"config",
".",
"getConfig",
"(",
"'ttxSettings'",
")",
";",
"const",
"syncUrl",
"=",
"(",
"ttxSettings",
"&&",
"ttxSettings",
".",
"syncUrl",
")",
"||",
"SYNC_ENDPOINT",
";",
"r... | Sync object will always be of type iframe for TTX | [
"Sync",
"object",
"will",
"always",
"be",
"of",
"type",
"iframe",
"for",
"TTX"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L125-L133 |
6,196 | prebid/Prebid.js | modules/33acrossBidAdapter.js | ViewabilityContributor | function ViewabilityContributor(viewabilityAmount) {
function contributeViewability(ttxRequest) {
const req = Object.assign({}, ttxRequest);
const imp = req.imp = req.imp.map(impItem => Object.assign({}, impItem));
const banner = imp[0].banner = Object.assign({}, imp[0].banner);
const ext = banner.ext... | javascript | function ViewabilityContributor(viewabilityAmount) {
function contributeViewability(ttxRequest) {
const req = Object.assign({}, ttxRequest);
const imp = req.imp = req.imp.map(impItem => Object.assign({}, impItem));
const banner = imp[0].banner = Object.assign({}, imp[0].banner);
const ext = banner.ext... | [
"function",
"ViewabilityContributor",
"(",
"viewabilityAmount",
")",
"{",
"function",
"contributeViewability",
"(",
"ttxRequest",
")",
"{",
"const",
"req",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"ttxRequest",
")",
";",
"const",
"imp",
"=",
"req",
... | Viewability contribution to request.. | [
"Viewability",
"contribution",
"to",
"request",
".."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L226-L240 |
6,197 | prebid/Prebid.js | src/auction.js | tryAddVideoBid | function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded) {
let addBid = true;
const bidderRequest = getBidRequest(bidResponse.requestId, [bidRequests]);
const videoMediaType =
bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video');
const context = videoMediaType && deepAccess... | javascript | function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded) {
let addBid = true;
const bidderRequest = getBidRequest(bidResponse.requestId, [bidRequests]);
const videoMediaType =
bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video');
const context = videoMediaType && deepAccess... | [
"function",
"tryAddVideoBid",
"(",
"auctionInstance",
",",
"bidResponse",
",",
"bidRequests",
",",
"afterBidAdded",
")",
"{",
"let",
"addBid",
"=",
"true",
";",
"const",
"bidderRequest",
"=",
"getBidRequest",
"(",
"bidResponse",
".",
"requestId",
",",
"[",
"bidR... | Video bids may fail if the cache is down, or there's trouble on the network. | [
"Video",
"bids",
"may",
"fail",
"if",
"the",
"cache",
"is",
"down",
"or",
"there",
"s",
"trouble",
"on",
"the",
"network",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L405-L426 |
6,198 | prebid/Prebid.js | src/auction.js | createKeyVal | function createKeyVal(key, value) {
return {
key,
val: (typeof value === 'function')
? function (bidResponse) {
return value(bidResponse);
}
: function (bidResponse) {
return getValue(bidResponse, value);
}
};
} | javascript | function createKeyVal(key, value) {
return {
key,
val: (typeof value === 'function')
? function (bidResponse) {
return value(bidResponse);
}
: function (bidResponse) {
return getValue(bidResponse, value);
}
};
} | [
"function",
"createKeyVal",
"(",
"key",
",",
"value",
")",
"{",
"return",
"{",
"key",
",",
"val",
":",
"(",
"typeof",
"value",
"===",
"'function'",
")",
"?",
"function",
"(",
"bidResponse",
")",
"{",
"return",
"value",
"(",
"bidResponse",
")",
";",
"}"... | factory for key value objs | [
"factory",
"for",
"key",
"value",
"objs"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L519-L530 |
6,199 | prebid/Prebid.js | src/auction.js | groupByPlacement | function groupByPlacement(bidsByPlacement, bid) {
if (!bidsByPlacement[bid.adUnitCode]) { bidsByPlacement[bid.adUnitCode] = { bids: [] }; }
bidsByPlacement[bid.adUnitCode].bids.push(bid);
return bidsByPlacement;
} | javascript | function groupByPlacement(bidsByPlacement, bid) {
if (!bidsByPlacement[bid.adUnitCode]) { bidsByPlacement[bid.adUnitCode] = { bids: [] }; }
bidsByPlacement[bid.adUnitCode].bids.push(bid);
return bidsByPlacement;
} | [
"function",
"groupByPlacement",
"(",
"bidsByPlacement",
",",
"bid",
")",
"{",
"if",
"(",
"!",
"bidsByPlacement",
"[",
"bid",
".",
"adUnitCode",
"]",
")",
"{",
"bidsByPlacement",
"[",
"bid",
".",
"adUnitCode",
"]",
"=",
"{",
"bids",
":",
"[",
"]",
"}",
... | groupByPlacement is a reduce function that converts an array of Bid objects
to an object with placement codes as keys, with each key representing an object
with an array of `Bid` objects for that placement
@returns {*} as { [adUnitCode]: { bids: [Bid, Bid, Bid] } } | [
"groupByPlacement",
"is",
"a",
"reduce",
"function",
"that",
"converts",
"an",
"array",
"of",
"Bid",
"objects",
"to",
"an",
"object",
"with",
"placement",
"codes",
"as",
"keys",
"with",
"each",
"key",
"representing",
"an",
"object",
"with",
"an",
"array",
"o... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L688-L692 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.