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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
51,300 | jakekara/datab.js | src/datab-data.js | function( matrix )
{
// default to empty 2d array
if ( typeof( matrix ) == "undefined" )
var matrix = []; // zero rows
// store rows for O(n) retrieval after initial
// operation. sacrifices memory efficiency
this.__rows = matrix;
this.__cols = d3.transpose(matrix);
// get the default in... | javascript | function( matrix )
{
// default to empty 2d array
if ( typeof( matrix ) == "undefined" )
var matrix = []; // zero rows
// store rows for O(n) retrieval after initial
// operation. sacrifices memory efficiency
this.__rows = matrix;
this.__cols = d3.transpose(matrix);
// get the default in... | [
"function",
"(",
"matrix",
")",
"{",
"// default to empty 2d array",
"if",
"(",
"typeof",
"(",
"matrix",
")",
"==",
"\"undefined\"",
")",
"var",
"matrix",
"=",
"[",
"]",
";",
"// zero rows",
"// store rows for O(n) retrieval after initial",
"// operation. sacrifices mem... | create a data object from a two-dimensional array
@constructor
@arg matrix - a matrix (2d-array) of the table | [
"create",
"a",
"data",
"object",
"from",
"a",
"two",
"-",
"dimensional",
"array"
] | 696246bf461609bf1fd145634307f4c7d3edc82a | https://github.com/jakekara/datab.js/blob/696246bf461609bf1fd145634307f4c7d3edc82a/src/datab-data.js#L41-L73 | |
51,301 | vkiding/judpack-lib | src/cordova/plugin_parser.js | plugin_parser | function plugin_parser(xmlPath) {
this.path = xmlPath;
this.doc = xml.parseElementtreeSync(xmlPath);
this.platforms = this.doc.findall('platform').map(function(p) {
return p.attrib.name;
});
} | javascript | function plugin_parser(xmlPath) {
this.path = xmlPath;
this.doc = xml.parseElementtreeSync(xmlPath);
this.platforms = this.doc.findall('platform').map(function(p) {
return p.attrib.name;
});
} | [
"function",
"plugin_parser",
"(",
"xmlPath",
")",
"{",
"this",
".",
"path",
"=",
"xmlPath",
";",
"this",
".",
"doc",
"=",
"xml",
".",
"parseElementtreeSync",
"(",
"xmlPath",
")",
";",
"this",
".",
"platforms",
"=",
"this",
".",
"doc",
".",
"findall",
"... | Deprecated. Use PluginInfo instead. | [
"Deprecated",
".",
"Use",
"PluginInfo",
"instead",
"."
] | 8657cecfec68221109279106adca8dbc81f430f4 | https://github.com/vkiding/judpack-lib/blob/8657cecfec68221109279106adca8dbc81f430f4/src/cordova/plugin_parser.js#L23-L29 |
51,302 | tolokoban/ToloFrameWork | ker/mod/tfw.view.icon.js | onContentChanged | function onContentChanged( contentStringOrObject ) {
try {
const
isString = typeof contentStringOrObject === 'string',
content = isString ? Icons.iconsBook[ contentStringOrObject ] : contentStringOrObject;
this._content = createSvgFromDefinition.call( this, content );
... | javascript | function onContentChanged( contentStringOrObject ) {
try {
const
isString = typeof contentStringOrObject === 'string',
content = isString ? Icons.iconsBook[ contentStringOrObject ] : contentStringOrObject;
this._content = createSvgFromDefinition.call( this, content );
... | [
"function",
"onContentChanged",
"(",
"contentStringOrObject",
")",
"{",
"try",
"{",
"const",
"isString",
"=",
"typeof",
"contentStringOrObject",
"===",
"'string'",
",",
"content",
"=",
"isString",
"?",
"Icons",
".",
"iconsBook",
"[",
"contentStringOrObject",
"]",
... | Create SVG icon from `content`
@this ViewXJS
@param {object|string} contentStringOrObject - Can be an icon name or a SVG description.
@returns {undefined} | [
"Create",
"SVG",
"icon",
"from",
"content"
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.view.icon.js#L30-L50 |
51,303 | tolokoban/ToloFrameWork | ker/mod/tfw.view.icon.js | updatePen | function updatePen( penIndex, penColor = "0" ) {
if ( !this._content ) return;
let elementsToFill = this._content.elementsToFillPerColor[ penIndex ];
if ( !Array.isArray( elementsToFill ) ) elementsToFill = [];
let elementsToStroke = this._content.elementsToStrokePerColor[ penIndex ];
if ( !Array.i... | javascript | function updatePen( penIndex, penColor = "0" ) {
if ( !this._content ) return;
let elementsToFill = this._content.elementsToFillPerColor[ penIndex ];
if ( !Array.isArray( elementsToFill ) ) elementsToFill = [];
let elementsToStroke = this._content.elementsToStrokePerColor[ penIndex ];
if ( !Array.i... | [
"function",
"updatePen",
"(",
"penIndex",
",",
"penColor",
"=",
"\"0\"",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_content",
")",
"return",
";",
"let",
"elementsToFill",
"=",
"this",
".",
"_content",
".",
"elementsToFillPerColor",
"[",
"penIndex",
"]",
";",... | Update the color of a pen.
@this ViewXJS
@param {integer} penIndex - The index of the pen.
@param {string} penColor - The new color of this pen.
@returns {undefined} | [
"Update",
"the",
"color",
"of",
"a",
"pen",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.view.icon.js#L198-L207 |
51,304 | baaae/charge | lib/index.js | aliasesTaken | function aliasesTaken (arr) {
var taken
for (var ind in arr) {
if (!arr.hasOwnProperty(ind)) continue;
if (aliasTaken(arr[ind]) !== false) return arr[ind];
}
return false;
} | javascript | function aliasesTaken (arr) {
var taken
for (var ind in arr) {
if (!arr.hasOwnProperty(ind)) continue;
if (aliasTaken(arr[ind]) !== false) return arr[ind];
}
return false;
} | [
"function",
"aliasesTaken",
"(",
"arr",
")",
"{",
"var",
"taken",
"for",
"(",
"var",
"ind",
"in",
"arr",
")",
"{",
"if",
"(",
"!",
"arr",
".",
"hasOwnProperty",
"(",
"ind",
")",
")",
"continue",
";",
"if",
"(",
"aliasTaken",
"(",
"arr",
"[",
"ind",... | return false if _any_ one of them is in use | [
"return",
"false",
"if",
"_any_",
"one",
"of",
"them",
"is",
"in",
"use"
] | af756ab21edc7e96d68e217225f3e386b72f0af1 | https://github.com/baaae/charge/blob/af756ab21edc7e96d68e217225f3e386b72f0af1/lib/index.js#L147-L154 |
51,305 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | simpleChar | function simpleChar(character) {
return CHAR_TAB !== character &&
CHAR_LINE_FEED !== character &&
CHAR_CARRIAGE_RETURN !== character &&
CHAR_COMMA !== character &&
CHAR_LEFT_SQUARE_BRACKET !== character &&
CHAR_RIGHT_SQUARE_... | javascript | function simpleChar(character) {
return CHAR_TAB !== character &&
CHAR_LINE_FEED !== character &&
CHAR_CARRIAGE_RETURN !== character &&
CHAR_COMMA !== character &&
CHAR_LEFT_SQUARE_BRACKET !== character &&
CHAR_RIGHT_SQUARE_... | [
"function",
"simpleChar",
"(",
"character",
")",
"{",
"return",
"CHAR_TAB",
"!==",
"character",
"&&",
"CHAR_LINE_FEED",
"!==",
"character",
"&&",
"CHAR_CARRIAGE_RETURN",
"!==",
"character",
"&&",
"CHAR_COMMA",
"!==",
"character",
"&&",
"CHAR_LEFT_SQUARE_BRACKET",
"!==... | Returns true if character can be found in a simple scalar | [
"Returns",
"true",
"if",
"character",
"can",
"be",
"found",
"in",
"a",
"simple",
"scalar"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L7770-L7791 |
51,306 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | needsHexEscape | function needsHexEscape(character) {
return !((0x00020 <= character && character <= 0x00007E) ||
(0x00085 === character) ||
(0x000A0 <= character && character <= 0x00D7FF) ||
(0x0E000 <= character && character <= 0x00FFFD) ||
(0x10000 <= character &&... | javascript | function needsHexEscape(character) {
return !((0x00020 <= character && character <= 0x00007E) ||
(0x00085 === character) ||
(0x000A0 <= character && character <= 0x00D7FF) ||
(0x0E000 <= character && character <= 0x00FFFD) ||
(0x10000 <= character &&... | [
"function",
"needsHexEscape",
"(",
"character",
")",
"{",
"return",
"!",
"(",
"(",
"0x00020",
"<=",
"character",
"&&",
"character",
"<=",
"0x00007E",
")",
"||",
"(",
"0x00085",
"===",
"character",
")",
"||",
"(",
"0x000A0",
"<=",
"character",
"&&",
"charac... | Returns true if the character code needs to be escaped. | [
"Returns",
"true",
"if",
"the",
"character",
"code",
"needs",
"to",
"be",
"escaped",
"."
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L7794-L7800 |
51,307 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | fromCodePoint | function fromCodePoint(cp) {
return (cp < 0x10000) ? String.fromCharCode(cp) :
String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
} | javascript | function fromCodePoint(cp) {
return (cp < 0x10000) ? String.fromCharCode(cp) :
String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
} | [
"function",
"fromCodePoint",
"(",
"cp",
")",
"{",
"return",
"(",
"cp",
"<",
"0x10000",
")",
"?",
"String",
".",
"fromCharCode",
"(",
"cp",
")",
":",
"String",
".",
"fromCharCode",
"(",
"0xD800",
"+",
"(",
"(",
"cp",
"-",
"0x10000",
")",
">>",
"10",
... | ECMA-262 11.6 Identifier Names and Identifiers | [
"ECMA",
"-",
"262",
"11",
".",
"6",
"Identifier",
"Names",
"and",
"Identifiers"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L11449-L11453 |
51,308 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | isKeyword | function isKeyword(id) {
switch (id.length) {
case 2:
return (id === 'if') || (id === 'in') || (id === 'do');
case 3:
return (id === 'var') || (id === 'for') || (id === 'new') ||
(id === 'try') || (id === 'let');
case 4:
return (id === ... | javascript | function isKeyword(id) {
switch (id.length) {
case 2:
return (id === 'if') || (id === 'in') || (id === 'do');
case 3:
return (id === 'var') || (id === 'for') || (id === 'new') ||
(id === 'try') || (id === 'let');
case 4:
return (id === ... | [
"function",
"isKeyword",
"(",
"id",
")",
"{",
"switch",
"(",
"id",
".",
"length",
")",
"{",
"case",
"2",
":",
"return",
"(",
"id",
"===",
"'if'",
")",
"||",
"(",
"id",
"===",
"'in'",
")",
"||",
"(",
"id",
"===",
"'do'",
")",
";",
"case",
"3",
... | ECMA-262 11.6.2.1 Keywords | [
"ECMA",
"-",
"262",
"11",
".",
"6",
".",
"2",
".",
"1",
"Keywords"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L11509-L11535 |
51,309 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | scanPunctuator | function scanPunctuator() {
var token, str;
token = {
type: Token.Punctuator,
value: '',
lineNumber: lineNumber,
lineStart: lineStart,
start: index,
end: index
};
// Check for most common single-character punctuato... | javascript | function scanPunctuator() {
var token, str;
token = {
type: Token.Punctuator,
value: '',
lineNumber: lineNumber,
lineStart: lineStart,
start: index,
end: index
};
// Check for most common single-character punctuato... | [
"function",
"scanPunctuator",
"(",
")",
"{",
"var",
"token",
",",
"str",
";",
"token",
"=",
"{",
"type",
":",
"Token",
".",
"Punctuator",
",",
"value",
":",
"''",
",",
"lineNumber",
":",
"lineNumber",
",",
"lineStart",
":",
"lineStart",
",",
"start",
"... | ECMA-262 11.7 Punctuators | [
"ECMA",
"-",
"262",
"11",
".",
"7",
"Punctuators"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L11902-L11998 |
51,310 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | scanTemplate | function scanTemplate() {
var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;
terminated = false;
tail = false;
start = index;
head = (source[index] === '`');
rawOffset = 2;
++index;
while (index < length) {
ch... | javascript | function scanTemplate() {
var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;
terminated = false;
tail = false;
start = index;
head = (source[index] === '`');
rawOffset = 2;
++index;
while (index < length) {
ch... | [
"function",
"scanTemplate",
"(",
")",
"{",
"var",
"cooked",
"=",
"''",
",",
"ch",
",",
"start",
",",
"rawOffset",
",",
"terminated",
",",
"head",
",",
"tail",
",",
"restore",
",",
"unescaped",
";",
"terminated",
"=",
"false",
";",
"tail",
"=",
"false",... | ECMA-262 11.8.6 Template Literal Lexical Components | [
"ECMA",
"-",
"262",
"11",
".",
"8",
".",
"6",
"Template",
"Literal",
"Lexical",
"Components"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L12305-L12425 |
51,311 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseArrayPattern | function parseArrayPattern(params, kind) {
var node = new Node(), elements = [], rest, restNode;
expect('[');
while (!match(']')) {
if (match(',')) {
lex();
elements.push(null);
} else {
if (match('...')) {
... | javascript | function parseArrayPattern(params, kind) {
var node = new Node(), elements = [], rest, restNode;
expect('[');
while (!match(']')) {
if (match(',')) {
lex();
elements.push(null);
} else {
if (match('...')) {
... | [
"function",
"parseArrayPattern",
"(",
"params",
",",
"kind",
")",
"{",
"var",
"node",
"=",
"new",
"Node",
"(",
")",
",",
"elements",
"=",
"[",
"]",
",",
"rest",
",",
"restNode",
";",
"expect",
"(",
"'['",
")",
";",
"while",
"(",
"!",
"match",
"(",
... | ECMA-262 13.3.3 Destructuring Binding Patterns | [
"ECMA",
"-",
"262",
"13",
".",
"3",
".",
"3",
"Destructuring",
"Binding",
"Patterns"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L13838-L13867 |
51,312 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parsePropertyFunction | function parsePropertyFunction(node, paramInfo, isGenerator) {
var previousStrict, body;
isAssignmentTarget = isBindingElement = false;
previousStrict = strict;
body = isolateCoverGrammar(parseFunctionSourceElements);
if (strict && paramInfo.firstRestricted) {
tole... | javascript | function parsePropertyFunction(node, paramInfo, isGenerator) {
var previousStrict, body;
isAssignmentTarget = isBindingElement = false;
previousStrict = strict;
body = isolateCoverGrammar(parseFunctionSourceElements);
if (strict && paramInfo.firstRestricted) {
tole... | [
"function",
"parsePropertyFunction",
"(",
"node",
",",
"paramInfo",
",",
"isGenerator",
")",
"{",
"var",
"previousStrict",
",",
"body",
";",
"isAssignmentTarget",
"=",
"isBindingElement",
"=",
"false",
";",
"previousStrict",
"=",
"strict",
";",
"body",
"=",
"iso... | ECMA-262 12.2.6 Object Initializer | [
"ECMA",
"-",
"262",
"12",
".",
"2",
".",
"6",
"Object",
"Initializer"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L13977-L13994 |
51,313 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseTemplateElement | function parseTemplateElement(option) {
var node, token;
if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {
throwUnexpectedToken();
}
node = new Node();
token = lex();
return node.finishTemplateElement({ raw: token.value.raw, cooke... | javascript | function parseTemplateElement(option) {
var node, token;
if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {
throwUnexpectedToken();
}
node = new Node();
token = lex();
return node.finishTemplateElement({ raw: token.value.raw, cooke... | [
"function",
"parseTemplateElement",
"(",
"option",
")",
"{",
"var",
"node",
",",
"token",
";",
"if",
"(",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"Template",
"||",
"(",
"option",
".",
"head",
"&&",
"!",
"lookahead",
".",
"head",
")",
")",
"{",
... | ECMA-262 12.2.9 Template Literals | [
"ECMA",
"-",
"262",
"12",
".",
"2",
".",
"9",
"Template",
"Literals"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14248-L14259 |
51,314 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseGroupExpression | function parseGroupExpression() {
var expr, expressions, startToken, i, params = [];
expect('(');
if (match(')')) {
lex();
if (!match('=>')) {
expect('=>');
}
return {
type: PlaceHolders.ArrowParameterPlaceHolder,
... | javascript | function parseGroupExpression() {
var expr, expressions, startToken, i, params = [];
expect('(');
if (match(')')) {
lex();
if (!match('=>')) {
expect('=>');
}
return {
type: PlaceHolders.ArrowParameterPlaceHolder,
... | [
"function",
"parseGroupExpression",
"(",
")",
"{",
"var",
"expr",
",",
"expressions",
",",
"startToken",
",",
"i",
",",
"params",
"=",
"[",
"]",
";",
"expect",
"(",
"'('",
")",
";",
"if",
"(",
"match",
"(",
"')'",
")",
")",
"{",
"lex",
"(",
")",
... | ECMA-262 12.2.10 The Grouping Operator | [
"ECMA",
"-",
"262",
"12",
".",
"2",
".",
"10",
"The",
"Grouping",
"Operator"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14279-L14377 |
51,315 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parsePrimaryExpression | function parsePrimaryExpression() {
var type, token, expr, node;
if (match('(')) {
isBindingElement = false;
return inheritCoverGrammar(parseGroupExpression);
}
if (match('[')) {
return inheritCoverGrammar(parseArrayInitializer);
}
i... | javascript | function parsePrimaryExpression() {
var type, token, expr, node;
if (match('(')) {
isBindingElement = false;
return inheritCoverGrammar(parseGroupExpression);
}
if (match('[')) {
return inheritCoverGrammar(parseArrayInitializer);
}
i... | [
"function",
"parsePrimaryExpression",
"(",
")",
"{",
"var",
"type",
",",
"token",
",",
"expr",
",",
"node",
";",
"if",
"(",
"match",
"(",
"'('",
")",
")",
"{",
"isBindingElement",
"=",
"false",
";",
"return",
"inheritCoverGrammar",
"(",
"parseGroupExpression... | ECMA-262 12.2 Primary Expressions | [
"ECMA",
"-",
"262",
"12",
".",
"2",
"Primary",
"Expressions"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14382-L14459 |
51,316 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseArguments | function parseArguments() {
var args = [], expr;
expect('(');
if (!match(')')) {
while (startIndex < length) {
if (match('...')) {
expr = new Node();
lex();
expr.finishSpreadElement(isolateCoverGrammar(pars... | javascript | function parseArguments() {
var args = [], expr;
expect('(');
if (!match(')')) {
while (startIndex < length) {
if (match('...')) {
expr = new Node();
lex();
expr.finishSpreadElement(isolateCoverGrammar(pars... | [
"function",
"parseArguments",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"]",
",",
"expr",
";",
"expect",
"(",
"'('",
")",
";",
"if",
"(",
"!",
"match",
"(",
"')'",
")",
")",
"{",
"while",
"(",
"startIndex",
"<",
"length",
")",
"{",
"if",
"(",
"ma... | ECMA-262 12.3 Left-Hand-Side Expressions | [
"ECMA",
"-",
"262",
"12",
".",
"3",
"Left",
"-",
"Hand",
"-",
"Side",
"Expressions"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14463-L14488 |
51,317 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseNewExpression | function parseNewExpression() {
var callee, args, node = new Node();
expectKeyword('new');
if (match('.')) {
lex();
if (lookahead.type === Token.Identifier && lookahead.value === 'target') {
if (state.inFunctionBody) {
lex();
... | javascript | function parseNewExpression() {
var callee, args, node = new Node();
expectKeyword('new');
if (match('.')) {
lex();
if (lookahead.type === Token.Identifier && lookahead.value === 'target') {
if (state.inFunctionBody) {
lex();
... | [
"function",
"parseNewExpression",
"(",
")",
"{",
"var",
"callee",
",",
"args",
",",
"node",
"=",
"new",
"Node",
"(",
")",
";",
"expectKeyword",
"(",
"'new'",
")",
";",
"if",
"(",
"match",
"(",
"'.'",
")",
")",
"{",
"lex",
"(",
")",
";",
"if",
"("... | ECMA-262 12.3.3 The new Operator | [
"ECMA",
"-",
"262",
"12",
".",
"3",
".",
"3",
"The",
"new",
"Operator"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14522-L14544 |
51,318 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseLeftHandSideExpressionAllowCall | function parseLeftHandSideExpressionAllowCall() {
var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;
startToken = lookahead;
state.allowIn = true;
if (matchKeyword('super') && state.inFunctionBody) {
expr = new Node();
lex();
... | javascript | function parseLeftHandSideExpressionAllowCall() {
var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;
startToken = lookahead;
state.allowIn = true;
if (matchKeyword('super') && state.inFunctionBody) {
expr = new Node();
lex();
... | [
"function",
"parseLeftHandSideExpressionAllowCall",
"(",
")",
"{",
"var",
"quasi",
",",
"expr",
",",
"args",
",",
"property",
",",
"startToken",
",",
"previousAllowIn",
"=",
"state",
".",
"allowIn",
";",
"startToken",
"=",
"lookahead",
";",
"state",
".",
"allo... | ECMA-262 12.3.4 Function Calls | [
"ECMA",
"-",
"262",
"12",
".",
"3",
".",
"4",
"Function",
"Calls"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14548-L14591 |
51,319 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parsePostfixExpression | function parsePostfixExpression() {
var expr, token, startToken = lookahead;
expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);
if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
if (match('++') || match('--')) {
// ECMA-262 11.3.1, 11.3... | javascript | function parsePostfixExpression() {
var expr, token, startToken = lookahead;
expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);
if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
if (match('++') || match('--')) {
// ECMA-262 11.3.1, 11.3... | [
"function",
"parsePostfixExpression",
"(",
")",
"{",
"var",
"expr",
",",
"token",
",",
"startToken",
"=",
"lookahead",
";",
"expr",
"=",
"inheritCoverGrammar",
"(",
"parseLeftHandSideExpressionAllowCall",
")",
";",
"if",
"(",
"!",
"hasLineTerminator",
"&&",
"looka... | ECMA-262 12.4 Postfix Expressions | [
"ECMA",
"-",
"262",
"12",
".",
"4",
"Postfix",
"Expressions"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14635-L14659 |
51,320 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseUnaryExpression | function parseUnaryExpression() {
var token, expr, startToken;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('++') || match('--')) {
startToken = lookahead;
token = lex();
... | javascript | function parseUnaryExpression() {
var token, expr, startToken;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('++') || match('--')) {
startToken = lookahead;
token = lex();
... | [
"function",
"parseUnaryExpression",
"(",
")",
"{",
"var",
"token",
",",
"expr",
",",
"startToken",
";",
"if",
"(",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"Punctuator",
"&&",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"Keyword",
")",
"{",
"exp... | ECMA-262 12.5 Unary Operators | [
"ECMA",
"-",
"262",
"12",
".",
"5",
"Unary",
"Operators"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14663-L14702 |
51,321 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseConditionalExpression | function parseConditionalExpression() {
var expr, previousAllowIn, consequent, alternate, startToken;
startToken = lookahead;
expr = inheritCoverGrammar(parseBinaryExpression);
if (match('?')) {
lex();
previousAllowIn = state.allowIn;
state.allowIn =... | javascript | function parseConditionalExpression() {
var expr, previousAllowIn, consequent, alternate, startToken;
startToken = lookahead;
expr = inheritCoverGrammar(parseBinaryExpression);
if (match('?')) {
lex();
previousAllowIn = state.allowIn;
state.allowIn =... | [
"function",
"parseConditionalExpression",
"(",
")",
"{",
"var",
"expr",
",",
"previousAllowIn",
",",
"consequent",
",",
"alternate",
",",
"startToken",
";",
"startToken",
"=",
"lookahead",
";",
"expr",
"=",
"inheritCoverGrammar",
"(",
"parseBinaryExpression",
")",
... | ECMA-262 12.13 Conditional Operator | [
"ECMA",
"-",
"262",
"12",
".",
"13",
"Conditional",
"Operator"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L14839-L14859 |
51,322 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseYieldExpression | function parseYieldExpression() {
var argument, expr, delegate, previousAllowYield;
argument = null;
expr = new Node();
delegate = false;
expectKeyword('yield');
if (!hasLineTerminator) {
previousAllowYield = state.allowYield;
state.allowYield =... | javascript | function parseYieldExpression() {
var argument, expr, delegate, previousAllowYield;
argument = null;
expr = new Node();
delegate = false;
expectKeyword('yield');
if (!hasLineTerminator) {
previousAllowYield = state.allowYield;
state.allowYield =... | [
"function",
"parseYieldExpression",
"(",
")",
"{",
"var",
"argument",
",",
"expr",
",",
"delegate",
",",
"previousAllowYield",
";",
"argument",
"=",
"null",
";",
"expr",
"=",
"new",
"Node",
"(",
")",
";",
"delegate",
"=",
"false",
";",
"expectKeyword",
"("... | ECMA-262 14.4 Yield expression | [
"ECMA",
"-",
"262",
"14",
".",
"4",
"Yield",
"expression"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15002-L15027 |
51,323 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseAssignmentExpression | function parseAssignmentExpression() {
var token, expr, right, list, startToken;
startToken = lookahead;
token = lookahead;
if (!state.allowYield && matchKeyword('yield')) {
return parseYieldExpression();
}
expr = parseConditionalExpression();
if (... | javascript | function parseAssignmentExpression() {
var token, expr, right, list, startToken;
startToken = lookahead;
token = lookahead;
if (!state.allowYield && matchKeyword('yield')) {
return parseYieldExpression();
}
expr = parseConditionalExpression();
if (... | [
"function",
"parseAssignmentExpression",
"(",
")",
"{",
"var",
"token",
",",
"expr",
",",
"right",
",",
"list",
",",
"startToken",
";",
"startToken",
"=",
"lookahead",
";",
"token",
"=",
"lookahead",
";",
"if",
"(",
"!",
"state",
".",
"allowYield",
"&&",
... | ECMA-262 12.14 Assignment Operators | [
"ECMA",
"-",
"262",
"12",
".",
"14",
"Assignment",
"Operators"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15031-L15083 |
51,324 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseExpression | function parseExpression() {
var expr, startToken = lookahead, expressions;
expr = isolateCoverGrammar(parseAssignmentExpression);
if (match(',')) {
expressions = [expr];
while (startIndex < length) {
if (!match(',')) {
break;
... | javascript | function parseExpression() {
var expr, startToken = lookahead, expressions;
expr = isolateCoverGrammar(parseAssignmentExpression);
if (match(',')) {
expressions = [expr];
while (startIndex < length) {
if (!match(',')) {
break;
... | [
"function",
"parseExpression",
"(",
")",
"{",
"var",
"expr",
",",
"startToken",
"=",
"lookahead",
",",
"expressions",
";",
"expr",
"=",
"isolateCoverGrammar",
"(",
"parseAssignmentExpression",
")",
";",
"if",
"(",
"match",
"(",
"','",
")",
")",
"{",
"express... | ECMA-262 12.15 Comma Operator | [
"ECMA",
"-",
"262",
"12",
".",
"15",
"Comma",
"Operator"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15087-L15107 |
51,325 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseStatementListItem | function parseStatementListItem() {
if (lookahead.type === Token.Keyword) {
switch (lookahead.value) {
case 'export':
if (state.sourceType !== 'module') {
tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration);
}
... | javascript | function parseStatementListItem() {
if (lookahead.type === Token.Keyword) {
switch (lookahead.value) {
case 'export':
if (state.sourceType !== 'module') {
tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration);
}
... | [
"function",
"parseStatementListItem",
"(",
")",
"{",
"if",
"(",
"lookahead",
".",
"type",
"===",
"Token",
".",
"Keyword",
")",
"{",
"switch",
"(",
"lookahead",
".",
"value",
")",
"{",
"case",
"'export'",
":",
"if",
"(",
"state",
".",
"sourceType",
"!==",... | ECMA-262 13.2 Block | [
"ECMA",
"-",
"262",
"13",
".",
"2",
"Block"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15111-L15138 |
51,326 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseLexicalBinding | function parseLexicalBinding(kind, options) {
var init = null, id, node = new Node(), params = [];
id = parsePattern(params, kind);
// ECMA-262 12.2.1
if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
tolerateError(Messages.StrictVarName);
... | javascript | function parseLexicalBinding(kind, options) {
var init = null, id, node = new Node(), params = [];
id = parsePattern(params, kind);
// ECMA-262 12.2.1
if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
tolerateError(Messages.StrictVarName);
... | [
"function",
"parseLexicalBinding",
"(",
"kind",
",",
"options",
")",
"{",
"var",
"init",
"=",
"null",
",",
"id",
",",
"node",
"=",
"new",
"Node",
"(",
")",
",",
"params",
"=",
"[",
"]",
";",
"id",
"=",
"parsePattern",
"(",
"params",
",",
"kind",
")... | ECMA-262 13.3.1 Let and Const Declarations | [
"ECMA",
"-",
"262",
"13",
".",
"3",
".",
"1",
"Let",
"and",
"Const",
"Declarations"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15240-L15261 |
51,327 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseIfStatement | function parseIfStatement(node) {
var test, consequent, alternate;
expectKeyword('if');
expect('(');
test = parseExpression();
expect(')');
consequent = parseStatement();
if (matchKeyword('else')) {
lex();
alternate = parseStatement()... | javascript | function parseIfStatement(node) {
var test, consequent, alternate;
expectKeyword('if');
expect('(');
test = parseExpression();
expect(')');
consequent = parseStatement();
if (matchKeyword('else')) {
lex();
alternate = parseStatement()... | [
"function",
"parseIfStatement",
"(",
"node",
")",
"{",
"var",
"test",
",",
"consequent",
",",
"alternate",
";",
"expectKeyword",
"(",
"'if'",
")",
";",
"expect",
"(",
"'('",
")",
";",
"test",
"=",
"parseExpression",
"(",
")",
";",
"expect",
"(",
"')'",
... | ECMA-262 13.6 If statement | [
"ECMA",
"-",
"262",
"13",
".",
"6",
"If",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15377-L15398 |
51,328 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseDoWhileStatement | function parseDoWhileStatement(node) {
var body, test, oldInIteration;
expectKeyword('do');
oldInIteration = state.inIteration;
state.inIteration = true;
body = parseStatement();
state.inIteration = oldInIteration;
expectKeyword('while');
expect('(')... | javascript | function parseDoWhileStatement(node) {
var body, test, oldInIteration;
expectKeyword('do');
oldInIteration = state.inIteration;
state.inIteration = true;
body = parseStatement();
state.inIteration = oldInIteration;
expectKeyword('while');
expect('(')... | [
"function",
"parseDoWhileStatement",
"(",
"node",
")",
"{",
"var",
"body",
",",
"test",
",",
"oldInIteration",
";",
"expectKeyword",
"(",
"'do'",
")",
";",
"oldInIteration",
"=",
"state",
".",
"inIteration",
";",
"state",
".",
"inIteration",
"=",
"true",
";"... | ECMA-262 13.7 Iteration Statements | [
"ECMA",
"-",
"262",
"13",
".",
"7",
"Iteration",
"Statements"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15402-L15427 |
51,329 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseContinueStatement | function parseContinueStatement(node) {
var label = null, key;
expectKeyword('continue');
// Optimize the most common form: 'continue;'.
if (source.charCodeAt(startIndex) === 0x3B) {
lex();
if (!state.inIteration) {
throwError(Messages.IllegalCo... | javascript | function parseContinueStatement(node) {
var label = null, key;
expectKeyword('continue');
// Optimize the most common form: 'continue;'.
if (source.charCodeAt(startIndex) === 0x3B) {
lex();
if (!state.inIteration) {
throwError(Messages.IllegalCo... | [
"function",
"parseContinueStatement",
"(",
"node",
")",
"{",
"var",
"label",
"=",
"null",
",",
"key",
";",
"expectKeyword",
"(",
"'continue'",
")",
";",
"// Optimize the most common form: 'continue;'.",
"if",
"(",
"source",
".",
"charCodeAt",
"(",
"startIndex",
")... | ECMA-262 13.8 The continue statement | [
"ECMA",
"-",
"262",
"13",
".",
"8",
"The",
"continue",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15592-L15632 |
51,330 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseReturnStatement | function parseReturnStatement(node) {
var argument = null;
expectKeyword('return');
if (!state.inFunctionBody) {
tolerateError(Messages.IllegalReturn);
}
// 'return' followed by a space and an identifier is very common.
if (source.charCodeAt(lastIndex) === ... | javascript | function parseReturnStatement(node) {
var argument = null;
expectKeyword('return');
if (!state.inFunctionBody) {
tolerateError(Messages.IllegalReturn);
}
// 'return' followed by a space and an identifier is very common.
if (source.charCodeAt(lastIndex) === ... | [
"function",
"parseReturnStatement",
"(",
"node",
")",
"{",
"var",
"argument",
"=",
"null",
";",
"expectKeyword",
"(",
"'return'",
")",
";",
"if",
"(",
"!",
"state",
".",
"inFunctionBody",
")",
"{",
"tolerateError",
"(",
"Messages",
".",
"IllegalReturn",
")",... | ECMA-262 13.10 The return statement | [
"ECMA",
"-",
"262",
"13",
".",
"10",
"The",
"return",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15676-L15708 |
51,331 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseWithStatement | function parseWithStatement(node) {
var object, body;
if (strict) {
tolerateError(Messages.StrictModeWith);
}
expectKeyword('with');
expect('(');
object = parseExpression();
expect(')');
body = parseStatement();
return node.finis... | javascript | function parseWithStatement(node) {
var object, body;
if (strict) {
tolerateError(Messages.StrictModeWith);
}
expectKeyword('with');
expect('(');
object = parseExpression();
expect(')');
body = parseStatement();
return node.finis... | [
"function",
"parseWithStatement",
"(",
"node",
")",
"{",
"var",
"object",
",",
"body",
";",
"if",
"(",
"strict",
")",
"{",
"tolerateError",
"(",
"Messages",
".",
"StrictModeWith",
")",
";",
"}",
"expectKeyword",
"(",
"'with'",
")",
";",
"expect",
"(",
"'... | ECMA-262 13.11 The with statement | [
"ECMA",
"-",
"262",
"13",
".",
"11",
"The",
"with",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15712-L15730 |
51,332 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseSwitchCase | function parseSwitchCase() {
var test, consequent = [], statement, node = new Node();
if (matchKeyword('default')) {
lex();
test = null;
} else {
expectKeyword('case');
test = parseExpression();
}
expect(':');
while (start... | javascript | function parseSwitchCase() {
var test, consequent = [], statement, node = new Node();
if (matchKeyword('default')) {
lex();
test = null;
} else {
expectKeyword('case');
test = parseExpression();
}
expect(':');
while (start... | [
"function",
"parseSwitchCase",
"(",
")",
"{",
"var",
"test",
",",
"consequent",
"=",
"[",
"]",
",",
"statement",
",",
"node",
"=",
"new",
"Node",
"(",
")",
";",
"if",
"(",
"matchKeyword",
"(",
"'default'",
")",
")",
"{",
"lex",
"(",
")",
";",
"test... | ECMA-262 13.12 The switch statement | [
"ECMA",
"-",
"262",
"13",
".",
"12",
"The",
"switch",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15734-L15755 |
51,333 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseThrowStatement | function parseThrowStatement(node) {
var argument;
expectKeyword('throw');
if (hasLineTerminator) {
throwError(Messages.NewlineAfterThrow);
}
argument = parseExpression();
consumeSemicolon();
return node.finishThrowStatement(argument);
} | javascript | function parseThrowStatement(node) {
var argument;
expectKeyword('throw');
if (hasLineTerminator) {
throwError(Messages.NewlineAfterThrow);
}
argument = parseExpression();
consumeSemicolon();
return node.finishThrowStatement(argument);
} | [
"function",
"parseThrowStatement",
"(",
"node",
")",
"{",
"var",
"argument",
";",
"expectKeyword",
"(",
"'throw'",
")",
";",
"if",
"(",
"hasLineTerminator",
")",
"{",
"throwError",
"(",
"Messages",
".",
"NewlineAfterThrow",
")",
";",
"}",
"argument",
"=",
"p... | ECMA-262 13.14 The throw statement | [
"ECMA",
"-",
"262",
"13",
".",
"14",
"The",
"throw",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15804-L15818 |
51,334 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseCatchClause | function parseCatchClause() {
var param, params = [], paramMap = {}, key, i, body, node = new Node();
expectKeyword('catch');
expect('(');
if (match(')')) {
throwUnexpectedToken(lookahead);
}
param = parsePattern(params);
for (i = 0; i < params.leng... | javascript | function parseCatchClause() {
var param, params = [], paramMap = {}, key, i, body, node = new Node();
expectKeyword('catch');
expect('(');
if (match(')')) {
throwUnexpectedToken(lookahead);
}
param = parsePattern(params);
for (i = 0; i < params.leng... | [
"function",
"parseCatchClause",
"(",
")",
"{",
"var",
"param",
",",
"params",
"=",
"[",
"]",
",",
"paramMap",
"=",
"{",
"}",
",",
"key",
",",
"i",
",",
"body",
",",
"node",
"=",
"new",
"Node",
"(",
")",
";",
"expectKeyword",
"(",
"'catch'",
")",
... | ECMA-262 13.15 The try statement | [
"ECMA",
"-",
"262",
"13",
".",
"15",
"The",
"try",
"statement"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15822-L15849 |
51,335 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseFunctionSourceElements | function parseFunctionSourceElements() {
var statement, body = [], token, directive, firstRestricted,
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
node = new Node();
expect('{');
while (startIndex < length) {
if (lookahea... | javascript | function parseFunctionSourceElements() {
var statement, body = [], token, directive, firstRestricted,
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
node = new Node();
expect('{');
while (startIndex < length) {
if (lookahea... | [
"function",
"parseFunctionSourceElements",
"(",
")",
"{",
"var",
"statement",
",",
"body",
"=",
"[",
"]",
",",
"token",
",",
"directive",
",",
"firstRestricted",
",",
"oldLabelSet",
",",
"oldInIteration",
",",
"oldInSwitch",
",",
"oldInFunctionBody",
",",
"oldPa... | ECMA-262 14.1 Function Definition | [
"ECMA",
"-",
"262",
"14",
".",
"1",
"Function",
"Definition"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L15971-L16031 |
51,336 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseModuleSpecifier | function parseModuleSpecifier() {
var node = new Node();
if (lookahead.type !== Token.StringLiteral) {
throwError(Messages.InvalidModuleSpecifier);
}
return node.finishLiteral(lex());
} | javascript | function parseModuleSpecifier() {
var node = new Node();
if (lookahead.type !== Token.StringLiteral) {
throwError(Messages.InvalidModuleSpecifier);
}
return node.finishLiteral(lex());
} | [
"function",
"parseModuleSpecifier",
"(",
")",
"{",
"var",
"node",
"=",
"new",
"Node",
"(",
")",
";",
"if",
"(",
"lookahead",
".",
"type",
"!==",
"Token",
".",
"StringLiteral",
")",
"{",
"throwError",
"(",
"Messages",
".",
"InvalidModuleSpecifier",
")",
";"... | ECMA-262 15.2 Modules | [
"ECMA",
"-",
"262",
"15",
".",
"2",
"Modules"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L16348-L16355 |
51,337 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | parseScriptBody | function parseScriptBody() {
var statement, body = [], token, directive, firstRestricted;
while (startIndex < length) {
token = lookahead;
if (token.type !== Token.StringLiteral) {
break;
}
statement = parseStatementListItem();
... | javascript | function parseScriptBody() {
var statement, body = [], token, directive, firstRestricted;
while (startIndex < length) {
token = lookahead;
if (token.type !== Token.StringLiteral) {
break;
}
statement = parseStatementListItem();
... | [
"function",
"parseScriptBody",
"(",
")",
"{",
"var",
"statement",
",",
"body",
"=",
"[",
"]",
",",
"token",
",",
"directive",
",",
"firstRestricted",
";",
"while",
"(",
"startIndex",
"<",
"length",
")",
"{",
"token",
"=",
"lookahead",
";",
"if",
"(",
"... | ECMA-262 15.1 Scripts | [
"ECMA",
"-",
"262",
"15",
".",
"1",
"Scripts"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L16612-L16649 |
51,338 | reptilbud/hapi-swagger | public/swaggerui/swagger-ui.js | function(){
// Initialize the API object
if (this.mainView) {
this.mainView.clear();
}
var url = this.options.url;
if (url && url.indexOf('http') !== 0) {
url = this.buildUrl(window.location.href.toString(), url);
}
if(this.api) {
this.options.authorizations = this.api.clie... | javascript | function(){
// Initialize the API object
if (this.mainView) {
this.mainView.clear();
}
var url = this.options.url;
if (url && url.indexOf('http') !== 0) {
url = this.buildUrl(window.location.href.toString(), url);
}
if(this.api) {
this.options.authorizations = this.api.clie... | [
"function",
"(",
")",
"{",
"// Initialize the API object",
"if",
"(",
"this",
".",
"mainView",
")",
"{",
"this",
".",
"mainView",
".",
"clear",
"(",
")",
";",
"}",
"var",
"url",
"=",
"this",
".",
"options",
".",
"url",
";",
"if",
"(",
"url",
"&&",
... | Create an api and render | [
"Create",
"an",
"api",
"and",
"render"
] | 8a4a1059f060a7100270e837d2759c6a2b9c7e74 | https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/public/swaggerui/swagger-ui.js#L24808-L24824 | |
51,339 | tolokoban/ToloFrameWork | ker/com/x-row/x-row.com.js | flushCurrentCell | function flushCurrentCell() {
if (currentCell.children.length > 0) {
cells.push(currentCell);
currentCell = N.tag("div");
cellsWeights.push(1);
totalWeight++;
}
} | javascript | function flushCurrentCell() {
if (currentCell.children.length > 0) {
cells.push(currentCell);
currentCell = N.tag("div");
cellsWeights.push(1);
totalWeight++;
}
} | [
"function",
"flushCurrentCell",
"(",
")",
"{",
"if",
"(",
"currentCell",
".",
"children",
".",
"length",
">",
"0",
")",
"{",
"cells",
".",
"push",
"(",
"currentCell",
")",
";",
"currentCell",
"=",
"N",
".",
"tag",
"(",
"\"div\"",
")",
";",
"cellsWeight... | Push `currentCell` to `cells` if `currentCell` is not empty. | [
"Push",
"currentCell",
"to",
"cells",
"if",
"currentCell",
"is",
"not",
"empty",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/com/x-row/x-row.com.js#L49-L56 |
51,340 | finvernizzi/mplane_http_transport | ssl_files.js | readFileContent | function readFileContent(fileName){
try{
return(fs.readFileSync(fileName , "utf-8"));
}catch(e){
console.log("---readFileContent-- Error reading file "+fileName);
console.log(e);
return null;
}
} | javascript | function readFileContent(fileName){
try{
return(fs.readFileSync(fileName , "utf-8"));
}catch(e){
console.log("---readFileContent-- Error reading file "+fileName);
console.log(e);
return null;
}
} | [
"function",
"readFileContent",
"(",
"fileName",
")",
"{",
"try",
"{",
"return",
"(",
"fs",
".",
"readFileSync",
"(",
"fileName",
",",
"\"utf-8\"",
")",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"console",
".",
"log",
"(",
"\"---readFileContent-- Error re... | Reads cert and keys
@param fileName (full path)
@returns {*} | [
"Reads",
"cert",
"and",
"keys"
] | 1102d8e1458c3010f3b126b536434114c790b180 | https://github.com/finvernizzi/mplane_http_transport/blob/1102d8e1458c3010f3b126b536434114c790b180/ssl_files.js#L48-L56 |
51,341 | RoboterHund/April1 | modules/output.js | output | function output (consumer, template, params, getDefault) {
return new Output (consumer, template, params, getDefault);
} | javascript | function output (consumer, template, params, getDefault) {
return new Output (consumer, template, params, getDefault);
} | [
"function",
"output",
"(",
"consumer",
",",
"template",
",",
"params",
",",
"getDefault",
")",
"{",
"return",
"new",
"Output",
"(",
"consumer",
",",
"template",
",",
"params",
",",
"getDefault",
")",
";",
"}"
] | output generator constructor wrapper
@param {Consumer} consumer passed to constructor
@param {Array} template passed to constructor
@param {Parameterizer} [params] passed to constructor
@param getDefault
@returns {Output} initialized output generator | [
"output",
"generator",
"constructor",
"wrapper"
] | f4fead4d8190d0b7bdc7b649f4c2c0e9728ef30b | https://github.com/RoboterHund/April1/blob/f4fead4d8190d0b7bdc7b649f4c2c0e9728ef30b/modules/output.js#L44-L46 |
51,342 | itsa/itsa-io | io.js | function (xhr, options, promise) {
console.log(NAME, '_initXHR');
var instance = this,
url = options.url,
method = options.method || GET,
headers = options.headers || {}, // all request will get some headers
async = !options.sync,
... | javascript | function (xhr, options, promise) {
console.log(NAME, '_initXHR');
var instance = this,
url = options.url,
method = options.method || GET,
headers = options.headers || {}, // all request will get some headers
async = !options.sync,
... | [
"function",
"(",
"xhr",
",",
"options",
",",
"promise",
")",
"{",
"console",
".",
"log",
"(",
"NAME",
",",
"'_initXHR'",
")",
";",
"var",
"instance",
"=",
"this",
",",
"url",
"=",
"options",
".",
"url",
",",
"method",
"=",
"options",
".",
"method",
... | Initializes the xhr-instance, based on the config-params.
This method is the standard way of doing xhr-requests without processing streams.
@method _initXHR
@param xhr {Object} xhr-instance
@param options {Object}
@param [options.url] {String} The url to which the request is sent.
@param [options.method='GET'] {String... | [
"Initializes",
"the",
"xhr",
"-",
"instance",
"based",
"on",
"the",
"config",
"-",
"params",
".",
"This",
"method",
"is",
"the",
"standard",
"way",
"of",
"doing",
"xhr",
"-",
"requests",
"without",
"processing",
"streams",
"."
] | 790c77db5cfd3ee953256bfadd60218fb3a5041e | https://github.com/itsa/itsa-io/blob/790c77db5cfd3ee953256bfadd60218fb3a5041e/io.js#L89-L156 | |
51,343 | itsa/itsa-io | io.js | function(xhr, promise, headers, method) {
// XDR cannot set requestheaders, only XHR:
if (!xhr._isXDR) {
console.log(NAME, '_setHeaders');
var name;
if ((method!=='POST') && (method!=='PUT')) {
// force GET-request to make a req... | javascript | function(xhr, promise, headers, method) {
// XDR cannot set requestheaders, only XHR:
if (!xhr._isXDR) {
console.log(NAME, '_setHeaders');
var name;
if ((method!=='POST') && (method!=='PUT')) {
// force GET-request to make a req... | [
"function",
"(",
"xhr",
",",
"promise",
",",
"headers",
",",
"method",
")",
"{",
"// XDR cannot set requestheaders, only XHR:",
"if",
"(",
"!",
"xhr",
".",
"_isXDR",
")",
"{",
"console",
".",
"log",
"(",
"NAME",
",",
"'_setHeaders'",
")",
";",
"var",
"name... | Adds the `headers`-object to `xhr`-headers.
@method _setHeaders
@param xhr {Object} containing the xhr-instance
@param headers {Object} containing all headers
@param method {String} the request-method used
@private | [
"Adds",
"the",
"headers",
"-",
"object",
"to",
"xhr",
"-",
"headers",
"."
] | 790c77db5cfd3ee953256bfadd60218fb3a5041e | https://github.com/itsa/itsa-io/blob/790c77db5cfd3ee953256bfadd60218fb3a5041e/io.js#L167-L186 | |
51,344 | itsa/itsa-io | io.js | function(data) {
var paramArray = [],
key, value;
// TODO: use `object` module
for (key in data) {
value = data[key];
key = ENCODE_URI_COMPONENT(key);
paramArray.push((value === null) ? key : (key + '=' + ENCODE_URI_COMPONEN... | javascript | function(data) {
var paramArray = [],
key, value;
// TODO: use `object` module
for (key in data) {
value = data[key];
key = ENCODE_URI_COMPONENT(key);
paramArray.push((value === null) ? key : (key + '=' + ENCODE_URI_COMPONEN... | [
"function",
"(",
"data",
")",
"{",
"var",
"paramArray",
"=",
"[",
"]",
",",
"key",
",",
"value",
";",
"// TODO: use `object` module",
"for",
"(",
"key",
"in",
"data",
")",
"{",
"value",
"=",
"data",
"[",
"key",
"]",
";",
"key",
"=",
"ENCODE_URI_COMPONE... | Stringifies an object into one string with every pair separated by `&`
@method _toQueryString
@param data {Object} containing key-value pairs
@return {String} stringified presentation of the object, with every pair separated by `&`
@private | [
"Stringifies",
"an",
"object",
"into",
"one",
"string",
"with",
"every",
"pair",
"separated",
"by",
"&"
] | 790c77db5cfd3ee953256bfadd60218fb3a5041e | https://github.com/itsa/itsa-io/blob/790c77db5cfd3ee953256bfadd60218fb3a5041e/io.js#L247-L258 | |
51,345 | ibm-bluemix-mobile-services/bms-monitoring-sdk-node | AnalyticsEventEmitter.js | AnalyticsEventEmitter | function AnalyticsEventEmitter(logger, utils, CONSTANT, onErrorCallback, optionalArguments, serviceName) {
'use strict';
this.logger = logger || {};
this.utils = utils || {};
this.CONSTANT = CONSTANT || {};
optionalArguments = optionalArguments || {};
this.settings = optionalArguments.settings;
this.re... | javascript | function AnalyticsEventEmitter(logger, utils, CONSTANT, onErrorCallback, optionalArguments, serviceName) {
'use strict';
this.logger = logger || {};
this.utils = utils || {};
this.CONSTANT = CONSTANT || {};
optionalArguments = optionalArguments || {};
this.settings = optionalArguments.settings;
this.re... | [
"function",
"AnalyticsEventEmitter",
"(",
"logger",
",",
"utils",
",",
"CONSTANT",
",",
"onErrorCallback",
",",
"optionalArguments",
",",
"serviceName",
")",
"{",
"'use strict'",
";",
"this",
".",
"logger",
"=",
"logger",
"||",
"{",
"}",
";",
"this",
".",
"u... | This is the main class that gets returned by our SDK init method. It contains several public functions intended to be consumed by users of the SDK. Similar to AnalyticsSDK.java for our java SDK. See README.md for detailed documentation. | [
"This",
"is",
"the",
"main",
"class",
"that",
"gets",
"returned",
"by",
"our",
"SDK",
"init",
"method",
".",
"It",
"contains",
"several",
"public",
"functions",
"intended",
"to",
"be",
"consumed",
"by",
"users",
"of",
"the",
"SDK",
".",
"Similar",
"to",
... | 5b26fbd3b8adacb3fa9f4a0cbd60c8eae1a44df9 | https://github.com/ibm-bluemix-mobile-services/bms-monitoring-sdk-node/blob/5b26fbd3b8adacb3fa9f4a0cbd60c8eae1a44df9/AnalyticsEventEmitter.js#L16-L36 |
51,346 | ibm-bluemix-mobile-services/bms-monitoring-sdk-node | AnalyticsEventEmitter.js | function (types) {
that.logger.logEnter('callback in loadEventTypes, types:\n' + JSON.stringify(types));
// The "raw" event type data has a deeply-nested structure and it
// contains a bunch of stuff we're not interested in. We'll just
// store the names of each type's properties.
Object.keys(typ... | javascript | function (types) {
that.logger.logEnter('callback in loadEventTypes, types:\n' + JSON.stringify(types));
// The "raw" event type data has a deeply-nested structure and it
// contains a bunch of stuff we're not interested in. We'll just
// store the names of each type's properties.
Object.keys(typ... | [
"function",
"(",
"types",
")",
"{",
"that",
".",
"logger",
".",
"logEnter",
"(",
"'callback in loadEventTypes, types:\\n'",
"+",
"JSON",
".",
"stringify",
"(",
"types",
")",
")",
";",
"// The \"raw\" event type data has a deeply-nested structure and it",
"// contains a bu... | Get the event types from the analytics repository. | [
"Get",
"the",
"event",
"types",
"from",
"the",
"analytics",
"repository",
"."
] | 5b26fbd3b8adacb3fa9f4a0cbd60c8eae1a44df9 | https://github.com/ibm-bluemix-mobile-services/bms-monitoring-sdk-node/blob/5b26fbd3b8adacb3fa9f4a0cbd60c8eae1a44df9/AnalyticsEventEmitter.js#L61-L84 | |
51,347 | Becklyn/becklyn-gulp | lib/jshint-helper.js | function (filePath, options)
{
gulpUtil.log(gulpUtil.colors.blue("jsHint"), pathHelper.makeRelative(filePath));
var jsHintConfig = jsHintConfigHelper.getRules(xtend({
lookup: false,
esnext: false
}, options));
gulp.src(filePath)
.pipe(plumber())
... | javascript | function (filePath, options)
{
gulpUtil.log(gulpUtil.colors.blue("jsHint"), pathHelper.makeRelative(filePath));
var jsHintConfig = jsHintConfigHelper.getRules(xtend({
lookup: false,
esnext: false
}, options));
gulp.src(filePath)
.pipe(plumber())
... | [
"function",
"(",
"filePath",
",",
"options",
")",
"{",
"gulpUtil",
".",
"log",
"(",
"gulpUtil",
".",
"colors",
".",
"blue",
"(",
"\"jsHint\"",
")",
",",
"pathHelper",
".",
"makeRelative",
"(",
"filePath",
")",
")",
";",
"var",
"jsHintConfig",
"=",
"jsHin... | Lints a given file
@param {string} filePath
@param {{esnext: boolean}} [options] | [
"Lints",
"a",
"given",
"file"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/lib/jshint-helper.js#L20-L33 | |
51,348 | draykcirb/brickyard-webpack | index.js | moveETP2End | function moveETP2End(config) {
if (!ExtractTextPlugin) return
const etps = config.plugins.filter(val => val instanceof ExtractTextPlugin)
_.chain(config.plugins)
.pullAll(etps)
.push(...etps)
.value()
} | javascript | function moveETP2End(config) {
if (!ExtractTextPlugin) return
const etps = config.plugins.filter(val => val instanceof ExtractTextPlugin)
_.chain(config.plugins)
.pullAll(etps)
.push(...etps)
.value()
} | [
"function",
"moveETP2End",
"(",
"config",
")",
"{",
"if",
"(",
"!",
"ExtractTextPlugin",
")",
"return",
"const",
"etps",
"=",
"config",
".",
"plugins",
".",
"filter",
"(",
"val",
"=>",
"val",
"instanceof",
"ExtractTextPlugin",
")",
"_",
".",
"chain",
"(",
... | mutate. The etps should behind CommonsChunkPlugin
@param config | [
"mutate",
".",
"The",
"etps",
"should",
"behind",
"CommonsChunkPlugin"
] | 8b5f3fcc6ca8b8c9fae0c2908b4cc77065155ad6 | https://github.com/draykcirb/brickyard-webpack/blob/8b5f3fcc6ca8b8c9fae0c2908b4cc77065155ad6/index.js#L77-L86 |
51,349 | draykcirb/brickyard-webpack | index.js | defineGlobalVars | function defineGlobalVars(runtimeConfig, isDebug) {
const globals = Object.assign({}, runtimeConfig.globals, {
APP_DEBUG_MODE: isDebug || !!runtimeConfig.debuggable
})
return new webpack.DefinePlugin(globals)
} | javascript | function defineGlobalVars(runtimeConfig, isDebug) {
const globals = Object.assign({}, runtimeConfig.globals, {
APP_DEBUG_MODE: isDebug || !!runtimeConfig.debuggable
})
return new webpack.DefinePlugin(globals)
} | [
"function",
"defineGlobalVars",
"(",
"runtimeConfig",
",",
"isDebug",
")",
"{",
"const",
"globals",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"runtimeConfig",
".",
"globals",
",",
"{",
"APP_DEBUG_MODE",
":",
"isDebug",
"||",
"!",
"!",
"runtimeConfig"... | define globals variables for injecting them into source scope
@param runtimeConfig
@param isDebug
@returns {object} | [
"define",
"globals",
"variables",
"for",
"injecting",
"them",
"into",
"source",
"scope"
] | 8b5f3fcc6ca8b8c9fae0c2908b4cc77065155ad6 | https://github.com/draykcirb/brickyard-webpack/blob/8b5f3fcc6ca8b8c9fae0c2908b4cc77065155ad6/index.js#L134-L140 |
51,350 | launchbadge/node-bardo | src/db/execute.js | assertContext | function assertContext() {
return new Promise(function(resolve, reject) {
// Check if we're in an active session
let d = process.domain
if (d == null ||
d.context == null ||
d.context.bardo == null) {
// Begin the session before proceeding
return begin().then((ctx) => {
... | javascript | function assertContext() {
return new Promise(function(resolve, reject) {
// Check if we're in an active session
let d = process.domain
if (d == null ||
d.context == null ||
d.context.bardo == null) {
// Begin the session before proceeding
return begin().then((ctx) => {
... | [
"function",
"assertContext",
"(",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"// Check if we're in an active session",
"let",
"d",
"=",
"process",
".",
"domain",
"if",
"(",
"d",
"==",
"null",
"||",
"d",
... | Assert that we have a database context | [
"Assert",
"that",
"we",
"have",
"a",
"database",
"context"
] | fb790c4529410f79c67a5ecbada318f67b4f808b | https://github.com/launchbadge/node-bardo/blob/fb790c4529410f79c67a5ecbada318f67b4f808b/src/db/execute.js#L8-L24 |
51,351 | launchbadge/node-bardo | src/db/execute.js | execute_ | function execute_(ctx, statement, values) {
return new Promise(function(resolve, reject) {
if (/^begin/i.test(statement)) {
// If this is a `BEGIN` statement; put us in a transaction
ctx.inTransaction = true
} else if (/^(commit|rollback)/i.test(statement)) {
// Else if this is a `COMMIT` or... | javascript | function execute_(ctx, statement, values) {
return new Promise(function(resolve, reject) {
if (/^begin/i.test(statement)) {
// If this is a `BEGIN` statement; put us in a transaction
ctx.inTransaction = true
} else if (/^(commit|rollback)/i.test(statement)) {
// Else if this is a `COMMIT` or... | [
"function",
"execute_",
"(",
"ctx",
",",
"statement",
",",
"values",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"if",
"(",
"/",
"^begin",
"/",
"i",
".",
"test",
"(",
"statement",
")",
")",
"{",
"... | Actually execute the statement | [
"Actually",
"execute",
"the",
"statement"
] | fb790c4529410f79c67a5ecbada318f67b4f808b | https://github.com/launchbadge/node-bardo/blob/fb790c4529410f79c67a5ecbada318f67b4f808b/src/db/execute.js#L44-L91 |
51,352 | Becklyn/becklyn-gulp | tasks/scss.js | issueCountReporter | function issueCountReporter (file)
{
if (!file.scsslint.success)
{
totalIssues += file.scsslint.issues.length;
}
scssLintReporter.defaultReporter(file);
} | javascript | function issueCountReporter (file)
{
if (!file.scsslint.success)
{
totalIssues += file.scsslint.issues.length;
}
scssLintReporter.defaultReporter(file);
} | [
"function",
"issueCountReporter",
"(",
"file",
")",
"{",
"if",
"(",
"!",
"file",
".",
"scsslint",
".",
"success",
")",
"{",
"totalIssues",
"+=",
"file",
".",
"scsslint",
".",
"issues",
".",
"length",
";",
"}",
"scssLintReporter",
".",
"defaultReporter",
"(... | Wraps the default SCSS Lint Reporter and
counts the total amount of issues
@param {{
scsslint: {
success: bool,
errors: int,
warnings: int,
issues: Array.<{
line: int,
column: int,
severity: string,
reason: string,
}>
}}} file | [
"Wraps",
"the",
"default",
"SCSS",
"Lint",
"Reporter",
"and",
"counts",
"the",
"total",
"amount",
"of",
"issues"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/tasks/scss.js#L48-L56 |
51,353 | Becklyn/becklyn-gulp | tasks/scss.js | compileSingleFile | function compileSingleFile (filePath, isDebug, options)
{
var outputPath = "./" + path.dirname(filePath).replace("assets/scss", "public/css");
gulpUtil.log(gulpUtil.colors.blue("Sass"), pathHelper.makeRelative(filePath), " -> ", outputPath + "/" + path.basename(filePath).replace(/\.scss$/, ".css"));
var in... | javascript | function compileSingleFile (filePath, isDebug, options)
{
var outputPath = "./" + path.dirname(filePath).replace("assets/scss", "public/css");
gulpUtil.log(gulpUtil.colors.blue("Sass"), pathHelper.makeRelative(filePath), " -> ", outputPath + "/" + path.basename(filePath).replace(/\.scss$/, ".css"));
var in... | [
"function",
"compileSingleFile",
"(",
"filePath",
",",
"isDebug",
",",
"options",
")",
"{",
"var",
"outputPath",
"=",
"\"./\"",
"+",
"path",
".",
"dirname",
"(",
"filePath",
")",
".",
"replace",
"(",
"\"assets/scss\"",
",",
"\"public/css\"",
")",
";",
"gulpU... | Compiles a single Sass file
@param {string} filePath
@param {boolean} isDebug
@param {SassTaskOptions} options
@returns {*} | [
"Compiles",
"a",
"single",
"Sass",
"file"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/tasks/scss.js#L87-L124 |
51,354 | Becklyn/becklyn-gulp | tasks/scss.js | lintFiles | function lintFiles (src)
{
gulp.src(src)
.pipe(scssLint({
config: __dirname + "/../config/scss-lint.yml",
customReport: issueCountReporter
}))
.on('error', function (error)
{
gulpUtil.log(gulpUtil.colors.red('An error has occurred while executing s... | javascript | function lintFiles (src)
{
gulp.src(src)
.pipe(scssLint({
config: __dirname + "/../config/scss-lint.yml",
customReport: issueCountReporter
}))
.on('error', function (error)
{
gulpUtil.log(gulpUtil.colors.red('An error has occurred while executing s... | [
"function",
"lintFiles",
"(",
"src",
")",
"{",
"gulp",
".",
"src",
"(",
"src",
")",
".",
"pipe",
"(",
"scssLint",
"(",
"{",
"config",
":",
"__dirname",
"+",
"\"/../config/scss-lint.yml\"",
",",
"customReport",
":",
"issueCountReporter",
"}",
")",
")",
".",... | Lints the given files
@param {string} src | [
"Lints",
"the",
"given",
"files"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/tasks/scss.js#L133-L145 |
51,355 | Becklyn/becklyn-gulp | tasks/scss.js | startWatcherForLinting | function startWatcherForLinting (src)
{
watch(src,
function (file)
{
if (file.path)
{
lintFiles(file.path);
}
}
);
} | javascript | function startWatcherForLinting (src)
{
watch(src,
function (file)
{
if (file.path)
{
lintFiles(file.path);
}
}
);
} | [
"function",
"startWatcherForLinting",
"(",
"src",
")",
"{",
"watch",
"(",
"src",
",",
"function",
"(",
"file",
")",
"{",
"if",
"(",
"file",
".",
"path",
")",
"{",
"lintFiles",
"(",
"file",
".",
"path",
")",
";",
"}",
"}",
")",
";",
"}"
] | Starts a watcher that lints the changed files
@param {string} src | [
"Starts",
"a",
"watcher",
"that",
"lints",
"the",
"changed",
"files"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/tasks/scss.js#L153-L164 |
51,356 | Becklyn/becklyn-gulp | tasks/scss.js | compileAllFiles | function compileAllFiles (src, isDebug, options)
{
glob(src,
function (err, files)
{
if (err) throw err;
for (var i = 0, l = files.length; i < l; i++)
{
// only start compilation at root files
if (sassHelpers.isRootFile(files[i]))
... | javascript | function compileAllFiles (src, isDebug, options)
{
glob(src,
function (err, files)
{
if (err) throw err;
for (var i = 0, l = files.length; i < l; i++)
{
// only start compilation at root files
if (sassHelpers.isRootFile(files[i]))
... | [
"function",
"compileAllFiles",
"(",
"src",
",",
"isDebug",
",",
"options",
")",
"{",
"glob",
"(",
"src",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"if",
"(",
"err",
")",
"throw",
"err",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
... | Compiles all files in the given selector
@param {string} src all what is accepted by glob
@param {bool} isDebug
@param {SassTaskOptions} options | [
"Compiles",
"all",
"files",
"in",
"the",
"given",
"selector"
] | 1c633378d561f07101f9db19ccd153617b8e0252 | https://github.com/Becklyn/becklyn-gulp/blob/1c633378d561f07101f9db19ccd153617b8e0252/tasks/scss.js#L175-L192 |
51,357 | novadiscovery/nway | lib/parser.js | makeModule | function makeModule(index) {
var stored, src, srcPath, relpath;
// Prepare module
var module = new Module({
uid: index
,req: []
,path: index
,relpath: null
,isNodeModule: false
,isAsyncModule: arequirePath === index
,arequirePath: arequirePath
,index: index
});
if(~modul... | javascript | function makeModule(index) {
var stored, src, srcPath, relpath;
// Prepare module
var module = new Module({
uid: index
,req: []
,path: index
,relpath: null
,isNodeModule: false
,isAsyncModule: arequirePath === index
,arequirePath: arequirePath
,index: index
});
if(~modul... | [
"function",
"makeModule",
"(",
"index",
")",
"{",
"var",
"stored",
",",
"src",
",",
"srcPath",
",",
"relpath",
";",
"// Prepare module",
"var",
"module",
"=",
"new",
"Module",
"(",
"{",
"uid",
":",
"index",
",",
"req",
":",
"[",
"]",
",",
"path",
":"... | Create a module object for the index receives an absolute filepath to parse, and return a new Module object | [
"Create",
"a",
"module",
"object",
"for",
"the",
"index",
"receives",
"an",
"absolute",
"filepath",
"to",
"parse",
"and",
"return",
"a",
"new",
"Module",
"object"
] | fa31c6fe56f2305721e581ac25e8ac9a87e15dda | https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/parser.js#L140-L219 |
51,358 | bucharest-gold/unifiedpush-admin-client | lib/installations.js | update | function update (client) {
return function update (options) {
options = options || {};
const req = {
url: `${client.baseUrl}/rest/applications/${options.variantId}/installations/${options.installation.id}`,
body: options.installation,
method: 'PUT'
};
return request(client, req)
... | javascript | function update (client) {
return function update (options) {
options = options || {};
const req = {
url: `${client.baseUrl}/rest/applications/${options.variantId}/installations/${options.installation.id}`,
body: options.installation,
method: 'PUT'
};
return request(client, req)
... | [
"function",
"update",
"(",
"client",
")",
"{",
"return",
"function",
"update",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"const",
"req",
"=",
"{",
"url",
":",
"`",
"${",
"client",
".",
"baseUrl",
"}",
"${",
"options",
... | A function to update an existing installation.
@param {object} options - An options object that is the JSON representation of the Variant to Update
@param {string} options.variantId - The id of the push application
@param {object} options.installation - the installation object
@param {string} options.installation.id - ... | [
"A",
"function",
"to",
"update",
"an",
"existing",
"installation",
"."
] | a39c98c9a383d7f87cb5cbbc25c4371ea1ad049e | https://github.com/bucharest-gold/unifiedpush-admin-client/blob/a39c98c9a383d7f87cb5cbbc25c4371ea1ad049e/lib/installations.js#L73-L91 |
51,359 | Nazariglez/perenquen | lib/pixi/src/core/textures/BaseTexture.js | BaseTexture | function BaseTexture(source, scaleMode, resolution)
{
EventEmitter.call(this);
this.uuid = utils.uuid();
/**
* The Resolution of the texture.
*
* @member {number}
*/
this.resolution = resolution || 1;
/**
* The width of the base texture set when the image has loaded
... | javascript | function BaseTexture(source, scaleMode, resolution)
{
EventEmitter.call(this);
this.uuid = utils.uuid();
/**
* The Resolution of the texture.
*
* @member {number}
*/
this.resolution = resolution || 1;
/**
* The width of the base texture set when the image has loaded
... | [
"function",
"BaseTexture",
"(",
"source",
",",
"scaleMode",
",",
"resolution",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"uuid",
"=",
"utils",
".",
"uuid",
"(",
")",
";",
"/**\n * The Resolution of the texture.\n *\n ... | A texture stores the information that represents an image. All textures have a base texture.
@class
@memberof PIXI
@param source {Image|Canvas} the source object of the texture.
@param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values
@param resolution {number} the resolution of the t... | [
"A",
"texture",
"stores",
"the",
"information",
"that",
"represents",
"an",
"image",
".",
"All",
"textures",
"have",
"a",
"base",
"texture",
"."
] | e023964d05afeefebdcac4e2044819fdfa3899ae | https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/core/textures/BaseTexture.js#L14-L160 |
51,360 | epeios-q37/xdhelcq | js/Sortable/Sortable.js | function () {
var order = [],
el,
children = this.el.children,
i = 0,
n = children.length,
options = this.options;
for (; i < n; i++) {
el = children[i];
if (_closest(el, options.draggable, this.el)) {
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
}
}... | javascript | function () {
var order = [],
el,
children = this.el.children,
i = 0,
n = children.length,
options = this.options;
for (; i < n; i++) {
el = children[i];
if (_closest(el, options.draggable, this.el)) {
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
}
}... | [
"function",
"(",
")",
"{",
"var",
"order",
"=",
"[",
"]",
",",
"el",
",",
"children",
"=",
"this",
".",
"el",
".",
"children",
",",
"i",
"=",
"0",
",",
"n",
"=",
"children",
".",
"length",
",",
"options",
"=",
"this",
".",
"options",
";",
"for"... | Serializes the item into an array of string.
@returns {String[]} | [
"Serializes",
"the",
"item",
"into",
"an",
"array",
"of",
"string",
"."
] | 8cffac0650297c313779c9fba545096be24e52a5 | https://github.com/epeios-q37/xdhelcq/blob/8cffac0650297c313779c9fba545096be24e52a5/js/Sortable/Sortable.js#L757-L773 | |
51,361 | epeios-q37/xdhelcq | js/Sortable/Sortable.js | function (order) {
var items = {}, rootEl = this.el;
this.toArray().forEach(function (id, i) {
var el = rootEl.children[i];
if (_closest(el, this.options.draggable, rootEl)) {
items[id] = el;
}
}, this);
order.forEach(function (id) {
if (items[id]) {
rootEl.removeChild(items[id]... | javascript | function (order) {
var items = {}, rootEl = this.el;
this.toArray().forEach(function (id, i) {
var el = rootEl.children[i];
if (_closest(el, this.options.draggable, rootEl)) {
items[id] = el;
}
}, this);
order.forEach(function (id) {
if (items[id]) {
rootEl.removeChild(items[id]... | [
"function",
"(",
"order",
")",
"{",
"var",
"items",
"=",
"{",
"}",
",",
"rootEl",
"=",
"this",
".",
"el",
";",
"this",
".",
"toArray",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"id",
",",
"i",
")",
"{",
"var",
"el",
"=",
"rootEl",
".",
... | Sorts the elements according to the array.
@param {String[]} order order of the items | [
"Sorts",
"the",
"elements",
"according",
"to",
"the",
"array",
"."
] | 8cffac0650297c313779c9fba545096be24e52a5 | https://github.com/epeios-q37/xdhelcq/blob/8cffac0650297c313779c9fba545096be24e52a5/js/Sortable/Sortable.js#L780-L797 | |
51,362 | epeios-q37/xdhelcq | js/Sortable/Sortable.js | _index | function _index(/**HTMLElement*/el) {
var index = 0;
while (el && (el = el.previousElementSibling)) {
if (el.nodeName.toUpperCase() !== 'TEMPLATE') {
index++;
}
}
return index;
} | javascript | function _index(/**HTMLElement*/el) {
var index = 0;
while (el && (el = el.previousElementSibling)) {
if (el.nodeName.toUpperCase() !== 'TEMPLATE') {
index++;
}
}
return index;
} | [
"function",
"_index",
"(",
"/**HTMLElement*/",
"el",
")",
"{",
"var",
"index",
"=",
"0",
";",
"while",
"(",
"el",
"&&",
"(",
"el",
"=",
"el",
".",
"previousElementSibling",
")",
")",
"{",
"if",
"(",
"el",
".",
"nodeName",
".",
"toUpperCase",
"(",
")"... | Returns the index of an element within its parent
@param el
@returns {number}
@private | [
"Returns",
"the",
"index",
"of",
"an",
"element",
"within",
"its",
"parent"
] | 8cffac0650297c313779c9fba545096be24e52a5 | https://github.com/epeios-q37/xdhelcq/blob/8cffac0650297c313779c9fba545096be24e52a5/js/Sortable/Sortable.js#L1069-L1077 |
51,363 | aureooms/js-grammar | lib/util/setaddall.js | setaddall | function setaddall(set, iterable) {
var changed = false;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompl... | javascript | function setaddall(set, iterable) {
var changed = false;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompl... | [
"function",
"setaddall",
"(",
"set",
",",
"iterable",
")",
"{",
"var",
"changed",
"=",
"false",
";",
"var",
"_iteratorNormalCompletion",
"=",
"true",
";",
"var",
"_didIteratorError",
"=",
"false",
";",
"var",
"_iteratorError",
"=",
"undefined",
";",
"try",
"... | Adds all elements of an iterable to a set and returns true if the set has
changed.
@param {Set} set - The set to add to.
@param {Iterable} iterable - The iterable of elements to add to the set.
@returns {Boolean} Whether <code>set</code> has changed. | [
"Adds",
"all",
"elements",
"of",
"an",
"iterable",
"to",
"a",
"set",
"and",
"returns",
"true",
"if",
"the",
"set",
"has",
"changed",
"."
] | 28c4d1a3175327b33766c34539eab317303e26c5 | https://github.com/aureooms/js-grammar/blob/28c4d1a3175327b33766c34539eab317303e26c5/lib/util/setaddall.js#L20-L47 |
51,364 | coderaiser/node-tomas | lib/tomas.js | getName | function getName(name) {
const ext = path.extname(name);
const nameCrypt = crypto.createHash('sha1')
.update(name)
.digest('hex') + ext;
return getDir() + nameCrypt;
} | javascript | function getName(name) {
const ext = path.extname(name);
const nameCrypt = crypto.createHash('sha1')
.update(name)
.digest('hex') + ext;
return getDir() + nameCrypt;
} | [
"function",
"getName",
"(",
"name",
")",
"{",
"const",
"ext",
"=",
"path",
".",
"extname",
"(",
"name",
")",
";",
"const",
"nameCrypt",
"=",
"crypto",
".",
"createHash",
"(",
"'sha1'",
")",
".",
"update",
"(",
"name",
")",
".",
"digest",
"(",
"'hex'"... | function get name of file in min folder
@param name | [
"function",
"get",
"name",
"of",
"file",
"in",
"min",
"folder"
] | 62012fcdd432ccea9214969e8ca678baadbe32a0 | https://github.com/coderaiser/node-tomas/blob/62012fcdd432ccea9214969e8ca678baadbe32a0/lib/tomas.js#L91-L99 |
51,365 | agbowlin/liquicode_membership | Membership.js | function(password, salt) {
var hash = npm_crypto.createHmac('sha512', salt); /** Hashing algorithm sha512 */
hash.update(password);
var value = hash.digest('hex');
return {
salt: salt,
passwordHash: value
};
} | javascript | function(password, salt) {
var hash = npm_crypto.createHmac('sha512', salt); /** Hashing algorithm sha512 */
hash.update(password);
var value = hash.digest('hex');
return {
salt: salt,
passwordHash: value
};
} | [
"function",
"(",
"password",
",",
"salt",
")",
"{",
"var",
"hash",
"=",
"npm_crypto",
".",
"createHmac",
"(",
"'sha512'",
",",
"salt",
")",
";",
"/** Hashing algorithm sha512 */",
"hash",
".",
"update",
"(",
"password",
")",
";",
"var",
"value",
"=",
"hash... | hash password with sha512.
@function
@param {string} password - List of required fields.
@param {string} salt - Data to be validated. | [
"hash",
"password",
"with",
"sha512",
"."
] | bf680ce8bf07fd17f6f1670d8c10c9e75757edd5 | https://github.com/agbowlin/liquicode_membership/blob/bf680ce8bf07fd17f6f1670d8c10c9e75757edd5/Membership.js#L128-L136 | |
51,366 | fibo/write-file-utf8 | write-file-utf8.js | writeFileUtf8 | function writeFileUtf8 (filePath, content, callback) {
// Argument callback defaults to throwError.
if (typeof callback !== 'function') callback = throwError
if (typeof content === 'string') {
fs.writeFile(filePath, content, 'utf8', callback)
} else {
throw TypeError(error.contentIsNotString)
}
} | javascript | function writeFileUtf8 (filePath, content, callback) {
// Argument callback defaults to throwError.
if (typeof callback !== 'function') callback = throwError
if (typeof content === 'string') {
fs.writeFile(filePath, content, 'utf8', callback)
} else {
throw TypeError(error.contentIsNotString)
}
} | [
"function",
"writeFileUtf8",
"(",
"filePath",
",",
"content",
",",
"callback",
")",
"{",
"// Argument callback defaults to throwError.",
"if",
"(",
"typeof",
"callback",
"!==",
"'function'",
")",
"callback",
"=",
"throwError",
"if",
"(",
"typeof",
"content",
"===",
... | Write content to file using utf8 encoding
@param {String} filePath
@param {String} content
@param {Function} [callback] | [
"Write",
"content",
"to",
"file",
"using",
"utf8",
"encoding"
] | 2ae2667b0d3942380708412f7f8a6b4d492d191f | https://github.com/fibo/write-file-utf8/blob/2ae2667b0d3942380708412f7f8a6b4d492d191f/write-file-utf8.js#L22-L31 |
51,367 | atd-schubert/node-stream-lib | lib/unit.js | function (stream) {
var self = this;
stream.on('data', function (chunk) {
self.push(chunk);
});
stream.on('end', function () {
self.push(null);
});
this.readableUnit = stream;
return this;
} | javascript | function (stream) {
var self = this;
stream.on('data', function (chunk) {
self.push(chunk);
});
stream.on('end', function () {
self.push(null);
});
this.readableUnit = stream;
return this;
} | [
"function",
"(",
"stream",
")",
"{",
"var",
"self",
"=",
"this",
";",
"stream",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"chunk",
")",
"{",
"self",
".",
"push",
"(",
"chunk",
")",
";",
"}",
")",
";",
"stream",
".",
"on",
"(",
"'end'",
",... | Set a readable stream for this unit
@param {stream.Readable|stream.Duplex|stream.Transform} stream - Use this stream as readable stream
@returns {Unit} | [
"Set",
"a",
"readable",
"stream",
"for",
"this",
"unit"
] | 90f27042fae84d2fbdbf9d28149b0673997f151a | https://github.com/atd-schubert/node-stream-lib/blob/90f27042fae84d2fbdbf9d28149b0673997f151a/lib/unit.js#L56-L66 | |
51,368 | interlockjs/plugins | packages/h2/src/index.js | buildPushManifest | function buildPushManifest (bundles, manifestFilename) {
const manifestableBundles = filter(bundles, bundle => bundle.module);
const bundlesByModuleId = chain(manifestableBundles)
.map(bundle => [ bundle.module.id, bundle ])
.fromPairs()
.value();
const bundleDepGraph = chain... | javascript | function buildPushManifest (bundles, manifestFilename) {
const manifestableBundles = filter(bundles, bundle => bundle.module);
const bundlesByModuleId = chain(manifestableBundles)
.map(bundle => [ bundle.module.id, bundle ])
.fromPairs()
.value();
const bundleDepGraph = chain... | [
"function",
"buildPushManifest",
"(",
"bundles",
",",
"manifestFilename",
")",
"{",
"const",
"manifestableBundles",
"=",
"filter",
"(",
"bundles",
",",
"bundle",
"=>",
"bundle",
".",
"module",
")",
";",
"const",
"bundlesByModuleId",
"=",
"chain",
"(",
"manifesta... | Build a bundle dependency graph, such that when a JS bundle is requested, the server can know what other files will be requested once the bundle loads in the client browser. | [
"Build",
"a",
"bundle",
"dependency",
"graph",
"such",
"that",
"when",
"a",
"JS",
"bundle",
"is",
"requested",
"the",
"server",
"can",
"know",
"what",
"other",
"files",
"will",
"be",
"requested",
"once",
"the",
"bundle",
"loads",
"in",
"the",
"client",
"br... | 05197e4511b64d269260fe3c701ceff864897ab3 | https://github.com/interlockjs/plugins/blob/05197e4511b64d269260fe3c701ceff864897ab3/packages/h2/src/index.js#L97-L123 |
51,369 | ohmlang/eslint-plugin-camelcase-ohm | lib/camelcase-ohm.js | checkCamelCase | function checkCamelCase(idNode) {
var reported = false;
var fakeContext = {
report: function() { reported = true; },
options: []
};
camelcase(fakeContext).Identifier(idNode); // eslint-disable-line new-cap
return !reported;
} | javascript | function checkCamelCase(idNode) {
var reported = false;
var fakeContext = {
report: function() { reported = true; },
options: []
};
camelcase(fakeContext).Identifier(idNode); // eslint-disable-line new-cap
return !reported;
} | [
"function",
"checkCamelCase",
"(",
"idNode",
")",
"{",
"var",
"reported",
"=",
"false",
";",
"var",
"fakeContext",
"=",
"{",
"report",
":",
"function",
"(",
")",
"{",
"reported",
"=",
"true",
";",
"}",
",",
"options",
":",
"[",
"]",
"}",
";",
"camelc... | Checks whether the given node is considered an error by the camelcase rule. | [
"Checks",
"whether",
"the",
"given",
"node",
"is",
"considered",
"an",
"error",
"by",
"the",
"camelcase",
"rule",
"."
] | 21cdfa68b973eac43d68852ffbc3cb7cf688296f | https://github.com/ohmlang/eslint-plugin-camelcase-ohm/blob/21cdfa68b973eac43d68852ffbc3cb7cf688296f/lib/camelcase-ohm.js#L6-L14 |
51,370 | ohmlang/eslint-plugin-camelcase-ohm | lib/camelcase-ohm.js | checkSemanticActionName | function checkSemanticActionName(node) {
var name = node.name;
var underscoreIdx = name.indexOf('_');
// The underscore should not appear on the ends,
// case names should begin with a lowercase letter,
// and there should be only one underscore in the name.
if ((underscoreIdx > 0 && underscoreIdx < (name.... | javascript | function checkSemanticActionName(node) {
var name = node.name;
var underscoreIdx = name.indexOf('_');
// The underscore should not appear on the ends,
// case names should begin with a lowercase letter,
// and there should be only one underscore in the name.
if ((underscoreIdx > 0 && underscoreIdx < (name.... | [
"function",
"checkSemanticActionName",
"(",
"node",
")",
"{",
"var",
"name",
"=",
"node",
".",
"name",
";",
"var",
"underscoreIdx",
"=",
"name",
".",
"indexOf",
"(",
"'_'",
")",
";",
"// The underscore should not appear on the ends,",
"// case names should begin with ... | Returns true if `name` appears to be the name of a semantic action. The idiomatic style in Ohm is `RuleName_caseName`. | [
"Returns",
"true",
"if",
"name",
"appears",
"to",
"be",
"the",
"name",
"of",
"a",
"semantic",
"action",
".",
"The",
"idiomatic",
"style",
"in",
"Ohm",
"is",
"RuleName_caseName",
"."
] | 21cdfa68b973eac43d68852ffbc3cb7cf688296f | https://github.com/ohmlang/eslint-plugin-camelcase-ohm/blob/21cdfa68b973eac43d68852ffbc3cb7cf688296f/lib/camelcase-ohm.js#L23-L36 |
51,371 | andrewscwei/requiem | src/dom/setAttribute.js | setAttribute | function setAttribute(element, name, value) {
assertType(element, Node, false, 'Invalid element specified');
if (value === undefined || value === null || value === false)
element.removeAttribute(name);
else if (value === true)
element.setAttribute(name, '');
else
element.setAttribute(name, value);
... | javascript | function setAttribute(element, name, value) {
assertType(element, Node, false, 'Invalid element specified');
if (value === undefined || value === null || value === false)
element.removeAttribute(name);
else if (value === true)
element.setAttribute(name, '');
else
element.setAttribute(name, value);
... | [
"function",
"setAttribute",
"(",
"element",
",",
"name",
",",
"value",
")",
"{",
"assertType",
"(",
"element",
",",
"Node",
",",
"false",
",",
"'Invalid element specified'",
")",
";",
"if",
"(",
"value",
"===",
"undefined",
"||",
"value",
"===",
"null",
"|... | Sets an attribute of an element by the attribute name.
@param {Node} element - Target element.
@param {string} name - Attribute name.
@param {*} value - Attribute value.
@alias module:requiem~dom.setAttribute | [
"Sets",
"an",
"attribute",
"of",
"an",
"element",
"by",
"the",
"attribute",
"name",
"."
] | c4182bfffc9841c6de5718f689ad3c2060511777 | https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/dom/setAttribute.js#L17-L27 |
51,372 | Nazariglez/perenquen | lib/pixi/src/core/display/DisplayObject.js | DisplayObject | function DisplayObject()
{
EventEmitter.call(this);
/**
* The coordinate of the object relative to the local coordinates of the parent.
*
* @member {Point}
*/
this.position = new math.Point();
/**
* The scale factor of the object.
*
* @member {Point}
*/
this... | javascript | function DisplayObject()
{
EventEmitter.call(this);
/**
* The coordinate of the object relative to the local coordinates of the parent.
*
* @member {Point}
*/
this.position = new math.Point();
/**
* The scale factor of the object.
*
* @member {Point}
*/
this... | [
"function",
"DisplayObject",
"(",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"/**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {Point}\n */",
"this",
".",
"position",
"=",
"new",
"math",
"."... | The base class for all objects that are rendered on the screen.
This is an abstract class and should not be used on its own rather it should be extended.
@class
@memberof PIXI | [
"The",
"base",
"class",
"for",
"all",
"objects",
"that",
"are",
"rendered",
"on",
"the",
"screen",
".",
"This",
"is",
"an",
"abstract",
"class",
"and",
"should",
"not",
"be",
"used",
"on",
"its",
"own",
"rather",
"it",
"should",
"be",
"extended",
"."
] | e023964d05afeefebdcac4e2044819fdfa3899ae | https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/core/display/DisplayObject.js#L14-L152 |
51,373 | lourenzo/gulp-jscs-custom | index.js | loadReporter | function loadReporter(reporterPath) {
var reporter;
reporterPath = reporterPath || 'checkstyle';
if (!fs.existsSync(path.resolve(reporterPath))) {
try {
reporter = require('./lib/reporters/' + reporterPath);
} catch (e) {
try {
reporter = require('jscs... | javascript | function loadReporter(reporterPath) {
var reporter;
reporterPath = reporterPath || 'checkstyle';
if (!fs.existsSync(path.resolve(reporterPath))) {
try {
reporter = require('./lib/reporters/' + reporterPath);
} catch (e) {
try {
reporter = require('jscs... | [
"function",
"loadReporter",
"(",
"reporterPath",
")",
"{",
"var",
"reporter",
";",
"reporterPath",
"=",
"reporterPath",
"||",
"'checkstyle'",
";",
"if",
"(",
"!",
"fs",
".",
"existsSync",
"(",
"path",
".",
"resolve",
"(",
"reporterPath",
")",
")",
")",
"{"... | load a proper Reporter
@todo Throw error when no reporter was found
@return {Function} the selected report | [
"load",
"a",
"proper",
"Reporter"
] | 8fe9eb834f407aa0b4368131786704c5bc3bd989 | https://github.com/lourenzo/gulp-jscs-custom/blob/8fe9eb834f407aa0b4368131786704c5bc3bd989/index.js#L16-L38 |
51,374 | SSharyk/encrypted-ticket | index.js | generateRandomString | function generateRandomString(length) {
let s = "";
let i = length;
while (length-- > 0) {
let c = Math.floor(Math.random() * (MAX_HEX_SYMBOL - MIN_HEX_SYMBOL + 1)) + MIN_HEX_SYMBOL;
c = c.toString(16).toLowerCase();
s += c;
}
return s;
} | javascript | function generateRandomString(length) {
let s = "";
let i = length;
while (length-- > 0) {
let c = Math.floor(Math.random() * (MAX_HEX_SYMBOL - MIN_HEX_SYMBOL + 1)) + MIN_HEX_SYMBOL;
c = c.toString(16).toLowerCase();
s += c;
}
return s;
} | [
"function",
"generateRandomString",
"(",
"length",
")",
"{",
"let",
"s",
"=",
"\"\"",
";",
"let",
"i",
"=",
"length",
";",
"while",
"(",
"length",
"--",
">",
"0",
")",
"{",
"let",
"c",
"=",
"Math",
".",
"floor",
"(",
"Math",
".",
"random",
"(",
"... | Generates string, each symbol of that is either number or A..F
@param {number} length - length of string to be generated
@return {string} Random string of the required length | [
"Generates",
"string",
"each",
"symbol",
"of",
"that",
"is",
"either",
"number",
"or",
"A",
"..",
"F"
] | 0597b9680d343fede99d59894fe5ff9da93bdfc2 | https://github.com/SSharyk/encrypted-ticket/blob/0597b9680d343fede99d59894fe5ff9da93bdfc2/index.js#L104-L113 |
51,375 | willscott/grunt-jasmine-chromeapp | tasks/jasmine-chromeapp/relay.js | send | function send() {
'use strict';
var req = new XMLHttpRequest(),
specs = jsApiReporter.specs(),
payload;
if (specs.length) {
specs.push(logs);
}
payload = JSON.stringify(specs);
req.open('post', 'http://localhost:' + port + '/put', true);
req.onload = function () {
if (this.responseText =... | javascript | function send() {
'use strict';
var req = new XMLHttpRequest(),
specs = jsApiReporter.specs(),
payload;
if (specs.length) {
specs.push(logs);
}
payload = JSON.stringify(specs);
req.open('post', 'http://localhost:' + port + '/put', true);
req.onload = function () {
if (this.responseText =... | [
"function",
"send",
"(",
")",
"{",
"'use strict'",
";",
"var",
"req",
"=",
"new",
"XMLHttpRequest",
"(",
")",
",",
"specs",
"=",
"jsApiReporter",
".",
"specs",
"(",
")",
",",
"payload",
";",
"if",
"(",
"specs",
".",
"length",
")",
"{",
"specs",
".",
... | This code sends the report. | [
"This",
"code",
"sends",
"the",
"report",
"."
] | 8582a56e0fd3c559948656fae157082910c45055 | https://github.com/willscott/grunt-jasmine-chromeapp/blob/8582a56e0fd3c559948656fae157082910c45055/tasks/jasmine-chromeapp/relay.js#L7-L25 |
51,376 | PanthR/panthrMath | panthrMath/rgen/rgen.js | function(name) {
// "name" encapsulates some simple options like precision
rgen.random = rgen.algorithms[name].random;
rgen.setSeed = rgen.algorithms[name].setSeed;
return rgen.setRandomSeed();
} | javascript | function(name) {
// "name" encapsulates some simple options like precision
rgen.random = rgen.algorithms[name].random;
rgen.setSeed = rgen.algorithms[name].setSeed;
return rgen.setRandomSeed();
} | [
"function",
"(",
"name",
")",
"{",
"// \"name\" encapsulates some simple options like precision",
"rgen",
".",
"random",
"=",
"rgen",
".",
"algorithms",
"[",
"name",
"]",
".",
"random",
";",
"rgen",
".",
"setSeed",
"=",
"rgen",
".",
"algorithms",
"[",
"name",
... | Sets the algorithm to be used for random number generation.
Expects `name` to be one of the strings returned by `getAlgorithms`. | [
"Sets",
"the",
"algorithm",
"to",
"be",
"used",
"for",
"random",
"number",
"generation",
".",
"Expects",
"name",
"to",
"be",
"one",
"of",
"the",
"strings",
"returned",
"by",
"getAlgorithms",
"."
] | 54d249ca9903a9535f963da711bd3a87fb229c0b | https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/rgen/rgen.js#L69-L74 | |
51,377 | redisjs/jsr-server | lib/command/database/string/setbit.js | validate | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
var value = parseInt('' + args[2]);
if(value !== 0 && value !== 1) throw InvalidBit;
args[2] = value;
} | javascript | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
var value = parseInt('' + args[2]);
if(value !== 0 && value !== 1) throw InvalidBit;
args[2] = value;
} | [
"function",
"validate",
"(",
"cmd",
",",
"args",
",",
"info",
")",
"{",
"AbstractCommand",
".",
"prototype",
".",
"validate",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"var",
"value",
"=",
"parseInt",
"(",
"''",
"+",
"args",
"[",
"2",
"]... | Validate the SETBIT command. | [
"Validate",
"the",
"SETBIT",
"command",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/database/string/setbit.js#L19-L24 |
51,378 | thomasfr/Timeliner.Core | lib/tokenizeText.js | tokenizeText | function tokenizeText(text, callback) {
"use strict";
processTokens(tokenizer.tokenize(text) || [], function (error, tokens) {
process.nextTick(function () {
callback(error, tokens);
});
});
} | javascript | function tokenizeText(text, callback) {
"use strict";
processTokens(tokenizer.tokenize(text) || [], function (error, tokens) {
process.nextTick(function () {
callback(error, tokens);
});
});
} | [
"function",
"tokenizeText",
"(",
"text",
",",
"callback",
")",
"{",
"\"use strict\"",
";",
"processTokens",
"(",
"tokenizer",
".",
"tokenize",
"(",
"text",
")",
"||",
"[",
"]",
",",
"function",
"(",
"error",
",",
"tokens",
")",
"{",
"process",
".",
"next... | Tokenizes the given text into normalized uppercased tokens
@param String text Text you want to parse and tokenize
@param Function callback Callback gets called with this parameters function(error, String[])
@api public | [
"Tokenizes",
"the",
"given",
"text",
"into",
"normalized",
"uppercased",
"tokens"
] | f776202c22c7ca2ee50deb1bae6130fd3dcfe7fc | https://github.com/thomasfr/Timeliner.Core/blob/f776202c22c7ca2ee50deb1bae6130fd3dcfe7fc/lib/tokenizeText.js#L13-L20 |
51,379 | vesln/refractory | lib/refractory.js | load | function load(mod) {
var base = path.dirname(mod.filename);
var folders = [].slice.call(arguments, 1);
return function refractory() {
var files = [].slice.call(arguments);
var paths = [];
files
.map(function(file) {
return path.basename(file);
})
.forEach(function(file) {
fol... | javascript | function load(mod) {
var base = path.dirname(mod.filename);
var folders = [].slice.call(arguments, 1);
return function refractory() {
var files = [].slice.call(arguments);
var paths = [];
files
.map(function(file) {
return path.basename(file);
})
.forEach(function(file) {
fol... | [
"function",
"load",
"(",
"mod",
")",
"{",
"var",
"base",
"=",
"path",
".",
"dirname",
"(",
"mod",
".",
"filename",
")",
";",
"var",
"folders",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"return",
"function",
"... | Load a file.
`refractory` will search the paths in the order specified
for each module provided on `load`.
@param {Object} module (contains filename to resolve from)
@param {String} path(s) to search
@param ...
@returns {Function} file loader
@api public | [
"Load",
"a",
"file",
"."
] | 9bc07ad8e7ad5f93201400ad0a15037dfabda207 | https://github.com/vesln/refractory/blob/9bc07ad8e7ad5f93201400ad0a15037dfabda207/lib/refractory.js#L26-L61 |
51,380 | Nazariglez/perenquen | lib/pixi/src/core/renderers/webgl/filters/SpriteMaskFilter.js | SpriteMaskFilter | function SpriteMaskFilter(sprite)
{
var maskMatrix = new math.Matrix();
AbstractFilter.call(this,
fs.readFileSync(__dirname + '/spriteMaskFilter.vert', 'utf8'),
fs.readFileSync(__dirname + '/spriteMaskFilter.frag', 'utf8'),
{
mask: { type: 'sampler2D', value: sprit... | javascript | function SpriteMaskFilter(sprite)
{
var maskMatrix = new math.Matrix();
AbstractFilter.call(this,
fs.readFileSync(__dirname + '/spriteMaskFilter.vert', 'utf8'),
fs.readFileSync(__dirname + '/spriteMaskFilter.frag', 'utf8'),
{
mask: { type: 'sampler2D', value: sprit... | [
"function",
"SpriteMaskFilter",
"(",
"sprite",
")",
"{",
"var",
"maskMatrix",
"=",
"new",
"math",
".",
"Matrix",
"(",
")",
";",
"AbstractFilter",
".",
"call",
"(",
"this",
",",
"fs",
".",
"readFileSync",
"(",
"__dirname",
"+",
"'/spriteMaskFilter.vert'",
","... | The SpriteMaskFilter class
@class
@extends AbstractFilter
@memberof PIXI
@param sprite {Sprite} the target sprite | [
"The",
"SpriteMaskFilter",
"class"
] | e023964d05afeefebdcac4e2044819fdfa3899ae | https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/core/renderers/webgl/filters/SpriteMaskFilter.js#L15-L31 |
51,381 | SalvatorePreviti/tslint-config-quick | hasPrettier.js | hasPrettier | function hasPrettier() {
if (hasPrettierCache === true || hasPrettierCache === false) {
return hasPrettierCache
}
hasPrettierCache = false
try {
const requireOptions = { paths: [getRootPath()] }
const manifestPath = require.resolve('./package.json', requireOptions)
const manifest = JSON.parse(fs... | javascript | function hasPrettier() {
if (hasPrettierCache === true || hasPrettierCache === false) {
return hasPrettierCache
}
hasPrettierCache = false
try {
const requireOptions = { paths: [getRootPath()] }
const manifestPath = require.resolve('./package.json', requireOptions)
const manifest = JSON.parse(fs... | [
"function",
"hasPrettier",
"(",
")",
"{",
"if",
"(",
"hasPrettierCache",
"===",
"true",
"||",
"hasPrettierCache",
"===",
"false",
")",
"{",
"return",
"hasPrettierCache",
"}",
"hasPrettierCache",
"=",
"false",
"try",
"{",
"const",
"requireOptions",
"=",
"{",
"p... | Check wether prettier is present in the main package.json
@returns {boolean} True if prettier is present in the main package.json | [
"Check",
"wether",
"prettier",
"is",
"present",
"in",
"the",
"main",
"package",
".",
"json"
] | 2bc58f6acd86fe112150c8e825f6274f09f2cd52 | https://github.com/SalvatorePreviti/tslint-config-quick/blob/2bc58f6acd86fe112150c8e825f6274f09f2cd52/hasPrettier.js#L12-L30 |
51,382 | creationix/culvert | wrap-web-socket.js | wrapNodeSocket | function wrapNodeSocket(ws, reportError) {
// Data traveling from websocket to consumer
var incoming = makeChannel();
// Data traveling from consumer to websocket
var outgoing = makeChannel();
onTake = wrapHandler(onTake, onError);
outgoing.take(onTake);
ws.onerror = onError;
ws.onmessage = wrap(onMes... | javascript | function wrapNodeSocket(ws, reportError) {
// Data traveling from websocket to consumer
var incoming = makeChannel();
// Data traveling from consumer to websocket
var outgoing = makeChannel();
onTake = wrapHandler(onTake, onError);
outgoing.take(onTake);
ws.onerror = onError;
ws.onmessage = wrap(onMes... | [
"function",
"wrapNodeSocket",
"(",
"ws",
",",
"reportError",
")",
"{",
"// Data traveling from websocket to consumer",
"var",
"incoming",
"=",
"makeChannel",
"(",
")",
";",
"// Data traveling from consumer to websocket",
"var",
"outgoing",
"=",
"makeChannel",
"(",
")",
... | Given a browser websocket, return a culvert duplex channel. | [
"Given",
"a",
"browser",
"websocket",
"return",
"a",
"culvert",
"duplex",
"channel",
"."
] | 42b83894041cd7f8ee3993af0df65c1afe17b2c5 | https://github.com/creationix/culvert/blob/42b83894041cd7f8ee3993af0df65c1afe17b2c5/wrap-web-socket.js#L6-L49 |
51,383 | vantagejs/vantage-auth-basic | lib/vantage-auth-basic.js | search | function search(user, pass, userArray) {
return _.findWhere(userArray, { user: user, pass: pass });
} | javascript | function search(user, pass, userArray) {
return _.findWhere(userArray, { user: user, pass: pass });
} | [
"function",
"search",
"(",
"user",
",",
"pass",
",",
"userArray",
")",
"{",
"return",
"_",
".",
"findWhere",
"(",
"userArray",
",",
"{",
"user",
":",
"user",
",",
"pass",
":",
"pass",
"}",
")",
";",
"}"
] | Check if submitted user matches anything. | [
"Check",
"if",
"submitted",
"user",
"matches",
"anything",
"."
] | fb966abb64ab26dfef975bc6b13350e6306169d5 | https://github.com/vantagejs/vantage-auth-basic/blob/fb966abb64ab26dfef975bc6b13350e6306169d5/lib/vantage-auth-basic.js#L85-L87 |
51,384 | vantagejs/vantage-auth-basic | lib/vantage-auth-basic.js | ask | function ask(question, cbk, skip) {
if (skip) {
cbk(skip);
return;
}
self.prompt(question, function(answ) {
if (String(answ.answer).trim() === "") {
return ask(question, cbk);
} else {
cbk(answ.answer);
}
});
} | javascript | function ask(question, cbk, skip) {
if (skip) {
cbk(skip);
return;
}
self.prompt(question, function(answ) {
if (String(answ.answer).trim() === "") {
return ask(question, cbk);
} else {
cbk(answ.answer);
}
});
} | [
"function",
"ask",
"(",
"question",
",",
"cbk",
",",
"skip",
")",
"{",
"if",
"(",
"skip",
")",
"{",
"cbk",
"(",
"skip",
")",
";",
"return",
";",
"}",
"self",
".",
"prompt",
"(",
"question",
",",
"function",
"(",
"answ",
")",
"{",
"if",
"(",
"St... | If a value is given, skip, otherwise prompt user for data. | [
"If",
"a",
"value",
"is",
"given",
"skip",
"otherwise",
"prompt",
"user",
"for",
"data",
"."
] | fb966abb64ab26dfef975bc6b13350e6306169d5 | https://github.com/vantagejs/vantage-auth-basic/blob/fb966abb64ab26dfef975bc6b13350e6306169d5/lib/vantage-auth-basic.js#L91-L103 |
51,385 | vantagejs/vantage-auth-basic | lib/vantage-auth-basic.js | gather | function gather(cbk) {
ask(questions[0], function(user) {
state.user = user;
ask(questions[1], function(pass){
state.pass = pass;
cbk(state.user, state.pass);
}, state.pass);
}, state.user);
} | javascript | function gather(cbk) {
ask(questions[0], function(user) {
state.user = user;
ask(questions[1], function(pass){
state.pass = pass;
cbk(state.user, state.pass);
}, state.pass);
}, state.user);
} | [
"function",
"gather",
"(",
"cbk",
")",
"{",
"ask",
"(",
"questions",
"[",
"0",
"]",
",",
"function",
"(",
"user",
")",
"{",
"state",
".",
"user",
"=",
"user",
";",
"ask",
"(",
"questions",
"[",
"1",
"]",
",",
"function",
"(",
"pass",
")",
"{",
... | Ask for a user and password. If a user is passed in, just ask for a password and skip the user. | [
"Ask",
"for",
"a",
"user",
"and",
"password",
".",
"If",
"a",
"user",
"is",
"passed",
"in",
"just",
"ask",
"for",
"a",
"password",
"and",
"skip",
"the",
"user",
"."
] | fb966abb64ab26dfef975bc6b13350e6306169d5 | https://github.com/vantagejs/vantage-auth-basic/blob/fb966abb64ab26dfef975bc6b13350e6306169d5/lib/vantage-auth-basic.js#L108-L116 |
51,386 | vantagejs/vantage-auth-basic | lib/vantage-auth-basic.js | attempt | function attempt() {
connections[id].attempts++;
if (connections[id].attempts > retry) {
connections[id].attempts = 0;
connections[id].deny++;
self.log(chalk.yellow("Access denied: too many attempts."));
callback("Access denied: too many attempts.", false);
ret... | javascript | function attempt() {
connections[id].attempts++;
if (connections[id].attempts > retry) {
connections[id].attempts = 0;
connections[id].deny++;
self.log(chalk.yellow("Access denied: too many attempts."));
callback("Access denied: too many attempts.", false);
ret... | [
"function",
"attempt",
"(",
")",
"{",
"connections",
"[",
"id",
"]",
".",
"attempts",
"++",
";",
"if",
"(",
"connections",
"[",
"id",
"]",
".",
"attempts",
">",
"retry",
")",
"{",
"connections",
"[",
"id",
"]",
".",
"attempts",
"=",
"0",
";",
"conn... | Authentication attempt logic, including adding up retry and deny counts, etc. | [
"Authentication",
"attempt",
"logic",
"including",
"adding",
"up",
"retry",
"and",
"deny",
"counts",
"etc",
"."
] | fb966abb64ab26dfef975bc6b13350e6306169d5 | https://github.com/vantagejs/vantage-auth-basic/blob/fb966abb64ab26dfef975bc6b13350e6306169d5/lib/vantage-auth-basic.js#L121-L155 |
51,387 | feedhenry/fh-mbaas-middleware | lib/email/index.js | sendAlertEmail | function sendAlertEmail(alertEmailData, cb) {
var mongoAlert = alertEmailData.alert;
var eventDetails = alertEmailData.eventDetails;
var emailConfig = config.getConfig().email;
var from = emailConfig ? emailConfig.alert_email_from : 'noreply@feedhenry.com';
fs.readFile(ALERT_EMAIL_TEMPLATE, function(err, dat... | javascript | function sendAlertEmail(alertEmailData, cb) {
var mongoAlert = alertEmailData.alert;
var eventDetails = alertEmailData.eventDetails;
var emailConfig = config.getConfig().email;
var from = emailConfig ? emailConfig.alert_email_from : 'noreply@feedhenry.com';
fs.readFile(ALERT_EMAIL_TEMPLATE, function(err, dat... | [
"function",
"sendAlertEmail",
"(",
"alertEmailData",
",",
"cb",
")",
"{",
"var",
"mongoAlert",
"=",
"alertEmailData",
".",
"alert",
";",
"var",
"eventDetails",
"=",
"alertEmailData",
".",
"eventDetails",
";",
"var",
"emailConfig",
"=",
"config",
".",
"getConfig"... | Send an Alert email to recipients for given Event
@param alertEmailData
@param cb | [
"Send",
"an",
"Alert",
"email",
"to",
"recipients",
"for",
"given",
"Event"
] | f906e98efbb4b0963bf5137b34b5e0589ba24e69 | https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/email/index.js#L57-L90 |
51,388 | iwillwen/watchman.js | src/watchman.js | createRule | function createRule(path, handler) {
if ('*' !== path && 0 != path.indexOf(watch.__base)) {
path = watch.__base + (path == '/' ? '' : path)
}
let rule = pathToRegExp(path)
if (handler instanceof String) {
let target = handler
handler = function() {
watch({
url: target
})
}
... | javascript | function createRule(path, handler) {
if ('*' !== path && 0 != path.indexOf(watch.__base)) {
path = watch.__base + (path == '/' ? '' : path)
}
let rule = pathToRegExp(path)
if (handler instanceof String) {
let target = handler
handler = function() {
watch({
url: target
})
}
... | [
"function",
"createRule",
"(",
"path",
",",
"handler",
")",
"{",
"if",
"(",
"'*'",
"!==",
"path",
"&&",
"0",
"!=",
"path",
".",
"indexOf",
"(",
"watch",
".",
"__base",
")",
")",
"{",
"path",
"=",
"watch",
".",
"__base",
"+",
"(",
"path",
"==",
"'... | create a rule
@param {String} path path
@param {Funtion} handler handle callback
@return {Object} rule object | [
"create",
"a",
"rule"
] | 54b380f53311aa03422cf7ce4e41a5fb7a2c067a | https://github.com/iwillwen/watchman.js/blob/54b380f53311aa03422cf7ce4e41a5fb7a2c067a/src/watchman.js#L249-L265 |
51,389 | novadiscovery/nway | lib/builders/standard.js | initialize | function initialize(done) {
debug('prepare');
parser(options.index, options, function(err, modules) {
if(err) return done(err)
debug('Parser return, now build the tree...');
tree = buildTree(options, modules, true);
debug('Tree builded');
// Extract from tree as a flatten list of packet... | javascript | function initialize(done) {
debug('prepare');
parser(options.index, options, function(err, modules) {
if(err) return done(err)
debug('Parser return, now build the tree...');
tree = buildTree(options, modules, true);
debug('Tree builded');
// Extract from tree as a flatten list of packet... | [
"function",
"initialize",
"(",
"done",
")",
"{",
"debug",
"(",
"'prepare'",
")",
";",
"parser",
"(",
"options",
".",
"index",
",",
"options",
",",
"function",
"(",
"err",
",",
"modules",
")",
"{",
"if",
"(",
"err",
")",
"return",
"done",
"(",
"err",
... | BUILD FLOW
Step 1
Prepare builder information using nway.prepare() :
modules object, root module, sources, tree and packet list
@api private | [
"BUILD",
"FLOW",
"Step",
"1"
] | fa31c6fe56f2305721e581ac25e8ac9a87e15dda | https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/builders/standard.js#L97-L114 |
51,390 | thomasfr/Timeliner.Core | lib/tokenizeWord.js | tokenizeWord | function tokenizeWord(word, callback) {
"use strict";
var match, parts = [], stemmedPart, singularPart, singularMetaphones, stemmedMetaphones, token;
// TODO: Improve that. Should be in the stemmer actually
//if (-1 === (match = word.match(/^([#"',;:!?(.\[{])*([a-z0-9]+)+([,;:!?)\]}"'.])*$/i))) {
/... | javascript | function tokenizeWord(word, callback) {
"use strict";
var match, parts = [], stemmedPart, singularPart, singularMetaphones, stemmedMetaphones, token;
// TODO: Improve that. Should be in the stemmer actually
//if (-1 === (match = word.match(/^([#"',;:!?(.\[{])*([a-z0-9]+)+([,;:!?)\]}"'.])*$/i))) {
/... | [
"function",
"tokenizeWord",
"(",
"word",
",",
"callback",
")",
"{",
"\"use strict\"",
";",
"var",
"match",
",",
"parts",
"=",
"[",
"]",
",",
"stemmedPart",
",",
"singularPart",
",",
"singularMetaphones",
",",
"stemmedMetaphones",
",",
"token",
";",
"// TODO: I... | Processes a given word.
Will do stemming, singularizing and adds double metaphone of each.
also adds the stemmed and singularized and the word itself.
So at max there are 7 tokens generated for each word.
Tokens gets sorted and duplicates gets removed
@param String word
@param Function callback function(error, String[... | [
"Processes",
"a",
"given",
"word",
".",
"Will",
"do",
"stemming",
"singularizing",
"and",
"adds",
"double",
"metaphone",
"of",
"each",
".",
"also",
"adds",
"the",
"stemmed",
"and",
"singularized",
"and",
"the",
"word",
"itself",
".",
"So",
"at",
"max",
"th... | f776202c22c7ca2ee50deb1bae6130fd3dcfe7fc | https://github.com/thomasfr/Timeliner.Core/blob/f776202c22c7ca2ee50deb1bae6130fd3dcfe7fc/lib/tokenizeWord.js#L19-L87 |
51,391 | xiamidaxia/xiami | meteor/mongo-livedata/mongo_driver.js | function (ordered) {
var self = this;
if (ordered) {
return self.fetch();
} else {
var results = new LocalCollection._IdMap;
self.forEach(function (doc) {
results.set(doc._id, doc);
});
return results;
}
} | javascript | function (ordered) {
var self = this;
if (ordered) {
return self.fetch();
} else {
var results = new LocalCollection._IdMap;
self.forEach(function (doc) {
results.set(doc._id, doc);
});
return results;
}
} | [
"function",
"(",
"ordered",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"ordered",
")",
"{",
"return",
"self",
".",
"fetch",
"(",
")",
";",
"}",
"else",
"{",
"var",
"results",
"=",
"new",
"LocalCollection",
".",
"_IdMap",
";",
"self",
"."... | This method is NOT wrapped in Cursor. | [
"This",
"method",
"is",
"NOT",
"wrapped",
"in",
"Cursor",
"."
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/mongo-livedata/mongo_driver.js#L926-L937 | |
51,392 | tolokoban/ToloFrameWork | ker/mod/tfw.binding.list.js | function(arg) {
readOnly(this, ID, COUNT++);
readOnly(this, "_listeners", new Listeners());
readOnly(this, "_links", []);
// An object with the attribute `isContentChangeAware === true`
// can fire a property value changed when its contant has change.
readOnly(this, "isContentChangeAware", tr... | javascript | function(arg) {
readOnly(this, ID, COUNT++);
readOnly(this, "_listeners", new Listeners());
readOnly(this, "_links", []);
// An object with the attribute `isContentChangeAware === true`
// can fire a property value changed when its contant has change.
readOnly(this, "isContentChangeAware", tr... | [
"function",
"(",
"arg",
")",
"{",
"readOnly",
"(",
"this",
",",
"ID",
",",
"COUNT",
"++",
")",
";",
"readOnly",
"(",
"this",
",",
"\"_listeners\"",
",",
"new",
"Listeners",
"(",
")",
")",
";",
"readOnly",
"(",
"this",
",",
"\"_links\"",
",",
"[",
"... | A list is an observable array.
Several lists can share the same internal array. In that case, when
one list modifies the array, all lists will emit the same event as
it. Such lists are linked. | [
"A",
"list",
"is",
"an",
"observable",
"array",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.binding.list.js#L33-L48 | |
51,393 | redisjs/jsr-server | lib/stats.js | Stats | function Stats(state) {
this.state = state;
this.clear();
this.onConnect = onConnect.bind(this);
this.onDisconnect = onDisconnect.bind(this);
this.onRejected = onRejected.bind(this);
this.onHit = onHit.bind(this);
this.onMiss = onMiss.bind(this);
this.onExpired = onExpired.bind(this);
this.onExpired =... | javascript | function Stats(state) {
this.state = state;
this.clear();
this.onConnect = onConnect.bind(this);
this.onDisconnect = onDisconnect.bind(this);
this.onRejected = onRejected.bind(this);
this.onHit = onHit.bind(this);
this.onMiss = onMiss.bind(this);
this.onExpired = onExpired.bind(this);
this.onExpired =... | [
"function",
"Stats",
"(",
"state",
")",
"{",
"this",
".",
"state",
"=",
"state",
";",
"this",
".",
"clear",
"(",
")",
";",
"this",
".",
"onConnect",
"=",
"onConnect",
".",
"bind",
"(",
"this",
")",
";",
"this",
".",
"onDisconnect",
"=",
"onDisconnect... | Encapsulates the server statistics. | [
"Encapsulates",
"the",
"server",
"statistics",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/stats.js#L4-L15 |
51,394 | hydrojs/karma-hydro | adapter.js | function(error) {
if (!error.stack) return error.message;
var stack = error.stack;
var firstLine = stack.substring(0, stack.indexOf('\n'));
if (error.message && firstLine.indexOf(error.message) === -1) stack = error.message + '\n' + stack;
return stack.replace(/\n.+\/adapter(\/lib)?\/hydro.js\?\d*\:... | javascript | function(error) {
if (!error.stack) return error.message;
var stack = error.stack;
var firstLine = stack.substring(0, stack.indexOf('\n'));
if (error.message && firstLine.indexOf(error.message) === -1) stack = error.message + '\n' + stack;
return stack.replace(/\n.+\/adapter(\/lib)?\/hydro.js\?\d*\:... | [
"function",
"(",
"error",
")",
"{",
"if",
"(",
"!",
"error",
".",
"stack",
")",
"return",
"error",
".",
"message",
";",
"var",
"stack",
"=",
"error",
".",
"stack",
";",
"var",
"firstLine",
"=",
"stack",
".",
"substring",
"(",
"0",
",",
"stack",
"."... | Format error.
@param {Error} error
@returns {String}
@api private | [
"Format",
"error",
"."
] | a0d5e083b1ddd1c4fbc7d6fa29ed1b0d9d4a5193 | https://github.com/hydrojs/karma-hydro/blob/a0d5e083b1ddd1c4fbc7d6fa29ed1b0d9d4a5193/adapter.js#L17-L23 | |
51,395 | awto/mfjs-core | index.js | defaults | function defaults(defs,opts) {
if (!opts)
opts = {}
if (opts.context == null)
opts.context = true;
if (opts.coerce == null)
opts.coerce = true;
completeMonad(defs);
if (opts.control === "token")
defs = M.addControlByToken(defs);
if (opts.wrap)
defs = M.wrap(defs,opts.wrap);
if (opts.co... | javascript | function defaults(defs,opts) {
if (!opts)
opts = {}
if (opts.context == null)
opts.context = true;
if (opts.coerce == null)
opts.coerce = true;
completeMonad(defs);
if (opts.control === "token")
defs = M.addControlByToken(defs);
if (opts.wrap)
defs = M.wrap(defs,opts.wrap);
if (opts.co... | [
"function",
"defaults",
"(",
"defs",
",",
"opts",
")",
"{",
"if",
"(",
"!",
"opts",
")",
"opts",
"=",
"{",
"}",
"if",
"(",
"opts",
".",
"context",
"==",
"null",
")",
"opts",
".",
"context",
"=",
"true",
";",
"if",
"(",
"opts",
".",
"coerce",
"=... | Runs definitions transformations based on specified set of options.
Options:
* wrap - constructor function used for wrapped value,
it should construct objects with inner field
* context - boolean or "run" string for only wrapping run method,
default is true
* coerce - boolean for adding coercions to functions returnin... | [
"Runs",
"definitions",
"transformations",
"based",
"on",
"specified",
"set",
"of",
"options",
"."
] | 6138e74c373998592777b8849ec5a22d6b8edd7d | https://github.com/awto/mfjs-core/blob/6138e74c373998592777b8849ec5a22d6b8edd7d/index.js#L1101-L1120 |
51,396 | awto/mfjs-core | index.js | liftContext | function liftContext(ctx, func) {
if (!ctx.pure) {
throw new Error("no monad's definition is provided");
}
return function() {
var saved;
saved = context;
context = ctx;
try {
return func.apply(null, arguments);
} finally {
context = saved;
}
};
} | javascript | function liftContext(ctx, func) {
if (!ctx.pure) {
throw new Error("no monad's definition is provided");
}
return function() {
var saved;
saved = context;
context = ctx;
try {
return func.apply(null, arguments);
} finally {
context = saved;
}
};
} | [
"function",
"liftContext",
"(",
"ctx",
",",
"func",
")",
"{",
"if",
"(",
"!",
"ctx",
".",
"pure",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"no monad's definition is provided\"",
")",
";",
"}",
"return",
"function",
"(",
")",
"{",
"var",
"saved",
";",
... | Turns a function into a function initializing global context to `ctx`
and reverting it to the old value on exit.
@function M.liftContext
@param {MonadDict} ctx
@param {Function} func
@return {Function} | [
"Turns",
"a",
"function",
"into",
"a",
"function",
"initializing",
"global",
"context",
"to",
"ctx",
"and",
"reverting",
"it",
"to",
"the",
"old",
"value",
"on",
"exit",
"."
] | 6138e74c373998592777b8849ec5a22d6b8edd7d | https://github.com/awto/mfjs-core/blob/6138e74c373998592777b8849ec5a22d6b8edd7d/index.js#L1173-L1187 |
51,397 | awto/mfjs-core | index.js | liftContextG | function liftContextG(ctx, gen) {
return liftContext(ctx, function() {
return liftContextIterator(ctx, gen.apply(null, arguments));
});
} | javascript | function liftContextG(ctx, gen) {
return liftContext(ctx, function() {
return liftContextIterator(ctx, gen.apply(null, arguments));
});
} | [
"function",
"liftContextG",
"(",
"ctx",
",",
"gen",
")",
"{",
"return",
"liftContext",
"(",
"ctx",
",",
"function",
"(",
")",
"{",
"return",
"liftContextIterator",
"(",
"ctx",
",",
"gen",
".",
"apply",
"(",
"null",
",",
"arguments",
")",
")",
";",
"}",... | Same as `liftContext` but lifts generator function.
@function M.liftContextG
@param {MonadDict} ctx
@param {GeneratorFunction} gen
@return {Function} | [
"Same",
"as",
"liftContext",
"but",
"lifts",
"generator",
"function",
"."
] | 6138e74c373998592777b8849ec5a22d6b8edd7d | https://github.com/awto/mfjs-core/blob/6138e74c373998592777b8849ec5a22d6b8edd7d/index.js#L1197-L1201 |
51,398 | jonschlinkert/expand-config | index.js | Config | function Config(options) {
if (!(this instanceof Config)) {
return new Config(options);
}
utils.is(this, 'config');
use(this);
define(this, 'count', 0);
this.options = options || {};
this.targets = {};
this.tasks = {};
if (utils.isConfig(options)) {
this.options = {};
this.expand(option... | javascript | function Config(options) {
if (!(this instanceof Config)) {
return new Config(options);
}
utils.is(this, 'config');
use(this);
define(this, 'count', 0);
this.options = options || {};
this.targets = {};
this.tasks = {};
if (utils.isConfig(options)) {
this.options = {};
this.expand(option... | [
"function",
"Config",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Config",
")",
")",
"{",
"return",
"new",
"Config",
"(",
"options",
")",
";",
"}",
"utils",
".",
"is",
"(",
"this",
",",
"'config'",
")",
";",
"use",
"(",
... | Expand a declarative configuration with tasks and targets.
Create a new Config with the given `options`
```js
var config = new Config();
// example usage
config.expand({
jshint: {
src: ['*.js', 'lib/*.js']
}
});
```
@param {Object} `options`
@api public | [
"Expand",
"a",
"declarative",
"configuration",
"with",
"tasks",
"and",
"targets",
".",
"Create",
"a",
"new",
"Config",
"with",
"the",
"given",
"options"
] | 338fc219577d11318a08fe732410ac57a2d07b74 | https://github.com/jonschlinkert/expand-config/blob/338fc219577d11318a08fe732410ac57a2d07b74/index.js#L27-L45 |
51,399 | cli-kit/cli-mid-version | index.js | handler | function handler(req, next) {
var conf = this.configure();
var pkg = this.package();
var copyright = conf.copyright || (pkg ? pkg.copyright : null);
var opts = [this._version];
var msg = this._name + ' %s';
// NOTE: allows deferring to this handler from a custom handler
if(arguments.length > 1 && typeof(... | javascript | function handler(req, next) {
var conf = this.configure();
var pkg = this.package();
var copyright = conf.copyright || (pkg ? pkg.copyright : null);
var opts = [this._version];
var msg = this._name + ' %s';
// NOTE: allows deferring to this handler from a custom handler
if(arguments.length > 1 && typeof(... | [
"function",
"handler",
"(",
"req",
",",
"next",
")",
"{",
"var",
"conf",
"=",
"this",
".",
"configure",
"(",
")",
";",
"var",
"pkg",
"=",
"this",
".",
"package",
"(",
")",
";",
"var",
"copyright",
"=",
"conf",
".",
"copyright",
"||",
"(",
"pkg",
... | Default program version action.
@param alive Do not exit the process.
@param ... Message replacement parameters. | [
"Default",
"program",
"version",
"action",
"."
] | 4040eac6ba52af4c4cf540b9cc0c0f6bbdc1d579 | https://github.com/cli-kit/cli-mid-version/blob/4040eac6ba52af4c4cf540b9cc0c0f6bbdc1d579/index.js#L10-L35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.