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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
37,500 | jimivdw/grunt-mutation-testing | lib/reporting/html/HtmlReporter.js | function(basePath, config) {
this._basePath = basePath;
this._config = config;
var directories = IOUtils.getDirectoryList(basePath, false);
IOUtils.createPathIfNotExists(directories, './');
} | javascript | function(basePath, config) {
this._basePath = basePath;
this._config = config;
var directories = IOUtils.getDirectoryList(basePath, false);
IOUtils.createPathIfNotExists(directories, './');
} | [
"function",
"(",
"basePath",
",",
"config",
")",
"{",
"this",
".",
"_basePath",
"=",
"basePath",
";",
"this",
".",
"_config",
"=",
"config",
";",
"var",
"directories",
"=",
"IOUtils",
".",
"getDirectoryList",
"(",
"basePath",
",",
"false",
")",
";",
"IOU... | Constructor for the HTML reporter.
@param {string} basePath The base path where the report should be created
@param {object=} config Configuration object
@constructor | [
"Constructor",
"for",
"the",
"HTML",
"reporter",
"."
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/lib/reporting/html/HtmlReporter.js#L29-L35 | |
37,501 | infrabel/themes-gnap | raw/angular-dynamic-locale/tmhDynamicLocale.js | loadScript | function loadScript(url, callback, errorCallback, $timeout) {
var script = document.createElement('script'),
body = document.getElementsByTagName('body')[0],
removed = false;
script.type = 'text/javascript';
if (script.readyState) { // IE
script.onreadystatechange = function () {
... | javascript | function loadScript(url, callback, errorCallback, $timeout) {
var script = document.createElement('script'),
body = document.getElementsByTagName('body')[0],
removed = false;
script.type = 'text/javascript';
if (script.readyState) { // IE
script.onreadystatechange = function () {
... | [
"function",
"loadScript",
"(",
"url",
",",
"callback",
",",
"errorCallback",
",",
"$timeout",
")",
"{",
"var",
"script",
"=",
"document",
".",
"createElement",
"(",
"'script'",
")",
",",
"body",
"=",
"document",
".",
"getElementsByTagName",
"(",
"'body'",
")... | Loads a script asynchronously
@param {string} url The url for the script
@ @param {function) callback A function to be called once the script is loaded | [
"Loads",
"a",
"script",
"asynchronously"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/angular-dynamic-locale/tmhDynamicLocale.js#L19-L56 |
37,502 | infrabel/themes-gnap | raw/angular-dynamic-locale/tmhDynamicLocale.js | loadLocale | function loadLocale(localeUrl, $locale, localeId, $rootScope, $q, localeCache, $timeout) {
function overrideValues(oldObject, newObject) {
if (activeLocale !== localeId) {
return;
}
angular.forEach(oldObject, function(value, key) {
if (!newObject[key]) {
delete oldObject... | javascript | function loadLocale(localeUrl, $locale, localeId, $rootScope, $q, localeCache, $timeout) {
function overrideValues(oldObject, newObject) {
if (activeLocale !== localeId) {
return;
}
angular.forEach(oldObject, function(value, key) {
if (!newObject[key]) {
delete oldObject... | [
"function",
"loadLocale",
"(",
"localeUrl",
",",
"$locale",
",",
"localeId",
",",
"$rootScope",
",",
"$q",
",",
"localeCache",
",",
"$timeout",
")",
"{",
"function",
"overrideValues",
"(",
"oldObject",
",",
"newObject",
")",
"{",
"if",
"(",
"activeLocale",
"... | Loads a locale and replaces the properties from the current locale with the new locale information
@param localeUrl The path to the new locale
@param $locale The locale at the curent scope | [
"Loads",
"a",
"locale",
"and",
"replaces",
"the",
"properties",
"from",
"the",
"current",
"locale",
"with",
"the",
"new",
"locale",
"information"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/angular-dynamic-locale/tmhDynamicLocale.js#L64-L131 |
37,503 | kenahrens/newrelic-api-client-js | scripts/get-expirations.js | outputFile | function outputFile(configId, outputdata){
var fname= configId+ '_accounts.csv';
console.log("Outputing file... "+fname);
var input= {
data: outputdata,
fields: ['id','name','status','subscriptionStarts','subscriptionExpires']
};
json2csv(input, function(err, csv) {
if (err) {
console.log('E... | javascript | function outputFile(configId, outputdata){
var fname= configId+ '_accounts.csv';
console.log("Outputing file... "+fname);
var input= {
data: outputdata,
fields: ['id','name','status','subscriptionStarts','subscriptionExpires']
};
json2csv(input, function(err, csv) {
if (err) {
console.log('E... | [
"function",
"outputFile",
"(",
"configId",
",",
"outputdata",
")",
"{",
"var",
"fname",
"=",
"configId",
"+",
"'_accounts.csv'",
";",
"console",
".",
"log",
"(",
"\"Outputing file... \"",
"+",
"fname",
")",
";",
"var",
"input",
"=",
"{",
"data",
":",
"outp... | Get all the accounts and apikeys for a partner account, output as CSV Write the output file | [
"Get",
"all",
"the",
"accounts",
"and",
"apikeys",
"for",
"a",
"partner",
"account",
"output",
"as",
"CSV",
"Write",
"the",
"output",
"file"
] | 0776c66e3959ab489f600c16dba4ec9f62f99d2a | https://github.com/kenahrens/newrelic-api-client-js/blob/0776c66e3959ab489f600c16dba4ec9f62f99d2a/scripts/get-expirations.js#L14-L29 |
37,504 | RoganMurley/hitagi.js | src/utils.js | function (originalObj, originalProp, targetObj, targetProp) {
Object.defineProperty(
originalObj,
originalProp,
{
get: function () {
return targetObj[targetProp];
},
... | javascript | function (originalObj, originalProp, targetObj, targetProp) {
Object.defineProperty(
originalObj,
originalProp,
{
get: function () {
return targetObj[targetProp];
},
... | [
"function",
"(",
"originalObj",
",",
"originalProp",
",",
"targetObj",
",",
"targetProp",
")",
"{",
"Object",
".",
"defineProperty",
"(",
"originalObj",
",",
"originalProp",
",",
"{",
"get",
":",
"function",
"(",
")",
"{",
"return",
"targetObj",
"[",
"target... | Proxy a property, simillar to the proxy in ES6. Allows us to propagate changes to the target property. | [
"Proxy",
"a",
"property",
"simillar",
"to",
"the",
"proxy",
"in",
"ES6",
".",
"Allows",
"us",
"to",
"propagate",
"changes",
"to",
"the",
"target",
"property",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/utils.js#L17-L30 | |
37,505 | RoganMurley/hitagi.js | src/utils.js | function (originalObj, originalProp, targetObj, targetProp) {
Object.defineProperty(
originalObj,
originalProp,
{
get: function () {
return targetObj[targetProp];
},
... | javascript | function (originalObj, originalProp, targetObj, targetProp) {
Object.defineProperty(
originalObj,
originalProp,
{
get: function () {
return targetObj[targetProp];
},
... | [
"function",
"(",
"originalObj",
",",
"originalProp",
",",
"targetObj",
",",
"targetProp",
")",
"{",
"Object",
".",
"defineProperty",
"(",
"originalObj",
",",
"originalProp",
",",
"{",
"get",
":",
"function",
"(",
")",
"{",
"return",
"targetObj",
"[",
"target... | A read-only version of proxy, see above. | [
"A",
"read",
"-",
"only",
"version",
"of",
"proxy",
"see",
"above",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/utils.js#L34-L48 | |
37,506 | RoganMurley/hitagi.js | src/utils.js | function (obj, prop, callback, callbackParams) {
var value = obj[prop];
Object.defineProperty(
obj,
prop,
{
get: function () {
return value;
},
... | javascript | function (obj, prop, callback, callbackParams) {
var value = obj[prop];
Object.defineProperty(
obj,
prop,
{
get: function () {
return value;
},
... | [
"function",
"(",
"obj",
",",
"prop",
",",
"callback",
",",
"callbackParams",
")",
"{",
"var",
"value",
"=",
"obj",
"[",
"prop",
"]",
";",
"Object",
".",
"defineProperty",
"(",
"obj",
",",
"prop",
",",
"{",
"get",
":",
"function",
"(",
")",
"{",
"re... | Watches a property, executing a callback when the property changes. | [
"Watches",
"a",
"property",
"executing",
"a",
"callback",
"when",
"the",
"property",
"changes",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/utils.js#L52-L68 | |
37,507 | kenahrens/newrelic-api-client-js | scripts/dashboard-from-json.js | function(error, response, body) {
var rspBody = helper.handleCB(error, response, body);
if (rspBody != null) {
var destId = config.get(program.dest).accountId;
var url = 'http://insights.newrelic.com/accounts/' + destId + '/dashboards/' + rspBody.dashboard.id;
console.log('Dashboard created: ' + url);
... | javascript | function(error, response, body) {
var rspBody = helper.handleCB(error, response, body);
if (rspBody != null) {
var destId = config.get(program.dest).accountId;
var url = 'http://insights.newrelic.com/accounts/' + destId + '/dashboards/' + rspBody.dashboard.id;
console.log('Dashboard created: ' + url);
... | [
"function",
"(",
"error",
",",
"response",
",",
"body",
")",
"{",
"var",
"rspBody",
"=",
"helper",
".",
"handleCB",
"(",
"error",
",",
"response",
",",
"body",
")",
";",
"if",
"(",
"rspBody",
"!=",
"null",
")",
"{",
"var",
"destId",
"=",
"config",
... | Print out the URL of the newly created dashboard | [
"Print",
"out",
"the",
"URL",
"of",
"the",
"newly",
"created",
"dashboard"
] | 0776c66e3959ab489f600c16dba4ec9f62f99d2a | https://github.com/kenahrens/newrelic-api-client-js/blob/0776c66e3959ab489f600c16dba4ec9f62f99d2a/scripts/dashboard-from-json.js#L8-L15 | |
37,508 | kenahrens/newrelic-api-client-js | scripts/dashboard-from-json.js | readDashFromFS | function readDashFromFS(fname) {
var dashboardBody = fs.readFileSync(fname);
console.log('Read file:', fname);
// Set the proper account_id on all widgets
if (dashboardBody != null) {
dashboardBody = JSON.parse(dashboardBody);
console.log('Read source dashboard named: ' + dashboardBody.dashboard.title... | javascript | function readDashFromFS(fname) {
var dashboardBody = fs.readFileSync(fname);
console.log('Read file:', fname);
// Set the proper account_id on all widgets
if (dashboardBody != null) {
dashboardBody = JSON.parse(dashboardBody);
console.log('Read source dashboard named: ' + dashboardBody.dashboard.title... | [
"function",
"readDashFromFS",
"(",
"fname",
")",
"{",
"var",
"dashboardBody",
"=",
"fs",
".",
"readFileSync",
"(",
"fname",
")",
";",
"console",
".",
"log",
"(",
"'Read file:'",
",",
"fname",
")",
";",
"// Set the proper account_id on all widgets",
"if",
"(",
... | Read the source dashboard from the file system | [
"Read",
"the",
"source",
"dashboard",
"from",
"the",
"file",
"system"
] | 0776c66e3959ab489f600c16dba4ec9f62f99d2a | https://github.com/kenahrens/newrelic-api-client-js/blob/0776c66e3959ab489f600c16dba4ec9f62f99d2a/scripts/dashboard-from-json.js#L18-L36 |
37,509 | dominicbarnes/node-couchdb-api | docs/render.js | function (done) {
glob(path.join(__dirname, "*.ejs"), function (err, files) {
if (err) {
return done(err);
}
var templates = {};
async.forEach(files, function (file, done) {
fs.readFile(file, "utf8", function (err, data) {
... | javascript | function (done) {
glob(path.join(__dirname, "*.ejs"), function (err, files) {
if (err) {
return done(err);
}
var templates = {};
async.forEach(files, function (file, done) {
fs.readFile(file, "utf8", function (err, data) {
... | [
"function",
"(",
"done",
")",
"{",
"glob",
"(",
"path",
".",
"join",
"(",
"__dirname",
",",
"\"*.ejs\"",
")",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"done",
"(",
"err",
")",
";",
"}",
"var",
"... | gather the templates | [
"gather",
"the",
"templates"
] | 4363d9b41fddd39db201472c44116aab1a010d99 | https://github.com/dominicbarnes/node-couchdb-api/blob/4363d9b41fddd39db201472c44116aab1a010d99/docs/render.js#L11-L36 | |
37,510 | RoganMurley/hitagi.js | examples/example4/example4.js | function () {
this.update = {
gravity: function (entity, dt) {
// Accelerate entity until it reaches terminal velocity.
if (entity.c.velocity.yspeed < entity.c.gravity.terminal) {
entity.c.velocity.yspeed += hitagi.utils.delta(entity.c.gravity.magn... | javascript | function () {
this.update = {
gravity: function (entity, dt) {
// Accelerate entity until it reaches terminal velocity.
if (entity.c.velocity.yspeed < entity.c.gravity.terminal) {
entity.c.velocity.yspeed += hitagi.utils.delta(entity.c.gravity.magn... | [
"function",
"(",
")",
"{",
"this",
".",
"update",
"=",
"{",
"gravity",
":",
"function",
"(",
"entity",
",",
"dt",
")",
"{",
"// Accelerate entity until it reaches terminal velocity.",
"if",
"(",
"entity",
".",
"c",
".",
"velocity",
".",
"yspeed",
"<",
"entit... | Define systems. | [
"Define",
"systems",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/examples/example4/example4.js#L17-L26 | |
37,511 | AntonyThorpe/knockout-apollo | demo/src/viewModel.js | function(data) {
//initialise with a few Todos because we are very busy people
self.todoList.insert(data.data.todoList);
self.todoList2.insert(data.data.todoList);
self.todoList3.insert(data.data.todoList);
self.todoList4.insert(data.data.todoList);
} | javascript | function(data) {
//initialise with a few Todos because we are very busy people
self.todoList.insert(data.data.todoList);
self.todoList2.insert(data.data.todoList);
self.todoList3.insert(data.data.todoList);
self.todoList4.insert(data.data.todoList);
} | [
"function",
"(",
"data",
")",
"{",
"//initialise with a few Todos because we are very busy people",
"self",
".",
"todoList",
".",
"insert",
"(",
"data",
".",
"data",
".",
"todoList",
")",
";",
"self",
".",
"todoList2",
".",
"insert",
"(",
"data",
".",
"data",
... | callback when successful | [
"callback",
"when",
"successful"
] | 573a7caea7e41877710e69bac001771a6ea86d33 | https://github.com/AntonyThorpe/knockout-apollo/blob/573a7caea7e41877710e69bac001771a6ea86d33/demo/src/viewModel.js#L102-L108 | |
37,512 | ToMMApps/express-waf | database/mongo-db.js | MongoDB | function MongoDB(host, port, database, collection, username, password){
_self = this;
if(arguments.length < 3){
throw ("MongoDB constructor requires at least three arguments!");
}
if(collection){
_collection = collection;
} else{
_collection ... | javascript | function MongoDB(host, port, database, collection, username, password){
_self = this;
if(arguments.length < 3){
throw ("MongoDB constructor requires at least three arguments!");
}
if(collection){
_collection = collection;
} else{
_collection ... | [
"function",
"MongoDB",
"(",
"host",
",",
"port",
",",
"database",
",",
"collection",
",",
"username",
",",
"password",
")",
"{",
"_self",
"=",
"this",
";",
"if",
"(",
"arguments",
".",
"length",
"<",
"3",
")",
"{",
"throw",
"(",
"\"MongoDB constructor re... | Wrapper class for MongoDB for use with the Blocker modules.
Host and port specify on which computer MongoDB is running.
@param host Host of the database which shall be used for the Blocklist.
@param port Number of the port which shall be used for the Blocklist.
@param database Name of the database which shall be used f... | [
"Wrapper",
"class",
"for",
"MongoDB",
"for",
"use",
"with",
"the",
"Blocker",
"modules",
".",
"Host",
"and",
"port",
"specify",
"on",
"which",
"computer",
"MongoDB",
"is",
"running",
"."
] | 5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a | https://github.com/ToMMApps/express-waf/blob/5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a/database/mongo-db.js#L28-L48 |
37,513 | ToMMApps/express-waf | database/mongo-db.js | function(cb){
if(!_isOpen){
_self.open(function () {
_self.removeAll(function() {
getCollection(cb);
});
});
} else {
getCollection(cb);
}
function getCollection(cb) {
_db.collection(_co... | javascript | function(cb){
if(!_isOpen){
_self.open(function () {
_self.removeAll(function() {
getCollection(cb);
});
});
} else {
getCollection(cb);
}
function getCollection(cb) {
_db.collection(_co... | [
"function",
"(",
"cb",
")",
"{",
"if",
"(",
"!",
"_isOpen",
")",
"{",
"_self",
".",
"open",
"(",
"function",
"(",
")",
"{",
"_self",
".",
"removeAll",
"(",
"function",
"(",
")",
"{",
"getCollection",
"(",
"cb",
")",
";",
"}",
")",
";",
"}",
")"... | Gets the Blocklist collection from the MongoDB instance. | [
"Gets",
"the",
"Blocklist",
"collection",
"from",
"the",
"MongoDB",
"instance",
"."
] | 5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a | https://github.com/ToMMApps/express-waf/blob/5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a/database/mongo-db.js#L79-L94 | |
37,514 | chriszarate/supergenpass-lib | src/lib/generate.js | hashRound | function hashRound(input, length, hashFunction, rounds, callback) {
if (rounds > 0 || !validatePassword(input, length)) {
process.nextTick(() => {
hashRound(hashFunction(input), length, hashFunction, rounds - 1, callback);
});
return;
}
process.nextTick(() => {
callback(input.substring(0, le... | javascript | function hashRound(input, length, hashFunction, rounds, callback) {
if (rounds > 0 || !validatePassword(input, length)) {
process.nextTick(() => {
hashRound(hashFunction(input), length, hashFunction, rounds - 1, callback);
});
return;
}
process.nextTick(() => {
callback(input.substring(0, le... | [
"function",
"hashRound",
"(",
"input",
",",
"length",
",",
"hashFunction",
",",
"rounds",
",",
"callback",
")",
"{",
"if",
"(",
"rounds",
">",
"0",
"||",
"!",
"validatePassword",
"(",
"input",
",",
"length",
")",
")",
"{",
"process",
".",
"nextTick",
"... | Hash the input for the requested number of rounds, then continue hashing until the password policy is satisfied. Finally, pass result to callback. | [
"Hash",
"the",
"input",
"for",
"the",
"requested",
"number",
"of",
"rounds",
"then",
"continue",
"hashing",
"until",
"the",
"password",
"policy",
"is",
"satisfied",
".",
"Finally",
"pass",
"result",
"to",
"callback",
"."
] | eb9ee92050813d498229bfe0e6ccbcb87124cf90 | https://github.com/chriszarate/supergenpass-lib/blob/eb9ee92050813d498229bfe0e6ccbcb87124cf90/src/lib/generate.js#L20-L30 |
37,515 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | selectColor | function selectColor(namespace) {
var hash = 0,
i;
for (i in namespace) {
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
} | javascript | function selectColor(namespace) {
var hash = 0,
i;
for (i in namespace) {
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
} | [
"function",
"selectColor",
"(",
"namespace",
")",
"{",
"var",
"hash",
"=",
"0",
",",
"i",
";",
"for",
"(",
"i",
"in",
"namespace",
")",
"{",
"hash",
"=",
"(",
"hash",
"<<",
"5",
")",
"-",
"hash",
"+",
"namespace",
".",
"charCodeAt",
"(",
"i",
")"... | Select a color.
@param {String} namespace
@return {Number}
@api private | [
"Select",
"a",
"color",
"."
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L260-L270 |
37,516 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | isBuf | function isBuf(obj) {
return (
(withNativeBuffer && commonjsGlobal.Buffer.isBuffer(obj)) ||
(withNativeArrayBuffer && (obj instanceof commonjsGlobal.ArrayBuffer || isView(obj)))
);
} | javascript | function isBuf(obj) {
return (
(withNativeBuffer && commonjsGlobal.Buffer.isBuffer(obj)) ||
(withNativeArrayBuffer && (obj instanceof commonjsGlobal.ArrayBuffer || isView(obj)))
);
} | [
"function",
"isBuf",
"(",
"obj",
")",
"{",
"return",
"(",
"(",
"withNativeBuffer",
"&&",
"commonjsGlobal",
".",
"Buffer",
".",
"isBuffer",
"(",
"obj",
")",
")",
"||",
"(",
"withNativeArrayBuffer",
"&&",
"(",
"obj",
"instanceof",
"commonjsGlobal",
".",
"Array... | Returns true if obj is a buffer or an arraybuffer.
@api private | [
"Returns",
"true",
"if",
"obj",
"is",
"a",
"buffer",
"or",
"an",
"arraybuffer",
"."
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L1003-L1008 |
37,517 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | hasBinary | function hasBinary(obj) {
if (!obj || typeof obj !== "object") {
return false;
}
if (isarray(obj)) {
for (var i = 0, l = obj.length; i < l; i++) {
if (hasBinary(obj[i])) {
return true;
}
}
return false;
}
if (
(typeof Buffer === "function" && Buffer.isBuffer && Buffer... | javascript | function hasBinary(obj) {
if (!obj || typeof obj !== "object") {
return false;
}
if (isarray(obj)) {
for (var i = 0, l = obj.length; i < l; i++) {
if (hasBinary(obj[i])) {
return true;
}
}
return false;
}
if (
(typeof Buffer === "function" && Buffer.isBuffer && Buffer... | [
"function",
"hasBinary",
"(",
"obj",
")",
"{",
"if",
"(",
"!",
"obj",
"||",
"typeof",
"obj",
"!==",
"\"object\"",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"isarray",
"(",
"obj",
")",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l"... | Checks for binary data.
Supports Buffer, ArrayBuffer, Blob and File.
@param {Object} anything
@api public | [
"Checks",
"for",
"binary",
"data",
"."
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L1680-L1715 |
37,518 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | function(obj) {
var str = "";
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
if (str.length) str += "&";
str += encodeURIComponent(i) + "=" + encodeURIComponent(obj[i]);
}
}
return str;
} | javascript | function(obj) {
var str = "";
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
if (str.length) str += "&";
str += encodeURIComponent(i) + "=" + encodeURIComponent(obj[i]);
}
}
return str;
} | [
"function",
"(",
"obj",
")",
"{",
"var",
"str",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"in",
"obj",
")",
"{",
"if",
"(",
"obj",
".",
"hasOwnProperty",
"(",
"i",
")",
")",
"{",
"if",
"(",
"str",
".",
"length",
")",
"str",
"+=",
"\"&\"",
";"... | Compiles a querystring
Returns string representation of the object
@param {Object}
@api private | [
"Compiles",
"a",
"querystring",
"Returns",
"string",
"representation",
"of",
"the",
"object"
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L2982-L2993 | |
37,519 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | Polling | function Polling(opts) {
var forceBase64 = opts && opts.forceBase64;
if (!hasXHR2 || forceBase64) {
this.supportsBinary = false;
}
transport.call(this, opts);
} | javascript | function Polling(opts) {
var forceBase64 = opts && opts.forceBase64;
if (!hasXHR2 || forceBase64) {
this.supportsBinary = false;
}
transport.call(this, opts);
} | [
"function",
"Polling",
"(",
"opts",
")",
"{",
"var",
"forceBase64",
"=",
"opts",
"&&",
"opts",
".",
"forceBase64",
";",
"if",
"(",
"!",
"hasXHR2",
"||",
"forceBase64",
")",
"{",
"this",
".",
"supportsBinary",
"=",
"false",
";",
"}",
"transport",
".",
"... | Polling interface.
@param {Object} opts
@api private | [
"Polling",
"interface",
"."
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L3120-L3126 |
37,520 | compose-us/todastic | packages/server-web/src/client/socket.io-bundle.js | onerror | function onerror(err) {
var error = new Error("probe error: " + err);
error.transport = transport$$1.name;
freezeTransport();
debug$5('probe transport "%s" failed because of error: %s', name, err);
self.emit("upgradeError", error);
} | javascript | function onerror(err) {
var error = new Error("probe error: " + err);
error.transport = transport$$1.name;
freezeTransport();
debug$5('probe transport "%s" failed because of error: %s', name, err);
self.emit("upgradeError", error);
} | [
"function",
"onerror",
"(",
"err",
")",
"{",
"var",
"error",
"=",
"new",
"Error",
"(",
"\"probe error: \"",
"+",
"err",
")",
";",
"error",
".",
"transport",
"=",
"transport$$1",
".",
"name",
";",
"freezeTransport",
"(",
")",
";",
"debug$5",
"(",
"'probe ... | Handle any error that happens while probing | [
"Handle",
"any",
"error",
"that",
"happens",
"while",
"probing"
] | 4807d8e564905a2b49fe90d8046be9f1a19cf344 | https://github.com/compose-us/todastic/blob/4807d8e564905a2b49fe90d8046be9f1a19cf344/packages/server-web/src/client/socket.io-bundle.js#L4674-L4683 |
37,521 | adobe/react-twist-webpack-plugin | src/convertRuleToCondition.js | convertRuleToCondition | function convertRuleToCondition(rule) {
if (!rule || typeof rule !== 'object' || !Object.keys(rule).length) {
return rule;
}
if (Array.isArray(rule)) {
return rule.map(convertRuleToCondition);
}
const condition = {};
// We allow certain properties...
ALLOWED_PROPERTIES.forEac... | javascript | function convertRuleToCondition(rule) {
if (!rule || typeof rule !== 'object' || !Object.keys(rule).length) {
return rule;
}
if (Array.isArray(rule)) {
return rule.map(convertRuleToCondition);
}
const condition = {};
// We allow certain properties...
ALLOWED_PROPERTIES.forEac... | [
"function",
"convertRuleToCondition",
"(",
"rule",
")",
"{",
"if",
"(",
"!",
"rule",
"||",
"typeof",
"rule",
"!==",
"'object'",
"||",
"!",
"Object",
".",
"keys",
"(",
"rule",
")",
".",
"length",
")",
"{",
"return",
"rule",
";",
"}",
"if",
"(",
"Array... | Create a Webpack Condition from a Webpack Rule by stripping out any nested Rule properties,
keeping only the conditions in which the rule would be applied. In other words, the return
value of this function could be passed to `exclude` on another rule, to exclude only the
files matched by the input rule.
@param {Rule} ... | [
"Create",
"a",
"Webpack",
"Condition",
"from",
"a",
"Webpack",
"Rule",
"by",
"stripping",
"out",
"any",
"nested",
"Rule",
"properties",
"keeping",
"only",
"the",
"conditions",
"in",
"which",
"the",
"rule",
"would",
"be",
"applied",
".",
"In",
"other",
"words... | 499949d69931904eb5a2b7ef12cf9c1848ce6241 | https://github.com/adobe/react-twist-webpack-plugin/blob/499949d69931904eb5a2b7ef12cf9c1848ce6241/src/convertRuleToCondition.js#L33-L56 |
37,522 | carsdotcom/windshieldjs | lib/processRoutes.js | processRoutes | function processRoutes(handler, uriContext, routes) {
return routes.map(setupRoute);
/**
* @param {(PreReq|pageAdapter)[]} adapters - Array of adapters and Hapi route prerequisites for processing
* an incoming request
* @param {pageFilter} pageFilter ... | javascript | function processRoutes(handler, uriContext, routes) {
return routes.map(setupRoute);
/**
* @param {(PreReq|pageAdapter)[]} adapters - Array of adapters and Hapi route prerequisites for processing
* an incoming request
* @param {pageFilter} pageFilter ... | [
"function",
"processRoutes",
"(",
"handler",
",",
"uriContext",
",",
"routes",
")",
"{",
"return",
"routes",
".",
"map",
"(",
"setupRoute",
")",
";",
"/**\n * @param {(PreReq|pageAdapter)[]} adapters - Array of adapters and Hapi route prerequisites for processing\n * ... | Converts an array of Windshield routes into a an array of Hapi routes.
Each route will use the same handler method, which accesses a set of
Windshield adapters from the route to build a page object, and define a
layout template to compile the page object into a web page.
@param {handler} handler - ... | [
"Converts",
"an",
"array",
"of",
"Windshield",
"routes",
"into",
"a",
"an",
"array",
"of",
"Hapi",
"routes",
".",
"Each",
"route",
"will",
"use",
"the",
"same",
"handler",
"method",
"which",
"accesses",
"a",
"set",
"of",
"Windshield",
"adapters",
"from",
"... | fddd841c5d9e09251437c9a30cc39700e5e4a1f6 | https://github.com/carsdotcom/windshieldjs/blob/fddd841c5d9e09251437c9a30cc39700e5e4a1f6/lib/processRoutes.js#L37-L82 |
37,523 | atomantic/undermore | dist/undermore.js | function (object) {
var sortedObj = {},
keys = _.keys(object);
keys = _.sortBy(keys, function(key){
return key;
});
_.each(keys, function(key) {
if(_.isArray(object[key])) {
sortedObj[key] = _.map(object[key], function(val) {
... | javascript | function (object) {
var sortedObj = {},
keys = _.keys(object);
keys = _.sortBy(keys, function(key){
return key;
});
_.each(keys, function(key) {
if(_.isArray(object[key])) {
sortedObj[key] = _.map(object[key], function(val) {
... | [
"function",
"(",
"object",
")",
"{",
"var",
"sortedObj",
"=",
"{",
"}",
",",
"keys",
"=",
"_",
".",
"keys",
"(",
"object",
")",
";",
"keys",
"=",
"_",
".",
"sortBy",
"(",
"keys",
",",
"function",
"(",
"key",
")",
"{",
"return",
"key",
";",
"}",... | sort the keys in an object alphabetically, recursively
@function module:undermore.alphabetize
@param {object} obj The object to traverse
@return {mixed} the object with alphabetized keys
@example
var obj = {
b: 1,
a: 2
};
JSON.stringify(_.alphabetize(obj)) === '{"a":2,"b":1}' | [
"sort",
"the",
"keys",
"in",
"an",
"object",
"alphabetically",
"recursively"
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/dist/undermore.js#L71-L92 | |
37,524 | atomantic/undermore | dist/undermore.js | function(str) {
// allow browser implementation if it exists
// https://developer.mozilla.org/en-US/docs/Web/API/window.btoa
if (typeof atob!=='undefined') {
// utf8 decode after the fact to make sure we convert > 0xFF to ascii
return _.utf8_decode(atob(str));
}
... | javascript | function(str) {
// allow browser implementation if it exists
// https://developer.mozilla.org/en-US/docs/Web/API/window.btoa
if (typeof atob!=='undefined') {
// utf8 decode after the fact to make sure we convert > 0xFF to ascii
return _.utf8_decode(atob(str));
}
... | [
"function",
"(",
"str",
")",
"{",
"// allow browser implementation if it exists",
"// https://developer.mozilla.org/en-US/docs/Web/API/window.btoa",
"if",
"(",
"typeof",
"atob",
"!==",
"'undefined'",
")",
"{",
"// utf8 decode after the fact to make sure we convert > 0xFF to ascii",
"... | base64_decode decode a string. This is not a strict polyfill for window.atob
because it handles unicode characters
@function module:undermore.base64_decode
@link https://github.com/davidchambers/Base64.js
@param {string} str The string to decode
@return {string}
@example _.base64_decode('4pyI') => '✈' | [
"base64_decode",
"decode",
"a",
"string",
".",
"This",
"is",
"not",
"a",
"strict",
"polyfill",
"for",
"window",
".",
"atob",
"because",
"it",
"handles",
"unicode",
"characters"
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/dist/undermore.js#L103-L134 | |
37,525 | atomantic/undermore | dist/undermore.js | function(originalFn, moreFn, scope) {
return scope ?
function() {
originalFn.apply(scope, arguments);
moreFn.apply(scope, arguments);
} : function() {
originalFn();
moreFn();
};
} | javascript | function(originalFn, moreFn, scope) {
return scope ?
function() {
originalFn.apply(scope, arguments);
moreFn.apply(scope, arguments);
} : function() {
originalFn();
moreFn();
};
} | [
"function",
"(",
"originalFn",
",",
"moreFn",
",",
"scope",
")",
"{",
"return",
"scope",
"?",
"function",
"(",
")",
"{",
"originalFn",
".",
"apply",
"(",
"scope",
",",
"arguments",
")",
";",
"moreFn",
".",
"apply",
"(",
"scope",
",",
"arguments",
")",
... | get a new function, which runs two functions serially within a given context
@function module:undermore.fnMore
@param {function} originalFn The original function to run
@param {function} moreFn The extra function to run in the same context after the first
@param {object} scope The context in which to run the fn
@retur... | [
"get",
"a",
"new",
"function",
"which",
"runs",
"two",
"functions",
"serially",
"within",
"a",
"given",
"context"
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/dist/undermore.js#L215-L224 | |
37,526 | yangyxu/zeanium | dist/zn.reactnative.js | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor,
_descriptor = {};
if(!_exist){
_descriptor = Object.defineProperty(target, 'on' + name.toLowerCa... | javascript | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor,
_descriptor = {};
if(!_exist){
_descriptor = Object.defineProperty(target, 'on' + name.toLowerCa... | [
"function",
"(",
"target",
",",
"name",
",",
"meta",
")",
"{",
"var",
"_ctor",
"=",
"__define",
".",
"fixTargetCtor",
"(",
"target",
")",
",",
"_key",
"=",
"__define",
".",
"fixTargetKey",
"(",
"name",
")",
",",
"_exist",
"=",
"_key",
"in",
"_ctor",
... | Define an event for target
@param target
@param name
@param meta
@returns {boolean} | [
"Define",
"an",
"event",
"for",
"target"
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L762-L799 | |
37,527 | yangyxu/zeanium | dist/zn.reactnative.js | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor,
_descriptor = {};
var _getter, _setter;
if ('value' in meta) {
var _value = meta.val... | javascript | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor,
_descriptor = {};
var _getter, _setter;
if ('value' in meta) {
var _value = meta.val... | [
"function",
"(",
"target",
",",
"name",
",",
"meta",
")",
"{",
"var",
"_ctor",
"=",
"__define",
".",
"fixTargetCtor",
"(",
"target",
")",
",",
"_key",
"=",
"__define",
".",
"fixTargetKey",
"(",
"name",
")",
",",
"_exist",
"=",
"_key",
"in",
"_ctor",
... | Define a property for target
@param target
@param name
@param meta
@returns {boolean} | [
"Define",
"a",
"property",
"for",
"target"
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L807-L880 | |
37,528 | yangyxu/zeanium | dist/zn.reactnative.js | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor;
_ctor[_key] = {
name: name,
type: 'method',
meta: meta
};
... | javascript | function (target, name, meta){
var _ctor = __define.fixTargetCtor(target),
_key = __define.fixTargetKey(name),
_exist = _key in _ctor;
_ctor[_key] = {
name: name,
type: 'method',
meta: meta
};
... | [
"function",
"(",
"target",
",",
"name",
",",
"meta",
")",
"{",
"var",
"_ctor",
"=",
"__define",
".",
"fixTargetCtor",
"(",
"target",
")",
",",
"_key",
"=",
"__define",
".",
"fixTargetKey",
"(",
"name",
")",
",",
"_exist",
"=",
"_key",
"in",
"_ctor",
... | Define a method for target
@param target
@param name
@param meta
@returns {boolean} | [
"Define",
"a",
"method",
"for",
"target"
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L888-L912 | |
37,529 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, target) {
var _ctor = __define.fixTargetCtor(target||this),
_member = _ctor[__define.fixTargetKey(name)];
if(!_member&&_ctor!==ZNObject){
return this.member(name, _ctor._super_);
}
return _member;
} | javascript | function (name, target) {
var _ctor = __define.fixTargetCtor(target||this),
_member = _ctor[__define.fixTargetKey(name)];
if(!_member&&_ctor!==ZNObject){
return this.member(name, _ctor._super_);
}
return _member;
} | [
"function",
"(",
"name",
",",
"target",
")",
"{",
"var",
"_ctor",
"=",
"__define",
".",
"fixTargetCtor",
"(",
"target",
"||",
"this",
")",
",",
"_member",
"=",
"_ctor",
"[",
"__define",
".",
"fixTargetKey",
"(",
"name",
")",
"]",
";",
"if",
"(",
"!",... | Get specified member.
@param name
@returns {*} | [
"Get",
"specified",
"member",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L923-L932 | |
37,530 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, options) {
var _member = this.member(name);
if(_member && _member.getter){
return _member.getter.call(this, options);
}
return undefined;
} | javascript | function (name, options) {
var _member = this.member(name);
if(_member && _member.getter){
return _member.getter.call(this, options);
}
return undefined;
} | [
"function",
"(",
"name",
",",
"options",
")",
"{",
"var",
"_member",
"=",
"this",
".",
"member",
"(",
"name",
")",
";",
"if",
"(",
"_member",
"&&",
"_member",
".",
"getter",
")",
"{",
"return",
"_member",
".",
"getter",
".",
"call",
"(",
"this",
",... | Get specified property value.
@method get
@param name {String}
@param [options] {Any}
@returns {*} | [
"Get",
"specified",
"property",
"value",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L970-L977 | |
37,531 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, value, options) {
var _member = this.member(name);
if (_member && _member.setter) {
_member.setter.call(this, value, options);
}
return this;
} | javascript | function (name, value, options) {
var _member = this.member(name);
if (_member && _member.setter) {
_member.setter.call(this, value, options);
}
return this;
} | [
"function",
"(",
"name",
",",
"value",
",",
"options",
")",
"{",
"var",
"_member",
"=",
"this",
".",
"member",
"(",
"name",
")",
";",
"if",
"(",
"_member",
"&&",
"_member",
".",
"setter",
")",
"{",
"_member",
".",
"setter",
".",
"call",
"(",
"this"... | Set specified property value.
@method set
@param name {String}
@param value {*}
@param [options] {Any} | [
"Set",
"specified",
"property",
"value",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L985-L992 | |
37,532 | yangyxu/zeanium | dist/zn.reactnative.js | function (options) {
var _values = {},
_properties = __define.fixTargetCtor(this)._properties_;
zn.each(_properties, function (name) {
_values[name] = this.get(name, options);
}, this);
return _values;
} | javascript | function (options) {
var _values = {},
_properties = __define.fixTargetCtor(this)._properties_;
zn.each(_properties, function (name) {
_values[name] = this.get(name, options);
}, this);
return _values;
} | [
"function",
"(",
"options",
")",
"{",
"var",
"_values",
"=",
"{",
"}",
",",
"_properties",
"=",
"__define",
".",
"fixTargetCtor",
"(",
"this",
")",
".",
"_properties_",
";",
"zn",
".",
"each",
"(",
"_properties",
",",
"function",
"(",
"name",
")",
"{",... | Get all properties.
@method gets
@returns {Object}
@param [options] {Any} | [
"Get",
"all",
"properties",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L999-L1007 | |
37,533 | yangyxu/zeanium | dist/zn.reactnative.js | function (values, options, callback) {
if (values) {
var _value = null;
for (var _name in values) {
if (values.hasOwnProperty(_name)) {
_value = values[_name];
if((callback && callback(_value, _name, options)... | javascript | function (values, options, callback) {
if (values) {
var _value = null;
for (var _name in values) {
if (values.hasOwnProperty(_name)) {
_value = values[_name];
if((callback && callback(_value, _name, options)... | [
"function",
"(",
"values",
",",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"values",
")",
"{",
"var",
"_value",
"=",
"null",
";",
"for",
"(",
"var",
"_name",
"in",
"values",
")",
"{",
"if",
"(",
"values",
".",
"hasOwnProperty",
"(",
"_name",
... | Set a bunch of properties.
@method sets
@param dict {Object}
@param [options] {Any} | [
"Set",
"a",
"bunch",
"of",
"properties",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1014-L1028 | |
37,534 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, meta, target) {
if (!__define.defineEvent(target || this.prototype, name, meta)) {
this._events_.push(name);
}
return this;
} | javascript | function (name, meta, target) {
if (!__define.defineEvent(target || this.prototype, name, meta)) {
this._events_.push(name);
}
return this;
} | [
"function",
"(",
"name",
",",
"meta",
",",
"target",
")",
"{",
"if",
"(",
"!",
"__define",
".",
"defineEvent",
"(",
"target",
"||",
"this",
".",
"prototype",
",",
"name",
",",
"meta",
")",
")",
"{",
"this",
".",
"_events_",
".",
"push",
"(",
"name"... | Define an event.
@method defineEvent
@static
@param name {String}
@param [meta] {Object}
@param [target] {Object} | [
"Define",
"an",
"event",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1157-L1163 | |
37,535 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, meta, target) {
if (!__define.defineProperty(target || this.prototype, name, meta)) {
this._properties_.push(name);
}
return this;
} | javascript | function (name, meta, target) {
if (!__define.defineProperty(target || this.prototype, name, meta)) {
this._properties_.push(name);
}
return this;
} | [
"function",
"(",
"name",
",",
"meta",
",",
"target",
")",
"{",
"if",
"(",
"!",
"__define",
".",
"defineProperty",
"(",
"target",
"||",
"this",
".",
"prototype",
",",
"name",
",",
"meta",
")",
")",
"{",
"this",
".",
"_properties_",
".",
"push",
"(",
... | Define a property.
@method defineProperty
@static
@param name {String}
@param [meta] {Object}
@param [target] {Object} | [
"Define",
"a",
"property",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1172-L1178 | |
37,536 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, meta, target) {
if (!__define.defineMethod(target || this.prototype, name, meta)) {
this._methods_.push(name);
}
return this;
} | javascript | function (name, meta, target) {
if (!__define.defineMethod(target || this.prototype, name, meta)) {
this._methods_.push(name);
}
return this;
} | [
"function",
"(",
"name",
",",
"meta",
",",
"target",
")",
"{",
"if",
"(",
"!",
"__define",
".",
"defineMethod",
"(",
"target",
"||",
"this",
".",
"prototype",
",",
"name",
",",
"meta",
")",
")",
"{",
"this",
".",
"_methods_",
".",
"push",
"(",
"nam... | Define a method.
@method defineMethod
@static
@param name {String}
@param meta {Object}
@param [target] {Object} | [
"Define",
"a",
"method",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1187-L1193 | |
37,537 | yangyxu/zeanium | dist/zn.reactnative.js | function (){
var _info = {
ClassName: (this.__name__ || 'Anonymous'),
InstanceID: this.__id__,
Meta: this.constructor._meta_
};
return JSON.stringify(_info);
} | javascript | function (){
var _info = {
ClassName: (this.__name__ || 'Anonymous'),
InstanceID: this.__id__,
Meta: this.constructor._meta_
};
return JSON.stringify(_info);
} | [
"function",
"(",
")",
"{",
"var",
"_info",
"=",
"{",
"ClassName",
":",
"(",
"this",
".",
"__name__",
"||",
"'Anonymous'",
")",
",",
"InstanceID",
":",
"this",
".",
"__id__",
",",
"Meta",
":",
"this",
".",
"constructor",
".",
"_meta_",
"}",
";",
"retu... | Instance Object to string value.
@returns {string} | [
"Instance",
"Object",
"to",
"string",
"value",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1201-L1208 | |
37,538 | yangyxu/zeanium | dist/zn.reactnative.js | function (){
var _json = {};
zn.each(this.constructor.getProperties(), function (field, key){
_json[key] = this.get(key);
}, this);
return _json;
} | javascript | function (){
var _json = {};
zn.each(this.constructor.getProperties(), function (field, key){
_json[key] = this.get(key);
}, this);
return _json;
} | [
"function",
"(",
")",
"{",
"var",
"_json",
"=",
"{",
"}",
";",
"zn",
".",
"each",
"(",
"this",
".",
"constructor",
".",
"getProperties",
"(",
")",
",",
"function",
"(",
"field",
",",
"key",
")",
"{",
"_json",
"[",
"key",
"]",
"=",
"this",
".",
... | Instance Object to json value.
@returns {json} | [
"Instance",
"Object",
"to",
"json",
"value",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1213-L1220 | |
37,539 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, handler, options) {
if (handler) {
var _handlers = this.__handlers__;
var _listeners = _handlers[name] = _handlers[name] || [];
_listeners[0] = zn.extend({
owner: this,
handler: handler
}... | javascript | function (name, handler, options) {
if (handler) {
var _handlers = this.__handlers__;
var _listeners = _handlers[name] = _handlers[name] || [];
_listeners[0] = zn.extend({
owner: this,
handler: handler
}... | [
"function",
"(",
"name",
",",
"handler",
",",
"options",
")",
"{",
"if",
"(",
"handler",
")",
"{",
"var",
"_handlers",
"=",
"this",
".",
"__handlers__",
";",
"var",
"_listeners",
"=",
"_handlers",
"[",
"name",
"]",
"=",
"_handlers",
"[",
"name",
"]",
... | Add a single event handler.
@method upon
@param name {String}
@param handler {Function}
@param [options] {Object} | [
"Add",
"a",
"single",
"event",
"handler",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1234-L1246 | |
37,540 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, handler, options) {
if (handler) {
var _handlers = this.__handlers__;
var _listeners = _handlers[name] = _handlers[name] || [
{
owner: null,
handler: null,
context: nul... | javascript | function (name, handler, options) {
if (handler) {
var _handlers = this.__handlers__;
var _listeners = _handlers[name] = _handlers[name] || [
{
owner: null,
handler: null,
context: nul... | [
"function",
"(",
"name",
",",
"handler",
",",
"options",
")",
"{",
"if",
"(",
"handler",
")",
"{",
"var",
"_handlers",
"=",
"this",
".",
"__handlers__",
";",
"var",
"_listeners",
"=",
"_handlers",
"[",
"name",
"]",
"=",
"_handlers",
"[",
"name",
"]",
... | Add an event handler.
@method on
@param name {String}
@param handler {Function}
@param [options] {Object} | [
"Add",
"an",
"event",
"handler",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1254-L1272 | |
37,541 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, handler, options) {
var _listeners = this.__handlers__[name]||[], _listener;
var _context = options && options.context;
if (handler) {
for (var i = _listeners.length - 1; i >= 0; i--) {
_listener = _listeners[i];
... | javascript | function (name, handler, options) {
var _listeners = this.__handlers__[name]||[], _listener;
var _context = options && options.context;
if (handler) {
for (var i = _listeners.length - 1; i >= 0; i--) {
_listener = _listeners[i];
... | [
"function",
"(",
"name",
",",
"handler",
",",
"options",
")",
"{",
"var",
"_listeners",
"=",
"this",
".",
"__handlers__",
"[",
"name",
"]",
"||",
"[",
"]",
",",
"_listener",
";",
"var",
"_context",
"=",
"options",
"&&",
"options",
".",
"context",
";",
... | Remove an event handler.
@method off
@param name {String}
@param [handler] {Function}
@param [options] {Object} | [
"Remove",
"an",
"event",
"handler",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1280-L1302 | |
37,542 | yangyxu/zeanium | dist/zn.reactnative.js | function (name, data, options) {
var _listeners = this.__handlers__[name],
_listener,
_result = null;
if (_listeners) {
for (var i = 0, length = _listeners.length; i < length; i++) {
_listener = _listeners[i];
... | javascript | function (name, data, options) {
var _listeners = this.__handlers__[name],
_listener,
_result = null;
if (_listeners) {
for (var i = 0, length = _listeners.length; i < length; i++) {
_listener = _listeners[i];
... | [
"function",
"(",
"name",
",",
"data",
",",
"options",
")",
"{",
"var",
"_listeners",
"=",
"this",
".",
"__handlers__",
"[",
"name",
"]",
",",
"_listener",
",",
"_result",
"=",
"null",
";",
"if",
"(",
"_listeners",
")",
"{",
"for",
"(",
"var",
"i",
... | Trigger an event.
@method fire
@param name {String}
@param [data] {*}
@param [options] {Object} | [
"Trigger",
"an",
"event",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1330-L1351 | |
37,543 | yangyxu/zeanium | dist/zn.reactnative.js | function (type) {
if (typeof type === 'string') {
type = zn.path(GLOBAL, type);
}
if (type) {
if (this instanceof type) {
return true;
} else {
var _mixins = this.constructor._mixins_;
... | javascript | function (type) {
if (typeof type === 'string') {
type = zn.path(GLOBAL, type);
}
if (type) {
if (this instanceof type) {
return true;
} else {
var _mixins = this.constructor._mixins_;
... | [
"function",
"(",
"type",
")",
"{",
"if",
"(",
"typeof",
"type",
"===",
"'string'",
")",
"{",
"type",
"=",
"zn",
".",
"path",
"(",
"GLOBAL",
",",
"type",
")",
";",
"}",
"if",
"(",
"type",
")",
"{",
"if",
"(",
"this",
"instanceof",
"type",
")",
"... | Check whether current object is specified type.
@method is
@param type {String|Function}
@returns {Boolean} | [
"Check",
"whether",
"current",
"object",
"is",
"specified",
"type",
"."
] | 8465e744654cea7a55be623fd440abb079a5309f | https://github.com/yangyxu/zeanium/blob/8465e744654cea7a55be623fd440abb079a5309f/dist/zn.reactnative.js#L1382-L1402 | |
37,544 | eswdd/aardvark | static-content/ScatterRenderer.js | function(into, data) {
var existingDataLen = into.length == 0 ? 0 : into[0].length - 1;
var i = 0;
var j = 0;
for (; i<into.length && j<data.length; ) {
if (into[i][0] == data[... | javascript | function(into, data) {
var existingDataLen = into.length == 0 ? 0 : into[0].length - 1;
var i = 0;
var j = 0;
for (; i<into.length && j<data.length; ) {
if (into[i][0] == data[... | [
"function",
"(",
"into",
",",
"data",
")",
"{",
"var",
"existingDataLen",
"=",
"into",
".",
"length",
"==",
"0",
"?",
"0",
":",
"into",
"[",
"0",
"]",
".",
"length",
"-",
"1",
";",
"var",
"i",
"=",
"0",
";",
"var",
"j",
"=",
"0",
";",
"for",
... | should both be sorted already | [
"should",
"both",
"be",
"sorted",
"already"
] | 7e0797fe5cde53047e610bd866d22e6caf0c6d49 | https://github.com/eswdd/aardvark/blob/7e0797fe5cde53047e610bd866d22e6caf0c6d49/static-content/ScatterRenderer.js#L208-L242 | |
37,545 | quentinrossetti/version-sort | index.js | composeVersion | function composeVersion (str, regex) {
var r = regex.exec(str)
return {
number: r[ 1 ],
stage: r[ 2 ] || null,
stageName: r[ 3 ] || null,
stageNumber: r[ 4 ] || null
}
} | javascript | function composeVersion (str, regex) {
var r = regex.exec(str)
return {
number: r[ 1 ],
stage: r[ 2 ] || null,
stageName: r[ 3 ] || null,
stageNumber: r[ 4 ] || null
}
} | [
"function",
"composeVersion",
"(",
"str",
",",
"regex",
")",
"{",
"var",
"r",
"=",
"regex",
".",
"exec",
"(",
"str",
")",
"return",
"{",
"number",
":",
"r",
"[",
"1",
"]",
",",
"stage",
":",
"r",
"[",
"2",
"]",
"||",
"null",
",",
"stageName",
"... | Transform a string into an exploitable version object.
@param str The original string
@returns {{number: *, stage: (*|null), stageName: (*|null), stageNumber: (*|null)}} | [
"Transform",
"a",
"string",
"into",
"an",
"exploitable",
"version",
"object",
"."
] | 3e8855216f14f12e99497bd487355c06076ceedc | https://github.com/quentinrossetti/version-sort/blob/3e8855216f14f12e99497bd487355c06076ceedc/index.js#L167-L175 |
37,546 | cevadtokatli/cordelia | dist/js/cordelia.esm.js | createEvent | function createEvent(name) {
var event = void 0;
if (typeof document !== 'undefined') {
event = document.createEvent('HTMLEvents') || document.createEvent('event');
event.initEvent(name, false, true);
}
return event;
} | javascript | function createEvent(name) {
var event = void 0;
if (typeof document !== 'undefined') {
event = document.createEvent('HTMLEvents') || document.createEvent('event');
event.initEvent(name, false, true);
}
return event;
} | [
"function",
"createEvent",
"(",
"name",
")",
"{",
"var",
"event",
"=",
"void",
"0",
";",
"if",
"(",
"typeof",
"document",
"!==",
"'undefined'",
")",
"{",
"event",
"=",
"document",
".",
"createEvent",
"(",
"'HTMLEvents'",
")",
"||",
"document",
".",
"crea... | Creates a new event and initalizes it.
@param {String} name
@returns {Event} | [
"Creates",
"a",
"new",
"event",
"and",
"initalizes",
"it",
"."
] | ac2c66c6844b28d3bf9ceb2c4c22b20bda0fc5ca | https://github.com/cevadtokatli/cordelia/blob/ac2c66c6844b28d3bf9ceb2c4c22b20bda0fc5ca/dist/js/cordelia.esm.js#L1229-L1236 |
37,547 | eswdd/aardvark | static-content/DeepUtils.js | function(target, skeleton) {
// console.log("Applying change: "+JSON.stringify(skeleton));
if (skeleton == null) {
return false;
}
if (typeof skeleton != typeof target) {
return false;
}
switch (typeof skeleton)
... | javascript | function(target, skeleton) {
// console.log("Applying change: "+JSON.stringify(skeleton));
if (skeleton == null) {
return false;
}
if (typeof skeleton != typeof target) {
return false;
}
switch (typeof skeleton)
... | [
"function",
"(",
"target",
",",
"skeleton",
")",
"{",
"// console.log(\"Applying change: \"+JSON.stringify(skeleton));",
"if",
"(",
"skeleton",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"typeof",
"skeleton",
"!=",
"typeof",
"target",... | Deep applies a skeleton change to the target object | [
"Deep",
"applies",
"a",
"skeleton",
"change",
"to",
"the",
"target",
"object"
] | 7e0797fe5cde53047e610bd866d22e6caf0c6d49 | https://github.com/eswdd/aardvark/blob/7e0797fe5cde53047e610bd866d22e6caf0c6d49/static-content/DeepUtils.js#L50-L126 | |
37,548 | solid/source-pane | sourcePane.js | function (newPaneOptions) {
var newInstance = newPaneOptions.newInstance
if (!newInstance) {
let uri = newPaneOptions.newBase
if (uri.endsWith('/')) {
uri = uri.slice(0, -1)
newPaneOptions.newBase = uri
}
newInstance = kb.sym(uri)
newPaneOptions.newInstance = newIns... | javascript | function (newPaneOptions) {
var newInstance = newPaneOptions.newInstance
if (!newInstance) {
let uri = newPaneOptions.newBase
if (uri.endsWith('/')) {
uri = uri.slice(0, -1)
newPaneOptions.newBase = uri
}
newInstance = kb.sym(uri)
newPaneOptions.newInstance = newIns... | [
"function",
"(",
"newPaneOptions",
")",
"{",
"var",
"newInstance",
"=",
"newPaneOptions",
".",
"newInstance",
"if",
"(",
"!",
"newInstance",
")",
"{",
"let",
"uri",
"=",
"newPaneOptions",
".",
"newBase",
"if",
"(",
"uri",
".",
"endsWith",
"(",
"'/'",
")",
... | Create a new text file in a Solid system, | [
"Create",
"a",
"new",
"text",
"file",
"in",
"a",
"Solid",
"system"
] | cd7803323fd79016c78eac08000faf0d40d285cf | https://github.com/solid/source-pane/blob/cd7803323fd79016c78eac08000faf0d40d285cf/sourcePane.js#L28-L58 | |
37,549 | jamiebuilds/graph-sequencer | index.js | visit | function visit(item, cycle) {
let visitedDeps = visited.get(item);
// Create an object for the item to mark visited deps.
if (!visitedDeps) {
visitedDeps = [];
visited.set(item, visitedDeps);
}
// Get the current deps for the item.
let deps = currDepsMap.get(item);
if (typeof d... | javascript | function visit(item, cycle) {
let visitedDeps = visited.get(item);
// Create an object for the item to mark visited deps.
if (!visitedDeps) {
visitedDeps = [];
visited.set(item, visitedDeps);
}
// Get the current deps for the item.
let deps = currDepsMap.get(item);
if (typeof d... | [
"function",
"visit",
"(",
"item",
",",
"cycle",
")",
"{",
"let",
"visitedDeps",
"=",
"visited",
".",
"get",
"(",
"item",
")",
";",
"// Create an object for the item to mark visited deps.",
"if",
"(",
"!",
"visitedDeps",
")",
"{",
"visitedDeps",
"=",
"[",
"]",
... | Create a function to call recursively in a depth-first search. | [
"Create",
"a",
"function",
"to",
"call",
"recursively",
"in",
"a",
"depth",
"-",
"first",
"search",
"."
] | 565c024a02a1e3b83758149a2fd4eeb24753a898 | https://github.com/jamiebuilds/graph-sequencer/blob/565c024a02a1e3b83758149a2fd4eeb24753a898/index.js#L32-L60 |
37,550 | botmasterai/node-red-contrib-botmaster | dist/botmaster.js | setupBotStatus | function setupBotStatus(bot, node) {
var updates = 0;
var replies = 0;
var updateText = function updateText() {
return updates !== 1 ? updates + ' updates' : updates + ' update';
};
var replyText= function replyText() {
return replies !== 1 ? replies + ' replies': replies + ' reply';... | javascript | function setupBotStatus(bot, node) {
var updates = 0;
var replies = 0;
var updateText = function updateText() {
return updates !== 1 ? updates + ' updates' : updates + ' update';
};
var replyText= function replyText() {
return replies !== 1 ? replies + ' replies': replies + ' reply';... | [
"function",
"setupBotStatus",
"(",
"bot",
",",
"node",
")",
"{",
"var",
"updates",
"=",
"0",
";",
"var",
"replies",
"=",
"0",
";",
"var",
"updateText",
"=",
"function",
"updateText",
"(",
")",
"{",
"return",
"updates",
"!==",
"1",
"?",
"updates",
"+",
... | Show a little status next to each configured bot | [
"Show",
"a",
"little",
"status",
"next",
"to",
"each",
"configured",
"bot"
] | 8a42897b15f7f99c1e7989ea9eacc3eceefa0905 | https://github.com/botmasterai/node-red-contrib-botmaster/blob/8a42897b15f7f99c1e7989ea9eacc3eceefa0905/dist/botmaster.js#L57-L87 |
37,551 | scienceai/jsonld-rdfa-parser | src/index.js | processGraph | function processGraph(data) {
let dataset = {
'@default': []
};
let subjects = data.subjects,
htmlMapper = n => {
let div = n.ownerDocument.createElement('div');
div.appendChild(n.cloneNode(true));
return div.innerHTML;
};
Object.keys(subjects).forEach(subject => {
let predic... | javascript | function processGraph(data) {
let dataset = {
'@default': []
};
let subjects = data.subjects,
htmlMapper = n => {
let div = n.ownerDocument.createElement('div');
div.appendChild(n.cloneNode(true));
return div.innerHTML;
};
Object.keys(subjects).forEach(subject => {
let predic... | [
"function",
"processGraph",
"(",
"data",
")",
"{",
"let",
"dataset",
"=",
"{",
"'@default'",
":",
"[",
"]",
"}",
";",
"let",
"subjects",
"=",
"data",
".",
"subjects",
",",
"htmlMapper",
"=",
"n",
"=>",
"{",
"let",
"div",
"=",
"n",
".",
"ownerDocument... | This function is mostly taken from the jsonld.js lib but updated to
the latest green-turtle API, and for support for HTML | [
"This",
"function",
"is",
"mostly",
"taken",
"from",
"the",
"jsonld",
".",
"js",
"lib",
"but",
"updated",
"to",
"the",
"latest",
"green",
"-",
"turtle",
"API",
"and",
"for",
"support",
"for",
"HTML"
] | 694459fa3cce03832f9a67f522a5143c89a47b84 | https://github.com/scienceai/jsonld-rdfa-parser/blob/694459fa3cce03832f9a67f522a5143c89a47b84/src/index.js#L64-L148 |
37,552 | chriszarate/supergenpass-lib | src/lib/hash.js | customBase64Hash | function customBase64Hash(str, hashFunction) {
const result = hashFunction(str).toString(encBase64);
return customBase64(result);
} | javascript | function customBase64Hash(str, hashFunction) {
const result = hashFunction(str).toString(encBase64);
return customBase64(result);
} | [
"function",
"customBase64Hash",
"(",
"str",
",",
"hashFunction",
")",
"{",
"const",
"result",
"=",
"hashFunction",
"(",
"str",
")",
".",
"toString",
"(",
"encBase64",
")",
";",
"return",
"customBase64",
"(",
"result",
")",
";",
"}"
] | Compute hexadecimal hash and convert it to Base-64. | [
"Compute",
"hexadecimal",
"hash",
"and",
"convert",
"it",
"to",
"Base",
"-",
"64",
"."
] | eb9ee92050813d498229bfe0e6ccbcb87124cf90 | https://github.com/chriszarate/supergenpass-lib/blob/eb9ee92050813d498229bfe0e6ccbcb87124cf90/src/lib/hash.js#L19-L22 |
37,553 | chriszarate/supergenpass-lib | src/lib/hash.js | hash | function hash(method) {
// Is user supplies a function, use it and assume they will take of any
// encoding (Base-64 or otherwise).
if (typeof method === 'function') {
return method;
}
if (hashFunctions.hasOwnProperty(method)) {
return hashFunctions[method];
}
throw new Error(`Could not resolve ... | javascript | function hash(method) {
// Is user supplies a function, use it and assume they will take of any
// encoding (Base-64 or otherwise).
if (typeof method === 'function') {
return method;
}
if (hashFunctions.hasOwnProperty(method)) {
return hashFunctions[method];
}
throw new Error(`Could not resolve ... | [
"function",
"hash",
"(",
"method",
")",
"{",
"// Is user supplies a function, use it and assume they will take of any",
"// encoding (Base-64 or otherwise).",
"if",
"(",
"typeof",
"method",
"===",
"'function'",
")",
"{",
"return",
"method",
";",
"}",
"if",
"(",
"hashFunct... | Return a hash function for SGP to use. | [
"Return",
"a",
"hash",
"function",
"for",
"SGP",
"to",
"use",
"."
] | eb9ee92050813d498229bfe0e6ccbcb87124cf90 | https://github.com/chriszarate/supergenpass-lib/blob/eb9ee92050813d498229bfe0e6ccbcb87124cf90/src/lib/hash.js#L30-L42 |
37,554 | cowboy/node-toc | lib/toc.js | normalize | function normalize(options, templates) {
// Options override defaults and toc methods.
var result = _.defaults({}, options, toc, toc.defaults);
// Remove "core" methods from result object.
['defaults', 'process', 'anchorize', 'toc'].forEach(function(prop) {
delete result[prop];
});
// Compile Lodash str... | javascript | function normalize(options, templates) {
// Options override defaults and toc methods.
var result = _.defaults({}, options, toc, toc.defaults);
// Remove "core" methods from result object.
['defaults', 'process', 'anchorize', 'toc'].forEach(function(prop) {
delete result[prop];
});
// Compile Lodash str... | [
"function",
"normalize",
"(",
"options",
",",
"templates",
")",
"{",
"// Options override defaults and toc methods.",
"var",
"result",
"=",
"_",
".",
"defaults",
"(",
"{",
"}",
",",
"options",
",",
"toc",
",",
"toc",
".",
"defaults",
")",
";",
"// Remove \"cor... | Compile specified lodash string template properties into functions. | [
"Compile",
"specified",
"lodash",
"string",
"template",
"properties",
"into",
"functions",
"."
] | a6907a18cafb6741d9770a93f27f0fda98a8cff3 | https://github.com/cowboy/node-toc/blob/a6907a18cafb6741d9770a93f27f0fda98a8cff3/lib/toc.js#L82-L96 |
37,555 | BohemiaInteractive/bi-service | lib/cli/runCmd.js | _parseShellConfigOptions | function _parseShellConfigOptions(argv) {
var out = {};
//`parse-pos-args` value is `true` by default, it must be
//explicitly set to falsy value thus undefined & null values does not count
if (argv['parse-pos-args'] === false || argv['parse-pos-args'] === 0) {
setConfigPathOption(out);
... | javascript | function _parseShellConfigOptions(argv) {
var out = {};
//`parse-pos-args` value is `true` by default, it must be
//explicitly set to falsy value thus undefined & null values does not count
if (argv['parse-pos-args'] === false || argv['parse-pos-args'] === 0) {
setConfigPathOption(out);
... | [
"function",
"_parseShellConfigOptions",
"(",
"argv",
")",
"{",
"var",
"out",
"=",
"{",
"}",
";",
"//`parse-pos-args` value is `true` by default, it must be",
"//explicitly set to falsy value thus undefined & null values does not count",
"if",
"(",
"argv",
"[",
"'parse-pos-args'",... | returns parsed object with positional shell arguments.
These options will then overwrite option values set in configuration file
@private
@param {Object} argv - shell arguments
@return {Object} | [
"returns",
"parsed",
"object",
"with",
"positional",
"shell",
"arguments",
".",
"These",
"options",
"will",
"then",
"overwrite",
"option",
"values",
"set",
"in",
"configuration",
"file"
] | 89e76f2e93714a3150ce7f59f16f646e4bdbbce1 | https://github.com/BohemiaInteractive/bi-service/blob/89e76f2e93714a3150ce7f59f16f646e4bdbbce1/lib/cli/runCmd.js#L132-L182 |
37,556 | joshfire/woodman | lib/logevent.js | function (loggerName, level, message) {
this.time = new Date();
this.loggerName = loggerName;
this.level = level;
this.message = message;
} | javascript | function (loggerName, level, message) {
this.time = new Date();
this.loggerName = loggerName;
this.level = level;
this.message = message;
} | [
"function",
"(",
"loggerName",
",",
"level",
",",
"message",
")",
"{",
"this",
".",
"time",
"=",
"new",
"Date",
"(",
")",
";",
"this",
".",
"loggerName",
"=",
"loggerName",
";",
"this",
".",
"level",
"=",
"level",
";",
"this",
".",
"message",
"=",
... | Definition of the LogEvent class.
@constructor
@param {string} loggerName Name of the logger that creates this event
@param {string} level The trace level ('info', 'warning', 'error'...)
@param {Message} message The message to log. | [
"Definition",
"of",
"the",
"LogEvent",
"class",
"."
] | fdc05de2124388780924980e6f27bf4483056d18 | https://github.com/joshfire/woodman/blob/fdc05de2124388780924980e6f27bf4483056d18/lib/logevent.js#L29-L34 | |
37,557 | jimivdw/grunt-mutation-testing | lib/reporting/html/FileHtmlBuilder.js | writeReport | function writeReport(fileResult, formatter, formattedSourceLines, baseDir) {
var fileName = fileResult.fileName,
stats = StatUtils.decorateStatPercentages(fileResult.stats),
parentDir = path.normalize(baseDir + '/..'),
mutations = formatter.formatMutations(fileResult.mutationResults),
... | javascript | function writeReport(fileResult, formatter, formattedSourceLines, baseDir) {
var fileName = fileResult.fileName,
stats = StatUtils.decorateStatPercentages(fileResult.stats),
parentDir = path.normalize(baseDir + '/..'),
mutations = formatter.formatMutations(fileResult.mutationResults),
... | [
"function",
"writeReport",
"(",
"fileResult",
",",
"formatter",
",",
"formattedSourceLines",
",",
"baseDir",
")",
"{",
"var",
"fileName",
"=",
"fileResult",
".",
"fileName",
",",
"stats",
"=",
"StatUtils",
".",
"decorateStatPercentages",
"(",
"fileResult",
".",
... | write the report to file | [
"write",
"the",
"report",
"to",
"file"
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/lib/reporting/html/FileHtmlBuilder.js#L52-L83 |
37,558 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(obj, keys, caseSensitive /* default: false */) {
var key, keyLower, newObj = {};
if (!$.isArray(keys) || !keys.length) {
return newObj;
}
for (var i = 0; i < keys.length; i++) {
key = keys[i];
if (obj.hasOwnProper... | javascript | function(obj, keys, caseSensitive /* default: false */) {
var key, keyLower, newObj = {};
if (!$.isArray(keys) || !keys.length) {
return newObj;
}
for (var i = 0; i < keys.length; i++) {
key = keys[i];
if (obj.hasOwnProper... | [
"function",
"(",
"obj",
",",
"keys",
",",
"caseSensitive",
"/* default: false */",
")",
"{",
"var",
"key",
",",
"keyLower",
",",
"newObj",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"$",
".",
"isArray",
"(",
"keys",
")",
"||",
"!",
"keys",
".",
"length",
... | slice object by specified keys | [
"slice",
"object",
"by",
"specified",
"keys"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L688-L715 | |
37,559 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(element, options) {
this.$element = $(element);
//since 1.4.1 container do not use data-* directly as they already merged into options.
this.options = $.extend({}, $.fn.editableContainer.defaults, options);
this.splitOptions();
/... | javascript | function(element, options) {
this.$element = $(element);
//since 1.4.1 container do not use data-* directly as they already merged into options.
this.options = $.extend({}, $.fn.editableContainer.defaults, options);
this.splitOptions();
/... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"$element",
"=",
"$",
"(",
"element",
")",
";",
"//since 1.4.1 container do not use data-* directly as they already merged into options.",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"{",
... | css class applied to container element | [
"css",
"class",
"applied",
"to",
"container",
"element"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L901-L967 | |
37,560 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function() {
this.containerOptions = {};
this.formOptions = {};
if(!$.fn[this.containerName]) {
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
}
var cDef = $.fn[this.co... | javascript | function() {
this.containerOptions = {};
this.formOptions = {};
if(!$.fn[this.containerName]) {
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
}
var cDef = $.fn[this.co... | [
"function",
"(",
")",
"{",
"this",
".",
"containerOptions",
"=",
"{",
"}",
";",
"this",
".",
"formOptions",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"$",
".",
"fn",
"[",
"this",
".",
"containerName",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"this"... | split options on containerOptions and formOptions | [
"split",
"options",
"on",
"containerOptions",
"and",
"formOptions"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L970-L987 | |
37,561 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(reason) {
if(!this.tip() || !this.tip().is(':visible') || !this.$element.hasClass('editable-open')) {
return;
}
//if form is saving value, schedule hide
if(this.$form.data('editableform').isSaving) {
this.delayedHide... | javascript | function(reason) {
if(!this.tip() || !this.tip().is(':visible') || !this.$element.hasClass('editable-open')) {
return;
}
//if form is saving value, schedule hide
if(this.$form.data('editableform').isSaving) {
this.delayedHide... | [
"function",
"(",
"reason",
")",
"{",
"if",
"(",
"!",
"this",
".",
"tip",
"(",
")",
"||",
"!",
"this",
".",
"tip",
"(",
")",
".",
"is",
"(",
"':visible'",
")",
"||",
"!",
"this",
".",
"$element",
".",
"hasClass",
"(",
"'editable-open'",
")",
")",
... | Hides container with form
@method hide()
@param {string} reason Reason caused hiding. Can be <code>save|cancel|onblur|nochange|undefined (=manual)</code> | [
"Hides",
"container",
"with",
"form"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L1110-L1143 | |
37,562 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(value, convertStr, response) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
if(this.container) {
this.container.option('value', this.value);
}
$.w... | javascript | function(value, convertStr, response) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
if(this.container) {
this.container.option('value', this.value);
}
$.w... | [
"function",
"(",
"value",
",",
"convertStr",
",",
"response",
")",
"{",
"if",
"(",
"convertStr",
")",
"{",
"this",
".",
"value",
"=",
"this",
".",
"input",
".",
"str2value",
"(",
"value",
")",
";",
"}",
"else",
"{",
"this",
".",
"value",
"=",
"valu... | Sets new value of editable
@method setValue(value, convertStr)
@param {mixed} value new value
@param {boolean} convertStr whether to convert value from string to internal format | [
"Sets",
"new",
"value",
"of",
"editable"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L1887-L1900 | |
37,563 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function() {
if (this.options.clear) {
this.$clear = $('<span class="editable-clear-x"></span>');
this.$input.after(this.$clear)
.css('padding-right', 24)
.keyup($.proxy(function(e) {
//arrows, ent... | javascript | function() {
if (this.options.clear) {
this.$clear = $('<span class="editable-clear-x"></span>');
this.$input.after(this.$clear)
.css('padding-right', 24)
.keyup($.proxy(function(e) {
//arrows, ent... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"clear",
")",
"{",
"this",
".",
"$clear",
"=",
"$",
"(",
"'<span class=\"editable-clear-x\"></span>'",
")",
";",
"this",
".",
"$input",
".",
"after",
"(",
"this",
".",
"$clear",
")",
".... | render clear button | [
"render",
"clear",
"button"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L2831-L2853 | |
37,564 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
value = str.split(reg);
} else if($.isArray(str)) {
value = str;
} else {
... | javascript | function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
value = str.split(reg);
} else if($.isArray(str)) {
value = str;
} else {
... | [
"function",
"(",
"str",
")",
"{",
"var",
"reg",
",",
"value",
"=",
"null",
";",
"if",
"(",
"typeof",
"str",
"===",
"'string'",
"&&",
"str",
".",
"length",
")",
"{",
"reg",
"=",
"new",
"RegExp",
"(",
"'\\\\s*'",
"+",
"$",
".",
"trim",
"(",
"this",... | parse separated string | [
"parse",
"separated",
"string"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L3190-L3201 | |
37,565 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(value) {
this.$input.prop('checked', false);
if($.isArray(value) && value.length) {
this.$input.each(function(i, el) {
var $el = $(el);
// cannot use $.inArray as it performs strict comparison
$.each(value, function... | javascript | function(value) {
this.$input.prop('checked', false);
if($.isArray(value) && value.length) {
this.$input.each(function(i, el) {
var $el = $(el);
// cannot use $.inArray as it performs strict comparison
$.each(value, function... | [
"function",
"(",
"value",
")",
"{",
"this",
".",
"$input",
".",
"prop",
"(",
"'checked'",
",",
"false",
")",
";",
"if",
"(",
"$",
".",
"isArray",
"(",
"value",
")",
"&&",
"value",
".",
"length",
")",
"{",
"this",
".",
"$input",
".",
"each",
"(",
... | set checked on required checkboxes | [
"set",
"checked",
"on",
"required",
"checkboxes"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L3204-L3219 | |
37,566 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js | function(value, element) {
var html = [],
checked = $.fn.editableutils.itemsByValue(value, this.sourceData);
if(checked.length) {
$.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });
$(element).html(html.joi... | javascript | function(value, element) {
var html = [],
checked = $.fn.editableutils.itemsByValue(value, this.sourceData);
if(checked.length) {
$.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });
$(element).html(html.joi... | [
"function",
"(",
"value",
",",
"element",
")",
"{",
"var",
"html",
"=",
"[",
"]",
",",
"checked",
"=",
"$",
".",
"fn",
".",
"editableutils",
".",
"itemsByValue",
"(",
"value",
",",
"this",
".",
"sourceData",
")",
";",
"if",
"(",
"checked",
".",
"le... | collect text of checked boxes | [
"collect",
"text",
"of",
"checked",
"boxes"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/x-editable/bootstrap-editable.js#L3230-L3240 | |
37,567 | infrabel/themes-gnap | raw/ace/mustache/app/views/assets/scripts/calendar.js | function(date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
var $extraEventClass = $(this).attr('data-class');
// we need to copy it, so that multiple events don't have a... | javascript | function(date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
var $extraEventClass = $(this).attr('data-class');
// we need to copy it, so that multiple events don't have a... | [
"function",
"(",
"date",
",",
"allDay",
")",
"{",
"// this function is called when something is dropped",
"// retrieve the dropped element's stored Event Object",
"var",
"originalEventObject",
"=",
"$",
"(",
"this",
")",
".",
"data",
"(",
"'eventObject'",
")",
";",
"var",... | this allows things to be dropped onto the calendar !!! | [
"this",
"allows",
"things",
"to",
"be",
"dropped",
"onto",
"the",
"calendar",
"!!!"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/mustache/app/views/assets/scripts/calendar.js#L69-L94 | |
37,568 | BohemiaInteractive/bi-service | lib/common/route.js | applyCatchList | function applyCatchList(promise, req, res, catchList, index) {
index = index || 0;
if ( !Array.isArray(catchList)
|| index > catchList.length - 1
|| !Array.isArray(catchList[index])
|| !(catchList[index][1] instanceof Function)
) {
return promise;
}
var args = _.c... | javascript | function applyCatchList(promise, req, res, catchList, index) {
index = index || 0;
if ( !Array.isArray(catchList)
|| index > catchList.length - 1
|| !Array.isArray(catchList[index])
|| !(catchList[index][1] instanceof Function)
) {
return promise;
}
var args = _.c... | [
"function",
"applyCatchList",
"(",
"promise",
",",
"req",
",",
"res",
",",
"catchList",
",",
"index",
")",
"{",
"index",
"=",
"index",
"||",
"0",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"catchList",
")",
"||",
"index",
">",
"catchList",
".... | applies collection of catch handler functions to provided Promise object
@private
@param {Promise} promise - the promise catch functions are going to be applied to
@param {Object} req
@param {Object} res
@param {Array} catchList - array of arrays - each item of array is a pair of [ErrorFilterConstructor,FunctionE... | [
"applies",
"collection",
"of",
"catch",
"handler",
"functions",
"to",
"provided",
"Promise",
"object"
] | 89e76f2e93714a3150ce7f59f16f646e4bdbbce1 | https://github.com/BohemiaInteractive/bi-service/blob/89e76f2e93714a3150ce7f59f16f646e4bdbbce1/lib/common/route.js#L604-L624 |
37,569 | adaptive-learning/flocs-visual-components | src/selectors/gameState.js | performMove | function performMove(fields, direction) {
const oldSpaceshipPosition = findSpaceshipPosition(fields);
const dx = { left: -1, ahead: 0, right: 1 }[direction];
const newSpaceshipPosition = [oldSpaceshipPosition[0] - 1, oldSpaceshipPosition[1] + dx];
const newFields = fields.map((row, i) => row.map((field, j) => {... | javascript | function performMove(fields, direction) {
const oldSpaceshipPosition = findSpaceshipPosition(fields);
const dx = { left: -1, ahead: 0, right: 1 }[direction];
const newSpaceshipPosition = [oldSpaceshipPosition[0] - 1, oldSpaceshipPosition[1] + dx];
const newFields = fields.map((row, i) => row.map((field, j) => {... | [
"function",
"performMove",
"(",
"fields",
",",
"direction",
")",
"{",
"const",
"oldSpaceshipPosition",
"=",
"findSpaceshipPosition",
"(",
"fields",
")",
";",
"const",
"dx",
"=",
"{",
"left",
":",
"-",
"1",
",",
"ahead",
":",
"0",
",",
"right",
":",
"1",
... | Return new 2D fields after move of the spaceship represented as object 'S'.
Dicection is one of 'left', 'ahead', 'right'. | [
"Return",
"new",
"2D",
"fields",
"after",
"move",
"of",
"the",
"spaceship",
"represented",
"as",
"object",
"S",
".",
"Dicection",
"is",
"one",
"of",
"left",
"ahead",
"right",
"."
] | c62e80a1fd5ad65ae2cbe37a1d9450a96c3a9306 | https://github.com/adaptive-learning/flocs-visual-components/blob/c62e80a1fd5ad65ae2cbe37a1d9450a96c3a9306/src/selectors/gameState.js#L280-L312 |
37,570 | jimivdw/grunt-mutation-testing | lib/karma/KarmaServerPool.js | KarmaServerPool | function KarmaServerPool(config) {
this._config = _.merge({ port: 12111, maxActiveServers: 5, startInterval: 100 }, config);
this._instances = [];
} | javascript | function KarmaServerPool(config) {
this._config = _.merge({ port: 12111, maxActiveServers: 5, startInterval: 100 }, config);
this._instances = [];
} | [
"function",
"KarmaServerPool",
"(",
"config",
")",
"{",
"this",
".",
"_config",
"=",
"_",
".",
"merge",
"(",
"{",
"port",
":",
"12111",
",",
"maxActiveServers",
":",
"5",
",",
"startInterval",
":",
"100",
"}",
",",
"config",
")",
";",
"this",
".",
"_... | Constructor for a Karma server manager
@param config {object} Configuration object for the server.
@constructor | [
"Constructor",
"for",
"a",
"Karma",
"server",
"manager"
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/lib/karma/KarmaServerPool.js#L25-L28 |
37,571 | joshfire/woodman | lib/loggercontext.js | LoggerContext | function LoggerContext() {
LifeCycle.call(this);
/**
* Context start time
*/
this.startTime = new Date();
/**
* The list of trace levels that the logger context knows about
*/
this.logLevel = new LogLevel();
/**
* Root logger, final ancestor of all loggers
*/
... | javascript | function LoggerContext() {
LifeCycle.call(this);
/**
* Context start time
*/
this.startTime = new Date();
/**
* The list of trace levels that the logger context knows about
*/
this.logLevel = new LogLevel();
/**
* Root logger, final ancestor of all loggers
*/
... | [
"function",
"LoggerContext",
"(",
")",
"{",
"LifeCycle",
".",
"call",
"(",
"this",
")",
";",
"/**\n * Context start time\n */",
"this",
".",
"startTime",
"=",
"new",
"Date",
"(",
")",
";",
"/**\n * The list of trace levels that the logger context knows about\n... | Internal anchor point for the logging system, used by LogManager.
@constructor | [
"Internal",
"anchor",
"point",
"for",
"the",
"logging",
"system",
"used",
"by",
"LogManager",
"."
] | fdc05de2124388780924980e6f27bf4483056d18 | https://github.com/joshfire/woodman/blob/fdc05de2124388780924980e6f27bf4483056d18/lib/loggercontext.js#L45-L131 |
37,572 | jldec/marked-forms | marked-forms.js | link | function link(href, title, text) {
var reLabelFirst = /^(.*?)\s*\?([^?\s]*)\?(\*?)(X?)(H?)$/;
var reLabelAfter = /^\?([^?\s]*)\?(\*?)(X?)(H?)\s*(.*)$/;
var m = text.match(reLabelFirst);
if (m) return renderInput(m[1], m[2], m[3], m[4], m[5], href, title, true);
m = text.match(reLabelAfter);
if (m) return... | javascript | function link(href, title, text) {
var reLabelFirst = /^(.*?)\s*\?([^?\s]*)\?(\*?)(X?)(H?)$/;
var reLabelAfter = /^\?([^?\s]*)\?(\*?)(X?)(H?)\s*(.*)$/;
var m = text.match(reLabelFirst);
if (m) return renderInput(m[1], m[2], m[3], m[4], m[5], href, title, true);
m = text.match(reLabelAfter);
if (m) return... | [
"function",
"link",
"(",
"href",
",",
"title",
",",
"text",
")",
"{",
"var",
"reLabelFirst",
"=",
"/",
"^(.*?)\\s*\\?([^?\\s]*)\\?(\\*?)(X?)(H?)$",
"/",
";",
"var",
"reLabelAfter",
"=",
"/",
"^\\?([^?\\s]*)\\?(\\*?)(X?)(H?)\\s*(.*)$",
"/",
";",
"var",
"m",
"=",
... | markdown link syntax extension for forms | [
"markdown",
"link",
"syntax",
"extension",
"for",
"forms"
] | 096f0ed19319c83df1a5479782c635fd5ce6281c | https://github.com/jldec/marked-forms/blob/096f0ed19319c83df1a5479782c635fd5ce6281c/marked-forms.js#L40-L52 |
37,573 | jldec/marked-forms | marked-forms.js | listitem | function listitem(text) {
if (inList()) {
// capture value in trailing "text" - unescape makes regexp work
var m = unescapeQuotes(text).match(/^(.*)\s+"([^"]*)"\s*$/);
var txt = m ? escapeQuotes(m[1]) : text;
var val = m ? escapeQuotes(m[2]) : text;
return renderOption(txt, val);
}
return f... | javascript | function listitem(text) {
if (inList()) {
// capture value in trailing "text" - unescape makes regexp work
var m = unescapeQuotes(text).match(/^(.*)\s+"([^"]*)"\s*$/);
var txt = m ? escapeQuotes(m[1]) : text;
var val = m ? escapeQuotes(m[2]) : text;
return renderOption(txt, val);
}
return f... | [
"function",
"listitem",
"(",
"text",
")",
"{",
"if",
"(",
"inList",
"(",
")",
")",
"{",
"// capture value in trailing \"text\" - unescape makes regexp work",
"var",
"m",
"=",
"unescapeQuotes",
"(",
"text",
")",
".",
"match",
"(",
"/",
"^(.*)\\s+\"([^\"]*)\"\\s*$",
... | capture listitems for select, checklist, radiolist | [
"capture",
"listitems",
"for",
"select",
"checklist",
"radiolist"
] | 096f0ed19319c83df1a5479782c635fd5ce6281c | https://github.com/jldec/marked-forms/blob/096f0ed19319c83df1a5479782c635fd5ce6281c/marked-forms.js#L55-L67 |
37,574 | jldec/marked-forms | marked-forms.js | list | function list(body, ordered) {
if (inList()) return body + endList();
return fallback.list.call(this, body, ordered);
} | javascript | function list(body, ordered) {
if (inList()) return body + endList();
return fallback.list.call(this, body, ordered);
} | [
"function",
"list",
"(",
"body",
",",
"ordered",
")",
"{",
"if",
"(",
"inList",
"(",
")",
")",
"return",
"body",
"+",
"endList",
"(",
")",
";",
"return",
"fallback",
".",
"list",
".",
"call",
"(",
"this",
",",
"body",
",",
"ordered",
")",
";",
"}... | rendering the list terminates listitem collector | [
"rendering",
"the",
"list",
"terminates",
"listitem",
"collector"
] | 096f0ed19319c83df1a5479782c635fd5ce6281c | https://github.com/jldec/marked-forms/blob/096f0ed19319c83df1a5479782c635fd5ce6281c/marked-forms.js#L76-L79 |
37,575 | RoganMurley/hitagi.js | examples/example6/example6.js | function () {
this.update = {
velocity: function (entity, dt) {
entity.c.position.x += hitagi.utils.delta(entity.c.velocity.xspeed, dt);
}
};
} | javascript | function () {
this.update = {
velocity: function (entity, dt) {
entity.c.position.x += hitagi.utils.delta(entity.c.velocity.xspeed, dt);
}
};
} | [
"function",
"(",
")",
"{",
"this",
".",
"update",
"=",
"{",
"velocity",
":",
"function",
"(",
"entity",
",",
"dt",
")",
"{",
"entity",
".",
"c",
".",
"position",
".",
"x",
"+=",
"hitagi",
".",
"utils",
".",
"delta",
"(",
"entity",
".",
"c",
".",
... | We need to update horizontal and vertical velocity seperately for our collision resolution technique. The default hitagi VelocitySystem doesn't support this, but it's easy to make our own. | [
"We",
"need",
"to",
"update",
"horizontal",
"and",
"vertical",
"velocity",
"seperately",
"for",
"our",
"collision",
"resolution",
"technique",
".",
"The",
"default",
"hitagi",
"VelocitySystem",
"doesn",
"t",
"support",
"this",
"but",
"it",
"s",
"easy",
"to",
"... | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/examples/example6/example6.js#L15-L21 | |
37,576 | RoganMurley/hitagi.js | examples/example6/example6.js | function (params) {
this.$id = 'dragBoxUI';
this.width = 0;
this.height = 0;
this.origin = {
x: params.x,
y: params.y
};
} | javascript | function (params) {
this.$id = 'dragBoxUI';
this.width = 0;
this.height = 0;
this.origin = {
x: params.x,
y: params.y
};
} | [
"function",
"(",
"params",
")",
"{",
"this",
".",
"$id",
"=",
"'dragBoxUI'",
";",
"this",
".",
"width",
"=",
"0",
";",
"this",
".",
"height",
"=",
"0",
";",
"this",
".",
"origin",
"=",
"{",
"x",
":",
"params",
".",
"x",
",",
"y",
":",
"params",... | Define components. | [
"Define",
"components",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/examples/example6/example6.js#L263-L271 | |
37,577 | RoganMurley/hitagi.js | src/components/collision.js | function (params) {
params = _.extend({
anchor: {
x: 0.5,
y: 0.5
}
}, params);
this.$id = 'collision';
this.$deps = ['position'];
this.width = params.width;
this.height = params.height;
this.anchor = params... | javascript | function (params) {
params = _.extend({
anchor: {
x: 0.5,
y: 0.5
}
}, params);
this.$id = 'collision';
this.$deps = ['position'];
this.width = params.width;
this.height = params.height;
this.anchor = params... | [
"function",
"(",
"params",
")",
"{",
"params",
"=",
"_",
".",
"extend",
"(",
"{",
"anchor",
":",
"{",
"x",
":",
"0.5",
",",
"y",
":",
"0.5",
"}",
"}",
",",
"params",
")",
";",
"this",
".",
"$id",
"=",
"'collision'",
";",
"this",
".",
"$deps",
... | Represents the collision boundaries of an entity. | [
"Represents",
"the",
"collision",
"boundaries",
"of",
"an",
"entity",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/components/collision.js#L7-L21 | |
37,578 | njoubert/node-groupme | lib/Stateless.js | getRequest | function getRequest(at, api_url, config, callback) {
if (!config.responseCode)
config.responseCode = 200;
request(
{
uri: getURL(at, api_url, config.opts),
method: 'GET',
headers: {'Content-Type': 'application/json'}
},
function(err,res,body) {
if (!err && res.statusCode ... | javascript | function getRequest(at, api_url, config, callback) {
if (!config.responseCode)
config.responseCode = 200;
request(
{
uri: getURL(at, api_url, config.opts),
method: 'GET',
headers: {'Content-Type': 'application/json'}
},
function(err,res,body) {
if (!err && res.statusCode ... | [
"function",
"getRequest",
"(",
"at",
",",
"api_url",
",",
"config",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"config",
".",
"responseCode",
")",
"config",
".",
"responseCode",
"=",
"200",
";",
"request",
"(",
"{",
"uri",
":",
"getURL",
"(",
"at",
"... | This makes one of many different types of post requests. config.opts - this adds additional parameters to the url config.doParse - if true, parses the return value as json config.responseCode - if set, checks for this response code | [
"This",
"makes",
"one",
"of",
"many",
"different",
"types",
"of",
"post",
"requests",
".",
"config",
".",
"opts",
"-",
"this",
"adds",
"additional",
"parameters",
"to",
"the",
"url",
"config",
".",
"doParse",
"-",
"if",
"true",
"parses",
"the",
"return",
... | 0d242fb41db4efa3edd9cd332626640623f8493b | https://github.com/njoubert/node-groupme/blob/0d242fb41db4efa3edd9cd332626640623f8493b/lib/Stateless.js#L36-L58 |
37,579 | njoubert/node-groupme | lib/Stateless.js | postRequest | function postRequest(at, api_url, config, callback) {
var r_opts = {
uri: getURL(at, api_url),
method: 'POST',
headers: {'Content-Type': 'application/json'}
};
if (config.body && !config.form) {
r_opts.body = JSON.stringify(config.body);
} else {
r_opts.form = config.form;
}
if (!c... | javascript | function postRequest(at, api_url, config, callback) {
var r_opts = {
uri: getURL(at, api_url),
method: 'POST',
headers: {'Content-Type': 'application/json'}
};
if (config.body && !config.form) {
r_opts.body = JSON.stringify(config.body);
} else {
r_opts.form = config.form;
}
if (!c... | [
"function",
"postRequest",
"(",
"at",
",",
"api_url",
",",
"config",
",",
"callback",
")",
"{",
"var",
"r_opts",
"=",
"{",
"uri",
":",
"getURL",
"(",
"at",
",",
"api_url",
")",
",",
"method",
":",
"'POST'",
",",
"headers",
":",
"{",
"'Content-Type'",
... | This makes one of many different types of post requests. config.body - this stingifies the object as the POST body config.form - this sets the POST body as form parameters config.doParse - if true, parses the return value as json config.responseCode - if set, checks for this response code | [
"This",
"makes",
"one",
"of",
"many",
"different",
"types",
"of",
"post",
"requests",
".",
"config",
".",
"body",
"-",
"this",
"stingifies",
"the",
"object",
"as",
"the",
"POST",
"body",
"config",
".",
"form",
"-",
"this",
"sets",
"the",
"POST",
"body",
... | 0d242fb41db4efa3edd9cd332626640623f8493b | https://github.com/njoubert/node-groupme/blob/0d242fb41db4efa3edd9cd332626640623f8493b/lib/Stateless.js#L65-L96 |
37,580 | commenthol/clones | src/index.js | clones | function clones (source, bind, target) {
let opts = {
bind: bind,
visited: [],
cloned: []
}
return _clone(opts, source, target)
} | javascript | function clones (source, bind, target) {
let opts = {
bind: bind,
visited: [],
cloned: []
}
return _clone(opts, source, target)
} | [
"function",
"clones",
"(",
"source",
",",
"bind",
",",
"target",
")",
"{",
"let",
"opts",
"=",
"{",
"bind",
":",
"bind",
",",
"visited",
":",
"[",
"]",
",",
"cloned",
":",
"[",
"]",
"}",
"return",
"_clone",
"(",
"opts",
",",
"source",
",",
"targe... | A Deep-Clone of object `source`
@static
@param {Object} source - clone source
@param {Object} [bind] - bind functions to this context
@return {Any} deep clone of `source`
@example
const clones = require('clones')
const source = [
{a: {b: 1}},
{c: {d: 2}},
'3',
function () { return 4 }
]
// adding circularities
source... | [
"A",
"Deep",
"-",
"Clone",
"of",
"object",
"source"
] | dd9d357948c949bd10a818d1f36e64b4d89c35b4 | https://github.com/commenthol/clones/blob/dd9d357948c949bd10a818d1f36e64b4d89c35b4/src/index.js#L33-L40 |
37,581 | commenthol/clones | src/index.js | _clone | function _clone (opts, source, target) {
let type = toType(source)
switch (type) {
case 'String':
case 'Number':
case 'Boolean':
case 'Null':
case 'Undefined':
case 'Symbol':
case 'DOMPrototype': // (browser)
case 'process': // (node) cloning this is not a good idea
target = so... | javascript | function _clone (opts, source, target) {
let type = toType(source)
switch (type) {
case 'String':
case 'Number':
case 'Boolean':
case 'Null':
case 'Undefined':
case 'Symbol':
case 'DOMPrototype': // (browser)
case 'process': // (node) cloning this is not a good idea
target = so... | [
"function",
"_clone",
"(",
"opts",
",",
"source",
",",
"target",
")",
"{",
"let",
"type",
"=",
"toType",
"(",
"source",
")",
"switch",
"(",
"type",
")",
"{",
"case",
"'String'",
":",
"case",
"'Number'",
":",
"case",
"'Boolean'",
":",
"case",
"'Null'",
... | Recursively clone source
@static
@private
@param {Object} opts - options
@param {Object} [opts.bind] - optional bind for function clones
@param {Array} opts.visited - visited references to detect circularities
@param {Array} opts.cloned - visited references of clones to assign circularities
@param {Any} source - The o... | [
"Recursively",
"clone",
"source"
] | dd9d357948c949bd10a818d1f36e64b4d89c35b4 | https://github.com/commenthol/clones/blob/dd9d357948c949bd10a818d1f36e64b4d89c35b4/src/index.js#L81-L176 |
37,582 | commenthol/clones | src/index.js | _props | function _props (opts, source, target) {
let idx = opts.visited.indexOf(source) // check for circularities
if (idx === -1) {
opts.visited.push(source)
opts.cloned.push(target)
Object.getOwnPropertyNames(source).forEach(function (key) {
if (key === 'prototype') {
target[key] = Object.create... | javascript | function _props (opts, source, target) {
let idx = opts.visited.indexOf(source) // check for circularities
if (idx === -1) {
opts.visited.push(source)
opts.cloned.push(target)
Object.getOwnPropertyNames(source).forEach(function (key) {
if (key === 'prototype') {
target[key] = Object.create... | [
"function",
"_props",
"(",
"opts",
",",
"source",
",",
"target",
")",
"{",
"let",
"idx",
"=",
"opts",
".",
"visited",
".",
"indexOf",
"(",
"source",
")",
"// check for circularities",
"if",
"(",
"idx",
"===",
"-",
"1",
")",
"{",
"opts",
".",
"visited",... | Clone property while cloning circularities
@static
@private
@param {Object} opts - options
@param {Any} source - source object
@param {Any} [target] - target object
@returns {Any} target | [
"Clone",
"property",
"while",
"cloning",
"circularities"
] | dd9d357948c949bd10a818d1f36e64b4d89c35b4 | https://github.com/commenthol/clones/blob/dd9d357948c949bd10a818d1f36e64b4d89c35b4/src/index.js#L188-L214 |
37,583 | commenthol/clones | src/index.js | _descriptor | function _descriptor (opts, source, target, key) {
let desc = Object.getOwnPropertyDescriptor(source, key)
if (desc) {
if (desc.writable) {
desc.value = _clone(opts, desc.value)
}
try {
Object.defineProperty(target, key, desc)
} catch (e) {
// Safari throws with TypeError:
//... | javascript | function _descriptor (opts, source, target, key) {
let desc = Object.getOwnPropertyDescriptor(source, key)
if (desc) {
if (desc.writable) {
desc.value = _clone(opts, desc.value)
}
try {
Object.defineProperty(target, key, desc)
} catch (e) {
// Safari throws with TypeError:
//... | [
"function",
"_descriptor",
"(",
"opts",
",",
"source",
",",
"target",
",",
"key",
")",
"{",
"let",
"desc",
"=",
"Object",
".",
"getOwnPropertyDescriptor",
"(",
"source",
",",
"key",
")",
"if",
"(",
"desc",
")",
"{",
"if",
"(",
"desc",
".",
"writable",
... | assign descriptor with property `key` from source to target
@private | [
"assign",
"descriptor",
"with",
"property",
"key",
"from",
"source",
"to",
"target"
] | dd9d357948c949bd10a818d1f36e64b4d89c35b4 | https://github.com/commenthol/clones/blob/dd9d357948c949bd10a818d1f36e64b4d89c35b4/src/index.js#L220-L237 |
37,584 | atomantic/undermore | gulp/tasks/undermore.js | cleanContent | function cleanContent() {
function transform(file, cb) {
file.contents = new Buffer((function (src) {
var lines = src.replace('_.mixin({\n','').split('\n'),
last = lines.pop();
// handle empty lines at the end of the file
while(last===''){
... | javascript | function cleanContent() {
function transform(file, cb) {
file.contents = new Buffer((function (src) {
var lines = src.replace('_.mixin({\n','').split('\n'),
last = lines.pop();
// handle empty lines at the end of the file
while(last===''){
... | [
"function",
"cleanContent",
"(",
")",
"{",
"function",
"transform",
"(",
"file",
",",
"cb",
")",
"{",
"file",
".",
"contents",
"=",
"new",
"Buffer",
"(",
"(",
"function",
"(",
"src",
")",
"{",
"var",
"lines",
"=",
"src",
".",
"replace",
"(",
"'_.mixi... | This method is used as a modifier for minification to clean up
the stream a bit. | [
"This",
"method",
"is",
"used",
"as",
"a",
"modifier",
"for",
"minification",
"to",
"clean",
"up",
"the",
"stream",
"a",
"bit",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/gulp/tasks/undermore.js#L16-L31 |
37,585 | ToMMApps/express-waf | express-waf.js | recursiveCall | function recursiveCall(i, callback) {
if(i >= _modules.length) {
callback();
} else {
_modules[i].check(req, res, function () {
recursiveCall(++i, callback);
})
}
} | javascript | function recursiveCall(i, callback) {
if(i >= _modules.length) {
callback();
} else {
_modules[i].check(req, res, function () {
recursiveCall(++i, callback);
})
}
} | [
"function",
"recursiveCall",
"(",
"i",
",",
"callback",
")",
"{",
"if",
"(",
"i",
">=",
"_modules",
".",
"length",
")",
"{",
"callback",
"(",
")",
";",
"}",
"else",
"{",
"_modules",
"[",
"i",
"]",
".",
"check",
"(",
"req",
",",
"res",
",",
"funct... | This iterates over all modules and run on them function check
@param i {int} iterator
@param callback {function} Callback after iteration ended | [
"This",
"iterates",
"over",
"all",
"modules",
"and",
"run",
"on",
"them",
"function",
"check"
] | 5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a | https://github.com/ToMMApps/express-waf/blob/5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a/express-waf.js#L43-L51 |
37,586 | joshfire/woodman | lib/message.js | function (params) {
this.formatString = '';
this.params = [];
if (!params) {
return;
}
params = utils.isArray(params) ? params : [params];
if ((params.length > 0) &&
utils.isString(params[0]) &&
(params[0].indexOf('{}') !== -1)) {
this.formatString = params[0];
... | javascript | function (params) {
this.formatString = '';
this.params = [];
if (!params) {
return;
}
params = utils.isArray(params) ? params : [params];
if ((params.length > 0) &&
utils.isString(params[0]) &&
(params[0].indexOf('{}') !== -1)) {
this.formatString = params[0];
... | [
"function",
"(",
"params",
")",
"{",
"this",
".",
"formatString",
"=",
"''",
";",
"this",
".",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"params",
")",
"{",
"return",
";",
"}",
"params",
"=",
"utils",
".",
"isArray",
"(",
"params",
")",
"?",
... | Definition of the Message class.
If the first parameter in the message is a string that contains "{}", it
is taken to be a format string, and the getFormattedMessage function will
substitute the occurrences of "{}" with the serialization of the other
parameters in order.
@constructor
@param {(string|Object|Array.<(st... | [
"Definition",
"of",
"the",
"Message",
"class",
"."
] | fdc05de2124388780924980e6f27bf4483056d18 | https://github.com/joshfire/woodman/blob/fdc05de2124388780924980e6f27bf4483056d18/lib/message.js#L47-L65 | |
37,587 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/jquery.colorbox.js | setSize | function setSize(size, dimension) {
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
} | javascript | function setSize(size, dimension) {
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
} | [
"function",
"setSize",
"(",
"size",
",",
"dimension",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"(",
"/",
"%",
"/",
".",
"test",
"(",
"size",
")",
"?",
"(",
"(",
"dimension",
"===",
"'x'",
"?",
"$window",
".",
"width",
"(",
")",
":",
"winhei... | Convert '%' and 'px' values to integers | [
"Convert",
"%",
"and",
"px",
"values",
"to",
"integers"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/jquery.colorbox.js#L171-L173 |
37,588 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/jquery.colorbox.js | appendHTML | function appendHTML() {
if (!$box && document.body) {
init = false;
$window = $(window);
$box = $tag(div).attr({
id: colorbox,
'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
role: 'dialog',
tabindex: '-1'
}).hide();
$overlay = ... | javascript | function appendHTML() {
if (!$box && document.body) {
init = false;
$window = $(window);
$box = $tag(div).attr({
id: colorbox,
'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
role: 'dialog',
tabindex: '-1'
}).hide();
$overlay = ... | [
"function",
"appendHTML",
"(",
")",
"{",
"if",
"(",
"!",
"$box",
"&&",
"document",
".",
"body",
")",
"{",
"init",
"=",
"false",
";",
"$window",
"=",
"$",
"(",
"window",
")",
";",
"$box",
"=",
"$tag",
"(",
"div",
")",
".",
"attr",
"(",
"{",
"id"... | Colorbox's markup needs to be added to the DOM prior to being called so that the browser will go ahead and load the CSS background images. | [
"Colorbox",
"s",
"markup",
"needs",
"to",
"be",
"added",
"to",
"the",
"DOM",
"prior",
"to",
"being",
"called",
"so",
"that",
"the",
"browser",
"will",
"go",
"ahead",
"and",
"load",
"the",
"CSS",
"background",
"images",
"."
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/jquery.colorbox.js#L406-L454 |
37,589 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/jquery.colorbox.js | addBindings | function addBindings() {
function clickHandler(e) {
// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
// See: http://jacklmoore.com/notes/click-events/
if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
e.preventDefault();
launch(this);
... | javascript | function addBindings() {
function clickHandler(e) {
// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
// See: http://jacklmoore.com/notes/click-events/
if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
e.preventDefault();
launch(this);
... | [
"function",
"addBindings",
"(",
")",
"{",
"function",
"clickHandler",
"(",
"e",
")",
"{",
"// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.",
"// See: http://jacklmoore.com/notes/click-events/",
"if",
"(",
"!",
"(",
"e",
".",
"which",
">... | Add Colorbox's event bindings | [
"Add",
"Colorbox",
"s",
"event",
"bindings"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/jquery.colorbox.js#L457-L518 |
37,590 | ToMMApps/express-waf | blocker.js | Blocker | function Blocker(config, logger) {
//DB must define an add, remove and contains function!
if(!(config.db && config.db.add && config.db.remove && config.db.contains)){
throw "db must define an add, remove and contains function";
};
_config = config;
_logger = logger;... | javascript | function Blocker(config, logger) {
//DB must define an add, remove and contains function!
if(!(config.db && config.db.add && config.db.remove && config.db.contains)){
throw "db must define an add, remove and contains function";
};
_config = config;
_logger = logger;... | [
"function",
"Blocker",
"(",
"config",
",",
"logger",
")",
"{",
"//DB must define an add, remove and contains function!",
"if",
"(",
"!",
"(",
"config",
".",
"db",
"&&",
"config",
".",
"db",
".",
"add",
"&&",
"config",
".",
"db",
".",
"remove",
"&&",
"config"... | The Blocker class realizes an IP blocklist that allows other modules to block attackers.
@param config must contain at least an object named db that must have an add, remove and contains function.
Furthermore it allow the user to specifiy a blockTime. If blockTime is not set, entries will never be removed
from Blocklis... | [
"The",
"Blocker",
"class",
"realizes",
"an",
"IP",
"blocklist",
"that",
"allows",
"other",
"modules",
"to",
"block",
"attackers",
"."
] | 5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a | https://github.com/ToMMApps/express-waf/blob/5c2c3ec379722d3ee63b3bf8c5fe65d4a0c0bb6a/blocker.js#L13-L22 |
37,591 | zhengxiaoyao0716/markplus | lib/Render.js | replaceHtml | function replaceHtml(ele, html) {
var _this = this;
if (ele.classList.contains('raw-text')) {
return;
}
ele.innerHTML = withEscape( // eslint-disable-line no-undef
function (html) {
return function (reg, rep) {
return _this.htmlSugars.redu... | javascript | function replaceHtml(ele, html) {
var _this = this;
if (ele.classList.contains('raw-text')) {
return;
}
ele.innerHTML = withEscape( // eslint-disable-line no-undef
function (html) {
return function (reg, rep) {
return _this.htmlSugars.redu... | [
"function",
"replaceHtml",
"(",
"ele",
",",
"html",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"ele",
".",
"classList",
".",
"contains",
"(",
"'raw-text'",
")",
")",
"{",
"return",
";",
"}",
"ele",
".",
"innerHTML",
"=",
"withEscape",
"("... | replace the sugars in the html content.
@param {HTMLElement} ele Element witch the resolved html will be set on.
@param {*} html Html content to be replaced the sugars. | [
"replace",
"the",
"sugars",
"in",
"the",
"html",
"content",
"."
] | fd55e04beb2025b483e78ae5fb711dcbf3083035 | https://github.com/zhengxiaoyao0716/markplus/blob/fd55e04beb2025b483e78ae5fb711dcbf3083035/lib/Render.js#L73-L91 |
37,592 | infrabel/themes-gnap | raw/angular-local-storage/angular-local-storage.js | function() {
try {
return navigator.cookieEnabled ||
("cookie" in $document && ($document.cookie.length > 0 ||
($document.cookie = "test").indexOf.call($document.cookie, "test") > -1));
} catch (e) {
$rootScope.$broadcast('LocalStorageModule.notification.error', e.messa... | javascript | function() {
try {
return navigator.cookieEnabled ||
("cookie" in $document && ($document.cookie.length > 0 ||
($document.cookie = "test").indexOf.call($document.cookie, "test") > -1));
} catch (e) {
$rootScope.$broadcast('LocalStorageModule.notification.error', e.messa... | [
"function",
"(",
")",
"{",
"try",
"{",
"return",
"navigator",
".",
"cookieEnabled",
"||",
"(",
"\"cookie\"",
"in",
"$document",
"&&",
"(",
"$document",
".",
"cookie",
".",
"length",
">",
"0",
"||",
"(",
"$document",
".",
"cookie",
"=",
"\"test\"",
")",
... | Checks the browser to see if cookies are supported | [
"Checks",
"the",
"browser",
"to",
"see",
"if",
"cookies",
"are",
"supported"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/angular-local-storage/angular-local-storage.js#L264-L273 | |
37,593 | infrabel/themes-gnap | raw/ace/mustache/app/views/assets/scripts/jqgrid.js | updatePagerIcons | function updatePagerIcons(table) {
var replacement =
{
'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',
'ui-icon-seek-prev' : 'icon-angle-left bigger-140',
'ui-icon-seek-next' : 'icon-angle-right bigger-140',
'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'
};
$('.ui-pg-table:no... | javascript | function updatePagerIcons(table) {
var replacement =
{
'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',
'ui-icon-seek-prev' : 'icon-angle-left bigger-140',
'ui-icon-seek-next' : 'icon-angle-right bigger-140',
'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'
};
$('.ui-pg-table:no... | [
"function",
"updatePagerIcons",
"(",
"table",
")",
"{",
"var",
"replacement",
"=",
"{",
"'ui-icon-seek-first'",
":",
"'icon-double-angle-left bigger-140'",
",",
"'ui-icon-seek-prev'",
":",
"'icon-angle-left bigger-140'",
",",
"'ui-icon-seek-next'",
":",
"'icon-angle-right big... | replace icons with FontAwesome icons like above | [
"replace",
"icons",
"with",
"FontAwesome",
"icons",
"like",
"above"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/mustache/app/views/assets/scripts/jqgrid.js#L285-L299 |
37,594 | jimivdw/grunt-mutation-testing | lib/karma/KarmaServerManager.js | KarmaServerManager | function KarmaServerManager(config, port, runnerTimeUnlimited) {
this._status = null;
this._serverProcess = null;
this._runnerTimeUnlimited = runnerTimeUnlimited;
this._config = _.merge({ waitForServerTime: 10, waitForRunnerTime: 2 }, config, { port: port });
var notIncluded = this._config.notInclu... | javascript | function KarmaServerManager(config, port, runnerTimeUnlimited) {
this._status = null;
this._serverProcess = null;
this._runnerTimeUnlimited = runnerTimeUnlimited;
this._config = _.merge({ waitForServerTime: 10, waitForRunnerTime: 2 }, config, { port: port });
var notIncluded = this._config.notInclu... | [
"function",
"KarmaServerManager",
"(",
"config",
",",
"port",
",",
"runnerTimeUnlimited",
")",
"{",
"this",
".",
"_status",
"=",
"null",
";",
"this",
".",
"_serverProcess",
"=",
"null",
";",
"this",
".",
"_runnerTimeUnlimited",
"=",
"runnerTimeUnlimited",
";",
... | Constructor for a Karma server instance
@param config {object} Karma configuration object that should be used
@param port {number} The port on which the Karma server should run
@param runnerTimeUnlimited {boolean} if set the KarmaServerManager will not limit the running time of the runner
@constructor | [
"Constructor",
"for",
"a",
"Karma",
"server",
"instance"
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/lib/karma/KarmaServerManager.js#L30-L40 |
37,595 | jimivdw/grunt-mutation-testing | lib/karma/KarmaServerManager.js | startServer | function startServer(serverPromise) {
var self = this,
startTime = Date.now(),
browsersStarting,
serverTimeout,
serverProcess = fork(__dirname + '/KarmaWorker.js', { silent: true });
// Limit the time it can take for a server to start to config.waitForServerTime seconds
serv... | javascript | function startServer(serverPromise) {
var self = this,
startTime = Date.now(),
browsersStarting,
serverTimeout,
serverProcess = fork(__dirname + '/KarmaWorker.js', { silent: true });
// Limit the time it can take for a server to start to config.waitForServerTime seconds
serv... | [
"function",
"startServer",
"(",
"serverPromise",
")",
"{",
"var",
"self",
"=",
"this",
",",
"startTime",
"=",
"Date",
".",
"now",
"(",
")",
",",
"browsersStarting",
",",
"serverTimeout",
",",
"serverProcess",
"=",
"fork",
"(",
"__dirname",
"+",
"'/KarmaWorke... | start a karma server by calling node's "fork" method.
The stdio will be piped to the current process so that it can be read and interpreted | [
"start",
"a",
"karma",
"server",
"by",
"calling",
"node",
"s",
"fork",
"method",
".",
"The",
"stdio",
"will",
"be",
"piped",
"to",
"the",
"current",
"process",
"so",
"that",
"it",
"can",
"be",
"read",
"and",
"interpreted"
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/lib/karma/KarmaServerManager.js#L165-L210 |
37,596 | jimivdw/grunt-mutation-testing | utils/ExclusionUtils.js | parseASTComments | function parseASTComments(astNode) {
var comments = [];
if(astNode && astNode.leadingComments) {
_.forEach(astNode.leadingComments, function(comment) {
if(comment.type === 'Block') {
comments = comments.concat(comment.value.split('\n').map(function(commentLine) {
... | javascript | function parseASTComments(astNode) {
var comments = [];
if(astNode && astNode.leadingComments) {
_.forEach(astNode.leadingComments, function(comment) {
if(comment.type === 'Block') {
comments = comments.concat(comment.value.split('\n').map(function(commentLine) {
... | [
"function",
"parseASTComments",
"(",
"astNode",
")",
"{",
"var",
"comments",
"=",
"[",
"]",
";",
"if",
"(",
"astNode",
"&&",
"astNode",
".",
"leadingComments",
")",
"{",
"_",
".",
"forEach",
"(",
"astNode",
".",
"leadingComments",
",",
"function",
"(",
"... | Parse the comments from a given astNode. It removes all leading asterisks from multiline comments, as
well as all leading and trailing whitespace.
@param {object} astNode the AST node from which comments should be retrieved
@returns {[string]} the comments for the AST node, or an empty array if none could be found | [
"Parse",
"the",
"comments",
"from",
"a",
"given",
"astNode",
".",
"It",
"removes",
"all",
"leading",
"asterisks",
"from",
"multiline",
"comments",
"as",
"well",
"as",
"all",
"leading",
"and",
"trailing",
"whitespace",
"."
] | 698b1b20813cd7d46cf44f09cc016f5cd6460f5f | https://github.com/jimivdw/grunt-mutation-testing/blob/698b1b20813cd7d46cf44f09cc016f5cd6460f5f/utils/ExclusionUtils.js#L22-L38 |
37,597 | joshfire/woodman | precompile/precompile.js | function (node, nodeType) {
var parentNode = node;
var levelNode = 0; // Security in while loop
while ((parentNode.type !== nodeType) &&
(parentNode.parent !== undefined) &&
(levelNode <= 20)) {
levelNode++;
parentNode = parentNode.parent;
}
parentNode.levelNode = levelNo... | javascript | function (node, nodeType) {
var parentNode = node;
var levelNode = 0; // Security in while loop
while ((parentNode.type !== nodeType) &&
(parentNode.parent !== undefined) &&
(levelNode <= 20)) {
levelNode++;
parentNode = parentNode.parent;
}
parentNode.levelNode = levelNo... | [
"function",
"(",
"node",
",",
"nodeType",
")",
"{",
"var",
"parentNode",
"=",
"node",
";",
"var",
"levelNode",
"=",
"0",
";",
"// Security in while loop",
"while",
"(",
"(",
"parentNode",
".",
"type",
"!==",
"nodeType",
")",
"&&",
"(",
"parentNode",
".",
... | Returns the first ancestor of the given node in the AST tree that has the
specified node type.
@function
@param {Object} node The node to start from in the AST tree
@param {string} nodeType The type of node you are searching for,
e.g. "VariableDeclaration", "ExpressionStatement"...
@return {Object} The first node in t... | [
"Returns",
"the",
"first",
"ancestor",
"of",
"the",
"given",
"node",
"in",
"the",
"AST",
"tree",
"that",
"has",
"the",
"specified",
"node",
"type",
"."
] | fdc05de2124388780924980e6f27bf4483056d18 | https://github.com/joshfire/woodman/blob/fdc05de2124388780924980e6f27bf4483056d18/precompile/precompile.js#L124-L135 | |
37,598 | peerigon/alamid-schema | plugins/validation/index.js | runValidation | function runValidation(validators, field, context, callback) {
var fieldErrors = [];
var pending = 0;
function saveResult(result) {
if (result !== true) {
fieldErrors.push(result);
}
}
function doCallback() {
callback(fieldErrors);
}
function asyncValid... | javascript | function runValidation(validators, field, context, callback) {
var fieldErrors = [];
var pending = 0;
function saveResult(result) {
if (result !== true) {
fieldErrors.push(result);
}
}
function doCallback() {
callback(fieldErrors);
}
function asyncValid... | [
"function",
"runValidation",
"(",
"validators",
",",
"field",
",",
"context",
",",
"callback",
")",
"{",
"var",
"fieldErrors",
"=",
"[",
"]",
";",
"var",
"pending",
"=",
"0",
";",
"function",
"saveResult",
"(",
"result",
")",
"{",
"if",
"(",
"result",
... | Runs the given validators on a single field.
Caution: callback will be called in synchronously in some situations. This behavior should usually be avoided in
public APIs, but since runValidation() is internal, we know how to deal with it. It allows us to speed up
validation and to return all synchronous validation res... | [
"Runs",
"the",
"given",
"validators",
"on",
"a",
"single",
"field",
"."
] | 7faa6e826f485b33ccc2e41b86b5861c61184a3c | https://github.com/peerigon/alamid-schema/blob/7faa6e826f485b33ccc2e41b86b5861c61184a3c/plugins/validation/index.js#L21-L56 |
37,599 | peerigon/alamid-schema | plugins/validation/validators.js | matchesValidator | function matchesValidator(match) {
return function matchValue(value) {
var result;
if (typeof match.test === "function") {
match.lastIndex = 0; // reset the lastIndex just in case the regexp is accidentally global
result = match.test(value);
} else {
resu... | javascript | function matchesValidator(match) {
return function matchValue(value) {
var result;
if (typeof match.test === "function") {
match.lastIndex = 0; // reset the lastIndex just in case the regexp is accidentally global
result = match.test(value);
} else {
resu... | [
"function",
"matchesValidator",
"(",
"match",
")",
"{",
"return",
"function",
"matchValue",
"(",
"value",
")",
"{",
"var",
"result",
";",
"if",
"(",
"typeof",
"match",
".",
"test",
"===",
"\"function\"",
")",
"{",
"match",
".",
"lastIndex",
"=",
"0",
";"... | Returns true if the given value matches the pattern. The pattern
may be a value or a regular expression. If it's a value, a strict comparison
will be performed. In case it's a regex, the test method will be invoked.
@param {*|RegExp} match
@returns {Function} | [
"Returns",
"true",
"if",
"the",
"given",
"value",
"matches",
"the",
"pattern",
".",
"The",
"pattern",
"may",
"be",
"a",
"value",
"or",
"a",
"regular",
"expression",
".",
"If",
"it",
"s",
"a",
"value",
"a",
"strict",
"comparison",
"will",
"be",
"performed... | 7faa6e826f485b33ccc2e41b86b5861c61184a3c | https://github.com/peerigon/alamid-schema/blob/7faa6e826f485b33ccc2e41b86b5861c61184a3c/plugins/validation/validators.js#L94-L107 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.