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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
38,400 | imbo/imboclient-js | lib/client.js | function(publicKey, expandGroups, callback) {
var qs = '';
if (!callback && typeof expandGroups === 'function') {
callback = expandGroups;
} else if (expandGroups) {
qs = '?expandGroups=1';
}
request.get(
this.getResourceUrl({ path: '/keys/' +... | javascript | function(publicKey, expandGroups, callback) {
var qs = '';
if (!callback && typeof expandGroups === 'function') {
callback = expandGroups;
} else if (expandGroups) {
qs = '?expandGroups=1';
}
request.get(
this.getResourceUrl({ path: '/keys/' +... | [
"function",
"(",
"publicKey",
",",
"expandGroups",
",",
"callback",
")",
"{",
"var",
"qs",
"=",
"''",
";",
"if",
"(",
"!",
"callback",
"&&",
"typeof",
"expandGroups",
"===",
"'function'",
")",
"{",
"callback",
"=",
"expandGroups",
";",
"}",
"else",
"if",... | Get a list of access control rules for a given public key
@param {String} publicKey
@param {Boolean} expandGroups
@param {Function} callback
@return {ImboClient} | [
"Get",
"a",
"list",
"of",
"access",
"control",
"rules",
"for",
"a",
"given",
"public",
"key"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L843-L858 | |
38,401 | imbo/imboclient-js | lib/client.js | function(publicKey, aclRuleId, callback) {
request.get(
this.getResourceUrl({
path: '/keys/' + publicKey + '/access/' + aclRuleId,
user: null
}),
function onAccessControlRulesResponse(err, res, body) {
callback(err, body, res);
... | javascript | function(publicKey, aclRuleId, callback) {
request.get(
this.getResourceUrl({
path: '/keys/' + publicKey + '/access/' + aclRuleId,
user: null
}),
function onAccessControlRulesResponse(err, res, body) {
callback(err, body, res);
... | [
"function",
"(",
"publicKey",
",",
"aclRuleId",
",",
"callback",
")",
"{",
"request",
".",
"get",
"(",
"this",
".",
"getResourceUrl",
"(",
"{",
"path",
":",
"'/keys/'",
"+",
"publicKey",
"+",
"'/access/'",
"+",
"aclRuleId",
",",
"user",
":",
"null",
"}",... | Get the details for the access control rule with the given ID
@param {String} publicKey
@param {String} aclRuleId
@param {Function} callback
@return {ImboClient} | [
"Get",
"the",
"details",
"for",
"the",
"access",
"control",
"rule",
"with",
"the",
"given",
"ID"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L868-L879 | |
38,402 | imbo/imboclient-js | lib/client.js | function(publicKey, rules, callback) {
if (!Array.isArray(rules)) {
rules = [rules];
}
if (!publicKey) {
throw new Error('Public key must be a valid string');
}
var url = this.getResourceUrl({ path: '/keys/' + publicKey + '/access', user: null });
... | javascript | function(publicKey, rules, callback) {
if (!Array.isArray(rules)) {
rules = [rules];
}
if (!publicKey) {
throw new Error('Public key must be a valid string');
}
var url = this.getResourceUrl({ path: '/keys/' + publicKey + '/access', user: null });
... | [
"function",
"(",
"publicKey",
",",
"rules",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"rules",
")",
")",
"{",
"rules",
"=",
"[",
"rules",
"]",
";",
"}",
"if",
"(",
"!",
"publicKey",
")",
"{",
"throw",
"new",
"Error"... | Add one or more access control rules to the given public key
@param {String} publicKey The public key to add rules to
@param {Array} rules Array of access control rules to add
@param {Function} callback
@return {ImboClient} | [
"Add",
"one",
"or",
"more",
"access",
"control",
"rules",
"to",
"the",
"given",
"public",
"key"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L889-L910 | |
38,403 | imbo/imboclient-js | lib/client.js | function(imageUrl, callback) {
readers.getContentsFromUrl(imageUrl.toString(), function(err, data) {
callback(err, err ? null : data);
});
return this;
} | javascript | function(imageUrl, callback) {
readers.getContentsFromUrl(imageUrl.toString(), function(err, data) {
callback(err, err ? null : data);
});
return this;
} | [
"function",
"(",
"imageUrl",
",",
"callback",
")",
"{",
"readers",
".",
"getContentsFromUrl",
"(",
"imageUrl",
".",
"toString",
"(",
")",
",",
"function",
"(",
"err",
",",
"data",
")",
"{",
"callback",
"(",
"err",
",",
"err",
"?",
"null",
":",
"data",
... | Get the binary data of an image, specified by URL
@param {String} imageUrl
@param {Function} callback
@return {ImboClient} | [
"Get",
"the",
"binary",
"data",
"of",
"an",
"image",
"specified",
"by",
"URL"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L951-L957 | |
38,404 | imbo/imboclient-js | lib/client.js | function(imageIdentifier, usePrimary) {
if (usePrimary) {
return this.options.hosts[0];
}
var dec = imageIdentifier.charCodeAt(imageIdentifier.length - 1);
// If this is an old image identifier (32 character hex string),
// maintain backwards compatibility
i... | javascript | function(imageIdentifier, usePrimary) {
if (usePrimary) {
return this.options.hosts[0];
}
var dec = imageIdentifier.charCodeAt(imageIdentifier.length - 1);
// If this is an old image identifier (32 character hex string),
// maintain backwards compatibility
i... | [
"function",
"(",
"imageIdentifier",
",",
"usePrimary",
")",
"{",
"if",
"(",
"usePrimary",
")",
"{",
"return",
"this",
".",
"options",
".",
"hosts",
"[",
"0",
"]",
";",
"}",
"var",
"dec",
"=",
"imageIdentifier",
".",
"charCodeAt",
"(",
"imageIdentifier",
... | Get a predictable hostname for the given image identifier
@param {String} imageIdentifier
@param {Boolean} [usePrimary=false] Whether to use the primary host
@return {String} | [
"Get",
"a",
"predictable",
"hostname",
"for",
"the",
"given",
"image",
"identifier"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L966-L980 | |
38,405 | imbo/imboclient-js | lib/client.js | function(method, url, timestamp) {
var data = [method, url, this.options.publicKey, timestamp].join('|'),
signature = crypto.sha256(this.options.privateKey, data);
return signature;
} | javascript | function(method, url, timestamp) {
var data = [method, url, this.options.publicKey, timestamp].join('|'),
signature = crypto.sha256(this.options.privateKey, data);
return signature;
} | [
"function",
"(",
"method",
",",
"url",
",",
"timestamp",
")",
"{",
"var",
"data",
"=",
"[",
"method",
",",
"url",
",",
"this",
".",
"options",
".",
"publicKey",
",",
"timestamp",
"]",
".",
"join",
"(",
"'|'",
")",
",",
"signature",
"=",
"crypto",
"... | Generate a signature for the given parameters
@param {String} method
@param {String} url
@param {String} timestamp
@return {String} | [
"Generate",
"a",
"signature",
"for",
"the",
"given",
"parameters"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L1018-L1023 | |
38,406 | imbo/imboclient-js | lib/client.js | function(method, url, date) {
var timestamp = (date || new Date()).toISOString().replace(/\.\d+Z$/, 'Z'),
addPubKey = this.options.user !== this.options.publicKey,
qs = url.toString().indexOf('?') > -1 ? '&' : '?',
signUrl = addPubKey ? url + qs + 'publicKey=' + this.options.... | javascript | function(method, url, date) {
var timestamp = (date || new Date()).toISOString().replace(/\.\d+Z$/, 'Z'),
addPubKey = this.options.user !== this.options.publicKey,
qs = url.toString().indexOf('?') > -1 ? '&' : '?',
signUrl = addPubKey ? url + qs + 'publicKey=' + this.options.... | [
"function",
"(",
"method",
",",
"url",
",",
"date",
")",
"{",
"var",
"timestamp",
"=",
"(",
"date",
"||",
"new",
"Date",
"(",
")",
")",
".",
"toISOString",
"(",
")",
".",
"replace",
"(",
"/",
"\\.\\d+Z$",
"/",
",",
"'Z'",
")",
",",
"addPubKey",
"... | Get a signed version of a given URL
@param {String} method - HTTP method
@param {String} url - Endpoint URL
@param {Date} [date] - Date to use for signing request
@return {String} | [
"Get",
"a",
"signed",
"version",
"of",
"a",
"given",
"URL"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/client.js#L1033-L1045 | |
38,407 | DimitarChristoff/primish | options.js | function(options){
var option,
o;
this.options || (this.options = {});
o = this.options = primish.merge(primish.clone(this.options), options);
// add the events as well, if class has events.
if ((this.on && this.off))
for (option in o){
if (o.hasOwnProperty(option)){
if (typeof o[opt... | javascript | function(options){
var option,
o;
this.options || (this.options = {});
o = this.options = primish.merge(primish.clone(this.options), options);
// add the events as well, if class has events.
if ((this.on && this.off))
for (option in o){
if (o.hasOwnProperty(option)){
if (typeof o[opt... | [
"function",
"(",
"options",
")",
"{",
"var",
"option",
",",
"o",
";",
"this",
".",
"options",
"||",
"(",
"this",
".",
"options",
"=",
"{",
"}",
")",
";",
"o",
"=",
"this",
".",
"options",
"=",
"primish",
".",
"merge",
"(",
"primish",
".",
"clone"... | a mixin class that allows for this.setOptions | [
"a",
"mixin",
"class",
"that",
"allows",
"for",
"this",
".",
"setOptions"
] | b80d54e346c8d5594254e95db0936be72264e4b4 | https://github.com/DimitarChristoff/primish/blob/b80d54e346c8d5594254e95db0936be72264e4b4/options.js#L25-L42 | |
38,408 | Schoonology/discovery | lib/service.js | Service | function Service(options) {
if (!(this instanceof Service)) {
return new Service(options);
}
options = options || {};
debug('New Service: %j', options);
// There's no reasonable way to protect this, so we let it be writable with
// the understanding that .update is called in the future. TL;DR - Write... | javascript | function Service(options) {
if (!(this instanceof Service)) {
return new Service(options);
}
options = options || {};
debug('New Service: %j', options);
// There's no reasonable way to protect this, so we let it be writable with
// the understanding that .update is called in the future. TL;DR - Write... | [
"function",
"Service",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Service",
")",
")",
"{",
"return",
"new",
"Service",
"(",
"options",
")",
";",
"}",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"debug",
"(",
"'New Servi... | Creates a new instance of Service with the provided `options`.
A Service is a simple wrapper around its `data` to ease managing the
Service's representation within its Registry and the announcements thereof.
For more information, see the README.
@param {Object} options | [
"Creates",
"a",
"new",
"instance",
"of",
"Service",
"with",
"the",
"provided",
"options",
"."
] | 9d123d74c13f8c9b6904e409f8933b09ab22e175 | https://github.com/Schoonology/discovery/blob/9d123d74c13f8c9b6904e409f8933b09ab22e175/lib/service.js#L19-L37 |
38,409 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
options = options || {};
var params = [
'color=' + (options.color || '000000').replace(/^#/, ''),
'width=' + toInt(options.width || 1),
'height=' + toInt(options.height || 1),
'mode=' + (options.mode || 'outbound')
];
... | javascript | function(options) {
options = options || {};
var params = [
'color=' + (options.color || '000000').replace(/^#/, ''),
'width=' + toInt(options.width || 1),
'height=' + toInt(options.height || 1),
'mode=' + (options.mode || 'outbound')
];
... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"params",
"=",
"[",
"'color='",
"+",
"(",
"options",
".",
"color",
"||",
"'000000'",
")",
".",
"replace",
"(",
"/",
"^#",
"/",
",",
"''",
")",
",",
"'wid... | Add a border to the image
@param {Object} [options={}]
@param {String} [options.color=000000] Color of the border (in hex-format)
@param {Number} [options.width=1] Width of the left and right borders
@param {Number} [options.height=1] Height of the top and bottom borders
@param {String} [options.mode=... | [
"Add",
"a",
"border",
"to",
"the",
"image"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L72-L83 | |
38,410 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
options = options || {};
if (!options.width || !options.height) {
throw new Error('width and height must be specified');
}
var params = [
'width=' + toInt(options.width),
'height=' + toInt(options.height)
];
if (o... | javascript | function(options) {
options = options || {};
if (!options.width || !options.height) {
throw new Error('width and height must be specified');
}
var params = [
'width=' + toInt(options.width),
'height=' + toInt(options.height)
];
if (o... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"options",
".",
"width",
"||",
"!",
"options",
".",
"height",
")",
"{",
"throw",
"new",
"Error",
"(",
"'width and height must be specified'",
")",
";",
... | Puts the image inside a canvas
@param {Object} options
@param {Number} options.width Width of the canvas
@param {Number} options.height Height of the canvas
@param {String} [options.mode] Placement mode: "free", "center", "center-x" or "center-y"
@param {Number} [options.x] X coordinate of the placement of th... | [
"Puts",
"the",
"image",
"inside",
"a",
"canvas"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L97-L126 | |
38,411 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
var params = [],
opts = options || {},
transform = 'contrast';
if (opts.sharpen) {
params.push('sharpen=' + opts.sharpen);
}
if (params.length) {
transform += ':' + params.join(',');
}
return this.appe... | javascript | function(options) {
var params = [],
opts = options || {},
transform = 'contrast';
if (opts.sharpen) {
params.push('sharpen=' + opts.sharpen);
}
if (params.length) {
transform += ':' + params.join(',');
}
return this.appe... | [
"function",
"(",
"options",
")",
"{",
"var",
"params",
"=",
"[",
"]",
",",
"opts",
"=",
"options",
"||",
"{",
"}",
",",
"transform",
"=",
"'contrast'",
";",
"if",
"(",
"opts",
".",
"sharpen",
")",
"{",
"params",
".",
"push",
"(",
"'sharpen='",
"+",... | Adjust contrast in the image
@param {Object} [options={}]
@param {Number} [options.sharpen] Change in contrast given as number of steps up (positive
number) or down (negative number)
@return {Imbo.ImageUrl} | [
"Adjust",
"contrast",
"in",
"the",
"image"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L148-L162 | |
38,412 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
var opts = options || {},
mode = opts.mode,
x = opts.x,
y = opts.y,
width = opts.width,
height = opts.height;
if (!mode && (isNaN(x) || isNaN(y))) {
throw new Error('x and y needs to be specified without a crop ... | javascript | function(options) {
var opts = options || {},
mode = opts.mode,
x = opts.x,
y = opts.y,
width = opts.width,
height = opts.height;
if (!mode && (isNaN(x) || isNaN(y))) {
throw new Error('x and y needs to be specified without a crop ... | [
"function",
"(",
"options",
")",
"{",
"var",
"opts",
"=",
"options",
"||",
"{",
"}",
",",
"mode",
"=",
"opts",
".",
"mode",
",",
"x",
"=",
"opts",
".",
"x",
",",
"y",
"=",
"opts",
".",
"y",
",",
"width",
"=",
"opts",
".",
"width",
",",
"heigh... | Crops the image using specified parameters
@param {Object} options
@param {String} [options.mode] Crop mode: "center-x" or "center-y" (available in Imbo >= 1.1.0)
@param {Number} [options.x] X coordinate of the top left corner of the crop
@param {Number} [options.y] Y coordinate of the top left corner of the... | [
"Crops",
"the",
"image",
"using",
"specified",
"parameters"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L186-L224 | |
38,413 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
var params = [];
if (options.width) {
params.push('width=' + toInt(options.width));
}
if (options.height) {
params.push('height=' + toInt(options.height));
}
if (!params.length) {
throw new Error('width and/or hei... | javascript | function(options) {
var params = [];
if (options.width) {
params.push('width=' + toInt(options.width));
}
if (options.height) {
params.push('height=' + toInt(options.height));
}
if (!params.length) {
throw new Error('width and/or hei... | [
"function",
"(",
"options",
")",
"{",
"var",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"options",
".",
"width",
")",
"{",
"params",
".",
"push",
"(",
"'width='",
"+",
"toInt",
"(",
"options",
".",
"width",
")",
")",
";",
"}",
"if",
"(",
"options",... | Resize the image to be at most the size specified while still preserving
the aspect ratio. If the image is smaller than the given size, the image
remains unchanged
@param {Object} options
@param {Number} [options.width] Max width of the image
@param {Number} [options.height] Max height of the image
@return {Imbo.I... | [
"Resize",
"the",
"image",
"to",
"be",
"at",
"most",
"the",
"size",
"specified",
"while",
"still",
"preserving",
"the",
"aspect",
"ratio",
".",
"If",
"the",
"image",
"is",
"smaller",
"than",
"the",
"given",
"size",
"the",
"image",
"remains",
"unchanged"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L263-L279 | |
38,414 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
if (!options || isNaN(options.angle)) {
throw new Error('angle needs to be specified');
}
var bg = (options.bg || '000000').replace(/^#/, '');
return this.append('rotate:angle=' + options.angle + ',bg=' + bg);
} | javascript | function(options) {
if (!options || isNaN(options.angle)) {
throw new Error('angle needs to be specified');
}
var bg = (options.bg || '000000').replace(/^#/, '');
return this.append('rotate:angle=' + options.angle + ',bg=' + bg);
} | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"options",
"||",
"isNaN",
"(",
"options",
".",
"angle",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'angle needs to be specified'",
")",
";",
"}",
"var",
"bg",
"=",
"(",
"options",
".",
"bg",
"|... | Rotate the image by the specified angle
@param {Object} options
@param {Number} options.angle Angle to rotate by
@param {String} [options.bg] Background color of image, in hex-format
@return {Imbo.ImageUrl} | [
"Rotate",
"the",
"image",
"by",
"the",
"specified",
"angle"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L357-L364 | |
38,415 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
var params = [],
opts = options || {},
transform = 'sharpen';
if (opts.preset) {
params.push('preset=' + opts.preset);
}
if (typeof opts.radius !== 'undefined') {
params.push('radius=' + opts.radius);
}
... | javascript | function(options) {
var params = [],
opts = options || {},
transform = 'sharpen';
if (opts.preset) {
params.push('preset=' + opts.preset);
}
if (typeof opts.radius !== 'undefined') {
params.push('radius=' + opts.radius);
}
... | [
"function",
"(",
"options",
")",
"{",
"var",
"params",
"=",
"[",
"]",
",",
"opts",
"=",
"options",
"||",
"{",
"}",
",",
"transform",
"=",
"'sharpen'",
";",
"if",
"(",
"opts",
".",
"preset",
")",
"{",
"params",
".",
"push",
"(",
"'preset='",
"+",
... | Sharpen the image
@param {Object} [options]
@param {String} [options.preset] Name of a defined preset to use
@param {Number} [options.radius=2] Radius of the Gaussian operator in pixels
@param {Number} [options.sigma=1] Standard deviation of the Gaussian, in pixels
@param {Number} [options.ga... | [
"Sharpen",
"the",
"image"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L390-L420 | |
38,416 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
options = options || {};
return this.append([
'thumbnail:width=' + (options.width || 50),
'height=' + (options.height || 50),
'fit=' + (options.fit || 'outbound')
].join(','));
} | javascript | function(options) {
options = options || {};
return this.append([
'thumbnail:width=' + (options.width || 50),
'height=' + (options.height || 50),
'fit=' + (options.fit || 'outbound')
].join(','));
} | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"return",
"this",
".",
"append",
"(",
"[",
"'thumbnail:width='",
"+",
"(",
"options",
".",
"width",
"||",
"50",
")",
",",
"'height='",
"+",
"(",
"options",
".",
"he... | Create a thumbnailed version of the image
@param {Object} [options]
@param {Number} [options.width=50] Width of the thumbnail
@param {Number} [options.height=50] Height of the thumbnail
@param {String} [options.fit=outbound] Fit mode: "outbound" or "inset"
@return {Imbo.ImageUrl} | [
"Create",
"a",
"thumbnailed",
"version",
"of",
"the",
"image"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L481-L489 | |
38,417 | imbo/imboclient-js | lib/url/imageurl.js | function(options) {
options = options || {};
var params = [
'position=' + (options.position || 'top-left'),
'x=' + toInt(options.x || 0),
'y=' + toInt(options.y || 0)
];
if (options.imageIdentifier) {
params.push('img=' + options.imageIde... | javascript | function(options) {
options = options || {};
var params = [
'position=' + (options.position || 'top-left'),
'x=' + toInt(options.x || 0),
'y=' + toInt(options.y || 0)
];
if (options.imageIdentifier) {
params.push('img=' + options.imageIde... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"params",
"=",
"[",
"'position='",
"+",
"(",
"options",
".",
"position",
"||",
"'top-left'",
")",
",",
"'x='",
"+",
"toInt",
"(",
"options",
".",
"x",
"||",
... | Applies a watermark on top of the original image
@param {Object} [options]
@param {Number} [options.img] Image identifier of the image to apply as watermark
@param {Number} [options.width] Width of the watermark, in pixels
@param {Number} [options.height] Height of the watermark, in pixels
@param {String} [optio... | [
"Applies",
"a",
"watermark",
"on",
"top",
"of",
"the",
"original",
"image"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L524-L546 | |
38,418 | imbo/imboclient-js | lib/url/imageurl.js | function() {
return new ImageUrl({
transformations: this.transformations.slice(0),
baseUrl: this.rootUrl,
user: this.user,
publicKey: this.publicKey,
privateKey: this.privateKey,
imageIdentifier: this.imageIdentifier,
extension:... | javascript | function() {
return new ImageUrl({
transformations: this.transformations.slice(0),
baseUrl: this.rootUrl,
user: this.user,
publicKey: this.publicKey,
privateKey: this.privateKey,
imageIdentifier: this.imageIdentifier,
extension:... | [
"function",
"(",
")",
"{",
"return",
"new",
"ImageUrl",
"(",
"{",
"transformations",
":",
"this",
".",
"transformations",
".",
"slice",
"(",
"0",
")",
",",
"baseUrl",
":",
"this",
".",
"rootUrl",
",",
"user",
":",
"this",
".",
"user",
",",
"publicKey",... | Clone this ImageUrl instance
@return {Imbo.ImageUrl} | [
"Clone",
"this",
"ImageUrl",
"instance"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L592-L604 | |
38,419 | imbo/imboclient-js | lib/url/imageurl.js | function(encode) {
var query = this.queryString || '',
transformations = this.transformations,
transformationKey = encode ? 't%5B%5D=' : 't[]=';
if (encode) {
transformations = transformations.map(encodeURIComponent);
}
if (this.transformations.lengt... | javascript | function(encode) {
var query = this.queryString || '',
transformations = this.transformations,
transformationKey = encode ? 't%5B%5D=' : 't[]=';
if (encode) {
transformations = transformations.map(encodeURIComponent);
}
if (this.transformations.lengt... | [
"function",
"(",
"encode",
")",
"{",
"var",
"query",
"=",
"this",
".",
"queryString",
"||",
"''",
",",
"transformations",
"=",
"this",
".",
"transformations",
",",
"transformationKey",
"=",
"encode",
"?",
"'t%5B%5D='",
":",
"'t[]='",
";",
"if",
"(",
"encod... | Get the query string with all transformations applied
@param {Boolean} [encode=false]
@return {String} | [
"Get",
"the",
"query",
"string",
"with",
"all",
"transformations",
"applied"
] | 809dcc489528dca9d67f49b03b612a99704339d0 | https://github.com/imbo/imboclient-js/blob/809dcc489528dca9d67f49b03b612a99704339d0/lib/url/imageurl.js#L650-L665 | |
38,420 | rootsdev/gedcomx-js | src/core/Identifiers.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Identifiers)){
return new Identifiers(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Identifiers.isInstance(json)){
return json;
}
... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Identifiers)){
return new Identifiers(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Identifiers.isInstance(json)){
return json;
}
... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Identifiers",
")",
")",
"{",
"return",
"new",
"Identifiers",
"(",
"json",
")",
";",
"}",
"// If the given objec... | Manage the set of identifers for an object.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#identifier-type|GEDCOM X JSON Spec}
@class
@extends Base
@param {Object} [json] | [
"Manage",
"the",
"set",
"of",
"identifers",
"for",
"an",
"object",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Identifiers.js#L13-L26 | |
38,421 | blaxk/ixband | dist/ixBand_1.2.js | function ( value ) {
if ( this.isObject(value) ) {
//$('.touch_area').get(0).constructor.toString()
return !!( value && value.nodeType === 1 && value.nodeName );
} else {
return /HTML(?:.*)Element/.test( Object.prototype.toString.call(value) );
... | javascript | function ( value ) {
if ( this.isObject(value) ) {
//$('.touch_area').get(0).constructor.toString()
return !!( value && value.nodeType === 1 && value.nodeName );
} else {
return /HTML(?:.*)Element/.test( Object.prototype.toString.call(value) );
... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"this",
".",
"isObject",
"(",
"value",
")",
")",
"{",
"//$('.touch_area').get(0).constructor.toString()",
"return",
"!",
"!",
"(",
"value",
"&&",
"value",
".",
"nodeType",
"===",
"1",
"&&",
"value",
".",
"node... | Element, HTMLElement, NodeElement check | [
"Element",
"HTMLElement",
"NodeElement",
"check"
] | 1f1ab638ea6dd633c31cf3f2bef97d121f63084f | https://github.com/blaxk/ixband/blob/1f1ab638ea6dd633c31cf3f2bef97d121f63084f/dist/ixBand_1.2.js#L507-L514 | |
38,422 | blaxk/ixband | dist/ixBand_1.2.js | function ( type ) {
if ( /pointerdown/i.test(type) ) {
type = 'touchstart';
} else if ( /pointermove/i.test(type) ) {
type = 'touchmove';
} else if ( /pointerup/i.test(type) ) {
type = 'touchend';
} else if ( /pointercancel/... | javascript | function ( type ) {
if ( /pointerdown/i.test(type) ) {
type = 'touchstart';
} else if ( /pointermove/i.test(type) ) {
type = 'touchmove';
} else if ( /pointerup/i.test(type) ) {
type = 'touchend';
} else if ( /pointercancel/... | [
"function",
"(",
"type",
")",
"{",
"if",
"(",
"/",
"pointerdown",
"/",
"i",
".",
"test",
"(",
"type",
")",
")",
"{",
"type",
"=",
"'touchstart'",
";",
"}",
"else",
"if",
"(",
"/",
"pointermove",
"/",
"i",
".",
"test",
"(",
"type",
")",
")",
"{"... | origin event type to cross event type | [
"origin",
"event",
"type",
"to",
"cross",
"event",
"type"
] | 1f1ab638ea6dd633c31cf3f2bef97d121f63084f | https://github.com/blaxk/ixband/blob/1f1ab638ea6dd633c31cf3f2bef97d121f63084f/dist/ixBand_1.2.js#L5790-L5802 | |
38,423 | Hypermediaisobar-admin/node-any-db-mssql | index.js | function(anyConfig) {
var result = {};
result.userName = anyConfig.user || anyConfig.userName || defaultConfig.userName;
result.password = anyConfig.password || defaultConfig.password;
result.server = anyConfig.host || anyConfig.server || defaultConfig.host;
result.options = any... | javascript | function(anyConfig) {
var result = {};
result.userName = anyConfig.user || anyConfig.userName || defaultConfig.userName;
result.password = anyConfig.password || defaultConfig.password;
result.server = anyConfig.host || anyConfig.server || defaultConfig.host;
result.options = any... | [
"function",
"(",
"anyConfig",
")",
"{",
"var",
"result",
"=",
"{",
"}",
";",
"result",
".",
"userName",
"=",
"anyConfig",
".",
"user",
"||",
"anyConfig",
".",
"userName",
"||",
"defaultConfig",
".",
"userName",
";",
"result",
".",
"password",
"=",
"anyCo... | Any DB config.
@external any-db~Config
@see {@link https://github.com/grncdr/node-any-db-adapter-spec#adaptercreateconnection}
Convert config provided by Any DB to the one used by Tedious.
@private
@param {any-db~Config} anyConfig
@return {Tedious~Config} | [
"Any",
"DB",
"config",
"."
] | 325922af18554bc5db703034d966d666407671db | https://github.com/Hypermediaisobar-admin/node-any-db-mssql/blob/325922af18554bc5db703034d966d666407671db/index.js#L63-L81 | |
38,424 | Hypermediaisobar-admin/node-any-db-mssql | index.js | function(request, parameters) {
if (!parameters) {
return;
}
var keys = Object.keys(parameters);
var type = false;
var value = null;
var options = null;
for (var i = keys.length - 1; i >= 0; i--) {
value = parameters[keys[i]];
options = null;
if (value instanceof Object && value.type && value.hasOwnPro... | javascript | function(request, parameters) {
if (!parameters) {
return;
}
var keys = Object.keys(parameters);
var type = false;
var value = null;
var options = null;
for (var i = keys.length - 1; i >= 0; i--) {
value = parameters[keys[i]];
options = null;
if (value instanceof Object && value.type && value.hasOwnPro... | [
"function",
"(",
"request",
",",
"parameters",
")",
"{",
"if",
"(",
"!",
"parameters",
")",
"{",
"return",
";",
"}",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"parameters",
")",
";",
"var",
"type",
"=",
"false",
";",
"var",
"value",
"=",
"nul... | Tedious' Request object.
@external Tedious~Request
@see {@link http://pekim.github.io/tedious/api-request.html}
Add parameters to the request.
@private
@param {Tedious~Request} request
@param {namedParameters|positionalParameters} [parameters] | [
"Tedious",
"Request",
"object",
"."
] | 325922af18554bc5db703034d966d666407671db | https://github.com/Hypermediaisobar-admin/node-any-db-mssql/blob/325922af18554bc5db703034d966d666407671db/index.js#L292-L321 | |
38,425 | Hypermediaisobar-admin/node-any-db-mssql | index.js | function(target) {
target.adapter = exports;
target.query = execQuery.bind(target);
// Tedious cannot execute more than one query at a time, so we have to
// implement a queue for queries, just in case someone tries to set
// multiple queries in a row (like node-any-db-adapter-spec tests do).
target._queue = [];... | javascript | function(target) {
target.adapter = exports;
target.query = execQuery.bind(target);
// Tedious cannot execute more than one query at a time, so we have to
// implement a queue for queries, just in case someone tries to set
// multiple queries in a row (like node-any-db-adapter-spec tests do).
target._queue = [];... | [
"function",
"(",
"target",
")",
"{",
"target",
".",
"adapter",
"=",
"exports",
";",
"target",
".",
"query",
"=",
"execQuery",
".",
"bind",
"(",
"target",
")",
";",
"// Tedious cannot execute more than one query at a time, so we have to",
"// implement a queue for querie... | Inject Queryable API into object.
@private
@param {Object} target
@return {any-db~Queryable} target object with Queryable API injected | [
"Inject",
"Queryable",
"API",
"into",
"object",
"."
] | 325922af18554bc5db703034d966d666407671db | https://github.com/Hypermediaisobar-admin/node-any-db-mssql/blob/325922af18554bc5db703034d966d666407671db/index.js#L535-L574 | |
38,426 | AckerApple/ack-node | js/modules/router.js | htmlCloseError | function htmlCloseError(options) {
options = options || {};
options.debugLocalNetwork = options.debugLocalNetwork == null ? true : options.debugLocalNetwork;
return function (err, req, res, next) {
var msg = err.message || err.code;
res.statusCode = err.status || err.statusCode || 500;
... | javascript | function htmlCloseError(options) {
options = options || {};
options.debugLocalNetwork = options.debugLocalNetwork == null ? true : options.debugLocalNetwork;
return function (err, req, res, next) {
var msg = err.message || err.code;
res.statusCode = err.status || err.statusCode || 500;
... | [
"function",
"htmlCloseError",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"options",
".",
"debugLocalNetwork",
"=",
"options",
".",
"debugLocalNetwork",
"==",
"null",
"?",
"true",
":",
"options",
".",
"debugLocalNetwork",
";",
"... | Returns universal error handler middleware
@options {debug:true/false, debugLocalNetwork:true} | [
"Returns",
"universal",
"error",
"handler",
"middleware"
] | c123d3fcbdd0195630fece6dc9ddee8910c9e115 | https://github.com/AckerApple/ack-node/blob/c123d3fcbdd0195630fece6dc9ddee8910c9e115/js/modules/router.js#L572-L599 |
38,427 | AckerApple/ack-node | js/modules/router.js | jsonCloseError | function jsonCloseError(options) {
if (options === void 0) { options = {}; }
options.debugLocalNetwork = options.debugLocalNetwork == null ? true : options.debugLocalNetwork;
return function (err, req, res, next) {
try {
err = toError(err);
var statusMessage = err.message || ... | javascript | function jsonCloseError(options) {
if (options === void 0) { options = {}; }
options.debugLocalNetwork = options.debugLocalNetwork == null ? true : options.debugLocalNetwork;
return function (err, req, res, next) {
try {
err = toError(err);
var statusMessage = err.message || ... | [
"function",
"jsonCloseError",
"(",
"options",
")",
"{",
"if",
"(",
"options",
"===",
"void",
"0",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"options",
".",
"debugLocalNetwork",
"=",
"options",
".",
"debugLocalNetwork",
"==",
"null",
"?",
"true",
":",... | returns middleware that handles errors with JSON style details
@options {debug:true/false, debugLocalNetwork:true} | [
"returns",
"middleware",
"that",
"handles",
"errors",
"with",
"JSON",
"style",
"details"
] | c123d3fcbdd0195630fece6dc9ddee8910c9e115 | https://github.com/AckerApple/ack-node/blob/c123d3fcbdd0195630fece6dc9ddee8910c9e115/js/modules/router.js#L615-L670 |
38,428 | rootsdev/gedcomx-js | src/core/Attribution.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Attribution)){
return new Attribution(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Attribution.isInstance(json)){
return json;
}
... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Attribution)){
return new Attribution(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Attribution.isInstance(json)){
return json;
}
... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Attribution",
")",
")",
"{",
"return",
"new",
"Attribution",
"(",
"json",
")",
";",
"}",
"// If the given objec... | Define who is contributing information, when they contributed it,
and why they are making the contribution.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#attribution|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json] | [
"Define",
"who",
"is",
"contributing",
"information",
"when",
"they",
"contributed",
"it",
"and",
"why",
"they",
"are",
"making",
"the",
"contribution",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Attribution.js#L14-L27 | |
38,429 | ghepesdoru/babel-plugin-module-alias-rn | src/index.js | adaptModulePath | function adaptModulePath(modulePath, state) {
// const fileName = state.file.opts.filename;
const options = getStateOptions(state);
const filesMap = createFilesMap(options);
const rootPath = getRootPath(options);
let module = determineContext(modulePath, options);
// Do not generate infinite cyrcular refe... | javascript | function adaptModulePath(modulePath, state) {
// const fileName = state.file.opts.filename;
const options = getStateOptions(state);
const filesMap = createFilesMap(options);
const rootPath = getRootPath(options);
let module = determineContext(modulePath, options);
// Do not generate infinite cyrcular refe... | [
"function",
"adaptModulePath",
"(",
"modulePath",
",",
"state",
")",
"{",
"// const fileName = state.file.opts.filename;",
"const",
"options",
"=",
"getStateOptions",
"(",
"state",
")",
";",
"const",
"filesMap",
"=",
"createFilesMap",
"(",
"options",
")",
";",
"cons... | Adapts a module path to the context of caller | [
"Adapts",
"a",
"module",
"path",
"to",
"the",
"context",
"of",
"caller"
] | db516c8623c3f598237fab07d164126386140186 | https://github.com/ghepesdoru/babel-plugin-module-alias-rn/blob/db516c8623c3f598237fab07d164126386140186/src/index.js#L201-L322 |
38,430 | rootsdev/gedcomx-js | src/core/Conclusion.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Conclusion)){
return new Conclusion(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Conclusion.isInstance(json)){
return json;
}
th... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Conclusion)){
return new Conclusion(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Conclusion.isInstance(json)){
return json;
}
th... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Conclusion",
")",
")",
"{",
"return",
"new",
"Conclusion",
"(",
"json",
")",
";",
"}",
"// If the given object ... | An abstract concept for a basic genealogical data item.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#conclusion|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json] | [
"An",
"abstract",
"concept",
"for",
"a",
"basic",
"genealogical",
"data",
"item",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Conclusion.js#L13-L26 | |
38,431 | rootsdev/gedcomx-js | src/core/EventRole.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof EventRole)){
return new EventRole(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(GedcomX.Conclusion.isInstance(json)){
return json;
}
... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof EventRole)){
return new EventRole(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(GedcomX.Conclusion.isInstance(json)){
return json;
}
... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"EventRole",
")",
")",
"{",
"return",
"new",
"EventRole",
"(",
"json",
")",
";",
"}",
"// If the given object is... | A role that a specific person plays in an event.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#conclusion-event-role|GEDCOM X JSON Spec}
@class
@extends Conclusion
@param {Object} [json] | [
"A",
"role",
"that",
"a",
"specific",
"person",
"plays",
"in",
"an",
"event",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/EventRole.js#L13-L26 | |
38,432 | Ubudu/uBeacon-uart-lib | node/uBeaconUARTController.js | function(finishedCallback){
self.getUARTProtocolVersion(function(data,error){
self.deviceData.uartProtocolVersion = data;
finishedCallback(error);
});
} | javascript | function(finishedCallback){
self.getUARTProtocolVersion(function(data,error){
self.deviceData.uartProtocolVersion = data;
finishedCallback(error);
});
} | [
"function",
"(",
"finishedCallback",
")",
"{",
"self",
".",
"getUARTProtocolVersion",
"(",
"function",
"(",
"data",
",",
"error",
")",
"{",
"self",
".",
"deviceData",
".",
"uartProtocolVersion",
"=",
"data",
";",
"finishedCallback",
"(",
"error",
")",
";",
"... | Get uart protocol version | [
"Get",
"uart",
"protocol",
"version"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/uBeaconUARTController.js#L207-L212 | |
38,433 | Ubudu/uBeacon-uart-lib | node/uBeaconUARTController.js | function(finishedCallback){
self.getHardwareModel(function(data,error){
self.deviceData.hardwareModel = data;
finishedCallback(error);
});
} | javascript | function(finishedCallback){
self.getHardwareModel(function(data,error){
self.deviceData.hardwareModel = data;
finishedCallback(error);
});
} | [
"function",
"(",
"finishedCallback",
")",
"{",
"self",
".",
"getHardwareModel",
"(",
"function",
"(",
"data",
",",
"error",
")",
"{",
"self",
".",
"deviceData",
".",
"hardwareModel",
"=",
"data",
";",
"finishedCallback",
"(",
"error",
")",
";",
"}",
")",
... | Get hardware model | [
"Get",
"hardware",
"model"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/uBeaconUARTController.js#L214-L219 | |
38,434 | Ubudu/uBeacon-uart-lib | node/uBeaconUARTController.js | function(finishedCallback){
self.getHardwareVersion(function(data,error){
self.deviceData.hardwareVersion = data;
finishedCallback(error);
});
} | javascript | function(finishedCallback){
self.getHardwareVersion(function(data,error){
self.deviceData.hardwareVersion = data;
finishedCallback(error);
});
} | [
"function",
"(",
"finishedCallback",
")",
"{",
"self",
".",
"getHardwareVersion",
"(",
"function",
"(",
"data",
",",
"error",
")",
"{",
"self",
".",
"deviceData",
".",
"hardwareVersion",
"=",
"data",
";",
"finishedCallback",
"(",
"error",
")",
";",
"}",
")... | Get hardware version | [
"Get",
"hardware",
"version"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/uBeaconUARTController.js#L221-L226 | |
38,435 | Ubudu/uBeacon-uart-lib | node/uBeaconUARTController.js | function(finishedCallback){
self.getFirmwareVersion(function(data,error){
self.deviceData.firmwareVersion = data;
finishedCallback(error);
});
} | javascript | function(finishedCallback){
self.getFirmwareVersion(function(data,error){
self.deviceData.firmwareVersion = data;
finishedCallback(error);
});
} | [
"function",
"(",
"finishedCallback",
")",
"{",
"self",
".",
"getFirmwareVersion",
"(",
"function",
"(",
"data",
",",
"error",
")",
"{",
"self",
".",
"deviceData",
".",
"firmwareVersion",
"=",
"data",
";",
"finishedCallback",
"(",
"error",
")",
";",
"}",
")... | Get firmware version | [
"Get",
"firmware",
"version"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/uBeaconUARTController.js#L228-L233 | |
38,436 | intel/grunt-zipup | tasks/grunt-zipup.js | function (path) {
if (fs.existsSync(path) && fs.statSync(path).isDirectory()) {
return true;
}
return false;
} | javascript | function (path) {
if (fs.existsSync(path) && fs.statSync(path).isDirectory()) {
return true;
}
return false;
} | [
"function",
"(",
"path",
")",
"{",
"if",
"(",
"fs",
".",
"existsSync",
"(",
"path",
")",
"&&",
"fs",
".",
"statSync",
"(",
"path",
")",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | returns true if path exists and is a directory | [
"returns",
"true",
"if",
"path",
"exists",
"and",
"is",
"a",
"directory"
] | 872e47cab6d111e7a61c69a042927fc6ffea0b79 | https://github.com/intel/grunt-zipup/blob/872e47cab6d111e7a61c69a042927fc6ffea0b79/tasks/grunt-zipup.js#L45-L50 | |
38,437 | stylecow/stylecow-core | lib/tasks.js | needFix | function needFix (stylecowSupport, task, method) {
const taskSupport = task[method];
if (!taskSupport || !stylecowSupport) {
return true;
}
for (let browser in taskSupport) {
if (stylecowSupport[browser] === false) {
continue;
}
if (method === 'forBrowsersL... | javascript | function needFix (stylecowSupport, task, method) {
const taskSupport = task[method];
if (!taskSupport || !stylecowSupport) {
return true;
}
for (let browser in taskSupport) {
if (stylecowSupport[browser] === false) {
continue;
}
if (method === 'forBrowsersL... | [
"function",
"needFix",
"(",
"stylecowSupport",
",",
"task",
",",
"method",
")",
"{",
"const",
"taskSupport",
"=",
"task",
"[",
"method",
"]",
";",
"if",
"(",
"!",
"taskSupport",
"||",
"!",
"stylecowSupport",
")",
"{",
"return",
"true",
";",
"}",
"for",
... | check the browser support of a task | [
"check",
"the",
"browser",
"support",
"of",
"a",
"task"
] | 8c22ec4cff21b10966d1e90fe870f037a8635976 | https://github.com/stylecow/stylecow-core/blob/8c22ec4cff21b10966d1e90fe870f037a8635976/lib/tasks.js#L117-L145 |
38,438 | rootsdev/gedcomx-js | src/atom/AtomSource.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomSource)){
return new AtomSource(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomSource.isInstance(json)){
return... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomSource)){
return new AtomSource(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomSource.isInstance(json)){
return... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AtomSource",
")",
")",
"{",
"return",
"new",
"AtomSource",
"(",
"json",
")",
";",
"}",
"// If the given object ... | Information about the originating feed if an entry is copied or aggregated
from another feed.
@see {@link https://github.com/FamilySearch/gedcomx-rs/blob/master/specifications/atom-model-specification.md#atom-json-media-type|GEDCOM X Atom JSON Spec}
@see {@link https://tools.ietf.org/html/rfc4287#section-4.2.11|RFC 42... | [
"Information",
"about",
"the",
"originating",
"feed",
"if",
"an",
"entry",
"is",
"copied",
"or",
"aggregated",
"from",
"another",
"feed",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/atom/AtomSource.js#L17-L30 | |
38,439 | stackr23/cssobjects-loader | lib/transformToNestedDomStyleObjects.js | transformPropertiesToCamelCase | function transformPropertiesToCamelCase (object) {
var output = {}
for (var _key in object) {
if (typeof object === 'string') { return object.replace(' !important', '') }
var key = _key
var value = object[_key]
if (~key.indexOf('-')) {
var splittedKeys = key.split('-')
splittedKeys = sp... | javascript | function transformPropertiesToCamelCase (object) {
var output = {}
for (var _key in object) {
if (typeof object === 'string') { return object.replace(' !important', '') }
var key = _key
var value = object[_key]
if (~key.indexOf('-')) {
var splittedKeys = key.split('-')
splittedKeys = sp... | [
"function",
"transformPropertiesToCamelCase",
"(",
"object",
")",
"{",
"var",
"output",
"=",
"{",
"}",
"for",
"(",
"var",
"_key",
"in",
"object",
")",
"{",
"if",
"(",
"typeof",
"object",
"===",
"'string'",
")",
"{",
"return",
"object",
".",
"replace",
"(... | f.e. font-family => fontFamily border-radius => borderRadius | [
"f",
".",
"e",
".",
"font",
"-",
"family",
"=",
">",
"fontFamily",
"border",
"-",
"radius",
"=",
">",
"borderRadius"
] | eab363c1df302429b85d5b36d8b65cadf7318ba4 | https://github.com/stackr23/cssobjects-loader/blob/eab363c1df302429b85d5b36d8b65cadf7318ba4/lib/transformToNestedDomStyleObjects.js#L8-L27 |
38,440 | jaredhanson/junction-disco | lib/junction-disco/elements/item.js | Item | function Item(jid, node, name) {
Element.call(this, 'item', 'http://jabber.org/protocol/disco#items');
this.jid = jid;
this.node = node;
this.displayName = name;
} | javascript | function Item(jid, node, name) {
Element.call(this, 'item', 'http://jabber.org/protocol/disco#items');
this.jid = jid;
this.node = node;
this.displayName = name;
} | [
"function",
"Item",
"(",
"jid",
",",
"node",
",",
"name",
")",
"{",
"Element",
".",
"call",
"(",
"this",
",",
"'item'",
",",
"'http://jabber.org/protocol/disco#items'",
")",
";",
"this",
".",
"jid",
"=",
"jid",
";",
"this",
".",
"node",
"=",
"node",
";... | Initialize a new `Item` element.
@param {String} jid
@param {String} node
@param {String} name
@api public | [
"Initialize",
"a",
"new",
"Item",
"element",
"."
] | 89f2d222518b3b0f282d54b25d6405b5e35c1383 | https://github.com/jaredhanson/junction-disco/blob/89f2d222518b3b0f282d54b25d6405b5e35c1383/lib/junction-disco/elements/item.js#L15-L20 |
38,441 | SamVerschueren/gulp-cordova-icon | index.js | copyIcon | function copyIcon() {
var dest = path.join(process.env.PWD, 'res');
// Make sure the destination exists
mkdir(dest);
return pify(fs.copy.bind(fs), Promise)(src, path.join(dest, 'icon.' + mime.extension(mimetype)));
} | javascript | function copyIcon() {
var dest = path.join(process.env.PWD, 'res');
// Make sure the destination exists
mkdir(dest);
return pify(fs.copy.bind(fs), Promise)(src, path.join(dest, 'icon.' + mime.extension(mimetype)));
} | [
"function",
"copyIcon",
"(",
")",
"{",
"var",
"dest",
"=",
"path",
".",
"join",
"(",
"process",
".",
"env",
".",
"PWD",
",",
"'res'",
")",
";",
"// Make sure the destination exists",
"mkdir",
"(",
"dest",
")",
";",
"return",
"pify",
"(",
"fs",
".",
"co... | Copy the icon to the res subdirectory of the cordova build. | [
"Copy",
"the",
"icon",
"to",
"the",
"res",
"subdirectory",
"of",
"the",
"cordova",
"build",
"."
] | e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380 | https://github.com/SamVerschueren/gulp-cordova-icon/blob/e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380/index.js#L33-L40 |
38,442 | SamVerschueren/gulp-cordova-icon | index.js | copyHooks | function copyHooks() {
var src = path.join(__dirname, 'hooks');
var dest = path.join(process.env.PWD, 'hooks');
return pify(fs.copy.bind(fs), Promise)(path.join(__dirname, 'platforms.json'), path.join(dest, 'platforms.json'))
.then(function () {
memFsEditor.copyTpl(src, dest, options);
return pify(me... | javascript | function copyHooks() {
var src = path.join(__dirname, 'hooks');
var dest = path.join(process.env.PWD, 'hooks');
return pify(fs.copy.bind(fs), Promise)(path.join(__dirname, 'platforms.json'), path.join(dest, 'platforms.json'))
.then(function () {
memFsEditor.copyTpl(src, dest, options);
return pify(me... | [
"function",
"copyHooks",
"(",
")",
"{",
"var",
"src",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'hooks'",
")",
";",
"var",
"dest",
"=",
"path",
".",
"join",
"(",
"process",
".",
"env",
".",
"PWD",
",",
"'hooks'",
")",
";",
"return",
"pify",... | Copy all the hooks in the `hooks` directory to the `hooks` directory
of the cordova project. | [
"Copy",
"all",
"the",
"hooks",
"in",
"the",
"hooks",
"directory",
"to",
"the",
"hooks",
"directory",
"of",
"the",
"cordova",
"project",
"."
] | e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380 | https://github.com/SamVerschueren/gulp-cordova-icon/blob/e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380/index.js#L46-L66 |
38,443 | SamVerschueren/gulp-cordova-icon | index.js | installHookDependencies | function installHookDependencies() {
return Promise.all(hookDependencies.map(function (dependency) {
return pify(npmi, Promise)({name: dependency, path: path.join(process.env.PWD, 'hooks')});
}));
} | javascript | function installHookDependencies() {
return Promise.all(hookDependencies.map(function (dependency) {
return pify(npmi, Promise)({name: dependency, path: path.join(process.env.PWD, 'hooks')});
}));
} | [
"function",
"installHookDependencies",
"(",
")",
"{",
"return",
"Promise",
".",
"all",
"(",
"hookDependencies",
".",
"map",
"(",
"function",
"(",
"dependency",
")",
"{",
"return",
"pify",
"(",
"npmi",
",",
"Promise",
")",
"(",
"{",
"name",
":",
"dependency... | Install all the dependencies that are used by the hooks. | [
"Install",
"all",
"the",
"dependencies",
"that",
"are",
"used",
"by",
"the",
"hooks",
"."
] | e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380 | https://github.com/SamVerschueren/gulp-cordova-icon/blob/e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380/index.js#L71-L75 |
38,444 | rootsdev/gedcomx-js | src/core/Note.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Note)){
return new Note(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Note.isInstance(json)){
return json;
}
this.init(json);
} | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Note)){
return new Note(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Note.isInstance(json)){
return json;
}
this.init(json);
} | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Note",
")",
")",
"{",
"return",
"new",
"Note",
"(",
"json",
")",
";",
"}",
"// If the given object is already a... | A note about a resource.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#note|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json] | [
"A",
"note",
"about",
"a",
"resource",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Note.js#L13-L26 | |
38,445 | mmalecki/seneca-loadbalance-transport | index.js | makeWorker | function makeWorker(worker) {
return {
seneca: Seneca().client(worker),
id: worker.id,
up: undefined,
lastCallDuration: -1,
meanCallDuration: -1,
host: worker.host,
port: worker.port,
type: worker.type
}
} | javascript | function makeWorker(worker) {
return {
seneca: Seneca().client(worker),
id: worker.id,
up: undefined,
lastCallDuration: -1,
meanCallDuration: -1,
host: worker.host,
port: worker.port,
type: worker.type
}
} | [
"function",
"makeWorker",
"(",
"worker",
")",
"{",
"return",
"{",
"seneca",
":",
"Seneca",
"(",
")",
".",
"client",
"(",
"worker",
")",
",",
"id",
":",
"worker",
".",
"id",
",",
"up",
":",
"undefined",
",",
"lastCallDuration",
":",
"-",
"1",
",",
"... | Make a worker and put it in our `workers` object | [
"Make",
"a",
"worker",
"and",
"put",
"it",
"in",
"our",
"workers",
"object"
] | 08d7e37370ace7768baaed5234054ec9db9d27a4 | https://github.com/mmalecki/seneca-loadbalance-transport/blob/08d7e37370ace7768baaed5234054ec9db9d27a4/index.js#L37-L48 |
38,446 | mmalecki/seneca-loadbalance-transport | index.js | nextWorker | function nextWorker(cb) {
seneca.act('role:loadbalance,hook:balance', {
workers: workers,
lastWorker: lastWorker
}, function (err, worker) {
if (!worker) return cb(new Error('No up backend found'))
lastWorker = worker
cb(null, worker)
})
} | javascript | function nextWorker(cb) {
seneca.act('role:loadbalance,hook:balance', {
workers: workers,
lastWorker: lastWorker
}, function (err, worker) {
if (!worker) return cb(new Error('No up backend found'))
lastWorker = worker
cb(null, worker)
})
} | [
"function",
"nextWorker",
"(",
"cb",
")",
"{",
"seneca",
".",
"act",
"(",
"'role:loadbalance,hook:balance'",
",",
"{",
"workers",
":",
"workers",
",",
"lastWorker",
":",
"lastWorker",
"}",
",",
"function",
"(",
"err",
",",
"worker",
")",
"{",
"if",
"(",
... | Get the next worker by asking the `balance` hook for one. Default one is round robin, as implemented in `roundRobin`. | [
"Get",
"the",
"next",
"worker",
"by",
"asking",
"the",
"balance",
"hook",
"for",
"one",
".",
"Default",
"one",
"is",
"round",
"robin",
"as",
"implemented",
"in",
"roundRobin",
"."
] | 08d7e37370ace7768baaed5234054ec9db9d27a4 | https://github.com/mmalecki/seneca-loadbalance-transport/blob/08d7e37370ace7768baaed5234054ec9db9d27a4/index.js#L52-L61 |
38,447 | mmalecki/seneca-loadbalance-transport | index.js | addWorker | function addWorker(worker, cb) {
function ping() {
// A thing to keep in mind that right now it can take very long
// (I think default is 22222 ms) for a request to time out, even
// in scenarios like remote side breaking the connection and
// ECONNREFUSED on reconnect.
madeWorker.sene... | javascript | function addWorker(worker, cb) {
function ping() {
// A thing to keep in mind that right now it can take very long
// (I think default is 22222 ms) for a request to time out, even
// in scenarios like remote side breaking the connection and
// ECONNREFUSED on reconnect.
madeWorker.sene... | [
"function",
"addWorker",
"(",
"worker",
",",
"cb",
")",
"{",
"function",
"ping",
"(",
")",
"{",
"// A thing to keep in mind that right now it can take very long",
"// (I think default is 22222 ms) for a request to time out, even",
"// in scenarios like remote side breaking the connecti... | Add a new worker. | [
"Add",
"a",
"new",
"worker",
"."
] | 08d7e37370ace7768baaed5234054ec9db9d27a4 | https://github.com/mmalecki/seneca-loadbalance-transport/blob/08d7e37370ace7768baaed5234054ec9db9d27a4/index.js#L79-L96 |
38,448 | BeLi4L/subz-hero | src/providers/subscene.js | getSubtitlesByFilename | async function getSubtitlesByFilename (filename) {
// TODO: revamp this + add unit tests
return getSubtitlesList(filename)
.then(parseSearchResults)
.then(getBestSearchResult(filename))
.then(getSubtitlesPage)
.then(parseDownloadLink)
.then(downloadZip)
.then(extractSrt)
} | javascript | async function getSubtitlesByFilename (filename) {
// TODO: revamp this + add unit tests
return getSubtitlesList(filename)
.then(parseSearchResults)
.then(getBestSearchResult(filename))
.then(getSubtitlesPage)
.then(parseDownloadLink)
.then(downloadZip)
.then(extractSrt)
} | [
"async",
"function",
"getSubtitlesByFilename",
"(",
"filename",
")",
"{",
"// TODO: revamp this + add unit tests",
"return",
"getSubtitlesList",
"(",
"filename",
")",
".",
"then",
"(",
"parseSearchResults",
")",
".",
"then",
"(",
"getBestSearchResult",
"(",
"filename",
... | Get subtitles for the given filename.
@param {string} filename
@returns {Promise<string>} the subtitles, formatted as .srt | [
"Get",
"subtitles",
"for",
"the",
"given",
"filename",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subscene.js#L34-L43 |
38,449 | BeLi4L/subz-hero | src/providers/subscene.js | getSubtitlesList | async function getSubtitlesList (filename) {
return request({
method: 'GET',
uri: SUBSCENE_URL + '/subtitles/release',
qs: {
q: filename, // search query
l: '', // language (english)
r: true // released or whatever
}
})
} | javascript | async function getSubtitlesList (filename) {
return request({
method: 'GET',
uri: SUBSCENE_URL + '/subtitles/release',
qs: {
q: filename, // search query
l: '', // language (english)
r: true // released or whatever
}
})
} | [
"async",
"function",
"getSubtitlesList",
"(",
"filename",
")",
"{",
"return",
"request",
"(",
"{",
"method",
":",
"'GET'",
",",
"uri",
":",
"SUBSCENE_URL",
"+",
"'/subtitles/release'",
",",
"qs",
":",
"{",
"q",
":",
"filename",
",",
"// search query",
"l",
... | Search for the given file on SubScene.
@param {string} filename
@returns {Promise<string>} the HTML string, containing the search results | [
"Search",
"for",
"the",
"given",
"file",
"on",
"SubScene",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subscene.js#L51-L61 |
38,450 | BeLi4L/subz-hero | src/providers/subscene.js | parseSearchResults | function parseSearchResults (html) {
const $ = cheerio.load(html)
return $('a')
.filter(function (index, element) {
const spans = $(element).find('span')
return spans.length === 2 && spans.eq(0).text().trim() === 'English'
})
.map(function (index, element) {
const title = $(element).fi... | javascript | function parseSearchResults (html) {
const $ = cheerio.load(html)
return $('a')
.filter(function (index, element) {
const spans = $(element).find('span')
return spans.length === 2 && spans.eq(0).text().trim() === 'English'
})
.map(function (index, element) {
const title = $(element).fi... | [
"function",
"parseSearchResults",
"(",
"html",
")",
"{",
"const",
"$",
"=",
"cheerio",
".",
"load",
"(",
"html",
")",
"return",
"$",
"(",
"'a'",
")",
".",
"filter",
"(",
"function",
"(",
"index",
",",
"element",
")",
"{",
"const",
"spans",
"=",
"$",
... | Parse an HTML document that contains a list of SubScene search results.
@param {string} html
@returns {Array<SearchResult>} the list of search results | [
"Parse",
"an",
"HTML",
"document",
"that",
"contains",
"a",
"list",
"of",
"SubScene",
"search",
"results",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subscene.js#L69-L85 |
38,451 | BeLi4L/subz-hero | src/providers/subscene.js | downloadZip | async function downloadZip (href) {
return request({
method: 'GET',
uri: SUBSCENE_URL + href,
encoding: null
})
} | javascript | async function downloadZip (href) {
return request({
method: 'GET',
uri: SUBSCENE_URL + href,
encoding: null
})
} | [
"async",
"function",
"downloadZip",
"(",
"href",
")",
"{",
"return",
"request",
"(",
"{",
"method",
":",
"'GET'",
",",
"uri",
":",
"SUBSCENE_URL",
"+",
"href",
",",
"encoding",
":",
"null",
"}",
")",
"}"
] | Download the subtitles based on the given link.
@param {string} href
@returns {Promise<Buffer>} the ZIP content | [
"Download",
"the",
"subtitles",
"based",
"on",
"the",
"given",
"link",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subscene.js#L138-L144 |
38,452 | BeLi4L/subz-hero | src/providers/subscene.js | extractSrt | function extractSrt (buffer) {
const zip = new AdmZip(buffer)
const srtZipEntry = zip
.getEntries()
.find(zipEntry =>
zipEntry.entryName.endsWith('.srt')
)
return zip.readAsText(srtZipEntry)
} | javascript | function extractSrt (buffer) {
const zip = new AdmZip(buffer)
const srtZipEntry = zip
.getEntries()
.find(zipEntry =>
zipEntry.entryName.endsWith('.srt')
)
return zip.readAsText(srtZipEntry)
} | [
"function",
"extractSrt",
"(",
"buffer",
")",
"{",
"const",
"zip",
"=",
"new",
"AdmZip",
"(",
"buffer",
")",
"const",
"srtZipEntry",
"=",
"zip",
".",
"getEntries",
"(",
")",
".",
"find",
"(",
"zipEntry",
"=>",
"zipEntry",
".",
"entryName",
".",
"endsWith... | Extract the first .srt file found in the given ZIP buffer.
@param {Buffer} buffer
@returns {string} the content of the first .srt file found in the given ZIP | [
"Extract",
"the",
"first",
".",
"srt",
"file",
"found",
"in",
"the",
"given",
"ZIP",
"buffer",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subscene.js#L152-L160 |
38,453 | WRidder/backgrid-advanced-filter | src/filter-dropdown.js | function (e) {
var self = this;
if (e) {
self.stopPropagation(e);
}
// Get current filter
var currentFilter = self.filterStateModel.getActiveFilter();
if (currentFilter !== self.filter) {
self.filterStateModel.setActiveFilter(self.filter);
self.filterStateModel.trigger("filter... | javascript | function (e) {
var self = this;
if (e) {
self.stopPropagation(e);
}
// Get current filter
var currentFilter = self.filterStateModel.getActiveFilter();
if (currentFilter !== self.filter) {
self.filterStateModel.setActiveFilter(self.filter);
self.filterStateModel.trigger("filter... | [
"function",
"(",
"e",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"e",
")",
"{",
"self",
".",
"stopPropagation",
"(",
"e",
")",
";",
"}",
"// Get current filter",
"var",
"currentFilter",
"=",
"self",
".",
"filterStateModel",
".",
"getActiveFilt... | Activates current filer
@method setActiveFilter
@param {object} e | [
"Activates",
"current",
"filer"
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-dropdown.js#L49-L61 | |
38,454 | WRidder/backgrid-advanced-filter | src/filter-dropdown.js | function (e) {
var self = this;
if (self.isOpen !== true) {
self.open(e);
}
else {
self.close(e);
}
} | javascript | function (e) {
var self = this;
if (self.isOpen !== true) {
self.open(e);
}
else {
self.close(e);
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"isOpen",
"!==",
"true",
")",
"{",
"self",
".",
"open",
"(",
"e",
")",
";",
"}",
"else",
"{",
"self",
".",
"close",
"(",
"e",
")",
";",
"}",
"}"
] | Toggle the dropdown visibility
@method toggle
@param {object} [e] | [
"Toggle",
"the",
"dropdown",
"visibility"
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-dropdown.js#L348-L356 | |
38,455 | WRidder/backgrid-advanced-filter | src/filter-dropdown.js | function (e) {
var self = this;
clearTimeout(self.closeTimeout);
clearTimeout(self.deferCloseTimeout);
if (e) {
if (e.stopPropagation) {
e.stopPropagation();
}
if (e.preventDefault) {
e.preventDefault();
}
e.cancelBubble = true;
}
// Don't do anyt... | javascript | function (e) {
var self = this;
clearTimeout(self.closeTimeout);
clearTimeout(self.deferCloseTimeout);
if (e) {
if (e.stopPropagation) {
e.stopPropagation();
}
if (e.preventDefault) {
e.preventDefault();
}
e.cancelBubble = true;
}
// Don't do anyt... | [
"function",
"(",
"e",
")",
"{",
"var",
"self",
"=",
"this",
";",
"clearTimeout",
"(",
"self",
".",
"closeTimeout",
")",
";",
"clearTimeout",
"(",
"self",
".",
"deferCloseTimeout",
")",
";",
"if",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"stopPropagat... | Open the dropdown
@method open
@param {object} [e] | [
"Open",
"the",
"dropdown"
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-dropdown.js#L364-L390 | |
38,456 | WRidder/backgrid-advanced-filter | src/filter-dropdown.js | function (e) {
var self = this;
// Don't do anything if already closed
if (!self.isOpen) {
return;
}
self.isOpen = false;
self.$el.removeClass("open");
// Notify child view
self.dropdownContainerView.close();
} | javascript | function (e) {
var self = this;
// Don't do anything if already closed
if (!self.isOpen) {
return;
}
self.isOpen = false;
self.$el.removeClass("open");
// Notify child view
self.dropdownContainerView.close();
} | [
"function",
"(",
"e",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Don't do anything if already closed",
"if",
"(",
"!",
"self",
".",
"isOpen",
")",
"{",
"return",
";",
"}",
"self",
".",
"isOpen",
"=",
"false",
";",
"self",
".",
"$el",
".",
"removeCl... | Close the dropdown
@method close
@param {object} [e] | [
"Close",
"the",
"dropdown"
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-dropdown.js#L398-L411 | |
38,457 | rootsdev/gedcomx-js | src/core/Address.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Address)){
return new Address(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Address.isInstance(json)){
return json;
}
this.init(j... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Address)){
return new Address(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Address.isInstance(json)){
return json;
}
this.init(j... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Address",
")",
")",
"{",
"return",
"new",
"Address",
"(",
"json",
")",
";",
"}",
"// If the given object is alr... | An address.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#address|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json] | [
"An",
"address",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Address.js#L13-L26 | |
38,458 | greim/ng-falcor | src/index.js | function(...path) {
path = pathify(path);
return noUndef(path)
? model.getValueSync(path)
: undefined;
} | javascript | function(...path) {
path = pathify(path);
return noUndef(path)
? model.getValueSync(path)
: undefined;
} | [
"function",
"(",
"...",
"path",
")",
"{",
"path",
"=",
"pathify",
"(",
"path",
")",
";",
"return",
"noUndef",
"(",
"path",
")",
"?",
"model",
".",
"getValueSync",
"(",
"path",
")",
":",
"undefined",
";",
"}"
] | Retrieve a value. Path must reference a single node in the graph. | [
"Retrieve",
"a",
"value",
".",
"Path",
"must",
"reference",
"a",
"single",
"node",
"in",
"the",
"graph",
"."
] | bbdad2bcf63f9b3b7e0b5ead083f36b0454cccd3 | https://github.com/greim/ng-falcor/blob/bbdad2bcf63f9b3b7e0b5ead083f36b0454cccd3/src/index.js#L31-L36 | |
38,459 | matterial/reckonjs | reckon.js | function(params) {
/**
* Reckon version
* @type {String}
*/
this.version = '0.1.0';
/**
* Define delimiter that marks beginning of interpolation
* @type {String}
*/
this.delimStart = settings.delimStart;
/**
* Define delimiter that marks end of interpolation
* @type {String}
*/
... | javascript | function(params) {
/**
* Reckon version
* @type {String}
*/
this.version = '0.1.0';
/**
* Define delimiter that marks beginning of interpolation
* @type {String}
*/
this.delimStart = settings.delimStart;
/**
* Define delimiter that marks end of interpolation
* @type {String}
*/
... | [
"function",
"(",
"params",
")",
"{",
"/**\n\t\t * Reckon version\n\t\t * @type {String}\n\t\t */",
"this",
".",
"version",
"=",
"'0.1.0'",
";",
"/**\n\t\t * Define delimiter that marks beginning of interpolation\n\t\t * @type {String}\n\t\t */",
"this",
".",
"delimStart",
"=",
"set... | The actual Reckon implementation
@param {Object} params Configuration and data | [
"The",
"actual",
"Reckon",
"implementation"
] | 39e1867886f50a2bd48eaeb15e24b24a09d22c24 | https://github.com/matterial/reckonjs/blob/39e1867886f50a2bd48eaeb15e24b24a09d22c24/reckon.js#L28-L69 | |
38,460 | matterial/reckonjs | reckon.js | function(param) {
/**
* Reference the instance
*/
var rInstance = this;
if (typeof param !== "undefined") {
rInstance.text = param.text;
rInstance.scopes = [].concat(param.scope);
}
/**
* The required regexp computed using delims in settings
* @type {RegExp}
*/
var re =... | javascript | function(param) {
/**
* Reference the instance
*/
var rInstance = this;
if (typeof param !== "undefined") {
rInstance.text = param.text;
rInstance.scopes = [].concat(param.scope);
}
/**
* The required regexp computed using delims in settings
* @type {RegExp}
*/
var re =... | [
"function",
"(",
"param",
")",
"{",
"/**\n\t\t\t * Reference the instance\n\t\t\t */",
"var",
"rInstance",
"=",
"this",
";",
"if",
"(",
"typeof",
"param",
"!==",
"\"undefined\"",
")",
"{",
"rInstance",
".",
"text",
"=",
"param",
".",
"text",
";",
"rInstance",
... | The function responsible for interpolation
@return {Reckon} return self object for chaining | [
"The",
"function",
"responsible",
"for",
"interpolation"
] | 39e1867886f50a2bd48eaeb15e24b24a09d22c24 | https://github.com/matterial/reckonjs/blob/39e1867886f50a2bd48eaeb15e24b24a09d22c24/reckon.js#L81-L208 | |
38,461 | matterial/reckonjs | reckon.js | function(expr, localScope) {
var variables = '';
/**
* If scope is a window object, no need to scopebox it
*/
if (typeof window !== "undefined" ? localScope !== window : true) {
for(var i in localScope) {
variables += 'var ' + i + ' = localScope.' + i + '; ';
}
... | javascript | function(expr, localScope) {
var variables = '';
/**
* If scope is a window object, no need to scopebox it
*/
if (typeof window !== "undefined" ? localScope !== window : true) {
for(var i in localScope) {
variables += 'var ' + i + ' = localScope.' + i + '; ';
}
... | [
"function",
"(",
"expr",
",",
"localScope",
")",
"{",
"var",
"variables",
"=",
"''",
";",
"/**\n\t\t\t\t\t\t * If scope is a window object, no need to scopebox it\n\t\t\t\t\t\t */",
"if",
"(",
"typeof",
"window",
"!==",
"\"undefined\"",
"?",
"localScope",
"!==",
"window",... | Break out scope variables out of scope's box and evaluate the expr expression | [
"Break",
"out",
"scope",
"variables",
"out",
"of",
"scope",
"s",
"box",
"and",
"evaluate",
"the",
"expr",
"expression"
] | 39e1867886f50a2bd48eaeb15e24b24a09d22c24 | https://github.com/matterial/reckonjs/blob/39e1867886f50a2bd48eaeb15e24b24a09d22c24/reckon.js#L132-L145 | |
38,462 | matterial/reckonjs | reckon.js | function(setting) {
if (typeof setting === "undefined") {
if (typeof window !== "undefined") {
if (typeof window.reckonSettings !== "undefined") {
if (typeof window.reckonSettings.delimStart) {
settings.delimStart = window.reckonSettings.delimStart;
}
if (typeof window.reckonSetting... | javascript | function(setting) {
if (typeof setting === "undefined") {
if (typeof window !== "undefined") {
if (typeof window.reckonSettings !== "undefined") {
if (typeof window.reckonSettings.delimStart) {
settings.delimStart = window.reckonSettings.delimStart;
}
if (typeof window.reckonSetting... | [
"function",
"(",
"setting",
")",
"{",
"if",
"(",
"typeof",
"setting",
"===",
"\"undefined\"",
")",
"{",
"if",
"(",
"typeof",
"window",
"!==",
"\"undefined\"",
")",
"{",
"if",
"(",
"typeof",
"window",
".",
"reckonSettings",
"!==",
"\"undefined\"",
")",
"{",... | Modify in-built settings
@param {Object} setting Delim settings
@return {Object} Return self for chaining | [
"Modify",
"in",
"-",
"built",
"settings"
] | 39e1867886f50a2bd48eaeb15e24b24a09d22c24 | https://github.com/matterial/reckonjs/blob/39e1867886f50a2bd48eaeb15e24b24a09d22c24/reckon.js#L217-L241 | |
38,463 | BeLi4L/subz-hero | src/providers/subdb.js | hash | async function hash (file) {
const filesize = await fileUtil.getFileSize(file)
const chunkSize = 64 * 1024
const firstBytesPromise = fileUtil.readBytes({
file,
chunkSize,
start: 0
})
const lastBytesPromise = fileUtil.readBytes({
file,
chunkSize,
start: filesize - chunkSize
})
c... | javascript | async function hash (file) {
const filesize = await fileUtil.getFileSize(file)
const chunkSize = 64 * 1024
const firstBytesPromise = fileUtil.readBytes({
file,
chunkSize,
start: 0
})
const lastBytesPromise = fileUtil.readBytes({
file,
chunkSize,
start: filesize - chunkSize
})
c... | [
"async",
"function",
"hash",
"(",
"file",
")",
"{",
"const",
"filesize",
"=",
"await",
"fileUtil",
".",
"getFileSize",
"(",
"file",
")",
"const",
"chunkSize",
"=",
"64",
"*",
"1024",
"const",
"firstBytesPromise",
"=",
"fileUtil",
".",
"readBytes",
"(",
"{"... | Create the hash used to identify a file.
@param {string} file - path to a file
@returns {Promise<string>} a hex string representing the MD5 digest of the
first 64kB and the last 64kB of the given file | [
"Create",
"the",
"hash",
"used",
"to",
"identify",
"a",
"file",
"."
] | c22c6df7c2d80c00685a9326043e1ceae3cbf53d | https://github.com/BeLi4L/subz-hero/blob/c22c6df7c2d80c00685a9326043e1ceae3cbf53d/src/providers/subdb.js#L47-L71 |
38,464 | angie-framework/angie | src/services/$Response.js | controllerTemplateRouteResponse | function controllerTemplateRouteResponse() {
if (this.template) {
let match = this.template.toString().match(/!doctype ([a-z]+)/i),
mime;
// In the context where MIME type is not set, but we have a
// DOCTYPE tag, we can force set the MIME
// We want this here instead of... | javascript | function controllerTemplateRouteResponse() {
if (this.template) {
let match = this.template.toString().match(/!doctype ([a-z]+)/i),
mime;
// In the context where MIME type is not set, but we have a
// DOCTYPE tag, we can force set the MIME
// We want this here instead of... | [
"function",
"controllerTemplateRouteResponse",
"(",
")",
"{",
"if",
"(",
"this",
".",
"template",
")",
"{",
"let",
"match",
"=",
"this",
".",
"template",
".",
"toString",
"(",
")",
".",
"match",
"(",
"/",
"!doctype ([a-z]+)",
"/",
"i",
")",
",",
"mime",
... | Performs the templating inside of Controller Classes | [
"Performs",
"the",
"templating",
"inside",
"of",
"Controller",
"Classes"
] | 7d0793f6125e60e0473b17ffd40305d6d6fdbc12 | https://github.com/angie-framework/angie/blob/7d0793f6125e60e0473b17ffd40305d6d6fdbc12/src/services/$Response.js#L589-L640 |
38,465 | rootsdev/gedcomx-js | src/core/Date.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof GDate)){
return new GDate(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(GDate.isInstance(json)){
return json;
}
this.init(json);
... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof GDate)){
return new GDate(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(GDate.isInstance(json)){
return json;
}
this.init(json);
... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"GDate",
")",
")",
"{",
"return",
"new",
"GDate",
"(",
"json",
")",
";",
"}",
"// If the given object is already... | A date.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#conclusion-date|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json]
@alias Date | [
"A",
"date",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Date.js#L14-L27 | |
38,466 | SamVerschueren/gulp-cordova-icon | hooks/before_prepare/icon.js | loadProjectName | function loadProjectName(callback) {
try {
var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
if (contents) {
// Windows is the BOM. Skip the Byte Order Mark.
contents = contents.substring(contents.indexOf('<'));
}
var doc = new et.ElementTree(et.XML(contents));
var roo... | javascript | function loadProjectName(callback) {
try {
var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
if (contents) {
// Windows is the BOM. Skip the Byte Order Mark.
contents = contents.substring(contents.indexOf('<'));
}
var doc = new et.ElementTree(et.XML(contents));
var roo... | [
"function",
"loadProjectName",
"(",
"callback",
")",
"{",
"try",
"{",
"var",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../../config.xml'",
")",
",",
"'utf-8'",
")",
";",
"if",
"(",
"contents",
")",
"{"... | Loads the project name from the config.xml file.
@param {Function} callback Called when the name is retrieved. | [
"Loads",
"the",
"project",
"name",
"from",
"the",
"config",
".",
"xml",
"file",
"."
] | e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380 | https://github.com/SamVerschueren/gulp-cordova-icon/blob/e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380/hooks/before_prepare/icon.js#L33-L59 |
38,467 | SamVerschueren/gulp-cordova-icon | hooks/before_prepare/icon.js | updateConfig | function updateConfig(target) {
try {
var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
if (contents) {
// Windows is the BOM. Skip the Byte Order Mark.
contents = contents.substring(contents.indexOf('<'));
}
var doc = new et.ElementTree(et.XML(contents));
var root = d... | javascript | function updateConfig(target) {
try {
var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
if (contents) {
// Windows is the BOM. Skip the Byte Order Mark.
contents = contents.substring(contents.indexOf('<'));
}
var doc = new et.ElementTree(et.XML(contents));
var root = d... | [
"function",
"updateConfig",
"(",
"target",
")",
"{",
"try",
"{",
"var",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../../config.xml'",
")",
",",
"'utf-8'",
")",
";",
"if",
"(",
"contents",
")",
"{",
"... | This method will update the config.xml file for the target platform. It will
add the icon tags to the config file. | [
"This",
"method",
"will",
"update",
"the",
"config",
".",
"xml",
"file",
"for",
"the",
"target",
"platform",
".",
"It",
"will",
"add",
"the",
"icon",
"tags",
"to",
"the",
"config",
"file",
"."
] | e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380 | https://github.com/SamVerschueren/gulp-cordova-icon/blob/e228d4d4ccc4e3e9fbbf3f05f47a46015fc59380/hooks/before_prepare/icon.js#L65-L111 |
38,468 | Globegitter/sails-hook-eslint | index.js | function (cb) {
// If the hook has been deactivated, just return
if (!sails.config[this.configKey].check) {
sails.log.verbose('Eslint hook deactivated.');
return cb();
} else {
var format = sails.config[this.configKey].formatter || 'stylish';
var patterns = sails.con... | javascript | function (cb) {
// If the hook has been deactivated, just return
if (!sails.config[this.configKey].check) {
sails.log.verbose('Eslint hook deactivated.');
return cb();
} else {
var format = sails.config[this.configKey].formatter || 'stylish';
var patterns = sails.con... | [
"function",
"(",
"cb",
")",
"{",
"// If the hook has been deactivated, just return",
"if",
"(",
"!",
"sails",
".",
"config",
"[",
"this",
".",
"configKey",
"]",
".",
"check",
")",
"{",
"sails",
".",
"log",
".",
"verbose",
"(",
"'Eslint hook deactivated.'",
")"... | Initialize the hook
@param {Function} cb Callback for when we're done initializing | [
"Initialize",
"the",
"hook"
] | 0e3c91a234e8514313e33662620d0006836ec78d | https://github.com/Globegitter/sails-hook-eslint/blob/0e3c91a234e8514313e33662620d0006836ec78d/index.js#L58-L83 | |
38,469 | Bartvds/gruntfile-gtx | lib/lib.js | getParamAccessor | function getParamAccessor(id, params) {
// easy access
var paramGet = function (prop, alt, required) {
if (arguments.length < 1) {
throw (new Error('expected at least 1 argument'));
}
if (arguments.length < 2) {
required = true;
}
if (params && hasOwnProp(params, prop)) {
retur... | javascript | function getParamAccessor(id, params) {
// easy access
var paramGet = function (prop, alt, required) {
if (arguments.length < 1) {
throw (new Error('expected at least 1 argument'));
}
if (arguments.length < 2) {
required = true;
}
if (params && hasOwnProp(params, prop)) {
retur... | [
"function",
"getParamAccessor",
"(",
"id",
",",
"params",
")",
"{",
"// easy access",
"var",
"paramGet",
"=",
"function",
"(",
"prop",
",",
"alt",
",",
"required",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"<",
"1",
")",
"{",
"throw",
"(",
"new"... | return a parameter accessor | [
"return",
"a",
"parameter",
"accessor"
] | 90ac642769189ad6be7886b83f1e0c55d350e873 | https://github.com/Bartvds/gruntfile-gtx/blob/90ac642769189ad6be7886b83f1e0c55d350e873/lib/lib.js#L6-L28 |
38,470 | ember-cli/broccoli-es6modules | index.js | function(inDir, outDir){
var name = this.bundleOptions.name;
var opts = this._generateEsperantoOptions(name);
var transpilerName = formatToFunctionName[this.format];
var targetExtension = this.targetExtension;
return esperanto.bundle({
base: inDir,
entry: this.bundleOptions.entry
})... | javascript | function(inDir, outDir){
var name = this.bundleOptions.name;
var opts = this._generateEsperantoOptions(name);
var transpilerName = formatToFunctionName[this.format];
var targetExtension = this.targetExtension;
return esperanto.bundle({
base: inDir,
entry: this.bundleOptions.entry
})... | [
"function",
"(",
"inDir",
",",
"outDir",
")",
"{",
"var",
"name",
"=",
"this",
".",
"bundleOptions",
".",
"name",
";",
"var",
"opts",
"=",
"this",
".",
"_generateEsperantoOptions",
"(",
"name",
")",
";",
"var",
"transpilerName",
"=",
"formatToFunctionName",
... | A hook called if ES6Modules is being used in a n-to-1 bundle.
Begins importing at an entry point and adds a single bundled
module to the output tree. | [
"A",
"hook",
"called",
"if",
"ES6Modules",
"is",
"being",
"used",
"in",
"a",
"n",
"-",
"to",
"-",
"1",
"bundle",
"."
] | 398d2e901687497a9eaab32a6ecb008b4e587230 | https://github.com/ember-cli/broccoli-es6modules/blob/398d2e901687497a9eaab32a6ecb008b4e587230/index.js#L151-L166 | |
38,471 | ember-cli/broccoli-es6modules | index.js | function(inDir, outDir, relativePath, newCache) {
var ext = this._matchingFileExtension(relativePath);
var moduleName = relativePath.slice(0, relativePath.length - (ext.length + 1));
var fullInputPath = path.join(inDir, relativePath);
var fullOutputPath = path.join(outDir, moduleName + '.' + this.target... | javascript | function(inDir, outDir, relativePath, newCache) {
var ext = this._matchingFileExtension(relativePath);
var moduleName = relativePath.slice(0, relativePath.length - (ext.length + 1));
var fullInputPath = path.join(inDir, relativePath);
var fullOutputPath = path.join(outDir, moduleName + '.' + this.target... | [
"function",
"(",
"inDir",
",",
"outDir",
",",
"relativePath",
",",
"newCache",
")",
"{",
"var",
"ext",
"=",
"this",
".",
"_matchingFileExtension",
"(",
"relativePath",
")",
";",
"var",
"moduleName",
"=",
"relativePath",
".",
"slice",
"(",
"0",
",",
"relati... | Normalizes module name, input path, and output path
then calls transpileThroughCache to get a transpiled
version of the ES6 source. | [
"Normalizes",
"module",
"name",
"input",
"path",
"and",
"output",
"path",
"then",
"calls",
"transpileThroughCache",
"to",
"get",
"a",
"transpiled",
"version",
"of",
"the",
"ES6",
"source",
"."
] | 398d2e901687497a9eaab32a6ecb008b4e587230 | https://github.com/ember-cli/broccoli-es6modules/blob/398d2e901687497a9eaab32a6ecb008b4e587230/index.js#L199-L213 | |
38,472 | ember-cli/broccoli-es6modules | index.js | function(moduleName, source, newCache) {
var key = helpers.hashStrings([moduleName, source]);
var entry = this._transpilerCache[key];
if (entry) {
return newCache[key] = entry;
}
try {
return newCache[key] = {
output: this.toFormat(
source,
this._generateEspe... | javascript | function(moduleName, source, newCache) {
var key = helpers.hashStrings([moduleName, source]);
var entry = this._transpilerCache[key];
if (entry) {
return newCache[key] = entry;
}
try {
return newCache[key] = {
output: this.toFormat(
source,
this._generateEspe... | [
"function",
"(",
"moduleName",
",",
"source",
",",
"newCache",
")",
"{",
"var",
"key",
"=",
"helpers",
".",
"hashStrings",
"(",
"[",
"moduleName",
",",
"source",
"]",
")",
";",
"var",
"entry",
"=",
"this",
".",
"_transpilerCache",
"[",
"key",
"]",
";",... | Called on every file in a tree when used in per-file mode.
First this checks whether the file contents have been previously
transpiled by checking the previous cache. If the file has been transpiled,
adds the previous transpiled code into the new cache. If it has not been transpiled
it adds passed the source code alon... | [
"Called",
"on",
"every",
"file",
"in",
"a",
"tree",
"when",
"used",
"in",
"per",
"-",
"file",
"mode",
"."
] | 398d2e901687497a9eaab32a6ecb008b4e587230 | https://github.com/ember-cli/broccoli-es6modules/blob/398d2e901687497a9eaab32a6ecb008b4e587230/index.js#L224-L242 | |
38,473 | blendsdk/blend-class-system | examples/hello-world/Hello/app/Greeter.js | function () {
var me = this;
me.callParent.apply(me, arguments);
me.entity = me.entity || 'Someone';
} | javascript | function () {
var me = this;
me.callParent.apply(me, arguments);
me.entity = me.entity || 'Someone';
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"me",
".",
"callParent",
".",
"apply",
"(",
"me",
",",
"arguments",
")",
";",
"me",
".",
"entity",
"=",
"me",
".",
"entity",
"||",
"'Someone'",
";",
"}"
] | Constructor example.
Don't forget to call the parent constructor | [
"Constructor",
"example",
".",
"Don",
"t",
"forget",
"to",
"call",
"the",
"parent",
"constructor"
] | d6eb82c0305d8f4d17c925b8420654fe8271c590 | https://github.com/blendsdk/blend-class-system/blob/d6eb82c0305d8f4d17c925b8420654fe8271c590/examples/hello-world/Hello/app/Greeter.js#L10-L14 | |
38,474 | rootsdev/gedcomx-js | src/core/TextValue.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof TextValue)){
return new TextValue(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(TextValue.isInstance(json)){
return json;
}
this.... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof TextValue)){
return new TextValue(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(TextValue.isInstance(json)){
return json;
}
this.... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"TextValue",
")",
")",
"{",
"return",
"new",
"TextValue",
"(",
"json",
")",
";",
"}",
"// If the given object is... | A text value in a specific language.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#text-value|GEDCOM X JSON Spec}
@class
@extends Base
@apram {Object} [json] | [
"A",
"text",
"value",
"in",
"a",
"specific",
"language",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/TextValue.js#L13-L26 | |
38,475 | amrdraz/java-code-runner | index.js | runProc | function runProc(args, cb) {
var stoutBuffer = '',
sterrBuffer = '';
var proc = cp.spawn('java', args, {
cwd: config.rootDir + '/bin'
});
proc.stdout.on('data', function(data) {
stoutBuffer += data;
});
proc.stderr.on('data', function(data) {
sterrBuffer += data;
... | javascript | function runProc(args, cb) {
var stoutBuffer = '',
sterrBuffer = '';
var proc = cp.spawn('java', args, {
cwd: config.rootDir + '/bin'
});
proc.stdout.on('data', function(data) {
stoutBuffer += data;
});
proc.stderr.on('data', function(data) {
sterrBuffer += data;
... | [
"function",
"runProc",
"(",
"args",
",",
"cb",
")",
"{",
"var",
"stoutBuffer",
"=",
"''",
",",
"sterrBuffer",
"=",
"''",
";",
"var",
"proc",
"=",
"cp",
".",
"spawn",
"(",
"'java'",
",",
"args",
",",
"{",
"cwd",
":",
"config",
".",
"rootDir",
"+",
... | Spawn a java process and return callback
@param {Array} args arguments to pass to java proc
@param {Function} cb callback to be called with err, stout, sterr | [
"Spawn",
"a",
"java",
"process",
"and",
"return",
"callback"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/index.js#L56-L76 |
38,476 | amrdraz/java-code-runner | index.js | runCMD | function runCMD(options, cb) {
if (options.cb) {
cb = options.cb;
}
var args = ["-cp", ".", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "TerminalRunner"];
args.push(options.name);
args.push(options.program);
args.push(options.timeLimit);
args.push(options.input);
runPr... | javascript | function runCMD(options, cb) {
if (options.cb) {
cb = options.cb;
}
var args = ["-cp", ".", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "TerminalRunner"];
args.push(options.name);
args.push(options.program);
args.push(options.timeLimit);
args.push(options.input);
runPr... | [
"function",
"runCMD",
"(",
"options",
",",
"cb",
")",
"{",
"if",
"(",
"options",
".",
"cb",
")",
"{",
"cb",
"=",
"options",
".",
"cb",
";",
"}",
"var",
"args",
"=",
"[",
"\"-cp\"",
",",
"\".\"",
",",
"\"-XX:+TieredCompilation\"",
",",
"\"-XX:TieredStop... | Run java program in TerminalRunner
@param {Object} options an object containing all prgram needed configuration
- {String} name name of class
- {String} program source code of JavaClass with public class [name]
- {String} input The program's input stream if needed
@param {Function} cb callback when co... | [
"Run",
"java",
"program",
"in",
"TerminalRunner"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/index.js#L86-L101 |
38,477 | amrdraz/java-code-runner | index.js | runInServlet | function runInServlet(request, cb) {
// log("waitingQueue:"+waitingQueue.length+", runningQueue:"+runningQueue.length);
// log("pushed into running");
if (request.cb) {
cb = request.cb;
}
// program to run
var post_data = querystring.stringify({
'name': request.name,
'cod... | javascript | function runInServlet(request, cb) {
// log("waitingQueue:"+waitingQueue.length+", runningQueue:"+runningQueue.length);
// log("pushed into running");
if (request.cb) {
cb = request.cb;
}
// program to run
var post_data = querystring.stringify({
'name': request.name,
'cod... | [
"function",
"runInServlet",
"(",
"request",
",",
"cb",
")",
"{",
"// log(\"waitingQueue:\"+waitingQueue.length+\", runningQueue:\"+runningQueue.length);",
"// log(\"pushed into running\");",
"if",
"(",
"request",
".",
"cb",
")",
"{",
"cb",
"=",
"request",
".",
"cb",
";",
... | Run java program in server, which is singnificantly faster then CMD
@param {Object} options an object containing all prgram needed configuration
- {String} name name of class
- {String} program source code of JavaClass with public class [name]
- {String} input The program's input stream if needed
@param {F... | [
"Run",
"java",
"program",
"in",
"server",
"which",
"is",
"singnificantly",
"faster",
"then",
"CMD"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/index.js#L111-L179 |
38,478 | amrdraz/java-code-runner | index.js | classCase | function classCase(input) {
return input.toUpperCase().replace(/[\-\s](.)/g, function(match, group1) {
return group1.toUpperCase();
});
} | javascript | function classCase(input) {
return input.toUpperCase().replace(/[\-\s](.)/g, function(match, group1) {
return group1.toUpperCase();
});
} | [
"function",
"classCase",
"(",
"input",
")",
"{",
"return",
"input",
".",
"toUpperCase",
"(",
")",
".",
"replace",
"(",
"/",
"[\\-\\s](.)",
"/",
"g",
",",
"function",
"(",
"match",
",",
"group1",
")",
"{",
"return",
"group1",
".",
"toUpperCase",
"(",
")... | Turn a sting to Java class style camel Case striping - and space chracters
@param {[type]} input [description]
@return {[type]} [description] | [
"Turn",
"a",
"sting",
"to",
"Java",
"class",
"style",
"camel",
"Case",
"striping",
"-",
"and",
"space",
"chracters"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/index.js#L380-L384 |
38,479 | rootsdev/gedcomx-js | src/Base.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Base)){
return new Base(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Base.isInstance(json)){
return json;
}
this.init(json);
} | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Base)){
return new Base(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Base.isInstance(json)){
return json;
}
this.init(json);
} | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Base",
")",
")",
"{",
"return",
"new",
"Base",
"(",
"json",
")",
";",
"}",
"// If the given object is already a... | Base prototype that all other classes in this library extend
@class
@param {Object} [json] | [
"Base",
"prototype",
"that",
"all",
"other",
"classes",
"in",
"this",
"library",
"extend"
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/Base.js#L9-L22 | |
38,480 | wrwrwr/babel-remove-props | dist/main.es5.js | enter | function enter(path, state) {
regex = state.opts.regex;
if (!regex) {
throw new TypeError("A regex option is required.");
}
pure = function pure(n) {
return (0, _sideEffectsSafe.pureBabylon)(n, state.opts);
... | javascript | function enter(path, state) {
regex = state.opts.regex;
if (!regex) {
throw new TypeError("A regex option is required.");
}
pure = function pure(n) {
return (0, _sideEffectsSafe.pureBabylon)(n, state.opts);
... | [
"function",
"enter",
"(",
"path",
",",
"state",
")",
"{",
"regex",
"=",
"state",
".",
"opts",
".",
"regex",
";",
"if",
"(",
"!",
"regex",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"\"A regex option is required.\"",
")",
";",
"}",
"pure",
"=",
"functi... | Preprocess options. | [
"Preprocess",
"options",
"."
] | 37e0d759a9e6f2d4838f93231abe95f3dcb701ed | https://github.com/wrwrwr/babel-remove-props/blob/37e0d759a9e6f2d4838f93231abe95f3dcb701ed/dist/main.es5.js#L35-L43 |
38,481 | fanout/node-fanoutpub | lib/fanoutpub.js | function(realm, key, ssl) {
// Initialize with a specified realm, key, and a boolean indicating wther
// SSL should be enabled or disabled.
var scheme = 'https';
if (typeof ssl !== 'undefined' && !ssl) {
scheme = 'http';
}
var uri = scheme + '://api.fanout.io/realm/' + realm;
var pu... | javascript | function(realm, key, ssl) {
// Initialize with a specified realm, key, and a boolean indicating wther
// SSL should be enabled or disabled.
var scheme = 'https';
if (typeof ssl !== 'undefined' && !ssl) {
scheme = 'http';
}
var uri = scheme + '://api.fanout.io/realm/' + realm;
var pu... | [
"function",
"(",
"realm",
",",
"key",
",",
"ssl",
")",
"{",
"// Initialize with a specified realm, key, and a boolean indicating wther",
"// SSL should be enabled or disabled.",
"var",
"scheme",
"=",
"'https'",
";",
"if",
"(",
"typeof",
"ssl",
"!==",
"'undefined'",
"&&",
... | The Fanout class is used for publishing messages to Fanout.io and is configured with a Fanout.io realm and associated key. SSL can either be enabled or disabled. | [
"The",
"Fanout",
"class",
"is",
"used",
"for",
"publishing",
"messages",
"to",
"Fanout",
".",
"io",
"and",
"is",
"configured",
"with",
"a",
"Fanout",
".",
"io",
"realm",
"and",
"associated",
"key",
".",
"SSL",
"can",
"either",
"be",
"enabled",
"or",
"dis... | 726ca2f928385358ee095ea3ceb29c6cd32e80eb | https://github.com/fanout/node-fanoutpub/blob/726ca2f928385358ee095ea3ceb29c6cd32e80eb/lib/fanoutpub.js#L22-L34 | |
38,482 | keqingrong/react-iframe | packages/iframe-utils/src/index.js | buildOrigin | function buildOrigin(src, href) {
try {
const url = new URL(src, href || location.href);
return url.origin;
} catch (error) {
return null;
}
} | javascript | function buildOrigin(src, href) {
try {
const url = new URL(src, href || location.href);
return url.origin;
} catch (error) {
return null;
}
} | [
"function",
"buildOrigin",
"(",
"src",
",",
"href",
")",
"{",
"try",
"{",
"const",
"url",
"=",
"new",
"URL",
"(",
"src",
",",
"href",
"||",
"location",
".",
"href",
")",
";",
"return",
"url",
".",
"origin",
";",
"}",
"catch",
"(",
"error",
")",
"... | Build origin from URL string.
@param {string} src - URL string
@param {string} [href] - URL string
@returns {string|null} | [
"Build",
"origin",
"from",
"URL",
"string",
"."
] | 9ebfa116fc97c9ecf8d4d5968ca5f851f21acb74 | https://github.com/keqingrong/react-iframe/blob/9ebfa116fc97c9ecf8d4d5968ca5f851f21acb74/packages/iframe-utils/src/index.js#L13-L20 |
38,483 | keqingrong/react-iframe | packages/iframe-utils/src/index.js | checkOlderIE | function checkOlderIE() {
const ua = navigator.userAgent;
const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
if (!isIE) {
return false;
}
const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
const versionNumber = parseFloat(version);
if (versionNumber < 10) {
return t... | javascript | function checkOlderIE() {
const ua = navigator.userAgent;
const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
if (!isIE) {
return false;
}
const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
const versionNumber = parseFloat(version);
if (versionNumber < 10) {
return t... | [
"function",
"checkOlderIE",
"(",
")",
"{",
"const",
"ua",
"=",
"navigator",
".",
"userAgent",
";",
"const",
"isIE",
"=",
"ua",
".",
"indexOf",
"(",
"'MSIE'",
")",
"!==",
"-",
"1",
"||",
"ua",
".",
"indexOf",
"(",
"'Trident'",
")",
"!==",
"-",
"1",
... | Check if it is IE below 10.
@returns {boolean} | [
"Check",
"if",
"it",
"is",
"IE",
"below",
"10",
"."
] | 9ebfa116fc97c9ecf8d4d5968ca5f851f21acb74 | https://github.com/keqingrong/react-iframe/blob/9ebfa116fc97c9ecf8d4d5968ca5f851f21acb74/packages/iframe-utils/src/index.js#L47-L59 |
38,484 | rootsdev/gedcomx-js | src/atom/AtomPerson.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomPerson)){
return new AtomPerson(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomPerson.isInstance(json)){
return... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomPerson)){
return new AtomPerson(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomPerson.isInstance(json)){
return... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AtomPerson",
")",
")",
"{",
"return",
"new",
"AtomPerson",
"(",
"json",
")",
";",
"}",
"// If the given object ... | Common schema for atom authors and contributors.
@see {@link https://github.com/FamilySearch/gedcomx-rs/blob/master/specifications/atom-model-specification.md#atom-json-media-type|GEDCOM X Atom JSON Spec}
@see {@link https://tools.ietf.org/html/rfc4287#appendix-B|RFC 4287}
@class AtomPerson
@extends AtomCommon
@param... | [
"Common",
"schema",
"for",
"atom",
"authors",
"and",
"contributors",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/atom/AtomPerson.js#L16-L29 | |
38,485 | mikolalysenko/poly-to-pslg | poly-to-pslg.js | polygonToPSLG | function polygonToPSLG(loops, options) {
if(!Array.isArray(loops)) {
throw new Error('poly-to-pslg: Error, invalid polygon')
}
if(loops.length === 0) {
return {
points: [],
edges: []
}
}
options = options || {}
var nested = true
if('nested' in options) {
nested = !!options.n... | javascript | function polygonToPSLG(loops, options) {
if(!Array.isArray(loops)) {
throw new Error('poly-to-pslg: Error, invalid polygon')
}
if(loops.length === 0) {
return {
points: [],
edges: []
}
}
options = options || {}
var nested = true
if('nested' in options) {
nested = !!options.n... | [
"function",
"polygonToPSLG",
"(",
"loops",
",",
"options",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"loops",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'poly-to-pslg: Error, invalid polygon'",
")",
"}",
"if",
"(",
"loops",
".",
"length",
... | Converts a polygon to a planar straight line graph | [
"Converts",
"a",
"polygon",
"to",
"a",
"planar",
"straight",
"line",
"graph"
] | 186c2e164049009d2d89078d83065f3f7c86b182 | https://github.com/mikolalysenko/poly-to-pslg/blob/186c2e164049009d2d89078d83065f3f7c86b182/poly-to-pslg.js#L8-L55 |
38,486 | JS-DevTools/sourcemapify | lib/index.js | sourcemapify | function sourcemapify (browserify, options) {
options = options || browserify._options || {};
function write (data) {
if (options.base) {
// Determine the relative path
// from the bundle file's directory to the source file
let base = path.resolve(process.cwd(), options.base);
data.sour... | javascript | function sourcemapify (browserify, options) {
options = options || browserify._options || {};
function write (data) {
if (options.base) {
// Determine the relative path
// from the bundle file's directory to the source file
let base = path.resolve(process.cwd(), options.base);
data.sour... | [
"function",
"sourcemapify",
"(",
"browserify",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"browserify",
".",
"_options",
"||",
"{",
"}",
";",
"function",
"write",
"(",
"data",
")",
"{",
"if",
"(",
"options",
".",
"base",
")",
"{",
"// D... | Transforms the browserify sourcemap
@param {object} browserify - The Browserify instance
@param {object} [options] - Plugin options | [
"Transforms",
"the",
"browserify",
"sourcemap"
] | 2e1d838ab6ff766a762c32097855125b3ed7bd80 | https://github.com/JS-DevTools/sourcemapify/blob/2e1d838ab6ff766a762c32097855125b3ed7bd80/lib/index.js#L14-L45 |
38,487 | JS-DevTools/sourcemapify | lib/index.js | joinURL | function joinURL (urlA, urlB) {
urlA = urlA || "";
urlB = urlB || "";
let endsWithASlash = urlA.substr(-1) === "/" || urlA.substr(-1) === "\\";
let startsWithASlash = urlB[0] === "/" || urlB[0] === "\\";
if (endsWithASlash || startsWithASlash) {
return urlA + urlB;
}
else {
return urlA + "/" + u... | javascript | function joinURL (urlA, urlB) {
urlA = urlA || "";
urlB = urlB || "";
let endsWithASlash = urlA.substr(-1) === "/" || urlA.substr(-1) === "\\";
let startsWithASlash = urlB[0] === "/" || urlB[0] === "\\";
if (endsWithASlash || startsWithASlash) {
return urlA + urlB;
}
else {
return urlA + "/" + u... | [
"function",
"joinURL",
"(",
"urlA",
",",
"urlB",
")",
"{",
"urlA",
"=",
"urlA",
"||",
"\"\"",
";",
"urlB",
"=",
"urlB",
"||",
"\"\"",
";",
"let",
"endsWithASlash",
"=",
"urlA",
".",
"substr",
"(",
"-",
"1",
")",
"===",
"\"/\"",
"||",
"urlA",
".",
... | Joins two URL paths, possibly adding a separator.
@param {string} urlA
@param {string} urlB
@returns {string} | [
"Joins",
"two",
"URL",
"paths",
"possibly",
"adding",
"a",
"separator",
"."
] | 2e1d838ab6ff766a762c32097855125b3ed7bd80 | https://github.com/JS-DevTools/sourcemapify/blob/2e1d838ab6ff766a762c32097855125b3ed7bd80/lib/index.js#L54-L67 |
38,488 | ragingwind/electron-togglify-window | index.js | ToggleAnimation | function ToggleAnimation(target, animation) {
var preset = {
hide: {
hide: 'hide',
focus: 'show',
restore: 'show',
blur: 'hide'
},
scale: {
hide: 'minimize',
focus: 'focus',
restore: 'restore',
}
};
this._preset = preset[animation];
this._target = target;
if (!this._target) {
throw... | javascript | function ToggleAnimation(target, animation) {
var preset = {
hide: {
hide: 'hide',
focus: 'show',
restore: 'show',
blur: 'hide'
},
scale: {
hide: 'minimize',
focus: 'focus',
restore: 'restore',
}
};
this._preset = preset[animation];
this._target = target;
if (!this._target) {
throw... | [
"function",
"ToggleAnimation",
"(",
"target",
",",
"animation",
")",
"{",
"var",
"preset",
"=",
"{",
"hide",
":",
"{",
"hide",
":",
"'hide'",
",",
"focus",
":",
"'show'",
",",
"restore",
":",
"'show'",
",",
"blur",
":",
"'hide'",
"}",
",",
"scale",
"... | Delegate function for animation of window set toggle | [
"Delegate",
"function",
"for",
"animation",
"of",
"window",
"set",
"toggle"
] | e9781f67f79e8d2a082dba4cb31b29bdbb874df7 | https://github.com/ragingwind/electron-togglify-window/blob/e9781f67f79e8d2a082dba4cb31b29bdbb874df7/index.js#L6-L29 |
38,489 | ragingwind/electron-togglify-window | index.js | togglify | function togglify(win, opts) {
// extend options for toggle window
opts = oassign({
animation: 'hide'
}, opts);
win._toggleAction = new ToggleAnimation(win, opts.animation);
// patch toggle function to window
win.toggle = function () {
if (this.isVisible() && this.isFocused()) {
this._toggleAction.hide()... | javascript | function togglify(win, opts) {
// extend options for toggle window
opts = oassign({
animation: 'hide'
}, opts);
win._toggleAction = new ToggleAnimation(win, opts.animation);
// patch toggle function to window
win.toggle = function () {
if (this.isVisible() && this.isFocused()) {
this._toggleAction.hide()... | [
"function",
"togglify",
"(",
"win",
",",
"opts",
")",
"{",
"// extend options for toggle window",
"opts",
"=",
"oassign",
"(",
"{",
"animation",
":",
"'hide'",
"}",
",",
"opts",
")",
";",
"win",
".",
"_toggleAction",
"=",
"new",
"ToggleAnimation",
"(",
"win"... | Set window to be able to togggle | [
"Set",
"window",
"to",
"be",
"able",
"to",
"togggle"
] | e9781f67f79e8d2a082dba4cb31b29bdbb874df7 | https://github.com/ragingwind/electron-togglify-window/blob/e9781f67f79e8d2a082dba4cb31b29bdbb874df7/index.js#L55-L82 |
38,490 | rootsdev/gedcomx-js | src/core/SourceCitation.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof SourceCitation)){
return new SourceCitation(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(SourceCitation.isInstance(json)){
return json;... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof SourceCitation)){
return new SourceCitation(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(SourceCitation.isInstance(json)){
return json;... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"SourceCitation",
")",
")",
"{",
"return",
"new",
"SourceCitation",
"(",
"json",
")",
";",
"}",
"// If the given... | A source citation.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#source-citation|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@apram {Object} [json] | [
"A",
"source",
"citation",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/SourceCitation.js#L13-L26 | |
38,491 | lroche/karma-jasmine-bridge | lib/Spec.js | wrapper | function wrapper(matcherName, legacyMatcher){
return function(util, customEqualityTesters){
return {
compare: function(actual, expected){
var scope = {actual: actual}, message, result;
result = legacyMatcher.call(scope, expected)
mes... | javascript | function wrapper(matcherName, legacyMatcher){
return function(util, customEqualityTesters){
return {
compare: function(actual, expected){
var scope = {actual: actual}, message, result;
result = legacyMatcher.call(scope, expected)
mes... | [
"function",
"wrapper",
"(",
"matcherName",
",",
"legacyMatcher",
")",
"{",
"return",
"function",
"(",
"util",
",",
"customEqualityTesters",
")",
"{",
"return",
"{",
"compare",
":",
"function",
"(",
"actual",
",",
"expected",
")",
"{",
"var",
"scope",
"=",
... | Wraps Jasmine2 matcher to be compliant with Jasmine 1 API. | [
"Wraps",
"Jasmine2",
"matcher",
"to",
"be",
"compliant",
"with",
"Jasmine",
"1",
"API",
"."
] | eda799fab2bb09f7876d31420955583e6791d27c | https://github.com/lroche/karma-jasmine-bridge/blob/eda799fab2bb09f7876d31420955583e6791d27c/lib/Spec.js#L135-L151 |
38,492 | rowanmanning/chic | lib/chic.js | applySuperMethod | function applySuperMethod (fn, sup) {
return function () {
var prev, result;
prev = this.sup;
this.sup = sup;
result = fn.apply(this, arguments);
this.sup = prev;
if (typeof this.sup === 'undefined') {
delete this.sup;
... | javascript | function applySuperMethod (fn, sup) {
return function () {
var prev, result;
prev = this.sup;
this.sup = sup;
result = fn.apply(this, arguments);
this.sup = prev;
if (typeof this.sup === 'undefined') {
delete this.sup;
... | [
"function",
"applySuperMethod",
"(",
"fn",
",",
"sup",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"prev",
",",
"result",
";",
"prev",
"=",
"this",
".",
"sup",
";",
"this",
".",
"sup",
"=",
"sup",
";",
"result",
"=",
"fn",
".",
"apply",
... | Apply a super-method to a function. `this.sup` is set to `sup` inside calls to `fn`. | [
"Apply",
"a",
"super",
"-",
"method",
"to",
"a",
"function",
".",
"this",
".",
"sup",
"is",
"set",
"to",
"sup",
"inside",
"calls",
"to",
"fn",
"."
] | c5839c2e1e2be1cf13e86e828f5059c57954d5e8 | https://github.com/rowanmanning/chic/blob/c5839c2e1e2be1cf13e86e828f5059c57954d5e8/lib/chic.js#L27-L39 |
38,493 | ipanli/xlsxtojson | index.js | parseCommandLine | function parseCommandLine(args) {
var parsed_cmds = [];
if (args.length <= 2) {
parsed_cmds.push(defaultCommand());
} else {
var cli = args.slice(2);
var pos = 0;
var cmd;
cli.forEach(function(element, index, array) {
//replace alias name with real n... | javascript | function parseCommandLine(args) {
var parsed_cmds = [];
if (args.length <= 2) {
parsed_cmds.push(defaultCommand());
} else {
var cli = args.slice(2);
var pos = 0;
var cmd;
cli.forEach(function(element, index, array) {
//replace alias name with real n... | [
"function",
"parseCommandLine",
"(",
"args",
")",
"{",
"var",
"parsed_cmds",
"=",
"[",
"]",
";",
"if",
"(",
"args",
".",
"length",
"<=",
"2",
")",
"{",
"parsed_cmds",
".",
"push",
"(",
"defaultCommand",
"(",
")",
")",
";",
"}",
"else",
"{",
"var",
... | parse command line args | [
"parse",
"command",
"line",
"args"
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/index.js#L120-L160 |
38,494 | ipanli/xlsxtojson | index.js | defaultCommand | function defaultCommand() {
if (keys.length <= 0) {
throw new Error("Error: there is no command at all!");
};
for (var p in commands) {
if (commands[p]["default"]) {
return commands[p];
};
};
if (keys["--help"]) {
return commands["--help"];
} else {
... | javascript | function defaultCommand() {
if (keys.length <= 0) {
throw new Error("Error: there is no command at all!");
};
for (var p in commands) {
if (commands[p]["default"]) {
return commands[p];
};
};
if (keys["--help"]) {
return commands["--help"];
} else {
... | [
"function",
"defaultCommand",
"(",
")",
"{",
"if",
"(",
"keys",
".",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Error: there is no command at all!\"",
")",
";",
"}",
";",
"for",
"(",
"var",
"p",
"in",
"commands",
")",
"{",
"if",
"(... | default command when no command line argas provided. | [
"default",
"command",
"when",
"no",
"command",
"line",
"argas",
"provided",
"."
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/index.js#L165-L181 |
38,495 | smagch/simple-lru | simple-lru.js | Entry | function Entry(key, val, index) {
this.key = key;
this.val = val;
this.index = index;
} | javascript | function Entry(key, val, index) {
this.key = key;
this.val = val;
this.index = index;
} | [
"function",
"Entry",
"(",
"key",
",",
"val",
",",
"index",
")",
"{",
"this",
".",
"key",
"=",
"key",
";",
"this",
".",
"val",
"=",
"val",
";",
"this",
".",
"index",
"=",
"index",
";",
"}"
] | Cache entry instance
@param {String}
@param {any}
@param {Number}
@api private | [
"Cache",
"entry",
"instance"
] | b32d8e55a190c969419d84669a1228c8705bfca2 | https://github.com/smagch/simple-lru/blob/b32d8e55a190c969419d84669a1228c8705bfca2/simple-lru.js#L92-L96 |
38,496 | smagch/simple-lru | simple-lru.js | function (key, val) {
var entry = this._byKey.get(key);
// reuse entry if the key exists
if (entry) {
this._touch(entry);
entry.val = val;
return;
}
entry = new Entry(key, val, this._head++);
this._byKey.set(key, entry);
this._byOrder[entry.index] = en... | javascript | function (key, val) {
var entry = this._byKey.get(key);
// reuse entry if the key exists
if (entry) {
this._touch(entry);
entry.val = val;
return;
}
entry = new Entry(key, val, this._head++);
this._byKey.set(key, entry);
this._byOrder[entry.index] = en... | [
"function",
"(",
"key",
",",
"val",
")",
"{",
"var",
"entry",
"=",
"this",
".",
"_byKey",
".",
"get",
"(",
"key",
")",
";",
"// reuse entry if the key exists",
"if",
"(",
"entry",
")",
"{",
"this",
".",
"_touch",
"(",
"entry",
")",
";",
"entry",
".",... | Set cache by key
@param {String} unique string key
@param {String|Object|Number} any value | [
"Set",
"cache",
"by",
"key"
] | b32d8e55a190c969419d84669a1228c8705bfca2 | https://github.com/smagch/simple-lru/blob/b32d8e55a190c969419d84669a1228c8705bfca2/simple-lru.js#L126-L141 | |
38,497 | smagch/simple-lru | simple-lru.js | function (key) {
var entry = this._byKey.del(key);
if (!entry) return;
delete this._byOrder[entry.index];
this._len--;
if (this._len === 0) {
this._head = this._tail = 0;
} else {
// update most index if it was most lecently used entry
if (entry.index === th... | javascript | function (key) {
var entry = this._byKey.del(key);
if (!entry) return;
delete this._byOrder[entry.index];
this._len--;
if (this._len === 0) {
this._head = this._tail = 0;
} else {
// update most index if it was most lecently used entry
if (entry.index === th... | [
"function",
"(",
"key",
")",
"{",
"var",
"entry",
"=",
"this",
".",
"_byKey",
".",
"del",
"(",
"key",
")",
";",
"if",
"(",
"!",
"entry",
")",
"return",
";",
"delete",
"this",
".",
"_byOrder",
"[",
"entry",
".",
"index",
"]",
";",
"this",
".",
"... | delete cache by key
@param {String}
@return {String|Object|Number} cached value | [
"delete",
"cache",
"by",
"key"
] | b32d8e55a190c969419d84669a1228c8705bfca2 | https://github.com/smagch/simple-lru/blob/b32d8e55a190c969419d84669a1228c8705bfca2/simple-lru.js#L149-L166 | |
38,498 | smagch/simple-lru | simple-lru.js | function (key) {
var entry = this._byKey.get(key);
if (entry) {
this._touch(entry);
return entry.val;
}
} | javascript | function (key) {
var entry = this._byKey.get(key);
if (entry) {
this._touch(entry);
return entry.val;
}
} | [
"function",
"(",
"key",
")",
"{",
"var",
"entry",
"=",
"this",
".",
"_byKey",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
")",
"{",
"this",
".",
"_touch",
"(",
"entry",
")",
";",
"return",
"entry",
".",
"val",
";",
"}",
"}"
] | get cache by key
@param {String}
@return {any} cache if it exists | [
"get",
"cache",
"by",
"key"
] | b32d8e55a190c969419d84669a1228c8705bfca2 | https://github.com/smagch/simple-lru/blob/b32d8e55a190c969419d84669a1228c8705bfca2/simple-lru.js#L174-L180 | |
38,499 | smagch/simple-lru | simple-lru.js | function (max) {
if (typeof max !== 'number') return this._max;
if (max < 1) throw new TypeError('max should be a positive number');
var shrink = (this._max || 0) > max;
this._max = max;
if (shrink) this._trim();
} | javascript | function (max) {
if (typeof max !== 'number') return this._max;
if (max < 1) throw new TypeError('max should be a positive number');
var shrink = (this._max || 0) > max;
this._max = max;
if (shrink) this._trim();
} | [
"function",
"(",
"max",
")",
"{",
"if",
"(",
"typeof",
"max",
"!==",
"'number'",
")",
"return",
"this",
".",
"_max",
";",
"if",
"(",
"max",
"<",
"1",
")",
"throw",
"new",
"TypeError",
"(",
"'max should be a positive number'",
")",
";",
"var",
"shrink",
... | Getter|Setter function of "max" option
@param {Number} if setter | [
"Getter|Setter",
"function",
"of",
"max",
"option"
] | b32d8e55a190c969419d84669a1228c8705bfca2 | https://github.com/smagch/simple-lru/blob/b32d8e55a190c969419d84669a1228c8705bfca2/simple-lru.js#L222-L228 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.