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,600 | jpettersson/node-ordered-merge-stream | index.js | emitData | function emitData() {
for(var i=0;i<streamQueue.length;i++) {
var dataQueue = streamQueue[i].dataQueue;
if(streamQueue[i].pending) {
return;
}
for(var j=0;j<dataQueue.length;j++) {
var data = dataQueue[j];
if(!!data) {
_this.emit('data', ... | javascript | function emitData() {
for(var i=0;i<streamQueue.length;i++) {
var dataQueue = streamQueue[i].dataQueue;
if(streamQueue[i].pending) {
return;
}
for(var j=0;j<dataQueue.length;j++) {
var data = dataQueue[j];
if(!!data) {
_this.emit('data', ... | [
"function",
"emitData",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"streamQueue",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"dataQueue",
"=",
"streamQueue",
"[",
"i",
"]",
".",
"dataQueue",
";",
"if",
"(",
"streamQueue",
... | Emit everything available so far in the queue | [
"Emit",
"everything",
"available",
"so",
"far",
"in",
"the",
"queue"
] | 5e19cd3dae8ffbdce4a74a147edb7f6b1c97f3ab | https://github.com/jpettersson/node-ordered-merge-stream/blob/5e19cd3dae8ffbdce4a74a147edb7f6b1c97f3ab/index.js#L14-L36 |
38,601 | sethvincent/store-emitter | index.js | store | function store (action) {
if (!action || !isPlainObject(action)) {
throw new Error('action parameter is required and must be a plain object')
}
if (!action.type || typeof action.type !== 'string') {
throw new Error('type property of action is required and must be a string')
}
if (isEmi... | javascript | function store (action) {
if (!action || !isPlainObject(action)) {
throw new Error('action parameter is required and must be a plain object')
}
if (!action.type || typeof action.type !== 'string') {
throw new Error('type property of action is required and must be a string')
}
if (isEmi... | [
"function",
"store",
"(",
"action",
")",
"{",
"if",
"(",
"!",
"action",
"||",
"!",
"isPlainObject",
"(",
"action",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'action parameter is required and must be a plain object'",
")",
"}",
"if",
"(",
"!",
"action",
"... | Send an action to the store. Takes a single object parameter. Object must include a `type` property with a string value, and can contain any other properties.
@name store
@param {object} action
@param {string} action.type
@example
store({
type: 'example'
exampleValue: 'anything'
}) | [
"Send",
"an",
"action",
"to",
"the",
"store",
".",
"Takes",
"a",
"single",
"object",
"parameter",
".",
"Object",
"must",
"include",
"a",
"type",
"property",
"with",
"a",
"string",
"value",
"and",
"can",
"contain",
"any",
"other",
"properties",
"."
] | a58d19390f1ef08477d795831738019993f074d5 | https://github.com/sethvincent/store-emitter/blob/a58d19390f1ef08477d795831738019993f074d5/index.js#L46-L66 |
38,602 | rootsdev/gedcomx-js | src/core/Qualifier.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Qualifier)){
return new Qualifier(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Qualifier.isInstance(json)){
return json;
}
this.... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Qualifier)){
return new Qualifier(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Qualifier.isInstance(json)){
return json;
}
this.... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Qualifier",
")",
")",
"{",
"return",
"new",
"Qualifier",
"(",
"json",
")",
";",
"}",
"// If the given object is... | Qualifiers are used to supply additional details about a piece of data.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#qualifier|GEDCOM X JSON Spec}
@class
@extends Base
@param {Object} [json] | [
"Qualifiers",
"are",
"used",
"to",
"supply",
"additional",
"details",
"about",
"a",
"piece",
"of",
"data",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Qualifier.js#L13-L26 | |
38,603 | fullcube/loopback-component-templates | lib/index.js | hasRemoteMethod | function hasRemoteMethod(model, methodName) {
return model.sharedClass
.methods({ includeDisabled: false })
.map(sharedMethod => sharedMethod.name)
.includes(methodName)
} | javascript | function hasRemoteMethod(model, methodName) {
return model.sharedClass
.methods({ includeDisabled: false })
.map(sharedMethod => sharedMethod.name)
.includes(methodName)
} | [
"function",
"hasRemoteMethod",
"(",
"model",
",",
"methodName",
")",
"{",
"return",
"model",
".",
"sharedClass",
".",
"methods",
"(",
"{",
"includeDisabled",
":",
"false",
"}",
")",
".",
"map",
"(",
"sharedMethod",
"=>",
"sharedMethod",
".",
"name",
")",
"... | Helper method to check if a remote method exists on a model
@param model The LoopBack Model
@param methodName The name of the Remote Method
@returns {boolean} | [
"Helper",
"method",
"to",
"check",
"if",
"a",
"remote",
"method",
"exists",
"on",
"a",
"model"
] | 8fc81955d1ddae805bc6d66743d8e359d1cfac5f | https://github.com/fullcube/loopback-component-templates/blob/8fc81955d1ddae805bc6d66743d8e359d1cfac5f/lib/index.js#L13-L18 |
38,604 | fullcube/loopback-component-templates | lib/index.js | addRemoteMethods | function addRemoteMethods(app) {
return Object.keys(app.models).forEach(modelName => {
const Model = app.models[modelName]
if (typeof Model._templates !== 'function') {
return null
}
return Object.keys(Model._templates()).forEach(templateName => {
const fnName = `_template_${templateName... | javascript | function addRemoteMethods(app) {
return Object.keys(app.models).forEach(modelName => {
const Model = app.models[modelName]
if (typeof Model._templates !== 'function') {
return null
}
return Object.keys(Model._templates()).forEach(templateName => {
const fnName = `_template_${templateName... | [
"function",
"addRemoteMethods",
"(",
"app",
")",
"{",
"return",
"Object",
".",
"keys",
"(",
"app",
".",
"models",
")",
".",
"forEach",
"(",
"modelName",
"=>",
"{",
"const",
"Model",
"=",
"app",
".",
"models",
"[",
"modelName",
"]",
"if",
"(",
"typeof",... | Add remote methods for each template.
@param {Object} app loopback application
@param {Object} config component configuration | [
"Add",
"remote",
"methods",
"for",
"each",
"template",
"."
] | 8fc81955d1ddae805bc6d66743d8e359d1cfac5f | https://github.com/fullcube/loopback-component-templates/blob/8fc81955d1ddae805bc6d66743d8e359d1cfac5f/lib/index.js#L26-L98 |
38,605 | fullcube/loopback-component-templates | lib/index.js | addAcls | function addAcls(app, config) {
config.acls = config.acls || []
return Promise.resolve(Object.keys(app.models)).mapSeries(modelName => {
const Model = app.models[modelName]
if (typeof Model._templates !== 'function') {
return null
}
return Promise.resolve(Object.keys(Model._templates()))
... | javascript | function addAcls(app, config) {
config.acls = config.acls || []
return Promise.resolve(Object.keys(app.models)).mapSeries(modelName => {
const Model = app.models[modelName]
if (typeof Model._templates !== 'function') {
return null
}
return Promise.resolve(Object.keys(Model._templates()))
... | [
"function",
"addAcls",
"(",
"app",
",",
"config",
")",
"{",
"config",
".",
"acls",
"=",
"config",
".",
"acls",
"||",
"[",
"]",
"return",
"Promise",
".",
"resolve",
"(",
"Object",
".",
"keys",
"(",
"app",
".",
"models",
")",
")",
".",
"mapSeries",
"... | Add ACLs for each template.
@param {Object} app loopback application
@param {Object} config component configuration | [
"Add",
"ACLs",
"for",
"each",
"template",
"."
] | 8fc81955d1ddae805bc6d66743d8e359d1cfac5f | https://github.com/fullcube/loopback-component-templates/blob/8fc81955d1ddae805bc6d66743d8e359d1cfac5f/lib/index.js#L106-L130 |
38,606 | FormBucket/xander | src/router.js | match | function match(routes = [], path) {
for (var i = 0; i < routes.length; i++) {
var re = pathRegexps[routes[i].path] || pathToRegexp(routes[i].path);
pathRegexps[routes[i].path] = re;
if (re && re.test(path)) {
return { re, route: routes[i] };
}
}
return false;
} | javascript | function match(routes = [], path) {
for (var i = 0; i < routes.length; i++) {
var re = pathRegexps[routes[i].path] || pathToRegexp(routes[i].path);
pathRegexps[routes[i].path] = re;
if (re && re.test(path)) {
return { re, route: routes[i] };
}
}
return false;
} | [
"function",
"match",
"(",
"routes",
"=",
"[",
"]",
",",
"path",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"routes",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"re",
"=",
"pathRegexps",
"[",
"routes",
"[",
"i",
"]",
".",
... | Return the first matching route. | [
"Return",
"the",
"first",
"matching",
"route",
"."
] | 6e63fdaa5cbacd125f661e87d703a4160d564e9f | https://github.com/FormBucket/xander/blob/6e63fdaa5cbacd125f661e87d703a4160d564e9f/src/router.js#L24-L35 |
38,607 | rootsdev/gedcomx-js | src/rs/DisplayProperties.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof DisplayProperties)){
return new DisplayProperties(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(DisplayProperties.isInstance... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof DisplayProperties)){
return new DisplayProperties(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(DisplayProperties.isInstance... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"DisplayProperties",
")",
")",
"{",
"return",
"new",
"DisplayProperties",
"(",
"json",
")",
";",
"}",
"// If the... | A set of properties for convenience in displaying a summary of a person to a user.
@see {@link https://github.com/FamilySearch/gedcomx-rs/blob/master/specifications/rs-specification.md#display-properties-data-type|GEDCOM X RS Spec}
@class DisplayProperties
@extends Base
@param {Object} [json] | [
"A",
"set",
"of",
"properties",
"for",
"convenience",
"in",
"displaying",
"a",
"summary",
"of",
"a",
"person",
"to",
"a",
"user",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/rs/DisplayProperties.js#L15-L28 | |
38,608 | rootsdev/gedcomx-js | src/atom/AtomEntry.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomEntry)){
return new AtomEntry(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomEntry.isInstance(json)){
return js... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomEntry)){
return new AtomEntry(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomEntry.isInstance(json)){
return js... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AtomEntry",
")",
")",
"{",
"return",
"new",
"AtomEntry",
"(",
"json",
")",
";",
"}",
"// If the given object is... | An individual atom feed entry.
@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.1.2|RFC 4287}
@class AtomEntry
@extends AtomCommon
@param {Object} [json] | [
"An",
"individual",
"atom",
"feed",
"entry",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/atom/AtomEntry.js#L16-L29 | |
38,609 | FormBucket/xander | src/store.js | Dispatcher | function Dispatcher() {
let lastId = 1;
let prefix = "ID_";
let callbacks = {};
let isPending = {};
let isHandled = {};
let isDispatching = false;
let pendingPayload = null;
function invokeCallback(id) {
isPending[id] = true;
callbacks[id](pendingPayload);
isHandled[id] = true;
}
this.... | javascript | function Dispatcher() {
let lastId = 1;
let prefix = "ID_";
let callbacks = {};
let isPending = {};
let isHandled = {};
let isDispatching = false;
let pendingPayload = null;
function invokeCallback(id) {
isPending[id] = true;
callbacks[id](pendingPayload);
isHandled[id] = true;
}
this.... | [
"function",
"Dispatcher",
"(",
")",
"{",
"let",
"lastId",
"=",
"1",
";",
"let",
"prefix",
"=",
"\"ID_\"",
";",
"let",
"callbacks",
"=",
"{",
"}",
";",
"let",
"isPending",
"=",
"{",
"}",
";",
"let",
"isHandled",
"=",
"{",
"}",
";",
"let",
"isDispatc... | Based on Facebook's Flux dispatcher class. | [
"Based",
"on",
"Facebook",
"s",
"Flux",
"dispatcher",
"class",
"."
] | 6e63fdaa5cbacd125f661e87d703a4160d564e9f | https://github.com/FormBucket/xander/blob/6e63fdaa5cbacd125f661e87d703a4160d564e9f/src/store.js#L5-L75 |
38,610 | neagle/smartgamer | index.js | function () {
if (sequence) {
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
if (localNodes) {
if (localIndex === (localNodes.length - 1)) {
return sequence.sequences || [];
} else {
return [];
}
}
}
} | javascript | function () {
if (sequence) {
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
if (localNodes) {
if (localIndex === (localNodes.length - 1)) {
return sequence.sequences || [];
} else {
return [];
}
}
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"sequence",
")",
"{",
"var",
"localNodes",
"=",
"sequence",
".",
"nodes",
";",
"var",
"localIndex",
"=",
"(",
"localNodes",
")",
"?",
"localNodes",
".",
"indexOf",
"(",
"node",
")",
":",
"null",
";",
"if",
"(",
... | Return any variations available at the current move | [
"Return",
"any",
"variations",
"available",
"at",
"the",
"current",
"move"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L65-L78 | |
38,611 | neagle/smartgamer | index.js | function (variation) {
variation = variation || 0;
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
// If there are no additional nodes in this sequence,
// advance to the next one
if (localIndex === null || localIndex >= (localNodes.length - 1)) {
... | javascript | function (variation) {
variation = variation || 0;
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
// If there are no additional nodes in this sequence,
// advance to the next one
if (localIndex === null || localIndex >= (localNodes.length - 1)) {
... | [
"function",
"(",
"variation",
")",
"{",
"variation",
"=",
"variation",
"||",
"0",
";",
"var",
"localNodes",
"=",
"sequence",
".",
"nodes",
";",
"var",
"localIndex",
"=",
"(",
"localNodes",
")",
"?",
"localNodes",
".",
"indexOf",
"(",
"node",
")",
":",
... | Go to the next move | [
"Go",
"to",
"the",
"next",
"move"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L83-L114 | |
38,612 | neagle/smartgamer | index.js | function () {
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
// Delete any variation forks at this point
// TODO: Make this configurable... we should keep this if we're
// remembering chosen paths
delete this.path[this.path.m];
if (!localIndex ||... | javascript | function () {
var localNodes = sequence.nodes;
var localIndex = (localNodes) ? localNodes.indexOf(node) : null;
// Delete any variation forks at this point
// TODO: Make this configurable... we should keep this if we're
// remembering chosen paths
delete this.path[this.path.m];
if (!localIndex ||... | [
"function",
"(",
")",
"{",
"var",
"localNodes",
"=",
"sequence",
".",
"nodes",
";",
"var",
"localIndex",
"=",
"(",
"localNodes",
")",
"?",
"localNodes",
".",
"indexOf",
"(",
"node",
")",
":",
"null",
";",
"// Delete any variation forks at this point",
"// TODO... | Go to the previous move | [
"Go",
"to",
"the",
"previous",
"move"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L119-L147 | |
38,613 | neagle/smartgamer | index.js | function (path) {
if (typeof path === 'string') {
path = this.pathTransform(path, 'object');
} else if (typeof path === 'number') {
path = { m: path };
}
this.reset();
var n = node;
for (var i = 0; i < path.m && n; i += 1) {
// Check for a variation in the path for the upcoming move
... | javascript | function (path) {
if (typeof path === 'string') {
path = this.pathTransform(path, 'object');
} else if (typeof path === 'number') {
path = { m: path };
}
this.reset();
var n = node;
for (var i = 0; i < path.m && n; i += 1) {
// Check for a variation in the path for the upcoming move
... | [
"function",
"(",
"path",
")",
"{",
"if",
"(",
"typeof",
"path",
"===",
"'string'",
")",
"{",
"path",
"=",
"this",
".",
"pathTransform",
"(",
"path",
",",
"'object'",
")",
";",
"}",
"else",
"if",
"(",
"typeof",
"path",
"===",
"'number'",
")",
"{",
"... | Go to a particular move, specified as a
a) number
b) path string
c) path object | [
"Go",
"to",
"a",
"particular",
"move",
"specified",
"as",
"a",
"a",
")",
"number",
"b",
")",
"path",
"string",
"c",
")",
"path",
"object"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L172-L190 | |
38,614 | neagle/smartgamer | index.js | function () {
var localSequence = this.game;
var moves = 0;
while(localSequence) {
moves += localSequence.nodes.length;
if (localSequence.sequences) {
localSequence = localSequence.sequences[0];
} else {
localSequence = null;
}
}
// TODO: Right now we're *assuming* that the ro... | javascript | function () {
var localSequence = this.game;
var moves = 0;
while(localSequence) {
moves += localSequence.nodes.length;
if (localSequence.sequences) {
localSequence = localSequence.sequences[0];
} else {
localSequence = null;
}
}
// TODO: Right now we're *assuming* that the ro... | [
"function",
"(",
")",
"{",
"var",
"localSequence",
"=",
"this",
".",
"game",
";",
"var",
"moves",
"=",
"0",
";",
"while",
"(",
"localSequence",
")",
"{",
"moves",
"+=",
"localSequence",
".",
"nodes",
".",
"length",
";",
"if",
"(",
"localSequence",
".",... | Get the total number of moves in a game | [
"Get",
"the",
"total",
"number",
"of",
"moves",
"in",
"a",
"game"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L202-L221 | |
38,615 | neagle/smartgamer | index.js | function (text) {
if (typeof text === 'undefined') {
// Unescape characters
if (node.C) {
return node.C.replace(/\\([\\:\]])/g, '$1');
} else {
return '';
}
} else {
// Escape characters
node.C = text.replace(/[\\:\]]/g, '\\$&');
}
} | javascript | function (text) {
if (typeof text === 'undefined') {
// Unescape characters
if (node.C) {
return node.C.replace(/\\([\\:\]])/g, '$1');
} else {
return '';
}
} else {
// Escape characters
node.C = text.replace(/[\\:\]]/g, '\\$&');
}
} | [
"function",
"(",
"text",
")",
"{",
"if",
"(",
"typeof",
"text",
"===",
"'undefined'",
")",
"{",
"// Unescape characters",
"if",
"(",
"node",
".",
"C",
")",
"{",
"return",
"node",
".",
"C",
".",
"replace",
"(",
"/",
"\\\\([\\\\:\\]])",
"/",
"g",
",",
... | Get or set a comment on the current node @see http://www.red-bean.com/sgf/sgf4.html#text | [
"Get",
"or",
"set",
"a",
"comment",
"on",
"the",
"current",
"node"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L225-L237 | |
38,616 | neagle/smartgamer | index.js | function (alphaCoordinates) {
var coordinateLabels = 'abcdefghijklmnopqrst';
var intersection = [];
intersection[0] = coordinateLabels.indexOf(alphaCoordinates.substring(0, 1));
intersection[1] = coordinateLabels.indexOf(alphaCoordinates.substring(1, 2));
return intersection;
} | javascript | function (alphaCoordinates) {
var coordinateLabels = 'abcdefghijklmnopqrst';
var intersection = [];
intersection[0] = coordinateLabels.indexOf(alphaCoordinates.substring(0, 1));
intersection[1] = coordinateLabels.indexOf(alphaCoordinates.substring(1, 2));
return intersection;
} | [
"function",
"(",
"alphaCoordinates",
")",
"{",
"var",
"coordinateLabels",
"=",
"'abcdefghijklmnopqrst'",
";",
"var",
"intersection",
"=",
"[",
"]",
";",
"intersection",
"[",
"0",
"]",
"=",
"coordinateLabels",
".",
"indexOf",
"(",
"alphaCoordinates",
".",
"substr... | Translate alpha coordinates into an array
@param string alphaCoordinates
@return array [x, y] | [
"Translate",
"alpha",
"coordinates",
"into",
"an",
"array"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L244-L252 | |
38,617 | neagle/smartgamer | index.js | function (input, outputType, verbose) {
var output;
// If no output type has been specified, try to set it to the
// opposite of the input
if (typeof outputType === 'undefined') {
outputType = (typeof input === 'string') ? 'object' : 'string';
}
/**
* Turn a path object into a string.
*/... | javascript | function (input, outputType, verbose) {
var output;
// If no output type has been specified, try to set it to the
// opposite of the input
if (typeof outputType === 'undefined') {
outputType = (typeof input === 'string') ? 'object' : 'string';
}
/**
* Turn a path object into a string.
*/... | [
"function",
"(",
"input",
",",
"outputType",
",",
"verbose",
")",
"{",
"var",
"output",
";",
"// If no output type has been specified, try to set it to the",
"// opposite of the input",
"if",
"(",
"typeof",
"outputType",
"===",
"'undefined'",
")",
"{",
"outputType",
"="... | Convert path objects to strings and path strings to objects | [
"Convert",
"path",
"objects",
"to",
"strings",
"and",
"path",
"strings",
"to",
"objects"
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L257-L335 | |
38,618 | neagle/smartgamer | index.js | stringify | function stringify(input) {
if (typeof input === 'string') {
return input;
}
if (!input) {
return '';
}
output = input.m;
var variations = [];
for (var key in input) {
if (input.hasOwnProperty(key) && key !== 'm') {
// Only show variations that are not the primary one... | javascript | function stringify(input) {
if (typeof input === 'string') {
return input;
}
if (!input) {
return '';
}
output = input.m;
var variations = [];
for (var key in input) {
if (input.hasOwnProperty(key) && key !== 'm') {
// Only show variations that are not the primary one... | [
"function",
"stringify",
"(",
"input",
")",
"{",
"if",
"(",
"typeof",
"input",
"===",
"'string'",
")",
"{",
"return",
"input",
";",
"}",
"if",
"(",
"!",
"input",
")",
"{",
"return",
"''",
";",
"}",
"output",
"=",
"input",
".",
"m",
";",
"var",
"v... | Turn a path object into a string. | [
"Turn",
"a",
"path",
"object",
"into",
"a",
"string",
"."
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L269-L297 |
38,619 | neagle/smartgamer | index.js | parse | function parse(input) {
if (typeof input === 'object') {
input = stringify(input);
}
if (!input) {
return { m: 0 };
}
var path = input.split('-');
output = {
m: Number(path.shift())
};
if (path.length) {
path.forEach(function (variation, i) {
variation = vari... | javascript | function parse(input) {
if (typeof input === 'object') {
input = stringify(input);
}
if (!input) {
return { m: 0 };
}
var path = input.split('-');
output = {
m: Number(path.shift())
};
if (path.length) {
path.forEach(function (variation, i) {
variation = vari... | [
"function",
"parse",
"(",
"input",
")",
"{",
"if",
"(",
"typeof",
"input",
"===",
"'object'",
")",
"{",
"input",
"=",
"stringify",
"(",
"input",
")",
";",
"}",
"if",
"(",
"!",
"input",
")",
"{",
"return",
"{",
"m",
":",
"0",
"}",
";",
"}",
"var... | Turn a path string into an object. | [
"Turn",
"a",
"path",
"string",
"into",
"an",
"object",
"."
] | 83a4b47c476729a19f8d04c165c0c10b69095d62 | https://github.com/neagle/smartgamer/blob/83a4b47c476729a19f8d04c165c0c10b69095d62/index.js#L302-L324 |
38,620 | AckerApple/ack-node | js/modules/reqres/req.js | processArray | function processArray(req, res, nextarray) {
if (!nextarray || !nextarray.length)
return;
var proc = nextarray.shift();
proc(req, res, function () {
processArray(req, res, nextarray);
});
} | javascript | function processArray(req, res, nextarray) {
if (!nextarray || !nextarray.length)
return;
var proc = nextarray.shift();
proc(req, res, function () {
processArray(req, res, nextarray);
});
} | [
"function",
"processArray",
"(",
"req",
",",
"res",
",",
"nextarray",
")",
"{",
"if",
"(",
"!",
"nextarray",
"||",
"!",
"nextarray",
".",
"length",
")",
"return",
";",
"var",
"proc",
"=",
"nextarray",
".",
"shift",
"(",
")",
";",
"proc",
"(",
"req",
... | !!!Non-prototypes below express request handler with array shifting | [
"!!!Non",
"-",
"prototypes",
"below",
"express",
"request",
"handler",
"with",
"array",
"shifting"
] | c123d3fcbdd0195630fece6dc9ddee8910c9e115 | https://github.com/AckerApple/ack-node/blob/c123d3fcbdd0195630fece6dc9ddee8910c9e115/js/modules/reqres/req.js#L210-L217 |
38,621 | AckerApple/ack-node | js/modules/reqres/req.js | path | function path(req) {
var oUrl = req.originalUrl || req.url;
this.string = oUrl.split('?')[0];
this.relative = req.url.split('?')[0];
} | javascript | function path(req) {
var oUrl = req.originalUrl || req.url;
this.string = oUrl.split('?')[0];
this.relative = req.url.split('?')[0];
} | [
"function",
"path",
"(",
"req",
")",
"{",
"var",
"oUrl",
"=",
"req",
".",
"originalUrl",
"||",
"req",
".",
"url",
";",
"this",
".",
"string",
"=",
"oUrl",
".",
"split",
"(",
"'?'",
")",
"[",
"0",
"]",
";",
"this",
".",
"relative",
"=",
"req",
"... | path component to aid in reading the request path | [
"path",
"component",
"to",
"aid",
"in",
"reading",
"the",
"request",
"path"
] | c123d3fcbdd0195630fece6dc9ddee8910c9e115 | https://github.com/AckerApple/ack-node/blob/c123d3fcbdd0195630fece6dc9ddee8910c9e115/js/modules/reqres/req.js#L219-L223 |
38,622 | rootsdev/gedcomx-js | src/atom/AtomCommon.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomCommon)){
return new AtomCommon(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomCommon.isInstance(json)){
return json;
}
th... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof AtomCommon)){
return new AtomCommon(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(AtomCommon.isInstance(json)){
return json;
}
th... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AtomCommon",
")",
")",
"{",
"return",
"new",
"AtomCommon",
"(",
"json",
")",
";",
"}",
"// If the given object ... | Common attributes for all Atom entities
@see {@link https://tools.ietf.org/html/rfc4287#page-7|RFC 4287}
@class AtomCommon
@extends Base
@param {Object} [json] | [
"Common",
"attributes",
"for",
"all",
"Atom",
"entities"
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/atom/AtomCommon.js#L13-L26 | |
38,623 | amrdraz/java-code-runner | node/server.js | findPort | function findPort(cb) {
var port = tryPort;
tryPort += 1;
var server = net.createServer();
server.listen(port, function(err) {
server.once('close', function() {
cb(port);
});
server.close();
});
server.on('error', function(err) {
log("port " + tryPort... | javascript | function findPort(cb) {
var port = tryPort;
tryPort += 1;
var server = net.createServer();
server.listen(port, function(err) {
server.once('close', function() {
cb(port);
});
server.close();
});
server.on('error', function(err) {
log("port " + tryPort... | [
"function",
"findPort",
"(",
"cb",
")",
"{",
"var",
"port",
"=",
"tryPort",
";",
"tryPort",
"+=",
"1",
";",
"var",
"server",
"=",
"net",
".",
"createServer",
"(",
")",
";",
"server",
".",
"listen",
"(",
"port",
",",
"function",
"(",
"err",
")",
"{"... | get an empty port for the java server | [
"get",
"an",
"empty",
"port",
"for",
"the",
"java",
"server"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/node/server.js#L41-L56 |
38,624 | amrdraz/java-code-runner | node/server.js | startServlet | function startServlet(cb) {
startingServer = true;
servletReady = false;
debugger;
findPort(function(port) {
servletPort = global._servletPort = '' + port;
servlet = global._servlet = cp.spawn('java', ['-cp', '.:../lib/servlet-api-2.5.jar:../lib/jetty-all-7.0.2.v20100331.jar', 'Runn... | javascript | function startServlet(cb) {
startingServer = true;
servletReady = false;
debugger;
findPort(function(port) {
servletPort = global._servletPort = '' + port;
servlet = global._servlet = cp.spawn('java', ['-cp', '.:../lib/servlet-api-2.5.jar:../lib/jetty-all-7.0.2.v20100331.jar', 'Runn... | [
"function",
"startServlet",
"(",
"cb",
")",
"{",
"startingServer",
"=",
"true",
";",
"servletReady",
"=",
"false",
";",
"debugger",
";",
"findPort",
"(",
"function",
"(",
"port",
")",
"{",
"servletPort",
"=",
"global",
".",
"_servletPort",
"=",
"''",
"+",
... | Starts the servlet on an empty port default is 3678 | [
"Starts",
"the",
"servlet",
"on",
"an",
"empty",
"port",
"default",
"is",
"3678"
] | b5d87b503076bf76a01d111b85c18a639e6f80c8 | https://github.com/amrdraz/java-code-runner/blob/b5d87b503076bf76a01d111b85c18a639e6f80c8/node/server.js#L144-L182 |
38,625 | DeviaVir/node-partyflock | partyflock.js | Partyflock | function Partyflock(consumerKey, consumerSecret, endpoint, debug) {
this.endpoint = 'partyflock.nl';
// Check instance arguments
this.endpoint = (endpoint ? endpoint : this.endpoint);
this.consumerKey = (consumerKey ? consumerKey : false);
this.consumerSecret = (consumerSecret ? consumerSecret : false);
thi... | javascript | function Partyflock(consumerKey, consumerSecret, endpoint, debug) {
this.endpoint = 'partyflock.nl';
// Check instance arguments
this.endpoint = (endpoint ? endpoint : this.endpoint);
this.consumerKey = (consumerKey ? consumerKey : false);
this.consumerSecret = (consumerSecret ? consumerSecret : false);
thi... | [
"function",
"Partyflock",
"(",
"consumerKey",
",",
"consumerSecret",
",",
"endpoint",
",",
"debug",
")",
"{",
"this",
".",
"endpoint",
"=",
"'partyflock.nl'",
";",
"// Check instance arguments",
"this",
".",
"endpoint",
"=",
"(",
"endpoint",
"?",
"endpoint",
":"... | Partyflock instance constructor
@prototype
@class Partyflock | [
"Partyflock",
"instance",
"constructor"
] | dafad1cc1f466d1373637f9748121f0acb7c3499 | https://github.com/DeviaVir/node-partyflock/blob/dafad1cc1f466d1373637f9748121f0acb7c3499/partyflock.js#L21-L58 |
38,626 | rootsdev/gedcomx-js | src/core/Coverage.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Coverage)){
return new Coverage(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Coverage.isInstance(json)){
return json;
}
this.ini... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Coverage)){
return new Coverage(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Coverage.isInstance(json)){
return json;
}
this.ini... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Coverage",
")",
")",
"{",
"return",
"new",
"Coverage",
"(",
"json",
")",
";",
"}",
"// If the given object is a... | A description of the spatial and temporal coverage of a resource.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#coverage|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@apram {Object} [json] | [
"A",
"description",
"of",
"the",
"spatial",
"and",
"temporal",
"coverage",
"of",
"a",
"resource",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Coverage.js#L13-L26 | |
38,627 | WildDogTeam/lib-js-wildgeo | src/geoDogUtils.js | function(resolution, latitude) {
var degs = metersToLongitudeDegrees(resolution, latitude);
return (Math.abs(degs) > 0.000001) ? Math.max(1, Math.log2(360/degs)) : 1;
} | javascript | function(resolution, latitude) {
var degs = metersToLongitudeDegrees(resolution, latitude);
return (Math.abs(degs) > 0.000001) ? Math.max(1, Math.log2(360/degs)) : 1;
} | [
"function",
"(",
"resolution",
",",
"latitude",
")",
"{",
"var",
"degs",
"=",
"metersToLongitudeDegrees",
"(",
"resolution",
",",
"latitude",
")",
";",
"return",
"(",
"Math",
".",
"abs",
"(",
"degs",
")",
">",
"0.000001",
")",
"?",
"Math",
".",
"max",
... | Calculates the bits necessary to reach a given resolution, in meters, for the longitude at a
given latitude.
@param {number} resolution The desired resolution.
@param {number} latitude The latitude used in the conversion.
@return {number} The bits necessary to reach a given resolution, in meters. | [
"Calculates",
"the",
"bits",
"necessary",
"to",
"reach",
"a",
"given",
"resolution",
"in",
"meters",
"for",
"the",
"longitude",
"at",
"a",
"given",
"latitude",
"."
] | 225c8949e814ec7b39d1457f3aa3c63808a79470 | https://github.com/WildDogTeam/lib-js-wildgeo/blob/225c8949e814ec7b39d1457f3aa3c63808a79470/src/geoDogUtils.js#L281-L284 | |
38,628 | WildDogTeam/lib-js-wildgeo | src/geoDogUtils.js | function(coordinate,size) {
var latDeltaDegrees = size/g_METERS_PER_DEGREE_LATITUDE;
var latitudeNorth = Math.min(90, coordinate[0] + latDeltaDegrees);
var latitudeSouth = Math.max(-90, coordinate[0] - latDeltaDegrees);
var bitsLat = Math.floor(latitudeBitsForResolution(size))*2;
var bitsLongNorth = Math.floo... | javascript | function(coordinate,size) {
var latDeltaDegrees = size/g_METERS_PER_DEGREE_LATITUDE;
var latitudeNorth = Math.min(90, coordinate[0] + latDeltaDegrees);
var latitudeSouth = Math.max(-90, coordinate[0] - latDeltaDegrees);
var bitsLat = Math.floor(latitudeBitsForResolution(size))*2;
var bitsLongNorth = Math.floo... | [
"function",
"(",
"coordinate",
",",
"size",
")",
"{",
"var",
"latDeltaDegrees",
"=",
"size",
"/",
"g_METERS_PER_DEGREE_LATITUDE",
";",
"var",
"latitudeNorth",
"=",
"Math",
".",
"min",
"(",
"90",
",",
"coordinate",
"[",
"0",
"]",
"+",
"latDeltaDegrees",
")",
... | Calculates the maximum number of bits of a geohash to get a bounding box that is larger than a
given size at the given coordinate.
@param {Array.<number>} coordinate The coordinate as a [latitude, longitude] pair.
@param {number} size The size of the bounding box.
@return {number} The number of bits necessary for the ... | [
"Calculates",
"the",
"maximum",
"number",
"of",
"bits",
"of",
"a",
"geohash",
"to",
"get",
"a",
"bounding",
"box",
"that",
"is",
"larger",
"than",
"a",
"given",
"size",
"at",
"the",
"given",
"coordinate",
"."
] | 225c8949e814ec7b39d1457f3aa3c63808a79470 | https://github.com/WildDogTeam/lib-js-wildgeo/blob/225c8949e814ec7b39d1457f3aa3c63808a79470/src/geoDogUtils.js#L322-L330 | |
38,629 | WildDogTeam/lib-js-wildgeo | src/geoDogUtils.js | function(center, radius) {
var latDegrees = radius/g_METERS_PER_DEGREE_LATITUDE;
var latitudeNorth = Math.min(90, center[0] + latDegrees);
var latitudeSouth = Math.max(-90, center[0] - latDegrees);
var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth);
var longDegsSouth = metersToLongitudeDegree... | javascript | function(center, radius) {
var latDegrees = radius/g_METERS_PER_DEGREE_LATITUDE;
var latitudeNorth = Math.min(90, center[0] + latDegrees);
var latitudeSouth = Math.max(-90, center[0] - latDegrees);
var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth);
var longDegsSouth = metersToLongitudeDegree... | [
"function",
"(",
"center",
",",
"radius",
")",
"{",
"var",
"latDegrees",
"=",
"radius",
"/",
"g_METERS_PER_DEGREE_LATITUDE",
";",
"var",
"latitudeNorth",
"=",
"Math",
".",
"min",
"(",
"90",
",",
"center",
"[",
"0",
"]",
"+",
"latDegrees",
")",
";",
"var"... | Calculates eight points on the bounding box and the center of a given circle. At least one
geohash of these nine coordinates, truncated to a precision of at most radius, are guaranteed
to be prefixes of any geohash that lies within the circle.
@param {Array.<number>} center The center given as [latitude, longitude].
@... | [
"Calculates",
"eight",
"points",
"on",
"the",
"bounding",
"box",
"and",
"the",
"center",
"of",
"a",
"given",
"circle",
".",
"At",
"least",
"one",
"geohash",
"of",
"these",
"nine",
"coordinates",
"truncated",
"to",
"a",
"precision",
"of",
"at",
"most",
"rad... | 225c8949e814ec7b39d1457f3aa3c63808a79470 | https://github.com/WildDogTeam/lib-js-wildgeo/blob/225c8949e814ec7b39d1457f3aa3c63808a79470/src/geoDogUtils.js#L341-L359 | |
38,630 | WildDogTeam/lib-js-wildgeo | src/geoDogUtils.js | function(geohash, bits) {
validateGeohash(geohash);
var precision = Math.ceil(bits/g_BITS_PER_CHAR);
if (geohash.length < precision) {
return [geohash, geohash+"~"];
}
geohash = geohash.substring(0, precision);
var base = geohash.substring(0, geohash.length - 1);
var lastValue = g_BASE32.indexOf(geoha... | javascript | function(geohash, bits) {
validateGeohash(geohash);
var precision = Math.ceil(bits/g_BITS_PER_CHAR);
if (geohash.length < precision) {
return [geohash, geohash+"~"];
}
geohash = geohash.substring(0, precision);
var base = geohash.substring(0, geohash.length - 1);
var lastValue = g_BASE32.indexOf(geoha... | [
"function",
"(",
"geohash",
",",
"bits",
")",
"{",
"validateGeohash",
"(",
"geohash",
")",
";",
"var",
"precision",
"=",
"Math",
".",
"ceil",
"(",
"bits",
"/",
"g_BITS_PER_CHAR",
")",
";",
"if",
"(",
"geohash",
".",
"length",
"<",
"precision",
")",
"{"... | Calculates the bounding box query for a geohash with x bits precision.
@param {string} geohash The geohash whose bounding box query to generate.
@param {number} bits The number of bits of precision.
@return {Array.<string>} A [start, end] pair of geohashes. | [
"Calculates",
"the",
"bounding",
"box",
"query",
"for",
"a",
"geohash",
"with",
"x",
"bits",
"precision",
"."
] | 225c8949e814ec7b39d1457f3aa3c63808a79470 | https://github.com/WildDogTeam/lib-js-wildgeo/blob/225c8949e814ec7b39d1457f3aa3c63808a79470/src/geoDogUtils.js#L368-L390 | |
38,631 | PlatziDev/react-markdown | index.js | reducer | function reducer(props, map, key) {
return Object.assign({}, map, {
[key]: props[key],
});
} | javascript | function reducer(props, map, key) {
return Object.assign({}, map, {
[key]: props[key],
});
} | [
"function",
"reducer",
"(",
"props",
",",
"map",
",",
"key",
")",
"{",
"return",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"map",
",",
"{",
"[",
"key",
"]",
":",
"props",
"[",
"key",
"]",
",",
"}",
")",
";",
"}"
] | Merge props into a new map
@param {Object} props The original prop map
@param {Object} map The new prop map to fill
@param {string} key Each key name that have passed the filter
@return {Object} The new prop map with the setted prop | [
"Merge",
"props",
"into",
"a",
"new",
"map"
] | f3f186627231bad7a4422df17191a68ff8c130df | https://github.com/PlatziDev/react-markdown/blob/f3f186627231bad7a4422df17191a68ff8c130df/index.js#L21-L25 |
38,632 | PlatziDev/react-markdown | index.js | Markdown | function Markdown(props) {
const tagProps = Object.keys(props).filter(filter).reduce(reducer.bind(null, props), {});
const parser = createParser(props.parser);
return React.createElement(
props.tagName,
Object.assign(tagProps, {
dangerouslySetInnerHTML: {
__html: parser(props.content),
... | javascript | function Markdown(props) {
const tagProps = Object.keys(props).filter(filter).reduce(reducer.bind(null, props), {});
const parser = createParser(props.parser);
return React.createElement(
props.tagName,
Object.assign(tagProps, {
dangerouslySetInnerHTML: {
__html: parser(props.content),
... | [
"function",
"Markdown",
"(",
"props",
")",
"{",
"const",
"tagProps",
"=",
"Object",
".",
"keys",
"(",
"props",
")",
".",
"filter",
"(",
"filter",
")",
".",
"reduce",
"(",
"reducer",
".",
"bind",
"(",
"null",
",",
"props",
")",
",",
"{",
"}",
")",
... | Render Platzi Flavored Markdown inside a React application.
@param {string} [props.tagName='div'] The HTML tag used as wrapper
@param {string} props.content The Markdown content to parse and render
@param {Object} [props.parser={}] The parser options | [
"Render",
"Platzi",
"Flavored",
"Markdown",
"inside",
"a",
"React",
"application",
"."
] | f3f186627231bad7a4422df17191a68ff8c130df | https://github.com/PlatziDev/react-markdown/blob/f3f186627231bad7a4422df17191a68ff8c130df/index.js#L33-L46 |
38,633 | Schoonology/discovery | lib/managers/http.js | HttpManager | function HttpManager(options) {
if (!(this instanceof HttpManager)) {
return new HttpManager(options);
}
options = options || {};
Manager.call(this, options);
debug('New HttpManager: %j', options);
this.hostname = options.hostname || null;
this.port = options.port || Defaults.PORT;
this.interva... | javascript | function HttpManager(options) {
if (!(this instanceof HttpManager)) {
return new HttpManager(options);
}
options = options || {};
Manager.call(this, options);
debug('New HttpManager: %j', options);
this.hostname = options.hostname || null;
this.port = options.port || Defaults.PORT;
this.interva... | [
"function",
"HttpManager",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"HttpManager",
")",
")",
"{",
"return",
"new",
"HttpManager",
"(",
"options",
")",
";",
"}",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"Manager",
".",... | Creates a new instance of HttpManager with the provided `options`.
The HttpManager provides a client connection to the HTTP-based, Tracker
discovery system.
For more information, see the README.
@param {Object} options | [
"Creates",
"a",
"new",
"instance",
"of",
"HttpManager",
"with",
"the",
"provided",
"options",
"."
] | 9d123d74c13f8c9b6904e409f8933b09ab22e175 | https://github.com/Schoonology/discovery/blob/9d123d74c13f8c9b6904e409f8933b09ab22e175/lib/managers/http.js#L23-L42 |
38,634 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function (newFilters, oldFilters) {
var self = this;
if (!oldFilters) {
oldFilters = this._filters;
} else if (!isArray(oldFilters)) {
oldFilters = [oldFilters];
}
if (!newFilters) {
newFilters = [];
} else if (!isArray(newFilters)) {... | javascript | function (newFilters, oldFilters) {
var self = this;
if (!oldFilters) {
oldFilters = this._filters;
} else if (!isArray(oldFilters)) {
oldFilters = [oldFilters];
}
if (!newFilters) {
newFilters = [];
} else if (!isArray(newFilters)) {... | [
"function",
"(",
"newFilters",
",",
"oldFilters",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"oldFilters",
")",
"{",
"oldFilters",
"=",
"this",
".",
"_filters",
";",
"}",
"else",
"if",
"(",
"!",
"isArray",
"(",
"oldFilters",
")",
")",... | Swap out a set of old filters with a set of new filters | [
"Swap",
"out",
"a",
"set",
"of",
"old",
"filters",
"with",
"a",
"set",
"of",
"new",
"filters"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L53-L77 | |
38,635 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function (query, indexName) {
var model = this.collection.get(query, indexName);
if (model && includes(this.models, model)) return model;
} | javascript | function (query, indexName) {
var model = this.collection.get(query, indexName);
if (model && includes(this.models, model)) return model;
} | [
"function",
"(",
"query",
",",
"indexName",
")",
"{",
"var",
"model",
"=",
"this",
".",
"collection",
".",
"get",
"(",
"query",
",",
"indexName",
")",
";",
"if",
"(",
"model",
"&&",
"includes",
"(",
"this",
".",
"models",
",",
"model",
")",
")",
"r... | proxy `get` method to the underlying collection | [
"proxy",
"get",
"method",
"to",
"the",
"underlying",
"collection"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L92-L95 | |
38,636 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function (query, indexName) {
if (!query) return;
var index = this._indexes[indexName || this.mainIndex];
return index[query] || index[query[this.mainIndex]] || this._indexes.cid[query] || this._indexes.cid[query.cid];
} | javascript | function (query, indexName) {
if (!query) return;
var index = this._indexes[indexName || this.mainIndex];
return index[query] || index[query[this.mainIndex]] || this._indexes.cid[query] || this._indexes.cid[query.cid];
} | [
"function",
"(",
"query",
",",
"indexName",
")",
"{",
"if",
"(",
"!",
"query",
")",
"return",
";",
"var",
"index",
"=",
"this",
".",
"_indexes",
"[",
"indexName",
"||",
"this",
".",
"mainIndex",
"]",
";",
"return",
"index",
"[",
"query",
"]",
"||",
... | Internal API try to get a model by index | [
"Internal",
"API",
"try",
"to",
"get",
"a",
"model",
"by",
"index"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L105-L109 | |
38,637 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function (model, options, eventName) {
var newModels = slice.call(this.models);
var comparator = this.comparator || this.collection.comparator;
//Whether or not we are to expect a sort event from our collection later
var sortable = eventName === 'add' && this.collection.comparator && (op... | javascript | function (model, options, eventName) {
var newModels = slice.call(this.models);
var comparator = this.comparator || this.collection.comparator;
//Whether or not we are to expect a sort event from our collection later
var sortable = eventName === 'add' && this.collection.comparator && (op... | [
"function",
"(",
"model",
",",
"options",
",",
"eventName",
")",
"{",
"var",
"newModels",
"=",
"slice",
".",
"call",
"(",
"this",
".",
"models",
")",
";",
"var",
"comparator",
"=",
"this",
".",
"comparator",
"||",
"this",
".",
"collection",
".",
"compa... | Add a model to this filtered collection that has already passed the filters | [
"Add",
"a",
"model",
"to",
"this",
"filtered",
"collection",
"that",
"has",
"already",
"passed",
"the",
"filters"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L178-L196 | |
38,638 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function (model) {
var newModels = slice.call(this.models);
var modelIndex = newModels.indexOf(model);
if (modelIndex > -1) {
newModels.splice(modelIndex, 1);
this.models = newModels;
this._removeIndex(this._indexes, model);
return true;
}
... | javascript | function (model) {
var newModels = slice.call(this.models);
var modelIndex = newModels.indexOf(model);
if (modelIndex > -1) {
newModels.splice(modelIndex, 1);
this.models = newModels;
this._removeIndex(this._indexes, model);
return true;
}
... | [
"function",
"(",
"model",
")",
"{",
"var",
"newModels",
"=",
"slice",
".",
"call",
"(",
"this",
".",
"models",
")",
";",
"var",
"modelIndex",
"=",
"newModels",
".",
"indexOf",
"(",
"model",
")",
";",
"if",
"(",
"modelIndex",
">",
"-",
"1",
")",
"{"... | Remove a model if it's in this filtered collection | [
"Remove",
"a",
"model",
"if",
"it",
"s",
"in",
"this",
"filtered",
"collection"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L199-L209 | |
38,639 | AmpersandJS/ampersand-filtered-subcollection | ampersand-filtered-subcollection.js | function () {
// make a copy of the array for comparisons
var existingModels = slice.call(this.models);
var rootModels = slice.call(this.collection.models);
var newIndexes = {};
var newModels, toAdd, toRemove;
this._resetIndexes(newIndexes);
// reduce base model... | javascript | function () {
// make a copy of the array for comparisons
var existingModels = slice.call(this.models);
var rootModels = slice.call(this.collection.models);
var newIndexes = {};
var newModels, toAdd, toRemove;
this._resetIndexes(newIndexes);
// reduce base model... | [
"function",
"(",
")",
"{",
"// make a copy of the array for comparisons",
"var",
"existingModels",
"=",
"slice",
".",
"call",
"(",
"this",
".",
"models",
")",
";",
"var",
"rootModels",
"=",
"slice",
".",
"call",
"(",
"this",
".",
"collection",
".",
"models",
... | Re-run the filters on all our parent's models | [
"Re",
"-",
"run",
"the",
"filters",
"on",
"all",
"our",
"parent",
"s",
"models"
] | 50fe385c658faff62e5c610217c949ad0e2c3ce2 | https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/50fe385c658faff62e5c610217c949ad0e2c3ce2/ampersand-filtered-subcollection.js#L245-L298 | |
38,640 | rootsdev/gedcomx-js | src/core/NameForm.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof NameForm)){
return new NameForm(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(NameForm.isInstance(json)){
return json;
}
this.ini... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof NameForm)){
return new NameForm(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(NameForm.isInstance(json)){
return json;
}
this.ini... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"NameForm",
")",
")",
"{",
"return",
"new",
"NameForm",
"(",
"json",
")",
";",
"}",
"// If the given object is a... | A form of a name.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#name-form|GEDCOM X JSON Spec}
@class
@extends ExtensibleData
@param {Object} [json] | [
"A",
"form",
"of",
"a",
"name",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/NameForm.js#L13-L26 | |
38,641 | Ubudu/uBeacon-uart-lib | node/examples/mesh-sender.js | function(callback){
ubeacon.getMeshSettingsRegisterObject( function(data, error){
if( error === null ){
meshSettings.setFrom( data );
console.log( 'meshSettings: ', meshSettings );
if( meshSettings.enabled !== true && program.enableMesh !== true ){
return callbac... | javascript | function(callback){
ubeacon.getMeshSettingsRegisterObject( function(data, error){
if( error === null ){
meshSettings.setFrom( data );
console.log( 'meshSettings: ', meshSettings );
if( meshSettings.enabled !== true && program.enableMesh !== true ){
return callbac... | [
"function",
"(",
"callback",
")",
"{",
"ubeacon",
".",
"getMeshSettingsRegisterObject",
"(",
"function",
"(",
"data",
",",
"error",
")",
"{",
"if",
"(",
"error",
"===",
"null",
")",
"{",
"meshSettings",
".",
"setFrom",
"(",
"data",
")",
";",
"console",
"... | Check if mesh is enabled | [
"Check",
"if",
"mesh",
"is",
"enabled"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/examples/mesh-sender.js#L35-L49 | |
38,642 | Ubudu/uBeacon-uart-lib | node/examples/mesh-sender.js | function(callback){
ubeacon.getMeshDeviceId( function( deviceAddress ){
console.log( '[ubeacon] Device address is: ' + deviceAddress + ' (0x' + deviceAddress.toString(16) + ')' );
callback(null);
});
} | javascript | function(callback){
ubeacon.getMeshDeviceId( function( deviceAddress ){
console.log( '[ubeacon] Device address is: ' + deviceAddress + ' (0x' + deviceAddress.toString(16) + ')' );
callback(null);
});
} | [
"function",
"(",
"callback",
")",
"{",
"ubeacon",
".",
"getMeshDeviceId",
"(",
"function",
"(",
"deviceAddress",
")",
"{",
"console",
".",
"log",
"(",
"'[ubeacon] Device address is: '",
"+",
"deviceAddress",
"+",
"' (0x'",
"+",
"deviceAddress",
".",
"toString",
... | Get device address and print it | [
"Get",
"device",
"address",
"and",
"print",
"it"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/examples/mesh-sender.js#L68-L73 | |
38,643 | Ubudu/uBeacon-uart-lib | node/examples/mesh-sender.js | function(callback){
console.log( 'Start sending messages... ');
setInterval(function(){
var msg = '';
if( program.message != null ){
msg = program.message;
}else{
msgCounter++;
msg = 'Hello #' + msgCounter + ' from node.js';
}
console.log( '[ubeacon] Sending "' +msg+ '" to... | javascript | function(callback){
console.log( 'Start sending messages... ');
setInterval(function(){
var msg = '';
if( program.message != null ){
msg = program.message;
}else{
msgCounter++;
msg = 'Hello #' + msgCounter + ' from node.js';
}
console.log( '[ubeacon] Sending "' +msg+ '" to... | [
"function",
"(",
"callback",
")",
"{",
"console",
".",
"log",
"(",
"'Start sending messages... '",
")",
";",
"setInterval",
"(",
"function",
"(",
")",
"{",
"var",
"msg",
"=",
"''",
";",
"if",
"(",
"program",
".",
"message",
"!=",
"null",
")",
"{",
"msg... | Send message - works until script is terminated | [
"Send",
"message",
"-",
"works",
"until",
"script",
"is",
"terminated"
] | a7436f3491f61ffabb34e2bc3b2441cc048f5dfa | https://github.com/Ubudu/uBeacon-uart-lib/blob/a7436f3491f61ffabb34e2bc3b2441cc048f5dfa/node/examples/mesh-sender.js#L76-L91 | |
38,644 | AppGeo/cartodb | lib/builder.js | columns | function columns(column) {
if (!column) {
return this;
}
this._statements.push({
grouping: 'columns',
value: normalizeArr.apply(null, arguments)
});
return this;
} | javascript | function columns(column) {
if (!column) {
return this;
}
this._statements.push({
grouping: 'columns',
value: normalizeArr.apply(null, arguments)
});
return this;
} | [
"function",
"columns",
"(",
"column",
")",
"{",
"if",
"(",
"!",
"column",
")",
"{",
"return",
"this",
";",
"}",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'columns'",
",",
"value",
":",
"normalizeArr",
".",
"apply",
"(",
"nu... | Adds a column or columns to the list of "columns" being selected on the query. | [
"Adds",
"a",
"column",
"or",
"columns",
"to",
"the",
"list",
"of",
"columns",
"being",
"selected",
"on",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L59-L68 |
38,645 | AppGeo/cartodb | lib/builder.js | distinct | function distinct() {
this._statements.push({
grouping: 'columns',
value: normalizeArr.apply(null, arguments),
distinct: true
});
return this;
} | javascript | function distinct() {
this._statements.push({
grouping: 'columns',
value: normalizeArr.apply(null, arguments),
distinct: true
});
return this;
} | [
"function",
"distinct",
"(",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'columns'",
",",
"value",
":",
"normalizeArr",
".",
"apply",
"(",
"null",
",",
"arguments",
")",
",",
"distinct",
":",
"true",
"}",
")",
";",
... | Adds a `distinct` clause to the query. | [
"Adds",
"a",
"distinct",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L86-L93 |
38,646 | AppGeo/cartodb | lib/builder.js | _objectWhere | function _objectWhere(obj) {
var boolVal = this._bool();
var notVal = this._not() ? 'Not' : '';
for (var key in obj) {
this[boolVal + 'Where' + notVal](key, obj[key]);
}
return this;
} | javascript | function _objectWhere(obj) {
var boolVal = this._bool();
var notVal = this._not() ? 'Not' : '';
for (var key in obj) {
this[boolVal + 'Where' + notVal](key, obj[key]);
}
return this;
} | [
"function",
"_objectWhere",
"(",
"obj",
")",
"{",
"var",
"boolVal",
"=",
"this",
".",
"_bool",
"(",
")",
";",
"var",
"notVal",
"=",
"this",
".",
"_not",
"(",
")",
"?",
"'Not'",
":",
"''",
";",
"for",
"(",
"var",
"key",
"in",
"obj",
")",
"{",
"t... | Processes an object literal provided in a "where" clause. | [
"Processes",
"an",
"object",
"literal",
"provided",
"in",
"a",
"where",
"clause",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L241-L248 |
38,647 | AppGeo/cartodb | lib/builder.js | havingWrapped | function havingWrapped(callback) {
this._statements.push({
grouping: 'having',
type: 'whereWrapped',
value: callback,
bool: this._bool()
});
return this;
} | javascript | function havingWrapped(callback) {
this._statements.push({
grouping: 'having',
type: 'whereWrapped',
value: callback,
bool: this._bool()
});
return this;
} | [
"function",
"havingWrapped",
"(",
"callback",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'having'",
",",
"type",
":",
"'whereWrapped'",
",",
"value",
":",
"callback",
",",
"bool",
":",
"this",
".",
"_bool",
"(",
")",
... | Helper for compiling any advanced `having` queries. | [
"Helper",
"for",
"compiling",
"any",
"advanced",
"having",
"queries",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L279-L287 |
38,648 | AppGeo/cartodb | lib/builder.js | whereExists | function whereExists(callback) {
this._statements.push({
grouping: 'where',
type: 'whereExists',
value: callback,
not: this._not(),
bool: this._bool() });
return this;
} | javascript | function whereExists(callback) {
this._statements.push({
grouping: 'where',
type: 'whereExists',
value: callback,
not: this._not(),
bool: this._bool() });
return this;
} | [
"function",
"whereExists",
"(",
"callback",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'where'",
",",
"type",
":",
"'whereExists'",
",",
"value",
":",
"callback",
",",
"not",
":",
"this",
".",
"_not",
"(",
")",
",",
... | Adds a `where exists` clause to the query. | [
"Adds",
"a",
"where",
"exists",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L290-L298 |
38,649 | AppGeo/cartodb | lib/builder.js | whereIn | function whereIn(column, values) {
if (Array.isArray(values) && isEmpty(values)) {
return this.where(this._not());
}
this._statements.push({
grouping: 'where',
type: 'whereIn',
column: column,
value: values,
not: this._not(),
bool: this._bool()
});
return th... | javascript | function whereIn(column, values) {
if (Array.isArray(values) && isEmpty(values)) {
return this.where(this._not());
}
this._statements.push({
grouping: 'where',
type: 'whereIn',
column: column,
value: values,
not: this._not(),
bool: this._bool()
});
return th... | [
"function",
"whereIn",
"(",
"column",
",",
"values",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"values",
")",
"&&",
"isEmpty",
"(",
"values",
")",
")",
"{",
"return",
"this",
".",
"where",
"(",
"this",
".",
"_not",
"(",
")",
")",
";",
"}... | Adds a `where in` clause to the query. | [
"Adds",
"a",
"where",
"in",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L316-L329 |
38,650 | AppGeo/cartodb | lib/builder.js | whereNull | function whereNull(column) {
this._statements.push({
grouping: 'where',
type: 'whereNull',
column: column,
not: this._not(),
bool: this._bool()
});
return this;
} | javascript | function whereNull(column) {
this._statements.push({
grouping: 'where',
type: 'whereNull',
column: column,
not: this._not(),
bool: this._bool()
});
return this;
} | [
"function",
"whereNull",
"(",
"column",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'where'",
",",
"type",
":",
"'whereNull'",
",",
"column",
":",
"column",
",",
"not",
":",
"this",
".",
"_not",
"(",
")",
",",
"bool... | Adds a `where null` clause to the query. | [
"Adds",
"a",
"where",
"null",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L347-L356 |
38,651 | AppGeo/cartodb | lib/builder.js | whereBetween | function whereBetween(column, values) {
assert(Array.isArray(values), 'The second argument to whereBetween must be an array.');
assert(values.length === 2, 'You must specify 2 values for the whereBetween clause');
this._statements.push({
grouping: 'where',
type: 'whereBetween',
column: col... | javascript | function whereBetween(column, values) {
assert(Array.isArray(values), 'The second argument to whereBetween must be an array.');
assert(values.length === 2, 'You must specify 2 values for the whereBetween clause');
this._statements.push({
grouping: 'where',
type: 'whereBetween',
column: col... | [
"function",
"whereBetween",
"(",
"column",
",",
"values",
")",
"{",
"assert",
"(",
"Array",
".",
"isArray",
"(",
"values",
")",
",",
"'The second argument to whereBetween must be an array.'",
")",
";",
"assert",
"(",
"values",
".",
"length",
"===",
"2",
",",
"... | Adds a `where between` clause to the query. | [
"Adds",
"a",
"where",
"between",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L374-L386 |
38,652 | AppGeo/cartodb | lib/builder.js | groupBy | function groupBy(item) {
if (item instanceof Raw) {
return this.groupByRaw.apply(this, arguments);
}
this._statements.push({
grouping: 'group',
type: 'groupByBasic',
value: normalizeArr.apply(null, arguments)
});
return this;
} | javascript | function groupBy(item) {
if (item instanceof Raw) {
return this.groupByRaw.apply(this, arguments);
}
this._statements.push({
grouping: 'group',
type: 'groupByBasic',
value: normalizeArr.apply(null, arguments)
});
return this;
} | [
"function",
"groupBy",
"(",
"item",
")",
"{",
"if",
"(",
"item",
"instanceof",
"Raw",
")",
"{",
"return",
"this",
".",
"groupByRaw",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"group... | Adds a `group by` clause to the query. | [
"Adds",
"a",
"group",
"by",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L404-L414 |
38,653 | AppGeo/cartodb | lib/builder.js | groupByRaw | function groupByRaw(sql, bindings) {
var raw = sql instanceof Raw ? sql : this.client.raw(sql, bindings);
this._statements.push({
grouping: 'group',
type: 'groupByRaw',
value: raw
});
return this;
} | javascript | function groupByRaw(sql, bindings) {
var raw = sql instanceof Raw ? sql : this.client.raw(sql, bindings);
this._statements.push({
grouping: 'group',
type: 'groupByRaw',
value: raw
});
return this;
} | [
"function",
"groupByRaw",
"(",
"sql",
",",
"bindings",
")",
"{",
"var",
"raw",
"=",
"sql",
"instanceof",
"Raw",
"?",
"sql",
":",
"this",
".",
"client",
".",
"raw",
"(",
"sql",
",",
"bindings",
")",
";",
"this",
".",
"_statements",
".",
"push",
"(",
... | Adds a raw `group by` clause to the query. | [
"Adds",
"a",
"raw",
"group",
"by",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L417-L425 |
38,654 | AppGeo/cartodb | lib/builder.js | orderBy | function orderBy(column, direction) {
this._statements.push({
grouping: 'order',
type: 'orderByBasic',
value: column,
direction: direction
});
return this;
} | javascript | function orderBy(column, direction) {
this._statements.push({
grouping: 'order',
type: 'orderByBasic',
value: column,
direction: direction
});
return this;
} | [
"function",
"orderBy",
"(",
"column",
",",
"direction",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'order'",
",",
"type",
":",
"'orderByBasic'",
",",
"value",
":",
"column",
",",
"direction",
":",
"direction",
"}",
")"... | Adds a `order by` clause to the query. | [
"Adds",
"a",
"order",
"by",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L428-L436 |
38,655 | AppGeo/cartodb | lib/builder.js | union | function union(callbacks, wrap) {
if (arguments.length === 1 || arguments.length === 2 && typeof wrap === 'boolean') {
if (!Array.isArray(callbacks)) {
callbacks = [callbacks];
}
for (var i = 0, l = callbacks.length; i < l; i++) {
this._statements.push({
grouping: 'union'... | javascript | function union(callbacks, wrap) {
if (arguments.length === 1 || arguments.length === 2 && typeof wrap === 'boolean') {
if (!Array.isArray(callbacks)) {
callbacks = [callbacks];
}
for (var i = 0, l = callbacks.length; i < l; i++) {
this._statements.push({
grouping: 'union'... | [
"function",
"union",
"(",
"callbacks",
",",
"wrap",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
"||",
"arguments",
".",
"length",
"===",
"2",
"&&",
"typeof",
"wrap",
"===",
"'boolean'",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArra... | Add a union statement to the query. | [
"Add",
"a",
"union",
"statement",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L450-L473 |
38,656 | AppGeo/cartodb | lib/builder.js | unionAll | function unionAll(callback, wrap) {
this._statements.push({
grouping: 'union',
clause: 'union all',
value: callback,
wrap: wrap || false
});
return this;
} | javascript | function unionAll(callback, wrap) {
this._statements.push({
grouping: 'union',
clause: 'union all',
value: callback,
wrap: wrap || false
});
return this;
} | [
"function",
"unionAll",
"(",
"callback",
",",
"wrap",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'union'",
",",
"clause",
":",
"'union all'",
",",
"value",
":",
"callback",
",",
"wrap",
":",
"wrap",
"||",
"false",
"}... | Adds a union all statement to the query. | [
"Adds",
"a",
"union",
"all",
"statement",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L476-L484 |
38,657 | AppGeo/cartodb | lib/builder.js | having | function having(column, operator, value) {
if (column instanceof Raw && arguments.length === 1) {
return this._havingRaw(column);
}
// Check if the column is a function, in which case it's
// a having statement wrapped in parens.
if (typeof column === 'function') {
return this.havingWra... | javascript | function having(column, operator, value) {
if (column instanceof Raw && arguments.length === 1) {
return this._havingRaw(column);
}
// Check if the column is a function, in which case it's
// a having statement wrapped in parens.
if (typeof column === 'function') {
return this.havingWra... | [
"function",
"having",
"(",
"column",
",",
"operator",
",",
"value",
")",
"{",
"if",
"(",
"column",
"instanceof",
"Raw",
"&&",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"return",
"this",
".",
"_havingRaw",
"(",
"column",
")",
";",
"}",
"// Check... | Adds a `having` clause to the query. | [
"Adds",
"a",
"having",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L487-L507 |
38,658 | AppGeo/cartodb | lib/builder.js | _havingRaw | function _havingRaw(sql, bindings) {
var raw = sql instanceof Raw ? sql : this.client.raw(sql, bindings);
this._statements.push({
grouping: 'having',
type: 'havingRaw',
value: raw,
bool: this._bool()
});
return this;
} | javascript | function _havingRaw(sql, bindings) {
var raw = sql instanceof Raw ? sql : this.client.raw(sql, bindings);
this._statements.push({
grouping: 'having',
type: 'havingRaw',
value: raw,
bool: this._bool()
});
return this;
} | [
"function",
"_havingRaw",
"(",
"sql",
",",
"bindings",
")",
"{",
"var",
"raw",
"=",
"sql",
"instanceof",
"Raw",
"?",
"sql",
":",
"this",
".",
"client",
".",
"raw",
"(",
"sql",
",",
"bindings",
")",
";",
"this",
".",
"_statements",
".",
"push",
"(",
... | Adds a raw `having` clause to the query. | [
"Adds",
"a",
"raw",
"having",
"clause",
"to",
"the",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L519-L528 |
38,659 | AppGeo/cartodb | lib/builder.js | limit | function limit(value) {
var val = parseInt(value, 10);
if (isNaN(val)) {
debug('A valid integer must be provided to limit');
} else {
this._single.limit = val;
}
return this;
} | javascript | function limit(value) {
var val = parseInt(value, 10);
if (isNaN(val)) {
debug('A valid integer must be provided to limit');
} else {
this._single.limit = val;
}
return this;
} | [
"function",
"limit",
"(",
"value",
")",
"{",
"var",
"val",
"=",
"parseInt",
"(",
"value",
",",
"10",
")",
";",
"if",
"(",
"isNaN",
"(",
"val",
")",
")",
"{",
"debug",
"(",
"'A valid integer must be provided to limit'",
")",
";",
"}",
"else",
"{",
"this... | Only allow a single "limit" to be set for the current query. | [
"Only",
"allow",
"a",
"single",
"limit",
"to",
"be",
"set",
"for",
"the",
"current",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L537-L545 |
38,660 | AppGeo/cartodb | lib/builder.js | pluck | function pluck(column) {
this._method = 'pluck';
this._single.pluck = column;
this._statements.push({
grouping: 'columns',
type: 'pluck',
value: column
});
return this;
} | javascript | function pluck(column) {
this._method = 'pluck';
this._single.pluck = column;
this._statements.push({
grouping: 'columns',
type: 'pluck',
value: column
});
return this;
} | [
"function",
"pluck",
"(",
"column",
")",
"{",
"this",
".",
"_method",
"=",
"'pluck'",
";",
"this",
".",
"_single",
".",
"pluck",
"=",
"column",
";",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'columns'",
",",
"type",
":",
"'... | Pluck a column from a query. | [
"Pluck",
"a",
"column",
"from",
"a",
"query",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L597-L606 |
38,661 | AppGeo/cartodb | lib/builder.js | fromJS | function fromJS(obj) {
Object.keys(obj).forEach(function (key) {
var val = obj[key];
if (typeof this[key] !== 'function') {
debug('Knex Error: unknown key ' + key);
}
if (Array.isArray(val)) {
this[key].apply(this, val);
} else {
this[key](val);
}
}, t... | javascript | function fromJS(obj) {
Object.keys(obj).forEach(function (key) {
var val = obj[key];
if (typeof this[key] !== 'function') {
debug('Knex Error: unknown key ' + key);
}
if (Array.isArray(val)) {
this[key].apply(this, val);
} else {
this[key](val);
}
}, t... | [
"function",
"fromJS",
"(",
"obj",
")",
"{",
"Object",
".",
"keys",
"(",
"obj",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"var",
"val",
"=",
"obj",
"[",
"key",
"]",
";",
"if",
"(",
"typeof",
"this",
"[",
"key",
"]",
"!==",
"'fu... | Takes a JS object of methods to call and calls them | [
"Takes",
"a",
"JS",
"object",
"of",
"methods",
"to",
"call",
"and",
"calls",
"them"
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L697-L710 |
38,662 | AppGeo/cartodb | lib/builder.js | _bool | function _bool(val) {
if (arguments.length === 1) {
this._boolFlag = val;
return this;
}
var ret = this._boolFlag;
this._boolFlag = 'and';
return ret;
} | javascript | function _bool(val) {
if (arguments.length === 1) {
this._boolFlag = val;
return this;
}
var ret = this._boolFlag;
this._boolFlag = 'and';
return ret;
} | [
"function",
"_bool",
"(",
"val",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"this",
".",
"_boolFlag",
"=",
"val",
";",
"return",
"this",
";",
"}",
"var",
"ret",
"=",
"this",
".",
"_boolFlag",
";",
"this",
".",
"_boolFlag... | Helper to get or set the "boolFlag" value. | [
"Helper",
"to",
"get",
"or",
"set",
"the",
"boolFlag",
"value",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L730-L738 |
38,663 | AppGeo/cartodb | lib/builder.js | _not | function _not(val) {
if (arguments.length === 1) {
this._notFlag = val;
return this;
}
var ret = this._notFlag;
this._notFlag = false;
return ret;
} | javascript | function _not(val) {
if (arguments.length === 1) {
this._notFlag = val;
return this;
}
var ret = this._notFlag;
this._notFlag = false;
return ret;
} | [
"function",
"_not",
"(",
"val",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"this",
".",
"_notFlag",
"=",
"val",
";",
"return",
"this",
";",
"}",
"var",
"ret",
"=",
"this",
".",
"_notFlag",
";",
"this",
".",
"_notFlag",
... | Helper to get or set the "notFlag" value. | [
"Helper",
"to",
"get",
"or",
"set",
"the",
"notFlag",
"value",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L741-L749 |
38,664 | AppGeo/cartodb | lib/builder.js | _joinType | function _joinType(val) {
if (arguments.length === 1) {
this._joinFlag = val;
return this;
}
var ret = this._joinFlag || 'inner';
this._joinFlag = 'inner';
return ret;
} | javascript | function _joinType(val) {
if (arguments.length === 1) {
this._joinFlag = val;
return this;
}
var ret = this._joinFlag || 'inner';
this._joinFlag = 'inner';
return ret;
} | [
"function",
"_joinType",
"(",
"val",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"this",
".",
"_joinFlag",
"=",
"val",
";",
"return",
"this",
";",
"}",
"var",
"ret",
"=",
"this",
".",
"_joinFlag",
"||",
"'inner'",
";",
"t... | Helper to get or set the "joinFlag" value. | [
"Helper",
"to",
"get",
"or",
"set",
"the",
"joinFlag",
"value",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L752-L760 |
38,665 | AppGeo/cartodb | lib/builder.js | _aggregate | function _aggregate(method, column) {
this._statements.push({
grouping: 'columns',
type: 'aggregate',
method: method,
value: column
});
return this;
} | javascript | function _aggregate(method, column) {
this._statements.push({
grouping: 'columns',
type: 'aggregate',
method: method,
value: column
});
return this;
} | [
"function",
"_aggregate",
"(",
"method",
",",
"column",
")",
"{",
"this",
".",
"_statements",
".",
"push",
"(",
"{",
"grouping",
":",
"'columns'",
",",
"type",
":",
"'aggregate'",
",",
"method",
":",
"method",
",",
"value",
":",
"column",
"}",
")",
";"... | Helper for compiling any aggregate queries. | [
"Helper",
"for",
"compiling",
"any",
"aggregate",
"queries",
"."
] | 4cc624975d359800961bf34cb74de97488d2efb5 | https://github.com/AppGeo/cartodb/blob/4cc624975d359800961bf34cb74de97488d2efb5/lib/builder.js#L763-L771 |
38,666 | rootsdev/gedcomx-js | src/core/ExtensibleData.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof ExtensibleData)){
return new ExtensibleData(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(ExtensibleData.isInstance(json)){
return json;... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof ExtensibleData)){
return new ExtensibleData(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(ExtensibleData.isInstance(json)){
return json;... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"ExtensibleData",
")",
")",
"{",
"return",
"new",
"ExtensibleData",
"(",
"json",
")",
";",
"}",
"// If the given... | A set of data that supports extension elements.
@class
@extends Base
@param {Object} [json] | [
"A",
"set",
"of",
"data",
"that",
"supports",
"extension",
"elements",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/ExtensibleData.js#L11-L24 | |
38,667 | anvilresearch/connect-keys | index.js | generateKeyPairs | function generateKeyPairs () {
AnvilConnectKeys.generateKeyPair(this.sig.pub, this.sig.prv)
AnvilConnectKeys.generateKeyPair(this.enc.pub, this.enc.prv)
} | javascript | function generateKeyPairs () {
AnvilConnectKeys.generateKeyPair(this.sig.pub, this.sig.prv)
AnvilConnectKeys.generateKeyPair(this.enc.pub, this.enc.prv)
} | [
"function",
"generateKeyPairs",
"(",
")",
"{",
"AnvilConnectKeys",
".",
"generateKeyPair",
"(",
"this",
".",
"sig",
".",
"pub",
",",
"this",
".",
"sig",
".",
"prv",
")",
"AnvilConnectKeys",
".",
"generateKeyPair",
"(",
"this",
".",
"enc",
".",
"pub",
",",
... | Generate key pairs | [
"Generate",
"key",
"pairs"
] | 45c7b4c7092cd37e92300add6951a8b1d74f3033 | https://github.com/anvilresearch/connect-keys/blob/45c7b4c7092cd37e92300add6951a8b1d74f3033/index.js#L42-L45 |
38,668 | anvilresearch/connect-keys | index.js | generateKeyPair | function generateKeyPair (pub, prv) {
try {
mkdirp.sync(path.dirname(pub))
mkdirp.sync(path.dirname(prv))
childProcess.execFileSync('openssl', [
'genrsa',
'-out',
prv,
'4096'
], {
stdio: 'ignore'
})
childProcess.execFileSync('openssl', [
'rsa',
'-pub... | javascript | function generateKeyPair (pub, prv) {
try {
mkdirp.sync(path.dirname(pub))
mkdirp.sync(path.dirname(prv))
childProcess.execFileSync('openssl', [
'genrsa',
'-out',
prv,
'4096'
], {
stdio: 'ignore'
})
childProcess.execFileSync('openssl', [
'rsa',
'-pub... | [
"function",
"generateKeyPair",
"(",
"pub",
",",
"prv",
")",
"{",
"try",
"{",
"mkdirp",
".",
"sync",
"(",
"path",
".",
"dirname",
"(",
"pub",
")",
")",
"mkdirp",
".",
"sync",
"(",
"path",
".",
"dirname",
"(",
"prv",
")",
")",
"childProcess",
".",
"e... | Generate single key pair | [
"Generate",
"single",
"key",
"pair"
] | 45c7b4c7092cd37e92300add6951a8b1d74f3033 | https://github.com/anvilresearch/connect-keys/blob/45c7b4c7092cd37e92300add6951a8b1d74f3033/index.js#L53-L83 |
38,669 | anvilresearch/connect-keys | index.js | loadKeyPairs | function loadKeyPairs () {
var sig = AnvilConnectKeys.loadKeyPair(this.sig.pub, this.sig.prv, 'sig')
var enc = AnvilConnectKeys.loadKeyPair(this.enc.pub, this.enc.prv, 'enc')
var jwkKeys = []
jwkKeys.push(sig.jwk.pub, enc.jwk.pub)
return {
sig: sig.pem,
enc: enc.pem,
jwks: {
keys: jwkKeys
... | javascript | function loadKeyPairs () {
var sig = AnvilConnectKeys.loadKeyPair(this.sig.pub, this.sig.prv, 'sig')
var enc = AnvilConnectKeys.loadKeyPair(this.enc.pub, this.enc.prv, 'enc')
var jwkKeys = []
jwkKeys.push(sig.jwk.pub, enc.jwk.pub)
return {
sig: sig.pem,
enc: enc.pem,
jwks: {
keys: jwkKeys
... | [
"function",
"loadKeyPairs",
"(",
")",
"{",
"var",
"sig",
"=",
"AnvilConnectKeys",
".",
"loadKeyPair",
"(",
"this",
".",
"sig",
".",
"pub",
",",
"this",
".",
"sig",
".",
"prv",
",",
"'sig'",
")",
"var",
"enc",
"=",
"AnvilConnectKeys",
".",
"loadKeyPair",
... | Load key pairs | [
"Load",
"key",
"pairs"
] | 45c7b4c7092cd37e92300add6951a8b1d74f3033 | https://github.com/anvilresearch/connect-keys/blob/45c7b4c7092cd37e92300add6951a8b1d74f3033/index.js#L91-L105 |
38,670 | anvilresearch/connect-keys | index.js | loadKeyPair | function loadKeyPair (pub, prv, use) {
var pubPEM, prvPEM, pubJWK
try {
pubPEM = fs.readFileSync(pub).toString('ascii')
} catch (e) {
throw new Error('Unable to read the public key from ' + pub)
}
try {
prvPEM = fs.readFileSync(prv).toString('ascii')
} catch (e) {
throw new Error('Unable t... | javascript | function loadKeyPair (pub, prv, use) {
var pubPEM, prvPEM, pubJWK
try {
pubPEM = fs.readFileSync(pub).toString('ascii')
} catch (e) {
throw new Error('Unable to read the public key from ' + pub)
}
try {
prvPEM = fs.readFileSync(prv).toString('ascii')
} catch (e) {
throw new Error('Unable t... | [
"function",
"loadKeyPair",
"(",
"pub",
",",
"prv",
",",
"use",
")",
"{",
"var",
"pubPEM",
",",
"prvPEM",
",",
"pubJWK",
"try",
"{",
"pubPEM",
"=",
"fs",
".",
"readFileSync",
"(",
"pub",
")",
".",
"toString",
"(",
"'ascii'",
")",
"}",
"catch",
"(",
... | Load single key pair | [
"Load",
"single",
"key",
"pair"
] | 45c7b4c7092cd37e92300add6951a8b1d74f3033 | https://github.com/anvilresearch/connect-keys/blob/45c7b4c7092cd37e92300add6951a8b1d74f3033/index.js#L113-L149 |
38,671 | anvilresearch/connect-keys | index.js | generateSetupToken | function generateSetupToken (tokenPath) {
mkdirp.sync(path.dirname(tokenPath))
var token = crypto.randomBytes(256).toString('hex')
try {
fs.writeFileSync(tokenPath, token, 'utf8')
} catch (e) {
throw new Error('Unable to save setup token to ' + tokenPath)
}
return token
} | javascript | function generateSetupToken (tokenPath) {
mkdirp.sync(path.dirname(tokenPath))
var token = crypto.randomBytes(256).toString('hex')
try {
fs.writeFileSync(tokenPath, token, 'utf8')
} catch (e) {
throw new Error('Unable to save setup token to ' + tokenPath)
}
return token
} | [
"function",
"generateSetupToken",
"(",
"tokenPath",
")",
"{",
"mkdirp",
".",
"sync",
"(",
"path",
".",
"dirname",
"(",
"tokenPath",
")",
")",
"var",
"token",
"=",
"crypto",
".",
"randomBytes",
"(",
"256",
")",
".",
"toString",
"(",
"'hex'",
")",
"try",
... | Generate setup token | [
"Generate",
"setup",
"token"
] | 45c7b4c7092cd37e92300add6951a8b1d74f3033 | https://github.com/anvilresearch/connect-keys/blob/45c7b4c7092cd37e92300add6951a8b1d74f3033/index.js#L157-L167 |
38,672 | benderjs/benderjs-coverage | lib/middleware.js | Transformer | function Transformer( file, res ) {
stream.Transform.call( this );
this.file = file;
this.res = res;
this.chunks = [];
} | javascript | function Transformer( file, res ) {
stream.Transform.call( this );
this.file = file;
this.res = res;
this.chunks = [];
} | [
"function",
"Transformer",
"(",
"file",
",",
"res",
")",
"{",
"stream",
".",
"Transform",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"file",
"=",
"file",
";",
"this",
".",
"res",
"=",
"res",
";",
"this",
".",
"chunks",
"=",
"[",
"]",
";",
... | Transofrms the code from an incomming stream and outputs the code instrumented by Istanbul
@param {String} file File name used by Istanbul
@param {Object} res HTTP response | [
"Transofrms",
"the",
"code",
"from",
"an",
"incomming",
"stream",
"and",
"outputs",
"the",
"code",
"instrumented",
"by",
"Istanbul"
] | 37099604257d7acf6dae57c425095cd884205a1f | https://github.com/benderjs/benderjs-coverage/blob/37099604257d7acf6dae57c425095cd884205a1f/lib/middleware.js#L27-L33 |
38,673 | nomocas/kroked | lib/utils.js | function(src, skipBlanck) {
var tokens = [],
cells, cap;
while (src) {
cells = [];
while (cap = cellDelimitter.exec(src)) {
src = src.substring(cap[0].length);
cells.push(cap[1]);
}
if (cells.length || !skipBlanck)
tokens.push(cells);
// src should start now with \n or \r
src = src.... | javascript | function(src, skipBlanck) {
var tokens = [],
cells, cap;
while (src) {
cells = [];
while (cap = cellDelimitter.exec(src)) {
src = src.substring(cap[0].length);
cells.push(cap[1]);
}
if (cells.length || !skipBlanck)
tokens.push(cells);
// src should start now with \n or \r
src = src.... | [
"function",
"(",
"src",
",",
"skipBlanck",
")",
"{",
"var",
"tokens",
"=",
"[",
"]",
",",
"cells",
",",
"cap",
";",
"while",
"(",
"src",
")",
"{",
"cells",
"=",
"[",
"]",
";",
"while",
"(",
"cap",
"=",
"cellDelimitter",
".",
"exec",
"(",
"src",
... | Parse tab delimitted lines from string. usefull for raw macros and table like widgets rendering.
@param {String} src the content block to parse until the end.
@param {Boolean} skipBlanck optional. if true, skip blank lines.
@return {Array} Parsed lines. Array of cells array. i.e. lines[2][3] gives y... | [
"Parse",
"tab",
"delimitted",
"lines",
"from",
"string",
".",
"usefull",
"for",
"raw",
"macros",
"and",
"table",
"like",
"widgets",
"rendering",
"."
] | 1d6baf62df437c0b4ab242be7b8915fa66c2cdb8 | https://github.com/nomocas/kroked/blob/1d6baf62df437c0b4ab242be7b8915fa66c2cdb8/lib/utils.js#L33-L48 | |
38,674 | lionel-rigoux/pandemic | lib/load-instructions.js | defaultInstructions | function defaultInstructions (format) {
// start with empty instructions
let instructions = emptyInstructions('_defaults', format);
// extend with the default recipe, if it exists for the target extension
const recipeFilePath = path.join(
__dirname,
'..',
'_defaults',
`recipe.${format}.json`
... | javascript | function defaultInstructions (format) {
// start with empty instructions
let instructions = emptyInstructions('_defaults', format);
// extend with the default recipe, if it exists for the target extension
const recipeFilePath = path.join(
__dirname,
'..',
'_defaults',
`recipe.${format}.json`
... | [
"function",
"defaultInstructions",
"(",
"format",
")",
"{",
"// start with empty instructions",
"let",
"instructions",
"=",
"emptyInstructions",
"(",
"'_defaults'",
",",
"format",
")",
";",
"// extend with the default recipe, if it exists for the target extension",
"const",
"re... | default recipe instruction | [
"default",
"recipe",
"instruction"
] | 133b2445ea4981f64012f6af4e6210a18981d46e | https://github.com/lionel-rigoux/pandemic/blob/133b2445ea4981f64012f6af4e6210a18981d46e/lib/load-instructions.js#L28-L46 |
38,675 | lionel-rigoux/pandemic | lib/load-instructions.js | isTemplate | function isTemplate (file, format) {
const { prefix, ext } = splitFormat(format);
return formatMap[ext]
.map(e => (prefix.length ? '.' : '') + prefix + e)
.some(e => file.endsWith(e));
} | javascript | function isTemplate (file, format) {
const { prefix, ext } = splitFormat(format);
return formatMap[ext]
.map(e => (prefix.length ? '.' : '') + prefix + e)
.some(e => file.endsWith(e));
} | [
"function",
"isTemplate",
"(",
"file",
",",
"format",
")",
"{",
"const",
"{",
"prefix",
",",
"ext",
"}",
"=",
"splitFormat",
"(",
"format",
")",
";",
"return",
"formatMap",
"[",
"ext",
"]",
".",
"map",
"(",
"e",
"=>",
"(",
"prefix",
".",
"length",
... | test if a given file could serve as a template for the format | [
"test",
"if",
"a",
"given",
"file",
"could",
"serve",
"as",
"a",
"template",
"for",
"the",
"format"
] | 133b2445ea4981f64012f6af4e6210a18981d46e | https://github.com/lionel-rigoux/pandemic/blob/133b2445ea4981f64012f6af4e6210a18981d46e/lib/load-instructions.js#L49-L54 |
38,676 | ningsuhen/passport-linkedin-token | lib/passport-linkedin-token/strategy.js | LinkedInTokenStrategy | function LinkedInTokenStrategy(options, verify) {
options = options || {};
options.requestTokenURL = options.requestTokenURL || 'https://api.linkedin.com/uas/oauth/requestToken';
options.accessTokenURL = options.accessTokenURL || 'https://api.linkedin.com/uas/oauth/accessToken';
options.userAuthorizationURL = o... | javascript | function LinkedInTokenStrategy(options, verify) {
options = options || {};
options.requestTokenURL = options.requestTokenURL || 'https://api.linkedin.com/uas/oauth/requestToken';
options.accessTokenURL = options.accessTokenURL || 'https://api.linkedin.com/uas/oauth/accessToken';
options.userAuthorizationURL = o... | [
"function",
"LinkedInTokenStrategy",
"(",
"options",
",",
"verify",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"options",
".",
"requestTokenURL",
"=",
"options",
".",
"requestTokenURL",
"||",
"'https://api.linkedin.com/uas/oauth/requestToken'",
";",
"... | `LinkedInTokenStrategy` constructor.
The LinkedIn authentication strategy authenticates requests by delegating to
LinkedIn using the OAuth protocol.
Applications must supply a `verify` callback which accepts a `token`,
`tokenSecret` and service-specific `profile`, and then calls the `done`
callback supplying a `user`... | [
"LinkedInTokenStrategy",
"constructor",
"."
] | da9e364abcaafca674d1a605101912844d46bde3 | https://github.com/ningsuhen/passport-linkedin-token/blob/da9e364abcaafca674d1a605101912844d46bde3/lib/passport-linkedin-token/strategy.js#L41-L53 |
38,677 | rootsdev/gedcomx-js | src/core/PlaceDescription.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof PlaceDescription)){
return new PlaceDescription(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(PlaceDescription.isInstance(json)){
return... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof PlaceDescription)){
return new PlaceDescription(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(PlaceDescription.isInstance(json)){
return... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"PlaceDescription",
")",
")",
"{",
"return",
"new",
"PlaceDescription",
"(",
"json",
")",
";",
"}",
"// If the g... | A description of a place
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#place-description|GEDCOM X JSON Spec}
@class
@extends Subject
@param {Object} [json] | [
"A",
"description",
"of",
"a",
"place"
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/PlaceDescription.js#L13-L26 | |
38,678 | reworkcss/rework-import | index.js | createImportError | function createImportError(rule) {
var url = rule.import ? rule.import.replace(/\r?\n/g, '\\n') : '<no url>';
var err = ['Bad import url: @import ' + url];
if (rule.position) {
err.push(' starting at line ' + rule.position.start.line + ' column ' + rule.position.start.column);
err.push(' ending at line ' + ... | javascript | function createImportError(rule) {
var url = rule.import ? rule.import.replace(/\r?\n/g, '\\n') : '<no url>';
var err = ['Bad import url: @import ' + url];
if (rule.position) {
err.push(' starting at line ' + rule.position.start.line + ' column ' + rule.position.start.column);
err.push(' ending at line ' + ... | [
"function",
"createImportError",
"(",
"rule",
")",
"{",
"var",
"url",
"=",
"rule",
".",
"import",
"?",
"rule",
".",
"import",
".",
"replace",
"(",
"/",
"\\r?\\n",
"/",
"g",
",",
"'\\\\n'",
")",
":",
"'<no url>'",
";",
"var",
"err",
"=",
"[",
"'Bad im... | Create bad import rule error
@param {String} rule
@api private | [
"Create",
"bad",
"import",
"rule",
"error"
] | 071a715124c7b10eeb1c298a72b7fc106a4bb8f0 | https://github.com/reworkcss/rework-import/blob/071a715124c7b10eeb1c298a72b7fc106a4bb8f0/index.js#L76-L90 |
38,679 | reworkcss/rework-import | index.js | read | function read(file, opts) {
var encoding = opts.encoding || 'utf8';
var data = opts.transform(fs.readFileSync(file, encoding));
return css.parse(data, {source: file}).stylesheet;
} | javascript | function read(file, opts) {
var encoding = opts.encoding || 'utf8';
var data = opts.transform(fs.readFileSync(file, encoding));
return css.parse(data, {source: file}).stylesheet;
} | [
"function",
"read",
"(",
"file",
",",
"opts",
")",
"{",
"var",
"encoding",
"=",
"opts",
".",
"encoding",
"||",
"'utf8'",
";",
"var",
"data",
"=",
"opts",
".",
"transform",
"(",
"fs",
".",
"readFileSync",
"(",
"file",
",",
"encoding",
")",
")",
";",
... | Read the contents of a file
@param {String} file
@param {Object} opts
@api private | [
"Read",
"the",
"contents",
"of",
"a",
"file"
] | 071a715124c7b10eeb1c298a72b7fc106a4bb8f0 | https://github.com/reworkcss/rework-import/blob/071a715124c7b10eeb1c298a72b7fc106a4bb8f0/index.js#L123-L127 |
38,680 | WRidder/backgrid-advanced-filter | src/filter-collection.js | function (attributes, options) {
var AttrCollection = Backgrid.Extension.AdvancedFilter.AttributeFilterCollection;
if (attributes.attributeFilters !== undefined && !(attributes.attributeFilters instanceof AttrCollection)) {
attributes.attributeFilters = new AttrCollection(attributes.attributeFilters);
... | javascript | function (attributes, options) {
var AttrCollection = Backgrid.Extension.AdvancedFilter.AttributeFilterCollection;
if (attributes.attributeFilters !== undefined && !(attributes.attributeFilters instanceof AttrCollection)) {
attributes.attributeFilters = new AttrCollection(attributes.attributeFilters);
... | [
"function",
"(",
"attributes",
",",
"options",
")",
"{",
"var",
"AttrCollection",
"=",
"Backgrid",
".",
"Extension",
".",
"AdvancedFilter",
".",
"AttributeFilterCollection",
";",
"if",
"(",
"attributes",
".",
"attributeFilters",
"!==",
"undefined",
"&&",
"!",
"(... | Set override
Makes sure the attributeFilters are set as a collection.
@method set
@param {Object} attributes
@param {Object} options
@return {*} | [
"Set",
"override",
"Makes",
"sure",
"the",
"attributeFilters",
"are",
"set",
"as",
"a",
"collection",
"."
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-collection.js#L238-L244 | |
38,681 | WRidder/backgrid-advanced-filter | src/filter-collection.js | function (style, exportAsString) {
var self = this;
var result;
switch (style) {
case "mongo":
case "mongodb":
default:
var mongoParser = new Backgrid.Extension.AdvancedFilter.FilterParsers.MongoParser();
result = mongoParser.parse(self);
if (exportAsString) {
... | javascript | function (style, exportAsString) {
var self = this;
var result;
switch (style) {
case "mongo":
case "mongodb":
default:
var mongoParser = new Backgrid.Extension.AdvancedFilter.FilterParsers.MongoParser();
result = mongoParser.parse(self);
if (exportAsString) {
... | [
"function",
"(",
"style",
",",
"exportAsString",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"result",
";",
"switch",
"(",
"style",
")",
"{",
"case",
"\"mongo\"",
":",
"case",
"\"mongodb\"",
":",
"default",
":",
"var",
"mongoParser",
"=",
"new",
... | Export the filter for a given style
@method exportFilter
@param {String} style. Values: "(mongo|mongodb), ..."
@param {boolean} exportAsString exports as a string if true.
@return {Object} | [
"Export",
"the",
"filter",
"for",
"a",
"given",
"style"
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-collection.js#L253-L269 | |
38,682 | WRidder/backgrid-advanced-filter | src/filter-collection.js | function() {
var self = this;
self.newFilterCount += 1;
if (self.length === 0) {
return self.newFilterCount;
}
else {
var newFilterName = self.newFilterName.replace(self.filterNamePartial, "");
var results = self.filter(function(fm) {
return fm.get("name").indexOf(newFilte... | javascript | function() {
var self = this;
self.newFilterCount += 1;
if (self.length === 0) {
return self.newFilterCount;
}
else {
var newFilterName = self.newFilterName.replace(self.filterNamePartial, "");
var results = self.filter(function(fm) {
return fm.get("name").indexOf(newFilte... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"newFilterCount",
"+=",
"1",
";",
"if",
"(",
"self",
".",
"length",
"===",
"0",
")",
"{",
"return",
"self",
".",
"newFilterCount",
";",
"}",
"else",
"{",
"var",
"newFilterName",... | Retrieves a new filter number.
@method getNewFilterNumber
@return {int}
@private | [
"Retrieves",
"a",
"new",
"filter",
"number",
"."
] | 5b10216f091d0e4bad418398fb4ec4c4588f4475 | https://github.com/WRidder/backgrid-advanced-filter/blob/5b10216f091d0e4bad418398fb4ec4c4588f4475/src/filter-collection.js#L332-L366 | |
38,683 | furf/vineapple | lib/vineapple.js | function (username, password, callback) {
var request;
var promise;
// Preemptively validate username and password
if (!username) {
throw new Error('Invalid credentials. Missing username.');
}
if (!password) {
throw new Error('Invalid credentials. Missing password.');
}
/... | javascript | function (username, password, callback) {
var request;
var promise;
// Preemptively validate username and password
if (!username) {
throw new Error('Invalid credentials. Missing username.');
}
if (!password) {
throw new Error('Invalid credentials. Missing password.');
}
/... | [
"function",
"(",
"username",
",",
"password",
",",
"callback",
")",
"{",
"var",
"request",
";",
"var",
"promise",
";",
"// Preemptively validate username and password",
"if",
"(",
"!",
"username",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Invalid credentials. Miss... | Authenticate the Vine API client
@param username {String}
@param password {String}
@param callback {Function} [optional]
@return {Object} request API promise | [
"Authenticate",
"the",
"Vine",
"API",
"client"
] | 9c71f2e45f306a517b6cfcfb3ef8e804918e3f81 | https://github.com/furf/vineapple/blob/9c71f2e45f306a517b6cfcfb3ef8e804918e3f81/lib/vineapple.js#L155-L191 | |
38,684 | furf/vineapple | lib/vineapple.js | function (callback) {
var promise = this.request({
method: 'delete',
url: 'users/authenticate'
}).then(this.authorize.bind(this));
if (callback) {
promise.then(callback.bind(null, null)).fail(callback);
}
return promise;
} | javascript | function (callback) {
var promise = this.request({
method: 'delete',
url: 'users/authenticate'
}).then(this.authorize.bind(this));
if (callback) {
promise.then(callback.bind(null, null)).fail(callback);
}
return promise;
} | [
"function",
"(",
"callback",
")",
"{",
"var",
"promise",
"=",
"this",
".",
"request",
"(",
"{",
"method",
":",
"'delete'",
",",
"url",
":",
"'users/authenticate'",
"}",
")",
".",
"then",
"(",
"this",
".",
"authorize",
".",
"bind",
"(",
"this",
")",
"... | De-authenticate the Vine API client
@param username {String}
@param password {String}
@param callback {Function} [optional]
@return {Object} request API promise | [
"De",
"-",
"authenticate",
"the",
"Vine",
"API",
"client"
] | 9c71f2e45f306a517b6cfcfb3ef8e804918e3f81 | https://github.com/furf/vineapple/blob/9c71f2e45f306a517b6cfcfb3ef8e804918e3f81/lib/vineapple.js#L200-L212 | |
38,685 | furf/vineapple | lib/vineapple.js | function (settings) {
this.key = settings && settings.key;
this.userId = settings && settings.userId;
this.username = settings && settings.username;
return this;
} | javascript | function (settings) {
this.key = settings && settings.key;
this.userId = settings && settings.userId;
this.username = settings && settings.username;
return this;
} | [
"function",
"(",
"settings",
")",
"{",
"this",
".",
"key",
"=",
"settings",
"&&",
"settings",
".",
"key",
";",
"this",
".",
"userId",
"=",
"settings",
"&&",
"settings",
".",
"userId",
";",
"this",
".",
"username",
"=",
"settings",
"&&",
"settings",
"."... | Authorize the current client
@param settings {Object}
@return {Object} self | [
"Authorize",
"the",
"current",
"client"
] | 9c71f2e45f306a517b6cfcfb3ef8e804918e3f81 | https://github.com/furf/vineapple/blob/9c71f2e45f306a517b6cfcfb3ef8e804918e3f81/lib/vineapple.js#L219-L224 | |
38,686 | kozervar/napi-js | dist/download.js | generateFileHashes | function generateFileHashes(options, files) {
if (options.verbose) {
_utils.logger.info('Generating files hash...');
}
if (files.length === 0) _utils.logger.info('No files found!');else if (options.verbose) {
_utils.logger.info('Files found: ');
var _iteratorNormalCompletion = true;
... | javascript | function generateFileHashes(options, files) {
if (options.verbose) {
_utils.logger.info('Generating files hash...');
}
if (files.length === 0) _utils.logger.info('No files found!');else if (options.verbose) {
_utils.logger.info('Files found: ');
var _iteratorNormalCompletion = true;
... | [
"function",
"generateFileHashes",
"(",
"options",
",",
"files",
")",
"{",
"if",
"(",
"options",
".",
"verbose",
")",
"{",
"_utils",
".",
"logger",
".",
"info",
"(",
"'Generating files hash...'",
")",
";",
"}",
"if",
"(",
"files",
".",
"length",
"===",
"0... | Generate MD5 partial hash for provided files
@param {NapijsOptions} options
@param files
@returns {Promise} | [
"Generate",
"MD5",
"partial",
"hash",
"for",
"provided",
"files"
] | f54809fdd20ad293c46ce1fbed0b4c1e12d4977c | https://github.com/kozervar/napi-js/blob/f54809fdd20ad293c46ce1fbed0b4c1e12d4977c/dist/download.js#L18-L77 |
38,687 | kozervar/napi-js | dist/download.js | makeHttpRequests | function makeHttpRequests(options, fileHashes) {
if (options.verbose) {
_utils.logger.info('Performing HTTP requests...');
}
var promises = [];
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator4 =... | javascript | function makeHttpRequests(options, fileHashes) {
if (options.verbose) {
_utils.logger.info('Performing HTTP requests...');
}
var promises = [];
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator4 =... | [
"function",
"makeHttpRequests",
"(",
"options",
",",
"fileHashes",
")",
"{",
"if",
"(",
"options",
".",
"verbose",
")",
"{",
"_utils",
".",
"logger",
".",
"info",
"(",
"'Performing HTTP requests...'",
")",
";",
"}",
"var",
"promises",
"=",
"[",
"]",
";",
... | Perform HTTP request to Napiprojekt server
@param {NapijsOptions} options
@param fileHashes
@returns {Promise} | [
"Perform",
"HTTP",
"request",
"to",
"Napiprojekt",
"server"
] | f54809fdd20ad293c46ce1fbed0b4c1e12d4977c | https://github.com/kozervar/napi-js/blob/f54809fdd20ad293c46ce1fbed0b4c1e12d4977c/dist/download.js#L123-L159 |
38,688 | kozervar/napi-js | dist/download.js | parseHttpResponse | function parseHttpResponse(options, filesWithHash) {
if (options.verbose) {
_utils.logger.info('Parsing HTTP responses...');
}
var promises = [];
var _iteratorNormalCompletion5 = true;
var _didIteratorError5 = false;
var _iteratorError5 = undefined;
try {
for (var _iterator5... | javascript | function parseHttpResponse(options, filesWithHash) {
if (options.verbose) {
_utils.logger.info('Parsing HTTP responses...');
}
var promises = [];
var _iteratorNormalCompletion5 = true;
var _didIteratorError5 = false;
var _iteratorError5 = undefined;
try {
for (var _iterator5... | [
"function",
"parseHttpResponse",
"(",
"options",
",",
"filesWithHash",
")",
"{",
"if",
"(",
"options",
".",
"verbose",
")",
"{",
"_utils",
".",
"logger",
".",
"info",
"(",
"'Parsing HTTP responses...'",
")",
";",
"}",
"var",
"promises",
"=",
"[",
"]",
";",... | Parse HTTP response from Napiprojekt server. Format XML response to JSON and save subtitles to file.
@param {NapijsOptions} options
@param filesWithHash
@returns {Promise} | [
"Parse",
"HTTP",
"response",
"from",
"Napiprojekt",
"server",
".",
"Format",
"XML",
"response",
"to",
"JSON",
"and",
"save",
"subtitles",
"to",
"file",
"."
] | f54809fdd20ad293c46ce1fbed0b4c1e12d4977c | https://github.com/kozervar/napi-js/blob/f54809fdd20ad293c46ce1fbed0b4c1e12d4977c/dist/download.js#L167-L205 |
38,689 | ipanli/xlsxtojson | lib/xlsx-to-json.js | parseObjectArrayField | function parseObjectArrayField(row, key, value) {
var obj_array = [];
if (value) {
if (value.indexOf(',') !== -1) {
obj_array = value.split(',');
} else {
obj_array.push(value.toString());
};
};
// if (typeof(value) === 'string' && value.indexOf(',') !=... | javascript | function parseObjectArrayField(row, key, value) {
var obj_array = [];
if (value) {
if (value.indexOf(',') !== -1) {
obj_array = value.split(',');
} else {
obj_array.push(value.toString());
};
};
// if (typeof(value) === 'string' && value.indexOf(',') !=... | [
"function",
"parseObjectArrayField",
"(",
"row",
",",
"key",
",",
"value",
")",
"{",
"var",
"obj_array",
"=",
"[",
"]",
";",
"if",
"(",
"value",
")",
"{",
"if",
"(",
"value",
".",
"indexOf",
"(",
"','",
")",
"!==",
"-",
"1",
")",
"{",
"obj_array",
... | parse object array. | [
"parse",
"object",
"array",
"."
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/lib/xlsx-to-json.js#L205-L232 |
38,690 | ipanli/xlsxtojson | lib/xlsx-to-json.js | parseBasicArrayField | function parseBasicArrayField(field, key, array) {
var basic_array;
if (typeof array === "string") {
basic_array = array.split(arraySeparator);
} else {
basic_array = [];
basic_array.push(array);
};
var result = [];
if (isNumberArray(basic_array)) {
basic_array.... | javascript | function parseBasicArrayField(field, key, array) {
var basic_array;
if (typeof array === "string") {
basic_array = array.split(arraySeparator);
} else {
basic_array = [];
basic_array.push(array);
};
var result = [];
if (isNumberArray(basic_array)) {
basic_array.... | [
"function",
"parseBasicArrayField",
"(",
"field",
",",
"key",
",",
"array",
")",
"{",
"var",
"basic_array",
";",
"if",
"(",
"typeof",
"array",
"===",
"\"string\"",
")",
"{",
"basic_array",
"=",
"array",
".",
"split",
"(",
"arraySeparator",
")",
";",
"}",
... | parse simple array. | [
"parse",
"simple",
"array",
"."
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/lib/xlsx-to-json.js#L267-L291 |
38,691 | ipanli/xlsxtojson | lib/xlsx-to-json.js | isBoolean | function isBoolean(value) {
if (typeof(value) == "undefined") {
return false;
}
if (typeof value === 'boolean') {
return true;
};
var b = value.toString().trim().toLowerCase();
return b === 'true' || b === 'false';
} | javascript | function isBoolean(value) {
if (typeof(value) == "undefined") {
return false;
}
if (typeof value === 'boolean') {
return true;
};
var b = value.toString().trim().toLowerCase();
return b === 'true' || b === 'false';
} | [
"function",
"isBoolean",
"(",
"value",
")",
"{",
"if",
"(",
"typeof",
"(",
"value",
")",
"==",
"\"undefined\"",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"typeof",
"value",
"===",
"'boolean'",
")",
"{",
"return",
"true",
";",
"}",
";",
"var",... | boolean type check. | [
"boolean",
"type",
"check",
"."
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/lib/xlsx-to-json.js#L336-L349 |
38,692 | ipanli/xlsxtojson | lib/xlsx-to-json.js | isDateType | function isDateType(value) {
if (value) {
var str = value.toString();
return moment(new Date(value), "YYYY-M-D", true).isValid() || moment(value, "YYYY-M-D H:m:s", true).isValid() || moment(value, "YYYY/M/D H:m:s", true).isValid() || moment(value, "YYYY/M/D", true).isValid();
};
return false... | javascript | function isDateType(value) {
if (value) {
var str = value.toString();
return moment(new Date(value), "YYYY-M-D", true).isValid() || moment(value, "YYYY-M-D H:m:s", true).isValid() || moment(value, "YYYY/M/D H:m:s", true).isValid() || moment(value, "YYYY/M/D", true).isValid();
};
return false... | [
"function",
"isDateType",
"(",
"value",
")",
"{",
"if",
"(",
"value",
")",
"{",
"var",
"str",
"=",
"value",
".",
"toString",
"(",
")",
";",
"return",
"moment",
"(",
"new",
"Date",
"(",
"value",
")",
",",
"\"YYYY-M-D\"",
",",
"true",
")",
".",
"isVa... | date type check. | [
"date",
"type",
"check",
"."
] | 7432f133d584d6f32eb2bf722de084e2416bc468 | https://github.com/ipanli/xlsxtojson/blob/7432f133d584d6f32eb2bf722de084e2416bc468/lib/xlsx-to-json.js#L359-L365 |
38,693 | mjlescano/domator | domator.js | domator | function domator() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return render(parse(args));
} | javascript | function domator() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return render(parse(args));
} | [
"function",
"domator",
"(",
")",
"{",
"for",
"(",
"var",
"_len",
"=",
"arguments",
".",
"length",
",",
"args",
"=",
"Array",
"(",
"_len",
")",
",",
"_key",
"=",
"0",
";",
"_key",
"<",
"_len",
";",
"_key",
"++",
")",
"{",
"args",
"[",
"_key",
"]... | Default domator export | [
"Default",
"domator",
"export"
] | 8307bee6172f4830d40df61ba277ac2b2b4c0fc2 | https://github.com/mjlescano/domator/blob/8307bee6172f4830d40df61ba277ac2b2b4c0fc2/domator.js#L175-L181 |
38,694 | rootsdev/gedcomx-js | src/core/Subject.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Subject)){
return new Subject(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Subject.isInstance(json)){
return json;
}
this.init(j... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Subject)){
return new Subject(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Subject.isInstance(json)){
return json;
}
this.init(j... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Subject",
")",
")",
"{",
"return",
"new",
"Subject",
"(",
"json",
")",
";",
"}",
"// If the given object is alr... | An object identified in time and space by various conclusions.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#subject|GEDCOM X JSON Spec}
@class
@extends Conclusion
@param {Object} [json] | [
"An",
"object",
"identified",
"in",
"time",
"and",
"space",
"by",
"various",
"conclusions",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Subject.js#L13-L26 | |
38,695 | rootsdev/gedcomx-js | src/core/Document.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Document)){
return new Document(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Document.isInstance(json)){
return json;
}
this.ini... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Document)){
return new Document(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Document.isInstance(json)){
return json;
}
this.ini... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Document",
")",
")",
"{",
"return",
"new",
"Document",
"(",
"json",
")",
";",
"}",
"// If the given object is a... | A textual document
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#document|GEDCOM X JSON Spec}
@class
@extends Conclusion
@param {Object} [json] | [
"A",
"textual",
"document"
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Document.js#L13-L26 | |
38,696 | rootsdev/gedcomx-js | src/records/FieldValue.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof FieldValue)){
return new FieldValue(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(FieldValue.isInstance(json)){
return... | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof FieldValue)){
return new FieldValue(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(FieldValue.isInstance(json)){
return... | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"FieldValue",
")",
")",
"{",
"return",
"new",
"FieldValue",
"(",
"json",
")",
";",
"}",
"// If the given object ... | Information about the value of a field.
@see {@link https://github.com/FamilySearch/gedcomx-record/blob/master/specifications/record-specification.md#field-value-data-type|GEDCOM X Records Spec}
@class FieldValue
@extends Conclusion
@param {Object} [json] | [
"Information",
"about",
"the",
"value",
"of",
"a",
"field",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/records/FieldValue.js#L14-L27 | |
38,697 | rootsdev/gedcomx-js | src/core/Name.js | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Name)){
return new Name(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Name.isInstance(json)){
return json;
}
this.init(json);
} | javascript | function(json){
// Protect against forgetting the new keyword when calling the constructor
if(!(this instanceof Name)){
return new Name(json);
}
// If the given object is already an instance then just return it. DON'T copy it.
if(Name.isInstance(json)){
return json;
}
this.init(json);
} | [
"function",
"(",
"json",
")",
"{",
"// Protect against forgetting the new keyword when calling the constructor",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Name",
")",
")",
"{",
"return",
"new",
"Name",
"(",
"json",
")",
";",
"}",
"// If the given object is already a... | A name.
@see {@link https://github.com/FamilySearch/gedcomx/blob/master/specifications/json-format-specification.md#name-conclusion|GEDCOM X JSON Spec}
@class
@extends Conclusion
@param {Object} [json] | [
"A",
"name",
"."
] | 08b2fcde96f1e301c78561bfb7a8b0cac606e26e | https://github.com/rootsdev/gedcomx-js/blob/08b2fcde96f1e301c78561bfb7a8b0cac606e26e/src/core/Name.js#L13-L26 | |
38,698 | Adeptive/Smappee-NodeJS | smappee-api.js | function(handler) {
if (typeof accessToken == 'undefined') {
var body = {
client_id: clientId,
client_secret: clientSecret,
username: username,
password: password,
grant_type: 'password'
};
if (t... | javascript | function(handler) {
if (typeof accessToken == 'undefined') {
var body = {
client_id: clientId,
client_secret: clientSecret,
username: username,
password: password,
grant_type: 'password'
};
if (t... | [
"function",
"(",
"handler",
")",
"{",
"if",
"(",
"typeof",
"accessToken",
"==",
"'undefined'",
")",
"{",
"var",
"body",
"=",
"{",
"client_id",
":",
"clientId",
",",
"client_secret",
":",
"clientSecret",
",",
"username",
":",
"username",
",",
"password",
":... | HELPER METHODS ++++++++++++++++++++++++++++++++++++++++ | [
"HELPER",
"METHODS",
"++++++++++++++++++++++++++++++++++++++++"
] | 02de2f6f8fcc1d48a39b1b36d36535ea24435395 | https://github.com/Adeptive/Smappee-NodeJS/blob/02de2f6f8fcc1d48a39b1b36d36535ea24435395/smappee-api.js#L125-L161 | |
38,699 | gabrieleds/node-argv | index.js | parse | function parse (argv, opts, target) {
if ('string' === typeof argv) argv = argv.split(rSplit).filter(ignore);
if (!opts) opts = {};
opts[don] = true;
var parsed = parseArray(argv, opts);
opts[don] = false;
var through = parsed[don].length ? parseArray(parsed[don], opts) : null;
if (!target) target ... | javascript | function parse (argv, opts, target) {
if ('string' === typeof argv) argv = argv.split(rSplit).filter(ignore);
if (!opts) opts = {};
opts[don] = true;
var parsed = parseArray(argv, opts);
opts[don] = false;
var through = parsed[don].length ? parseArray(parsed[don], opts) : null;
if (!target) target ... | [
"function",
"parse",
"(",
"argv",
",",
"opts",
",",
"target",
")",
"{",
"if",
"(",
"'string'",
"===",
"typeof",
"argv",
")",
"argv",
"=",
"argv",
".",
"split",
"(",
"rSplit",
")",
".",
"filter",
"(",
"ignore",
")",
";",
"if",
"(",
"!",
"opts",
")... | Parse arguments.
@param {argv} String/Array to parse
@param {opts} Object of properties
@param {target} Object
@return {target|Object}
@api public | [
"Parse",
"arguments",
"."
] | c970e90d0a812fc93435051a89ee1cc9c87a80d5 | https://github.com/gabrieleds/node-argv/blob/c970e90d0a812fc93435051a89ee1cc9c87a80d5/index.js#L38-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.