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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35,800 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/loader.js | cssPoll | function cssPoll() {
for (var url in monitors) {
var callbackObj = monitors[url],
node = callbackObj.node;
if (isCssLoaded(node, url)) {
if (callbackObj.callback) {
callbackObj.callback.call(node);
}
dele... | javascript | function cssPoll() {
for (var url in monitors) {
var callbackObj = monitors[url],
node = callbackObj.node;
if (isCssLoaded(node, url)) {
if (callbackObj.callback) {
callbackObj.callback.call(node);
}
dele... | [
"function",
"cssPoll",
"(",
")",
"{",
"for",
"(",
"var",
"url",
"in",
"monitors",
")",
"{",
"var",
"callbackObj",
"=",
"monitors",
"[",
"url",
"]",
",",
"node",
"=",
"callbackObj",
".",
"node",
";",
"if",
"(",
"isCssLoaded",
"(",
"node",
",",
"url",
... | single thread is ok | [
"single",
"thread",
"is",
"ok"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L1193-L1211 |
35,801 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/loader.js | function (moduleName) {
var requiresModule = createModule(moduleName);
var mods = requiresModule.getNormalizedModules();
Utils.each(mods, function (m) {
m.undef();
});
} | javascript | function (moduleName) {
var requiresModule = createModule(moduleName);
var mods = requiresModule.getNormalizedModules();
Utils.each(mods, function (m) {
m.undef();
});
} | [
"function",
"(",
"moduleName",
")",
"{",
"var",
"requiresModule",
"=",
"createModule",
"(",
"moduleName",
")",
";",
"var",
"mods",
"=",
"requiresModule",
".",
"getNormalizedModules",
"(",
")",
";",
"Utils",
".",
"each",
"(",
"mods",
",",
"function",
"(",
"... | undefine a module
@param {String} moduleName module name
@member KISSY | [
"undefine",
"a",
"module"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L2365-L2371 | |
35,802 | Automattic/wpcom-unpublished | lib/site.wordads.earnings.js | SiteWordAdsEarnings | function SiteWordAdsEarnings( sid, wpcom ) {
if ( ! ( this instanceof SiteWordAdsEarnings ) ) {
return new SiteWordAdsEarnings( sid, wpcom );
}
this._sid = sid;
this.wpcom = wpcom;
} | javascript | function SiteWordAdsEarnings( sid, wpcom ) {
if ( ! ( this instanceof SiteWordAdsEarnings ) ) {
return new SiteWordAdsEarnings( sid, wpcom );
}
this._sid = sid;
this.wpcom = wpcom;
} | [
"function",
"SiteWordAdsEarnings",
"(",
"sid",
",",
"wpcom",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"SiteWordAdsEarnings",
")",
")",
"{",
"return",
"new",
"SiteWordAdsEarnings",
"(",
"sid",
",",
"wpcom",
")",
";",
"}",
"this",
".",
"_sid",
... | `SiteWordAdsEarnings` constructor.
*Example:*
// Require `wpcom-unpublished` library
var wpcomUnpublished = require( 'wpcom-unpublished' );
// Create a `wpcomUnpublished` instance
var wpcom = wpcomUnpublished();
// Create a `SiteWordAdsEarnings` instance
var wordAds = wpcom
.site( 'my-blog.wordpress.com' )
.wordAds(... | [
"SiteWordAdsEarnings",
"constructor",
"."
] | 9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e | https://github.com/Automattic/wpcom-unpublished/blob/9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e/lib/site.wordads.earnings.js#L23-L30 |
35,803 | cshum/raco | index.js | _raco | function _raco (iter, args, callback, opts) {
var self = this
var trycatch = true
var isYieldable = true
var yielded = false
var nothrow = !!opts.nothrow
/**
* internal callback stepper
*
* @param {object} err - callback error object
* @param {...*} val - callback value(s)
*/
function step ... | javascript | function _raco (iter, args, callback, opts) {
var self = this
var trycatch = true
var isYieldable = true
var yielded = false
var nothrow = !!opts.nothrow
/**
* internal callback stepper
*
* @param {object} err - callback error object
* @param {...*} val - callback value(s)
*/
function step ... | [
"function",
"_raco",
"(",
"iter",
",",
"args",
",",
"callback",
",",
"opts",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"trycatch",
"=",
"true",
"var",
"isYieldable",
"=",
"true",
"var",
"yielded",
"=",
"false",
"var",
"nothrow",
"=",
"!",
"!",
"op... | internal raco resolver
@param {function} genFn - generator function
@param {array} args - arguments in real array form
@returns {promise} if no callback provided | [
"internal",
"raco",
"resolver"
] | 33909b489c1696492253c90f49d24c27e18a4ed6 | https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L62-L154 |
35,804 | cshum/raco | index.js | step | function step (err, val) {
if (iter) {
// generator step
yielded = false
isYieldable = false
var state
if (trycatch) {
try {
if (nothrow) state = iter.next(slice.call(arguments))
else state = err ? iter.throw(err) : iter.next(val)
} catch (err) {
... | javascript | function step (err, val) {
if (iter) {
// generator step
yielded = false
isYieldable = false
var state
if (trycatch) {
try {
if (nothrow) state = iter.next(slice.call(arguments))
else state = err ? iter.throw(err) : iter.next(val)
} catch (err) {
... | [
"function",
"step",
"(",
"err",
",",
"val",
")",
"{",
"if",
"(",
"iter",
")",
"{",
"// generator step",
"yielded",
"=",
"false",
"isYieldable",
"=",
"false",
"var",
"state",
"if",
"(",
"trycatch",
")",
"{",
"try",
"{",
"if",
"(",
"nothrow",
")",
"sta... | internal callback stepper
@param {object} err - callback error object
@param {...*} val - callback value(s) | [
"internal",
"callback",
"stepper"
] | 33909b489c1696492253c90f49d24c27e18a4ed6 | https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L74-L104 |
35,805 | cshum/raco | index.js | next | function next () {
var args = slice.call(arguments)
if (!isYieldable) {
// only handle callback if not yieldable
if (iter && yielded) {
// no need defer when yielded
step.apply(self, args)
} else {
// need next tick if not defered
process.nextTick(function () {
... | javascript | function next () {
var args = slice.call(arguments)
if (!isYieldable) {
// only handle callback if not yieldable
if (iter && yielded) {
// no need defer when yielded
step.apply(self, args)
} else {
// need next tick if not defered
process.nextTick(function () {
... | [
"function",
"next",
"(",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
")",
"if",
"(",
"!",
"isYieldable",
")",
"{",
"// only handle callback if not yieldable",
"if",
"(",
"iter",
"&&",
"yielded",
")",
"{",
"// no need defer when yielde... | next, callback stepper with nextTick
@param {object} err - callback error object
@param {...*} val - callback value(s) | [
"next",
"callback",
"stepper",
"with",
"nextTick"
] | 33909b489c1696492253c90f49d24c27e18a4ed6 | https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L111-L127 |
35,806 | cshum/raco | index.js | raco | function raco (genFn, opts) {
if (!isGeneratorFunction(genFn)) {
if (isFunction(genFn)) throw new Error('Generator function required')
else if (!isGenerator(genFn)) return factory(genFn)
}
opts = Object.assign({}, _opts, opts)
opts.Promise = null
return _raco.call(this, genFn, null, null... | javascript | function raco (genFn, opts) {
if (!isGeneratorFunction(genFn)) {
if (isFunction(genFn)) throw new Error('Generator function required')
else if (!isGenerator(genFn)) return factory(genFn)
}
opts = Object.assign({}, _opts, opts)
opts.Promise = null
return _raco.call(this, genFn, null, null... | [
"function",
"raco",
"(",
"genFn",
",",
"opts",
")",
"{",
"if",
"(",
"!",
"isGeneratorFunction",
"(",
"genFn",
")",
")",
"{",
"if",
"(",
"isFunction",
"(",
"genFn",
")",
")",
"throw",
"new",
"Error",
"(",
"'Generator function required'",
")",
"else",
"if"... | raco resolver
returns factory if no arguments
@param {function} genFn - generator function or factory options
@param {object} [opts] - options object
@returns {promise} if no callback provided | [
"raco",
"resolver",
"returns",
"factory",
"if",
"no",
"arguments"
] | 33909b489c1696492253c90f49d24c27e18a4ed6 | https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L171-L179 |
35,807 | lyveminds/scamandrios | lib/column_family.js | columnParent | function columnParent(cf, column)
{
var args = { column_family: cf.name };
if (cf.isSuper && column)
args.super_column = cf.columnMarshaller.serialize(column);
return new ttype.ColumnParent(args);
} | javascript | function columnParent(cf, column)
{
var args = { column_family: cf.name };
if (cf.isSuper && column)
args.super_column = cf.columnMarshaller.serialize(column);
return new ttype.ColumnParent(args);
} | [
"function",
"columnParent",
"(",
"cf",
",",
"column",
")",
"{",
"var",
"args",
"=",
"{",
"column_family",
":",
"cf",
".",
"name",
"}",
";",
"if",
"(",
"cf",
".",
"isSuper",
"&&",
"column",
")",
"args",
".",
"super_column",
"=",
"cf",
".",
"columnMars... | Returns a column parent
When calculating the column parent of a standard column family,
the parent is simply the column family name. When dealing with
super columns on the other hand, an optional name parameter may
be provided.
@param {Object} cf A reference to the ColumnFamily
@param {Object} name The name of the co... | [
"Returns",
"a",
"column",
"parent",
"When",
"calculating",
"the",
"column",
"parent",
"of",
"a",
"standard",
"column",
"family",
"the",
"parent",
"is",
"simply",
"the",
"column",
"family",
"name",
".",
"When",
"dealing",
"with",
"super",
"columns",
"on",
"th... | a1b643c68d3d88e608c610d4ce5f96e7142972cd | https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L28-L34 |
35,808 | lyveminds/scamandrios | lib/column_family.js | columnPath | function columnPath(cf, column, subcolumn)
{
var args = { column_family: cf.name };
if (column)
args.column = cf.columnMarshaller.serialize(column);
if (cf.isSuper && subcolumn)
args.subcolumn = cf.subcolumnMarshaller.serialize(subcolumn);
return new ttype.ColumnPath(args);
} | javascript | function columnPath(cf, column, subcolumn)
{
var args = { column_family: cf.name };
if (column)
args.column = cf.columnMarshaller.serialize(column);
if (cf.isSuper && subcolumn)
args.subcolumn = cf.subcolumnMarshaller.serialize(subcolumn);
return new ttype.ColumnPath(args);
} | [
"function",
"columnPath",
"(",
"cf",
",",
"column",
",",
"subcolumn",
")",
"{",
"var",
"args",
"=",
"{",
"column_family",
":",
"cf",
".",
"name",
"}",
";",
"if",
"(",
"column",
")",
"args",
".",
"column",
"=",
"cf",
".",
"columnMarshaller",
".",
"ser... | Returns a column path
As with the ColumnParent, the value of the ColumnPath depends on whether
this is a standard or super column family. Both must specify the column
family name. A standard column family may provide an optional column name
parameter. In addition to the column name, a super column family may also
us... | [
"Returns",
"a",
"column",
"path",
"As",
"with",
"the",
"ColumnParent",
"the",
"value",
"of",
"the",
"ColumnPath",
"depends",
"on",
"whether",
"this",
"is",
"a",
"standard",
"or",
"super",
"column",
"family",
".",
"Both",
"must",
"specify",
"the",
"column",
... | a1b643c68d3d88e608c610d4ce5f96e7142972cd | https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L50-L61 |
35,809 | lyveminds/scamandrios | lib/column_family.js | normalizeParameters | function normalizeParameters(list)
{
list = _.toArray(list);
return _.reduce(list, function(args, value, index)
{
if (_.isObject(value) && !Array.isArray(value))
{
var options = args.options,
timestamp = value.timestamp,
consistency = value.c... | javascript | function normalizeParameters(list)
{
list = _.toArray(list);
return _.reduce(list, function(args, value, index)
{
if (_.isObject(value) && !Array.isArray(value))
{
var options = args.options,
timestamp = value.timestamp,
consistency = value.c... | [
"function",
"normalizeParameters",
"(",
"list",
")",
"{",
"list",
"=",
"_",
".",
"toArray",
"(",
"list",
")",
";",
"return",
"_",
".",
"reduce",
"(",
"list",
",",
"function",
"(",
"args",
",",
"value",
",",
"index",
")",
"{",
"if",
"(",
"_",
".",
... | A convenience method to normalize the standard parameters used by
a thrift operation. The parameter list must contain a `key` parameter
as its first item. The `column`, `subcolumn`, `options`, and
`callback` parameters are optional.
@param {Array} list The list of parameters
@private
@memberOf ColumnFamily
@returns {O... | [
"A",
"convenience",
"method",
"to",
"normalize",
"the",
"standard",
"parameters",
"used",
"by",
"a",
"thrift",
"operation",
".",
"The",
"parameter",
"list",
"must",
"contain",
"a",
"key",
"parameter",
"as",
"its",
"first",
"item",
".",
"The",
"column",
"subc... | a1b643c68d3d88e608c610d4ce5f96e7142972cd | https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L116-L145 |
35,810 | DennisSchwartz/multilayerlayout3d | lib/multilayerlayout3d.js | function() {
var stable = [];
for (var i=0;i<physicsSimulators.length; i++) {
stable.push(physicsSimulators[i].step());
}
// Check if all simulators are stable
//console.log(stable);
for (i=0;i<stable.length;i++) {
i... | javascript | function() {
var stable = [];
for (var i=0;i<physicsSimulators.length; i++) {
stable.push(physicsSimulators[i].step());
}
// Check if all simulators are stable
//console.log(stable);
for (i=0;i<stable.length;i++) {
i... | [
"function",
"(",
")",
"{",
"var",
"stable",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"physicsSimulators",
".",
"length",
";",
"i",
"++",
")",
"{",
"stable",
".",
"push",
"(",
"physicsSimulators",
"[",
"i",
"]",
".",
... | Do one step of iterative layout calculation
Return true is the current layout is stable | [
"Do",
"one",
"step",
"of",
"iterative",
"layout",
"calculation",
"Return",
"true",
"is",
"the",
"current",
"layout",
"is",
"stable"
] | 772259e5cc46961df2d042c2866d52e039c91bc0 | https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L69-L82 | |
35,811 | DennisSchwartz/multilayerlayout3d | lib/multilayerlayout3d.js | function (nodeId) {
var layer = getLayer(nodeId);
var body = getInitializedBody(nodeId);
body.pos.z = layer * interLayerDistance;
return body.pos;
} | javascript | function (nodeId) {
var layer = getLayer(nodeId);
var body = getInitializedBody(nodeId);
body.pos.z = layer * interLayerDistance;
return body.pos;
} | [
"function",
"(",
"nodeId",
")",
"{",
"var",
"layer",
"=",
"getLayer",
"(",
"nodeId",
")",
";",
"var",
"body",
"=",
"getInitializedBody",
"(",
"nodeId",
")",
";",
"body",
".",
"pos",
".",
"z",
"=",
"layer",
"*",
"interLayerDistance",
";",
"return",
"bod... | This will return the current position for each node
@param nodeId
@returns {Vector3d} | [
"This",
"will",
"return",
"the",
"current",
"position",
"for",
"each",
"node"
] | 772259e5cc46961df2d042c2866d52e039c91bc0 | https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L89-L94 | |
35,812 | DennisSchwartz/multilayerlayout3d | lib/multilayerlayout3d.js | function() {
graph.off('changed', onGraphChanged);
for (var i=0;i<physicsSimulators.length; i++) {
physicsSimulators[i].off('stable', onStableChanged);
}
} | javascript | function() {
graph.off('changed', onGraphChanged);
for (var i=0;i<physicsSimulators.length; i++) {
physicsSimulators[i].off('stable', onStableChanged);
}
} | [
"function",
"(",
")",
"{",
"graph",
".",
"off",
"(",
"'changed'",
",",
"onGraphChanged",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"physicsSimulators",
".",
"length",
";",
"i",
"++",
")",
"{",
"physicsSimulators",
"[",
"i",
"]",
".... | Request to release all resources | [
"Request",
"to",
"release",
"all",
"resources"
] | 772259e5cc46961df2d042c2866d52e039c91bc0 | https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L173-L178 | |
35,813 | kissyteam/kissy-xtemplate | lib/kg/kg-4.2.0/compiler.js | function (tplContent, name) {
if (tplContent) {
var ret;
try {
ret = parser.parse(tplContent, name);
} catch (err) {
var e;
if (err instanceof Error) {
e = err;
} else {
e = new Error(err);
}
var errorStr = 'XTemplate error ';
... | javascript | function (tplContent, name) {
if (tplContent) {
var ret;
try {
ret = parser.parse(tplContent, name);
} catch (err) {
var e;
if (err instanceof Error) {
e = err;
} else {
e = new Error(err);
}
var errorStr = 'XTemplate error ';
... | [
"function",
"(",
"tplContent",
",",
"name",
")",
"{",
"if",
"(",
"tplContent",
")",
"{",
"var",
"ret",
";",
"try",
"{",
"ret",
"=",
"parser",
".",
"parse",
"(",
"tplContent",
",",
"name",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"var",
"e",
... | get ast of template
@param {String} [name] xtemplate name
@param {String} tplContent
@return {Object} | [
"get",
"ast",
"of",
"template"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kg/kg-4.2.0/compiler.js#L635-L658 | |
35,814 | craterdog-bali/js-bali-component-framework | src/collections/Queue.js | Queue | function Queue(parameters) {
parameters = parameters || new composites.Parameters(new Catalog());
if (!parameters.getParameter('$type')) parameters.setParameter('$type', '/bali/collections/Queue/v1');
abstractions.Collection.call(this, utilities.types.QUEUE, parameters);
// the capacity and array are p... | javascript | function Queue(parameters) {
parameters = parameters || new composites.Parameters(new Catalog());
if (!parameters.getParameter('$type')) parameters.setParameter('$type', '/bali/collections/Queue/v1');
abstractions.Collection.call(this, utilities.types.QUEUE, parameters);
// the capacity and array are p... | [
"function",
"Queue",
"(",
"parameters",
")",
"{",
"parameters",
"=",
"parameters",
"||",
"new",
"composites",
".",
"Parameters",
"(",
"new",
"Catalog",
"(",
")",
")",
";",
"if",
"(",
"!",
"parameters",
".",
"getParameter",
"(",
"'$type'",
")",
")",
"para... | PUBLIC CONSTRUCTORS
This constructor creates a new queue component with optional parameters that are
used to parameterize its type.
@param {Parameters} parameters Optional parameters used to parameterize this collection.
@returns {Queue} The new queue. | [
"PUBLIC",
"CONSTRUCTORS",
"This",
"constructor",
"creates",
"a",
"new",
"queue",
"component",
"with",
"optional",
"parameters",
"that",
"are",
"used",
"to",
"parameterize",
"its",
"type",
"."
] | 57279245e44d6ceef4debdb1d6132f48e464dcb8 | https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/collections/Queue.js#L40-L94 |
35,815 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function (type, code) {
$sgCodeTitles.removeClass('sg-code-title-active');
switch (type) {
case 'e':
$sgCodeTitleHtml.addClass('sg-code-title-active');
break;
case 'm':
$sgCodeTitleMustache.addClass('sg-code-title-active');
break;
}
$s... | javascript | function (type, code) {
$sgCodeTitles.removeClass('sg-code-title-active');
switch (type) {
case 'e':
$sgCodeTitleHtml.addClass('sg-code-title-active');
break;
case 'm':
$sgCodeTitleMustache.addClass('sg-code-title-active');
break;
}
$s... | [
"function",
"(",
"type",
",",
"code",
")",
"{",
"$sgCodeTitles",
".",
"removeClass",
"(",
"'sg-code-title-active'",
")",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"'e'",
":",
"$sgCodeTitleHtml",
".",
"addClass",
"(",
"'sg-code-title-active'",
")",
";",
"... | When loading the code view make sure the active tab is highlighted and filled in appropriately.
@param {string} type - Single letter that refers to classes and types.
@param {string} code - Code to appear in code view. | [
"When",
"loading",
"the",
"code",
"view",
"make",
"sure",
"the",
"active",
"tab",
"is",
"highlighted",
"and",
"filled",
"in",
"appropriately",
"."
] | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L40-L63 | |
35,816 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function () {
if (!codeViewer.codeActive) {
return;
}
if (window.getSelection().empty) {
window.getSelection().empty();
}
else if (window.getSelection().removeAllRanges) {
window.getSelection().removeAllRanges();
}
} | javascript | function () {
if (!codeViewer.codeActive) {
return;
}
if (window.getSelection().empty) {
window.getSelection().empty();
}
else if (window.getSelection().removeAllRanges) {
window.getSelection().removeAllRanges();
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"codeViewer",
".",
"codeActive",
")",
"{",
"return",
";",
"}",
"if",
"(",
"window",
".",
"getSelection",
"(",
")",
".",
"empty",
")",
"{",
"window",
".",
"getSelection",
"(",
")",
".",
"empty",
"(",
")",
... | Clear any selection of code when swapping tabs or opening a new pattern. | [
"Clear",
"any",
"selection",
"of",
"code",
"when",
"swapping",
"tabs",
"or",
"opening",
"a",
"new",
"pattern",
"."
] | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L68-L79 | |
35,817 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function () {
$sgCodeContainer // Has class sg-view-container.
.css('bottom', -$document.outerHeight())
.addClass('anim-ready');
// Make sure the close button handles the click.
$('#sg-code-close-btn').click(function (e) {
e.preventDefault();
codeViewer.closeCode();
... | javascript | function () {
$sgCodeContainer // Has class sg-view-container.
.css('bottom', -$document.outerHeight())
.addClass('anim-ready');
// Make sure the close button handles the click.
$('#sg-code-close-btn').click(function (e) {
e.preventDefault();
codeViewer.closeCode();
... | [
"function",
"(",
")",
"{",
"$sgCodeContainer",
"// Has class sg-view-container.",
".",
"css",
"(",
"'bottom'",
",",
"-",
"$document",
".",
"outerHeight",
"(",
")",
")",
".",
"addClass",
"(",
"'anim-ready'",
")",
";",
"// Make sure the close button handles the click.",... | Add the basic markup and events for the code container. | [
"Add",
"the",
"basic",
"markup",
"and",
"events",
"for",
"the",
"code",
"container",
"."
] | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L98-L120 | |
35,818 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function () {
let encoded = this.responseText;
// We sometimes want markup code to be in an HTML-like template language with tags delimited by stashes.
// In order for js-beautify to indent such code correctly, any space between control characters #, ^, and /, and
// the variable name must be r... | javascript | function () {
let encoded = this.responseText;
// We sometimes want markup code to be in an HTML-like template language with tags delimited by stashes.
// In order for js-beautify to indent such code correctly, any space between control characters #, ^, and /, and
// the variable name must be r... | [
"function",
"(",
")",
"{",
"let",
"encoded",
"=",
"this",
".",
"responseText",
";",
"// We sometimes want markup code to be in an HTML-like template language with tags delimited by stashes.",
"// In order for js-beautify to indent such code correctly, any space between control characters #, ... | This runs once the AJAX request for the encoded markup is finished.
If the encoded tab is the current active tab, it adds the content to the default code container | [
"This",
"runs",
"once",
"the",
"AJAX",
"request",
"for",
"the",
"encoded",
"markup",
"is",
"finished",
".",
"If",
"the",
"encoded",
"tab",
"is",
"the",
"current",
"active",
"tab",
"it",
"adds",
"the",
"content",
"to",
"the",
"default",
"code",
"container"
... | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L171-L204 | |
35,819 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function () {
let encoded = this.responseText;
encoded = window.he.encode(encoded);
codeViewer.mustache = encoded;
if (codeViewer.tabActive === 'm') {
codeViewer.activateDefaultTab('m', encoded);
}
} | javascript | function () {
let encoded = this.responseText;
encoded = window.he.encode(encoded);
codeViewer.mustache = encoded;
if (codeViewer.tabActive === 'm') {
codeViewer.activateDefaultTab('m', encoded);
}
} | [
"function",
"(",
")",
"{",
"let",
"encoded",
"=",
"this",
".",
"responseText",
";",
"encoded",
"=",
"window",
".",
"he",
".",
"encode",
"(",
"encoded",
")",
";",
"codeViewer",
".",
"mustache",
"=",
"encoded",
";",
"if",
"(",
"codeViewer",
".",
"tabActi... | This runs once the AJAX request for the mustache markup is finished.
If the mustache tab is the current active tab, it adds the content to the default code container. | [
"This",
"runs",
"once",
"the",
"AJAX",
"request",
"for",
"the",
"mustache",
"markup",
"is",
"finished",
".",
"If",
"the",
"mustache",
"tab",
"is",
"the",
"current",
"active",
"tab",
"it",
"adds",
"the",
"content",
"to",
"the",
"default",
"code",
"container... | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L210-L218 | |
35,820 | electric-eloquence/fepper-ui | scripts/code-viewer.js | function (type) {
if (!codeViewer.codeActive) {
return;
}
let fill = '';
codeViewer.tabActive = type;
$sgCodeTitles.removeClass('sg-code-title-active');
switch (type) {
case 'e':
fill = codeViewer.encoded;
$sgCodeTitleHtml.addClass('sg-code-tit... | javascript | function (type) {
if (!codeViewer.codeActive) {
return;
}
let fill = '';
codeViewer.tabActive = type;
$sgCodeTitles.removeClass('sg-code-title-active');
switch (type) {
case 'e':
fill = codeViewer.encoded;
$sgCodeTitleHtml.addClass('sg-code-tit... | [
"function",
"(",
"type",
")",
"{",
"if",
"(",
"!",
"codeViewer",
".",
"codeActive",
")",
"{",
"return",
";",
"}",
"let",
"fill",
"=",
"''",
";",
"codeViewer",
".",
"tabActive",
"=",
"type",
";",
"$sgCodeTitles",
".",
"removeClass",
"(",
"'sg-code-title-a... | Depending on what tab is clicked this swaps out the code container. Makes sure prism highlight is added.
@param {string} type - Single letter abbreviation of type. | [
"Depending",
"on",
"what",
"tab",
"is",
"clicked",
"this",
"swaps",
"out",
"the",
"code",
"container",
".",
"Makes",
"sure",
"prism",
"highlight",
"is",
"added",
"."
] | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L250-L280 | |
35,821 | Runnable/hermes | lib/event-jobs.js | EventJobs | function EventJobs (opts) {
debug('EventJobs constructor');
this._publishedEvents = opts.publishedEvents || [];
this._subscribedEvents = opts.subscribedEvents || [];
this._name = opts.name;
if (!this._name) {
debug('error: name required for EventJobs');
throw new Error('name required for EventJobs');... | javascript | function EventJobs (opts) {
debug('EventJobs constructor');
this._publishedEvents = opts.publishedEvents || [];
this._subscribedEvents = opts.subscribedEvents || [];
this._name = opts.name;
if (!this._name) {
debug('error: name required for EventJobs');
throw new Error('name required for EventJobs');... | [
"function",
"EventJobs",
"(",
"opts",
")",
"{",
"debug",
"(",
"'EventJobs constructor'",
")",
";",
"this",
".",
"_publishedEvents",
"=",
"opts",
".",
"publishedEvents",
"||",
"[",
"]",
";",
"this",
".",
"_subscribedEvents",
"=",
"opts",
".",
"subscribedEvents"... | Used to handle all event operations
@param {Object} opts options
@param opts.publishedEvents array of strings of events
which are going to be published to
@param opts.subscribedEvents array of strings of events
which are going to be subscribed to
@param opts.name name of service | [
"Used",
"to",
"handle",
"all",
"event",
"operations"
] | af660962b3bc67ed39811e17a4362a725442ff81 | https://github.com/Runnable/hermes/blob/af660962b3bc67ed39811e17a4362a725442ff81/lib/event-jobs.js#L20-L30 |
35,822 | kalamuna/metalsmith-metadata-convention | index.js | processFile | function processFile(file, filename, callback) {
// Check if it matches the convention.
if (path.extname(filename) === '.metadata') {
// Find the name of the metadata.
const name = path.basename(filename, '.metadata')
// Recursively merge the meta data.
const newMetadata = {... | javascript | function processFile(file, filename, callback) {
// Check if it matches the convention.
if (path.extname(filename) === '.metadata') {
// Find the name of the metadata.
const name = path.basename(filename, '.metadata')
// Recursively merge the meta data.
const newMetadata = {... | [
"function",
"processFile",
"(",
"file",
",",
"filename",
",",
"callback",
")",
"{",
"// Check if it matches the convention.",
"if",
"(",
"path",
".",
"extname",
"(",
"filename",
")",
"===",
"'.metadata'",
")",
"{",
"// Find the name of the metadata.",
"const",
"name... | Process a file, saving it as metadata if needed.
@param {string} file The file of which is being processed.
@param {string} filename The name of the given file.
@param {function} callback The callback to call when the function is finished. | [
"Process",
"a",
"file",
"saving",
"it",
"as",
"metadata",
"if",
"needed",
"."
] | 9090759643305e5dec484c1688c14649111a5958 | https://github.com/kalamuna/metalsmith-metadata-convention/blob/9090759643305e5dec484c1688c14649111a5958/index.js#L18-L34 |
35,823 | unitejs/engine | assets/gulp/dist/tasks/util/json-helper.js | codify | function codify(object) {
if (object === undefined) {
return object;
} else {
let json = JSON.stringify(object, undefined, "\t");
// First substitue embedded double quotes with FFFF
json = json.replace(/\\"/g, "\uFFFF");
// Now replace all property name quotes
jso... | javascript | function codify(object) {
if (object === undefined) {
return object;
} else {
let json = JSON.stringify(object, undefined, "\t");
// First substitue embedded double quotes with FFFF
json = json.replace(/\\"/g, "\uFFFF");
// Now replace all property name quotes
jso... | [
"function",
"codify",
"(",
"object",
")",
"{",
"if",
"(",
"object",
"===",
"undefined",
")",
"{",
"return",
"object",
";",
"}",
"else",
"{",
"let",
"json",
"=",
"JSON",
".",
"stringify",
"(",
"object",
",",
"undefined",
",",
"\"\\t\"",
")",
";",
"// ... | Gulp utils for client packages. | [
"Gulp",
"utils",
"for",
"client",
"packages",
"."
] | 8127a18cedf582e8949e70dcbfbce0f39a43664c | https://github.com/unitejs/engine/blob/8127a18cedf582e8949e70dcbfbce0f39a43664c/assets/gulp/dist/tasks/util/json-helper.js#L4-L21 |
35,824 | kissyteam/kissy-xtemplate | lib/kg/kg-4.2.0/runtime/scope.js | Scope | function Scope(data, affix, parent) {
if (data !== undefined) {
this.data = data;
} else {
this.data = {};
}
if (parent) {
this.parent = parent;
this.root = parent.root;
} else {
this.parent = undefined;
this.root = this;
}
this.affix = affix || {};
this.ready = false;
} | javascript | function Scope(data, affix, parent) {
if (data !== undefined) {
this.data = data;
} else {
this.data = {};
}
if (parent) {
this.parent = parent;
this.root = parent.root;
} else {
this.parent = undefined;
this.root = this;
}
this.affix = affix || {};
this.ready = false;
} | [
"function",
"Scope",
"(",
"data",
",",
"affix",
",",
"parent",
")",
"{",
"if",
"(",
"data",
"!==",
"undefined",
")",
"{",
"this",
".",
"data",
"=",
"data",
";",
"}",
"else",
"{",
"this",
".",
"data",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"parent"... | scope resolution for xtemplate like function in javascript but keep original data unmodified
@author yiminghe@gmail.com | [
"scope",
"resolution",
"for",
"xtemplate",
"like",
"function",
"in",
"javascript",
"but",
"keep",
"original",
"data",
"unmodified"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kg/kg-4.2.0/runtime/scope.js#L5-L20 |
35,825 | electric-eloquence/fepper-ui | scripts/html-scraper-ajax.js | selectorValidateAndParse | function selectorValidateAndParse(selectorRaw_) {
const selectorRaw = selectorRaw_.trim();
const bracketOpenPos = selectorRaw.indexOf('[');
const bracketClosePos = selectorRaw.indexOf(']');
let indexStr;
let name = selectorRaw;
// Slice selectorRaw to extract name and indexStr if submitted.
... | javascript | function selectorValidateAndParse(selectorRaw_) {
const selectorRaw = selectorRaw_.trim();
const bracketOpenPos = selectorRaw.indexOf('[');
const bracketClosePos = selectorRaw.indexOf(']');
let indexStr;
let name = selectorRaw;
// Slice selectorRaw to extract name and indexStr if submitted.
... | [
"function",
"selectorValidateAndParse",
"(",
"selectorRaw_",
")",
"{",
"const",
"selectorRaw",
"=",
"selectorRaw_",
".",
"trim",
"(",
")",
";",
"const",
"bracketOpenPos",
"=",
"selectorRaw",
".",
"indexOf",
"(",
"'['",
")",
";",
"const",
"bracketClosePos",
"=",
... | Validate syntax of Target Selector input.
@param {string} selectorRaw_ - CSS selector plus optional array index.
@returns {string|null} The selector name or null if invalid. | [
"Validate",
"syntax",
"of",
"Target",
"Selector",
"input",
"."
] | 58281efcb426c137881937956c7383cd4a30c878 | https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/html-scraper-ajax.js#L56-L89 |
35,826 | Creuna-Oslo/react-scripts | source/transforms/babel-utils.js | addThisDotProps | function addThisDotProps(path) {
path.replaceWith(
t.memberExpression(
t.memberExpression(t.thisExpression(), t.identifier('props')),
path.node
)
);
} | javascript | function addThisDotProps(path) {
path.replaceWith(
t.memberExpression(
t.memberExpression(t.thisExpression(), t.identifier('props')),
path.node
)
);
} | [
"function",
"addThisDotProps",
"(",
"path",
")",
"{",
"path",
".",
"replaceWith",
"(",
"t",
".",
"memberExpression",
"(",
"t",
".",
"memberExpression",
"(",
"t",
".",
"thisExpression",
"(",
")",
",",
"t",
".",
"identifier",
"(",
"'props'",
")",
")",
",",... | Replaces 'x' with 'this.props.x' | [
"Replaces",
"x",
"with",
"this",
".",
"props",
".",
"x"
] | 8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64 | https://github.com/Creuna-Oslo/react-scripts/blob/8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64/source/transforms/babel-utils.js#L4-L11 |
35,827 | Creuna-Oslo/react-scripts | source/transforms/babel-utils.js | isDestructuredPropsReference | function isDestructuredPropsReference(path) {
const object = path.get('object');
if (!path.scope.hasOwnBinding(object.node.name)) {
return;
}
const bindingValue = path.scope.bindings[object.node.name].path.get('init');
return (
(bindingValue.isMemberExpression() &&
bindingValue.get('object').i... | javascript | function isDestructuredPropsReference(path) {
const object = path.get('object');
if (!path.scope.hasOwnBinding(object.node.name)) {
return;
}
const bindingValue = path.scope.bindings[object.node.name].path.get('init');
return (
(bindingValue.isMemberExpression() &&
bindingValue.get('object').i... | [
"function",
"isDestructuredPropsReference",
"(",
"path",
")",
"{",
"const",
"object",
"=",
"path",
".",
"get",
"(",
"'object'",
")",
";",
"if",
"(",
"!",
"path",
".",
"scope",
".",
"hasOwnBinding",
"(",
"object",
".",
"node",
".",
"name",
")",
")",
"{"... | Checks whether a binding exists for an 'object' property of a MemberExpression, and if that binding is a reference to 'this.props' or 'this'. 'path' must be a MemberExpression NodePath. | [
"Checks",
"whether",
"a",
"binding",
"exists",
"for",
"an",
"object",
"property",
"of",
"a",
"MemberExpression",
"and",
"if",
"that",
"binding",
"is",
"a",
"reference",
"to",
"this",
".",
"props",
"or",
"this",
".",
"path",
"must",
"be",
"a",
"MemberExpres... | 8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64 | https://github.com/Creuna-Oslo/react-scripts/blob/8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64/source/transforms/babel-utils.js#L26-L40 |
35,828 | Creuna-Oslo/react-scripts | source/transforms/babel-utils.js | isObjectMemberProperty | function isObjectMemberProperty(path) {
return (
t.isMemberExpression(path.parent) &&
path.parentPath.get('property') === path
);
} | javascript | function isObjectMemberProperty(path) {
return (
t.isMemberExpression(path.parent) &&
path.parentPath.get('property') === path
);
} | [
"function",
"isObjectMemberProperty",
"(",
"path",
")",
"{",
"return",
"(",
"t",
".",
"isMemberExpression",
"(",
"path",
".",
"parent",
")",
"&&",
"path",
".",
"parentPath",
".",
"get",
"(",
"'property'",
")",
"===",
"path",
")",
";",
"}"
] | Checks whether the path is the 'property' of a MemberExpression | [
"Checks",
"whether",
"the",
"path",
"is",
"the",
"property",
"of",
"a",
"MemberExpression"
] | 8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64 | https://github.com/Creuna-Oslo/react-scripts/blob/8a46924c85dab53e1e48d6397ce5cf0ba3a0ca64/source/transforms/babel-utils.js#L43-L48 |
35,829 | virtualcodewarrior/webComponentBaseClass | src/webComponentBaseClass.js | createShadowDOM | function createShadowDOM(p_ComponentInstance, p_ComponentTemplate) {
// retrieve the correct template from our map of previously stored templates
const templateInstance = window.webComponentTemplates.get(p_ComponentTemplate);
// if we are using the shadyCSS polyfill, we must initialize that now
if (window.ShadyCSS)... | javascript | function createShadowDOM(p_ComponentInstance, p_ComponentTemplate) {
// retrieve the correct template from our map of previously stored templates
const templateInstance = window.webComponentTemplates.get(p_ComponentTemplate);
// if we are using the shadyCSS polyfill, we must initialize that now
if (window.ShadyCSS)... | [
"function",
"createShadowDOM",
"(",
"p_ComponentInstance",
",",
"p_ComponentTemplate",
")",
"{",
"// retrieve the correct template from our map of previously stored templates",
"const",
"templateInstance",
"=",
"window",
".",
"webComponentTemplates",
".",
"get",
"(",
"p_Component... | Create the shadow DOM and attach it to the given web component instance
@param {HTMLElement} p_ComponentInstance The web component instance to which we are attaching the shadow DOM
@param {string} p_ComponentTemplate The id of the web component template | [
"Create",
"the",
"shadow",
"DOM",
"and",
"attach",
"it",
"to",
"the",
"given",
"web",
"component",
"instance"
] | 78bb9b352fd5cd6bdb287d01066bff1bd6cc07cb | https://github.com/virtualcodewarrior/webComponentBaseClass/blob/78bb9b352fd5cd6bdb287d01066bff1bd6cc07cb/src/webComponentBaseClass.js#L8-L20 |
35,830 | KleeGroup/focus-notifications | src/reducers/visibility-filter.js | visibilityFilter | function visibilityFilter(state = SHOW_ALL, action = {}) {
const {type, filter} = action;
switch (type) {
case SET_VISIBILITY_FILTER:
return filter;
default:
return state;
}
} | javascript | function visibilityFilter(state = SHOW_ALL, action = {}) {
const {type, filter} = action;
switch (type) {
case SET_VISIBILITY_FILTER:
return filter;
default:
return state;
}
} | [
"function",
"visibilityFilter",
"(",
"state",
"=",
"SHOW_ALL",
",",
"action",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"type",
",",
"filter",
"}",
"=",
"action",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"SET_VISIBILITY_FILTER",
":",
"return",
"filter"... | reducer in charge of dealing with the visibility filter. | [
"reducer",
"in",
"charge",
"of",
"dealing",
"with",
"the",
"visibility",
"filter",
"."
] | b9a529264b625a12c3d8d479f839f36f77b674f6 | https://github.com/KleeGroup/focus-notifications/blob/b9a529264b625a12c3d8d479f839f36f77b674f6/src/reducers/visibility-filter.js#L5-L13 |
35,831 | craterdog-bali/js-bali-component-framework | src/utilities/Iterator.js | Iterator | function Iterator(array) {
// the array and current slot index are private attributes so methods that use them
// are defined in the constructor
var currentSlot = 0; // the slot before the first item
this.toStart = function() {
currentSlot = 0; // the slot before the first item
};
t... | javascript | function Iterator(array) {
// the array and current slot index are private attributes so methods that use them
// are defined in the constructor
var currentSlot = 0; // the slot before the first item
this.toStart = function() {
currentSlot = 0; // the slot before the first item
};
t... | [
"function",
"Iterator",
"(",
"array",
")",
"{",
"// the array and current slot index are private attributes so methods that use them",
"// are defined in the constructor",
"var",
"currentSlot",
"=",
"0",
";",
"// the slot before the first item",
"this",
".",
"toStart",
"=",
"func... | PUBLIC CONSTRUCTORS
This constructor creates a new array iterator that allows the items in the array
to be iterated over in either direction.
@constructor
@param {Array} array The array to be iterated over.
@returns {Iterator} The new array iterator. | [
"PUBLIC",
"CONSTRUCTORS",
"This",
"constructor",
"creates",
"a",
"new",
"array",
"iterator",
"that",
"allows",
"the",
"items",
"in",
"the",
"array",
"to",
"be",
"iterated",
"over",
"in",
"either",
"direction",
"."
] | 57279245e44d6ceef4debdb1d6132f48e464dcb8 | https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/utilities/Iterator.js#L42-L83 |
35,832 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/stylesheet-debug.js | StyleSheet | function StyleSheet(el) {
/**
* style/link element or selector
* @cfg {HTMLElement|String} el
*/
/**
* style/link element
* @type {HTMLElement}
* @property el
*/
if (el.el) {
el = el.el;
}
el = this.el = Dom.get(el); // http://msd... | javascript | function StyleSheet(el) {
/**
* style/link element or selector
* @cfg {HTMLElement|String} el
*/
/**
* style/link element
* @type {HTMLElement}
* @property el
*/
if (el.el) {
el = el.el;
}
el = this.el = Dom.get(el); // http://msd... | [
"function",
"StyleSheet",
"(",
"el",
")",
"{",
"/**\n * style/link element or selector\n * @cfg {HTMLElement|String} el\n */",
"/**\n * style/link element\n * @type {HTMLElement}\n * @property el\n */",
"if",
"(",
"el",
".",
"el",
")",
"{",
"el",
"=",
"e... | Normalize operation about stylesheet
@class KISSY.StyleSheet
@param el {HTMLElement} style/link element
Normalize operation about stylesheet
@class KISSY.StyleSheet
@param el {HTMLElement} style/link element | [
"Normalize",
"operation",
"about",
"stylesheet"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/stylesheet-debug.js#L26-L62 |
35,833 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/stylesheet-debug.js | function (selectorText) {
var rule, css, selector, cssRules = this.cssRules;
if (selectorText) {
rule = cssRules[selectorText];
return rule ? rule.style.cssText : null;
} else {
css = [];
for (selector in cssRules) {
... | javascript | function (selectorText) {
var rule, css, selector, cssRules = this.cssRules;
if (selectorText) {
rule = cssRules[selectorText];
return rule ? rule.style.cssText : null;
} else {
css = [];
for (selector in cssRules) {
... | [
"function",
"(",
"selectorText",
")",
"{",
"var",
"rule",
",",
"css",
",",
"selector",
",",
"cssRules",
"=",
"this",
".",
"cssRules",
";",
"if",
"(",
"selectorText",
")",
"{",
"rule",
"=",
"cssRules",
"[",
"selectorText",
"]",
";",
"return",
"rule",
"?... | Get cssText corresponding to specified selectorText
@param {String} selectorText specified selector as string
@return {String} CssText corresponding to specified selectorText | [
"Get",
"cssText",
"corresponding",
"to",
"specified",
"selectorText"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/stylesheet-debug.js#L142-L155 | |
35,834 | craterdog-bali/js-bali-component-framework | src/elements/Probability.js | Probability | function Probability(value, parameters) {
abstractions.Element.call(this, utilities.types.PROBABILITY, parameters);
if (value === undefined) value = 0; // default value
if (!isFinite(value) || value < 0 || value > 1) {
throw new utilities.Exception({
$module: '/bali/elements/Probability... | javascript | function Probability(value, parameters) {
abstractions.Element.call(this, utilities.types.PROBABILITY, parameters);
if (value === undefined) value = 0; // default value
if (!isFinite(value) || value < 0 || value > 1) {
throw new utilities.Exception({
$module: '/bali/elements/Probability... | [
"function",
"Probability",
"(",
"value",
",",
"parameters",
")",
"{",
"abstractions",
".",
"Element",
".",
"call",
"(",
"this",
",",
"utilities",
".",
"types",
".",
"PROBABILITY",
",",
"parameters",
")",
";",
"if",
"(",
"value",
"===",
"undefined",
")",
... | PUBLIC CONSTRUCTOR
This constructor creates a new probability element using the specified value.
@param {Number} value The value of the probability.
@param {Parameters} parameters Optional parameters used to parameterize this element.
@returns {Probability} The new probability element. | [
"PUBLIC",
"CONSTRUCTOR",
"This",
"constructor",
"creates",
"a",
"new",
"probability",
"element",
"using",
"the",
"specified",
"value",
"."
] | 57279245e44d6ceef4debdb1d6132f48e464dcb8 | https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Probability.js#L29-L47 |
35,835 | rezeus/kernel | lib/index.js | boot | function boot() {
if (config === null) {
// TODO [NSTDFRZN] Be sure nested objects are frozen too
config = Object.freeze(gatherConfigFromEnv());
}
ee.emitAsync('booting_backing')
.then(() => {
ee.emit('booting');
ee.emit('booted');
})
.catch((err) => {
ee.emit('error', err);... | javascript | function boot() {
if (config === null) {
// TODO [NSTDFRZN] Be sure nested objects are frozen too
config = Object.freeze(gatherConfigFromEnv());
}
ee.emitAsync('booting_backing')
.then(() => {
ee.emit('booting');
ee.emit('booted');
})
.catch((err) => {
ee.emit('error', err);... | [
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"config",
"===",
"null",
")",
"{",
"// TODO [NSTDFRZN] Be sure nested objects are frozen too",
"config",
"=",
"Object",
".",
"freeze",
"(",
"gatherConfigFromEnv",
"(",
")",
")",
";",
"}",
"ee",
".",
"emitAsync",
"(... | Boot the kernel to start the application.
To do that emits 'boot_backing' and
'boot' events to listeners.
If the kernel wasn't configured so far
gathers configuration automatically
from environment variables. | [
"Boot",
"the",
"kernel",
"to",
"start",
"the",
"application",
".",
"To",
"do",
"that",
"emits",
"boot_backing",
"and",
"boot",
"events",
"to",
"listeners",
"."
] | 4ce1c0509973b7512a284e483f1d6da5788bf7ea | https://github.com/rezeus/kernel/blob/4ce1c0509973b7512a284e483f1d6da5788bf7ea/lib/index.js#L46-L60 |
35,836 | rjenkinsjr/lufo | lufo-cli/src/lufo.js | function (isJson, transformer) {
printHelpOnExit = false;
return function (value) {
if (isJson) {
console.log(JSON.stringify(value, null, 2));
} else if (typeof transformer === 'function') {
console.log(transformer(value));
} else {
console.log(value);
}
if (theUfo) theUfo.disc... | javascript | function (isJson, transformer) {
printHelpOnExit = false;
return function (value) {
if (isJson) {
console.log(JSON.stringify(value, null, 2));
} else if (typeof transformer === 'function') {
console.log(transformer(value));
} else {
console.log(value);
}
if (theUfo) theUfo.disc... | [
"function",
"(",
"isJson",
",",
"transformer",
")",
"{",
"printHelpOnExit",
"=",
"false",
";",
"return",
"function",
"(",
"value",
")",
"{",
"if",
"(",
"isJson",
")",
"{",
"console",
".",
"log",
"(",
"JSON",
".",
"stringify",
"(",
"value",
",",
"null",... | Helper function to reduce boilerplate when running getter commands. | [
"Helper",
"function",
"to",
"reduce",
"boilerplate",
"when",
"running",
"getter",
"commands",
"."
] | bd2465eaf81cac2212735bd2f33d62355c72ab93 | https://github.com/rjenkinsjr/lufo/blob/bd2465eaf81cac2212735bd2f33d62355c72ab93/lufo-cli/src/lufo.js#L14-L26 | |
35,837 | rjenkinsjr/lufo | lufo-cli/src/lufo.js | function (obj) {
printHelpOnExit = false;
if (_.isError(obj)) {
console.error(obj);
} else {
console.error(`ERROR: ${obj.toString()}`);
}
if (theUfo) theUfo.disconnect();
process.exitCode = 1;
} | javascript | function (obj) {
printHelpOnExit = false;
if (_.isError(obj)) {
console.error(obj);
} else {
console.error(`ERROR: ${obj.toString()}`);
}
if (theUfo) theUfo.disconnect();
process.exitCode = 1;
} | [
"function",
"(",
"obj",
")",
"{",
"printHelpOnExit",
"=",
"false",
";",
"if",
"(",
"_",
".",
"isError",
"(",
"obj",
")",
")",
"{",
"console",
".",
"error",
"(",
"obj",
")",
";",
"}",
"else",
"{",
"console",
".",
"error",
"(",
"`",
"${",
"obj",
... | Helper function for printing errors and setting the exit code. | [
"Helper",
"function",
"for",
"printing",
"errors",
"and",
"setting",
"the",
"exit",
"code",
"."
] | bd2465eaf81cac2212735bd2f33d62355c72ab93 | https://github.com/rjenkinsjr/lufo/blob/bd2465eaf81cac2212735bd2f33d62355c72ab93/lufo-cli/src/lufo.js#L28-L37 | |
35,838 | rjenkinsjr/lufo | lufo-cli/src/lufo.js | function (...args) {
let value = false;
args.forEach((arg) => {
if (value === false) {
if (arg === true || (typeof arg === 'string' && arg.toLowerCase() === 'true') || arg === 1) {
value = true;
}
}
});
return value;
} | javascript | function (...args) {
let value = false;
args.forEach((arg) => {
if (value === false) {
if (arg === true || (typeof arg === 'string' && arg.toLowerCase() === 'true') || arg === 1) {
value = true;
}
}
});
return value;
} | [
"function",
"(",
"...",
"args",
")",
"{",
"let",
"value",
"=",
"false",
";",
"args",
".",
"forEach",
"(",
"(",
"arg",
")",
"=>",
"{",
"if",
"(",
"value",
"===",
"false",
")",
"{",
"if",
"(",
"arg",
"===",
"true",
"||",
"(",
"typeof",
"arg",
"==... | Helper function for parsing boolean CLI arguments. | [
"Helper",
"function",
"for",
"parsing",
"boolean",
"CLI",
"arguments",
"."
] | bd2465eaf81cac2212735bd2f33d62355c72ab93 | https://github.com/rjenkinsjr/lufo/blob/bd2465eaf81cac2212735bd2f33d62355c72ab93/lufo-cli/src/lufo.js#L39-L49 | |
35,839 | rjenkinsjr/lufo | lufo-cli/src/lufo.js | function () {
const options = {};
options.host = cli.ufo || process.env.LUFO_ADDRESS || '';
options.password = cli.password || process.env.LUFO_PASSWORD || undefined;
options.localHost = cli.localHost || process.env.LUFO_LOCALHOST || undefined;
options.localUdpPort = parseInt(cli.localUdpPort || process.env.L... | javascript | function () {
const options = {};
options.host = cli.ufo || process.env.LUFO_ADDRESS || '';
options.password = cli.password || process.env.LUFO_PASSWORD || undefined;
options.localHost = cli.localHost || process.env.LUFO_LOCALHOST || undefined;
options.localUdpPort = parseInt(cli.localUdpPort || process.env.L... | [
"function",
"(",
")",
"{",
"const",
"options",
"=",
"{",
"}",
";",
"options",
".",
"host",
"=",
"cli",
".",
"ufo",
"||",
"process",
".",
"env",
".",
"LUFO_ADDRESS",
"||",
"''",
";",
"options",
".",
"password",
"=",
"cli",
".",
"password",
"||",
"pr... | Helper function to construct a UfoOptions object. | [
"Helper",
"function",
"to",
"construct",
"a",
"UfoOptions",
"object",
"."
] | bd2465eaf81cac2212735bd2f33d62355c72ab93 | https://github.com/rjenkinsjr/lufo/blob/bd2465eaf81cac2212735bd2f33d62355c72ab93/lufo-cli/src/lufo.js#L51-L62 | |
35,840 | rjenkinsjr/lufo | lufo-cli/src/lufo.js | function (action) {
printHelpOnExit = false;
const cliOptions = getOptions();
if (cliOptions.host) {
if (net.isIPv4(cliOptions.host)) {
theUfo = new Ufo(cliOptions);
theUfo.connect()
.then(action.bind(theUfo))
.catch(quitError);
} else {
quitError(`Invalid UFO IP address ... | javascript | function (action) {
printHelpOnExit = false;
const cliOptions = getOptions();
if (cliOptions.host) {
if (net.isIPv4(cliOptions.host)) {
theUfo = new Ufo(cliOptions);
theUfo.connect()
.then(action.bind(theUfo))
.catch(quitError);
} else {
quitError(`Invalid UFO IP address ... | [
"function",
"(",
"action",
")",
"{",
"printHelpOnExit",
"=",
"false",
";",
"const",
"cliOptions",
"=",
"getOptions",
"(",
")",
";",
"if",
"(",
"cliOptions",
".",
"host",
")",
"{",
"if",
"(",
"net",
".",
"isIPv4",
"(",
"cliOptions",
".",
"host",
")",
... | Helper function for assembling the UFO object based on the given args. The UFO object created by this method is bound to "this" in the action callback. | [
"Helper",
"function",
"for",
"assembling",
"the",
"UFO",
"object",
"based",
"on",
"the",
"given",
"args",
".",
"The",
"UFO",
"object",
"created",
"by",
"this",
"method",
"is",
"bound",
"to",
"this",
"in",
"the",
"action",
"callback",
"."
] | bd2465eaf81cac2212735bd2f33d62355c72ab93 | https://github.com/rjenkinsjr/lufo/blob/bd2465eaf81cac2212735bd2f33d62355c72ab93/lufo-cli/src/lufo.js#L65-L80 | |
35,841 | fisker/cssgrace-lite | lib/index.js | ieInlineBlockHack | function ieInlineBlockHack(decl, i) {
if (decl.prop == 'display' && decl.value == 'inline-block') {
var reBefore = decl.raws.before.replace(reBLANK_LINE, '$1')
insertDecl(decl, i, {
raws: {
before: reBefore
},
prop: '*zoom',
value: 1
})
insertDecl(decl, i, {
raws... | javascript | function ieInlineBlockHack(decl, i) {
if (decl.prop == 'display' && decl.value == 'inline-block') {
var reBefore = decl.raws.before.replace(reBLANK_LINE, '$1')
insertDecl(decl, i, {
raws: {
before: reBefore
},
prop: '*zoom',
value: 1
})
insertDecl(decl, i, {
raws... | [
"function",
"ieInlineBlockHack",
"(",
"decl",
",",
"i",
")",
"{",
"if",
"(",
"decl",
".",
"prop",
"==",
"'display'",
"&&",
"decl",
".",
"value",
"==",
"'inline-block'",
")",
"{",
"var",
"reBefore",
"=",
"decl",
".",
"raws",
".",
"before",
".",
"replace... | IE inline-block hack | [
"IE",
"inline",
"-",
"block",
"hack"
] | e8d15ec56a2dcf5cc01fcbcabe14362bc22d7f3d | https://github.com/fisker/cssgrace-lite/blob/e8d15ec56a2dcf5cc01fcbcabe14362bc22d7f3d/lib/index.js#L148-L167 |
35,842 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (s2) {
var self = this;
return !!util.reduce(self.keys, function (v, k) {
return v && self[k] === s2[k];
}, 1);
} | javascript | function (s2) {
var self = this;
return !!util.reduce(self.keys, function (v, k) {
return v && self[k] === s2[k];
}, 1);
} | [
"function",
"(",
"s2",
")",
"{",
"var",
"self",
"=",
"this",
";",
"return",
"!",
"!",
"util",
".",
"reduce",
"(",
"self",
".",
"keys",
",",
"function",
"(",
"v",
",",
"k",
")",
"{",
"return",
"v",
"&&",
"self",
"[",
"k",
"]",
"===",
"s2",
"["... | whether current observer equals s2
@param {KISSY.Event.Observer} s2 another observer
@return {Boolean} | [
"whether",
"current",
"observer",
"equals",
"s2"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L211-L216 | |
35,843 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (event, ce) {
var ret, self = this;
ret = self.fn.call(self.context || ce.currentTarget, event, self.data);
if (self.once) {
//noinspection JSUnresolvedFunction
ce.removeObserver(self);
}
return ret;
} | javascript | function (event, ce) {
var ret, self = this;
ret = self.fn.call(self.context || ce.currentTarget, event, self.data);
if (self.once) {
//noinspection JSUnresolvedFunction
ce.removeObserver(self);
}
return ret;
} | [
"function",
"(",
"event",
",",
"ce",
")",
"{",
"var",
"ret",
",",
"self",
"=",
"this",
";",
"ret",
"=",
"self",
".",
"fn",
".",
"call",
"(",
"self",
".",
"context",
"||",
"ce",
".",
"currentTarget",
",",
"event",
",",
"self",
".",
"data",
")",
... | simple run current observer's user-defined function
@param {KISSY.Event.Object} event
@param {KISSY.Event.Observable} ce
@return {*} return value of current observer's user-defined function | [
"simple",
"run",
"current",
"observer",
"s",
"user",
"-",
"defined",
"function"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L223-L231 | |
35,844 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (event, ce) {
var ret = this.simpleNotify(event, ce); // return false 等价 preventDefault + stopPropagation
// return false 等价 preventDefault + stopPropagation
if (ret === false) {
event.halt();
}
return ret;
} | javascript | function (event, ce) {
var ret = this.simpleNotify(event, ce); // return false 等价 preventDefault + stopPropagation
// return false 等价 preventDefault + stopPropagation
if (ret === false) {
event.halt();
}
return ret;
} | [
"function",
"(",
"event",
",",
"ce",
")",
"{",
"var",
"ret",
"=",
"this",
".",
"simpleNotify",
"(",
"event",
",",
"ce",
")",
";",
"// return false 等价 preventDefault + stopPropagation",
"// return false 等价 preventDefault + stopPropagation",
"if",
"(",
"ret",
"===",
"... | current observer's notification.
@protected
@param {KISSY.Event.Object} event
@param {KISSY.Event.Observable} ce | [
"current",
"observer",
"s",
"notification",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L238-L245 | |
35,845 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (event, ce) {
var self = this, _ksGroups = event._ksGroups; // handler's group does not match specified groups (at fire step)
// handler's group does not match specified groups (at fire step)
if (_ksGroups && (!self.groups || !self.groups.match(_ksGroups))) {
... | javascript | function (event, ce) {
var self = this, _ksGroups = event._ksGroups; // handler's group does not match specified groups (at fire step)
// handler's group does not match specified groups (at fire step)
if (_ksGroups && (!self.groups || !self.groups.match(_ksGroups))) {
... | [
"function",
"(",
"event",
",",
"ce",
")",
"{",
"var",
"self",
"=",
"this",
",",
"_ksGroups",
"=",
"event",
".",
"_ksGroups",
";",
"// handler's group does not match specified groups (at fire step)",
"// handler's group does not match specified groups (at fire step)",
"if",
... | run current observer's user-defined function
@param event
@param ce | [
"run",
"current",
"observer",
"s",
"user",
"-",
"defined",
"function"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L251-L258 | |
35,846 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | Observable | function Observable(cfg) {
var self = this;
self.currentTarget = null;
util.mix(self, cfg);
self.reset(); /**
* current event type
* @cfg {String} type
*/
} | javascript | function Observable(cfg) {
var self = this;
self.currentTarget = null;
util.mix(self, cfg);
self.reset(); /**
* current event type
* @cfg {String} type
*/
} | [
"function",
"Observable",
"(",
"cfg",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"currentTarget",
"=",
"null",
";",
"util",
".",
"mix",
"(",
"self",
",",
"cfg",
")",
";",
"self",
".",
"reset",
"(",
")",
";",
"/**\n * current event type... | base custom event for registering and un-registering observer for specified event.
@class KISSY.Event.Observable
@private
@param {Object} cfg custom event's attribute
base custom event for registering and un-registering observer for specified event.
@class KISSY.Event.Observable
@private
@param {Object} cfg custom ev... | [
"base",
"custom",
"event",
"for",
"registering",
"and",
"un",
"-",
"registering",
"observer",
"for",
"specified",
"event",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L280-L288 |
35,847 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (observer) {
var self = this, i, observers = self.observers, len = observers.length;
for (i = 0; i < len; i++) {
if (observers[i] === observer) {
observers.splice(i, 1);
break;
}
}
self.check... | javascript | function (observer) {
var self = this, i, observers = self.observers, len = observers.length;
for (i = 0; i < len; i++) {
if (observers[i] === observer) {
observers.splice(i, 1);
break;
}
}
self.check... | [
"function",
"(",
"observer",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
",",
"observers",
"=",
"self",
".",
"observers",
",",
"len",
"=",
"observers",
".",
"length",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")"... | remove one observer from current event's observers
@param {KISSY.Event.Observer} observer | [
"remove",
"one",
"observer",
"from",
"current",
"event",
"s",
"observers"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L313-L322 | |
35,848 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/event/base.js | function (observer) {
var observers = this.observers, i;
for (i = observers.length - 1; i >= 0; --i) {
/*
If multiple identical EventListeners are registered on the same EventTarget
with the same parameters the duplicate instances are discarded.
... | javascript | function (observer) {
var observers = this.observers, i;
for (i = observers.length - 1; i >= 0; --i) {
/*
If multiple identical EventListeners are registered on the same EventTarget
with the same parameters the duplicate instances are discarded.
... | [
"function",
"(",
"observer",
")",
"{",
"var",
"observers",
"=",
"this",
".",
"observers",
",",
"i",
";",
"for",
"(",
"i",
"=",
"observers",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"/*\n If multiple identical ... | Search for a specified observer within current event's observers
@param {KISSY.Event.Observer} observer
@return {Number} observer's index in observers | [
"Search",
"for",
"a",
"specified",
"observer",
"within",
"current",
"event",
"s",
"observers"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/event/base.js#L334-L349 | |
35,849 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/url-debug.js | function (str, parseQueryString) {
var m = str.match(URI_SPLIT_REG) || [], ret = {}; // old ie 7: return "" for unmatched regexp ...
// old ie 7: return "" for unmatched regexp ...
for (var part in REG_INFO) {
ret[part] = m[REG_INFO[part]];
... | javascript | function (str, parseQueryString) {
var m = str.match(URI_SPLIT_REG) || [], ret = {}; // old ie 7: return "" for unmatched regexp ...
// old ie 7: return "" for unmatched regexp ...
for (var part in REG_INFO) {
ret[part] = m[REG_INFO[part]];
... | [
"function",
"(",
"str",
",",
"parseQueryString",
")",
"{",
"var",
"m",
"=",
"str",
".",
"match",
"(",
"URI_SPLIT_REG",
")",
"||",
"[",
"]",
",",
"ret",
"=",
"{",
"}",
";",
"// old ie 7: return \"\" for unmatched regexp ...",
"// old ie 7: return \"\" for unmatch... | parse a url to a structured object
@param {String} str url string
@param {Boolean} [parseQueryString] whether parse query string to structured object
@return {Object} | [
"parse",
"a",
"url",
"to",
"a",
"structured",
"object"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/url-debug.js#L100-L147 | |
35,850 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/url-debug.js | function (url, serializeArray) {
var host = url.host;
if (host === undef && url.hostname) {
host = encodeURIComponent(url.hostname);
if (url.port) {
host += ':' + url.port;
}
}
... | javascript | function (url, serializeArray) {
var host = url.host;
if (host === undef && url.hostname) {
host = encodeURIComponent(url.hostname);
if (url.port) {
host += ':' + url.port;
}
}
... | [
"function",
"(",
"url",
",",
"serializeArray",
")",
"{",
"var",
"host",
"=",
"url",
".",
"host",
";",
"if",
"(",
"host",
"===",
"undef",
"&&",
"url",
".",
"hostname",
")",
"{",
"host",
"=",
"encodeURIComponent",
"(",
"url",
".",
"hostname",
")",
";",... | Take a parsed URL object, and return a formatted URL string.
@param {Object} url parsed from url.parse
@param {Boolean} [serializeArray=true] whether add '[]' to array key of query data | [
"Take",
"a",
"parsed",
"URL",
"object",
"and",
"return",
"a",
"formatted",
"URL",
"string",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/url-debug.js#L153-L206 | |
35,851 | jonschlinkert/list-item | index.js | character | function character(options = {}) {
let chars = options.chars || ['-', '*', '+'];
if (typeof chars === 'string') {
return fill(...chars.split('..'), options);
}
return chars;
} | javascript | function character(options = {}) {
let chars = options.chars || ['-', '*', '+'];
if (typeof chars === 'string') {
return fill(...chars.split('..'), options);
}
return chars;
} | [
"function",
"character",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"let",
"chars",
"=",
"options",
".",
"chars",
"||",
"[",
"'-'",
",",
"'*'",
",",
"'+'",
"]",
";",
"if",
"(",
"typeof",
"chars",
"===",
"'string'",
")",
"{",
"return",
"fill",
"(",
... | Create the array of characters to use as bullets.
- http://spec.commonmark.org/0.19/#list-items
- https://daringfireball.net/projects/markdown/syntax#list
- https://help.github.com/articles/markdown-basics/#lists
@param {Object} `opts` Options to pass to [fill-range][]
@return {Array} | [
"Create",
"the",
"array",
"of",
"characters",
"to",
"use",
"as",
"bullets",
"."
] | fb3827cd1a1af00ff636a41a0c6ad547ef31f3a0 | https://github.com/jonschlinkert/list-item/blob/fb3827cd1a1af00ff636a41a0c6ad547ef31f3a0/index.js#L89-L97 |
35,852 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (index) {
var self = this;
if (typeof index === 'number') {
if (index >= self.length) {
return null;
} else {
return new Node(self[index]);
}
} else {
return new Node(inde... | javascript | function (index) {
var self = this;
if (typeof index === 'number') {
if (index >= self.length) {
return null;
} else {
return new Node(self[index]);
}
} else {
return new Node(inde... | [
"function",
"(",
"index",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"typeof",
"index",
"===",
"'number'",
")",
"{",
"if",
"(",
"index",
">=",
"self",
".",
"length",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"new",
"... | Get one node at index
@param {Number} index Index position.
@return {KISSY.Node} | [
"Get",
"one",
"node",
"at",
"index"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L107-L118 | |
35,853 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (selector, context, index) {
if (typeof context === 'number') {
index = context;
context = undefined;
}
var list = Node.all(selector, context).getDOMNodes(), ret = new Node(this);
if (index === undefined) {
push.app... | javascript | function (selector, context, index) {
if (typeof context === 'number') {
index = context;
context = undefined;
}
var list = Node.all(selector, context).getDOMNodes(), ret = new Node(this);
if (index === undefined) {
push.app... | [
"function",
"(",
"selector",
",",
"context",
",",
"index",
")",
"{",
"if",
"(",
"typeof",
"context",
"===",
"'number'",
")",
"{",
"index",
"=",
"context",
";",
"context",
"=",
"undefined",
";",
"}",
"var",
"list",
"=",
"Node",
".",
"all",
"(",
"selec... | return a new Node object which consists of current node list and parameter node list.
@param {KISSY.Node} selector Selector string or html string or common dom node.
@param {KISSY.Node|Number} [context] Search context for selector
@param {Number} [index] Insert position.
@return {KISSY.Node} a new Node | [
"return",
"a",
"new",
"Node",
"object",
"which",
"consists",
"of",
"current",
"node",
"list",
"and",
"parameter",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L126-L143 | |
35,854 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (fn, context) {
var self = this;
util.each(self, function (n, i) {
n = new Node(n);
return fn.call(context || n, n, i, self);
});
return self;
} | javascript | function (fn, context) {
var self = this;
util.each(self, function (n, i) {
n = new Node(n);
return fn.call(context || n, n, i, self);
});
return self;
} | [
"function",
"(",
"fn",
",",
"context",
")",
"{",
"var",
"self",
"=",
"this",
";",
"util",
".",
"each",
"(",
"self",
",",
"function",
"(",
"n",
",",
"i",
")",
"{",
"n",
"=",
"new",
"Node",
"(",
"n",
")",
";",
"return",
"fn",
".",
"call",
"(",
... | Applies the given function to each Node in the Node.
@param {Function} fn The function to apply. It receives 3 arguments:
the current node instance, the node's index,
and the Node instance
@param [context] An optional context to
apply the function with Default context is the current Node instance
@return {KISSY.Node} | [
"Applies",
"the",
"given",
"function",
"to",
"each",
"Node",
"in",
"the",
"Node",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L170-L177 | |
35,855 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (selector) {
var ret, self = this;
if (self.length > 0) {
ret = Node.all(selector, self);
} else {
ret = new Node();
}
ret.__parent = self;
return ret;
} | javascript | function (selector) {
var ret, self = this;
if (self.length > 0) {
ret = Node.all(selector, self);
} else {
ret = new Node();
}
ret.__parent = self;
return ret;
} | [
"function",
"(",
"selector",
")",
"{",
"var",
"ret",
",",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"length",
">",
"0",
")",
"{",
"ret",
"=",
"Node",
".",
"all",
"(",
"selector",
",",
"self",
")",
";",
"}",
"else",
"{",
"ret",
"=",
"n... | Get node list which are descendants of current node list.
@param {String} selector Selector string
@return {KISSY.Node} | [
"Get",
"node",
"list",
"which",
"are",
"descendants",
"of",
"current",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L206-L215 | |
35,856 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (selector) {
var self = this, all = self.all(selector), ret = all.length ? all.slice(0, 1) : null;
if (ret) {
ret.__parent = self;
}
return ret;
} | javascript | function (selector) {
var self = this, all = self.all(selector), ret = all.length ? all.slice(0, 1) : null;
if (ret) {
ret.__parent = self;
}
return ret;
} | [
"function",
"(",
"selector",
")",
"{",
"var",
"self",
"=",
"this",
",",
"all",
"=",
"self",
".",
"all",
"(",
"selector",
")",
",",
"ret",
"=",
"all",
".",
"length",
"?",
"all",
".",
"slice",
"(",
"0",
",",
"1",
")",
":",
"null",
";",
"if",
"(... | Get node list which match selector under current node list sub tree.
@param {String} selector
@return {KISSY.Node} | [
"Get",
"node",
"list",
"which",
"match",
"selector",
"under",
"current",
"node",
"list",
"sub",
"tree",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L221-L227 | |
35,857 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (selector, context) {
// are we dealing with html string ?
// TextNode 仍需要自己 new Node
if (typeof selector === 'string' && (selector = util.trim(selector)) && selector.length >= 3 && util.startsWith(selector, '<') && util.endsWith(selector, '>')) {
var attrs;
... | javascript | function (selector, context) {
// are we dealing with html string ?
// TextNode 仍需要自己 new Node
if (typeof selector === 'string' && (selector = util.trim(selector)) && selector.length >= 3 && util.startsWith(selector, '<') && util.endsWith(selector, '>')) {
var attrs;
... | [
"function",
"(",
"selector",
",",
"context",
")",
"{",
"// are we dealing with html string ?",
"// TextNode 仍需要自己 new Node",
"if",
"(",
"typeof",
"selector",
"===",
"'string'",
"&&",
"(",
"selector",
"=",
"util",
".",
"trim",
"(",
"selector",
")",
")",
"&&",
"se... | Get node list from selector or construct new node list from html string.
Can also called from KISSY.all
@param {String|KISSY.Node} selector Selector string or html string or common dom node.
@param {String|KISSY.Node} [context] Search context for selector
@return {KISSY.Node}
@member KISSY.Node
@static | [
"Get",
"node",
"list",
"from",
"selector",
"or",
"construct",
"new",
"node",
"list",
"from",
"html",
"string",
".",
"Can",
"also",
"called",
"from",
"KISSY",
".",
"all"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L239-L256 | |
35,858 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (selector, context) {
var all = Node.all(selector, context);
return all.length ? all.slice(0, 1) : null;
} | javascript | function (selector, context) {
var all = Node.all(selector, context);
return all.length ? all.slice(0, 1) : null;
} | [
"function",
"(",
"selector",
",",
"context",
")",
"{",
"var",
"all",
"=",
"Node",
".",
"all",
"(",
"selector",
",",
"context",
")",
";",
"return",
"all",
".",
"length",
"?",
"all",
".",
"slice",
"(",
"0",
",",
"1",
")",
":",
"null",
";",
"}"
] | Get node list with length of one
from selector or construct new node list from html string.
@param {String|KISSY.Node} selector Selector string or html string or common dom node.
@param {String|KISSY.Node} [context] Search context for selector
@return {KISSY.Node}
@member KISSY.Node
@static | [
"Get",
"node",
"list",
"with",
"length",
"of",
"one",
"from",
"selector",
"or",
"construct",
"new",
"node",
"list",
"from",
"html",
"string",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L266-L269 | |
35,859 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function () {
var self = this, l = self.length, needClone = self.length > 1, originArgs = util.makeArray(arguments);
var cfg = originArgs[0];
var AnimConstructor = Anim;
if (cfg.to) {
AnimConstructor = cfg.Anim || Anim;
} else {
... | javascript | function () {
var self = this, l = self.length, needClone = self.length > 1, originArgs = util.makeArray(arguments);
var cfg = originArgs[0];
var AnimConstructor = Anim;
if (cfg.to) {
AnimConstructor = cfg.Anim || Anim;
} else {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"l",
"=",
"self",
".",
"length",
",",
"needClone",
"=",
"self",
".",
"length",
">",
"1",
",",
"originArgs",
"=",
"util",
".",
"makeArray",
"(",
"arguments",
")",
";",
"var",
"cfg",
"=",
... | animate for current node list.
@chainable
@member KISSY.Node | [
"animate",
"for",
"current",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L616-L639 | |
35,860 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (end, clearQueue, queue) {
var self = this;
util.each(self, function (elem) {
Anim.stop(elem, end, clearQueue, queue);
});
return self;
} | javascript | function (end, clearQueue, queue) {
var self = this;
util.each(self, function (elem) {
Anim.stop(elem, end, clearQueue, queue);
});
return self;
} | [
"function",
"(",
"end",
",",
"clearQueue",
",",
"queue",
")",
"{",
"var",
"self",
"=",
"this",
";",
"util",
".",
"each",
"(",
"self",
",",
"function",
"(",
"elem",
")",
"{",
"Anim",
".",
"stop",
"(",
"elem",
",",
"end",
",",
"clearQueue",
",",
"q... | stop anim of current node list.
@param {Boolean} [end] see {@link KISSY.Anim#static-method-stop}
@param [clearQueue]
@param [queue]
@chainable
@member KISSY.Node | [
"stop",
"anim",
"of",
"current",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L648-L654 | |
35,861 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (end, queue) {
var self = this;
util.each(self, function (elem) {
Anim.pause(elem, queue);
});
return self;
} | javascript | function (end, queue) {
var self = this;
util.each(self, function (elem) {
Anim.pause(elem, queue);
});
return self;
} | [
"function",
"(",
"end",
",",
"queue",
")",
"{",
"var",
"self",
"=",
"this",
";",
"util",
".",
"each",
"(",
"self",
",",
"function",
"(",
"elem",
")",
"{",
"Anim",
".",
"pause",
"(",
"elem",
",",
"queue",
")",
";",
"}",
")",
";",
"return",
"self... | pause anim of current node list.
@param {Boolean} end see {@link KISSY.Anim#static-method-pause}
@param queue
@chainable
@member KISSY.Node | [
"pause",
"anim",
"of",
"current",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L662-L668 | |
35,862 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function (end, queue) {
var self = this;
util.each(self, function (elem) {
Anim.resume(elem, queue);
});
return self;
} | javascript | function (end, queue) {
var self = this;
util.each(self, function (elem) {
Anim.resume(elem, queue);
});
return self;
} | [
"function",
"(",
"end",
",",
"queue",
")",
"{",
"var",
"self",
"=",
"this",
";",
"util",
".",
"each",
"(",
"self",
",",
"function",
"(",
"elem",
")",
"{",
"Anim",
".",
"resume",
"(",
"elem",
",",
"queue",
")",
";",
"}",
")",
";",
"return",
"sel... | resume anim of current node list.
@param {Boolean} end see {@link KISSY.Anim#static-method-resume}
@param queue
@chainable
@member KISSY.Node | [
"resume",
"anim",
"of",
"current",
"node",
"list",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L676-L682 | |
35,863 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function () {
var self = this;
for (var i = 0; i < self.length; i++) {
if (Anim.isRunning(self[i])) {
return true;
}
}
return false;
} | javascript | function () {
var self = this;
for (var i = 0; i < self.length; i++) {
if (Anim.isRunning(self[i])) {
return true;
}
}
return false;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Anim",
".",
"isRunning",
"(",
"self",
"[",
"i",
"]",
")",
")",
"{",
... | whether one of current node list is animating.
@return {Boolean}
@member KISSY.Node | [
"whether",
"one",
"of",
"current",
"node",
"list",
"is",
"animating",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L688-L696 | |
35,864 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/node-debug.js | function () {
var self = this;
for (var i = 0; i < self.length; i++) {
if (Anim.isPaused(self[i])) {
return true;
}
}
return false;
} | javascript | function () {
var self = this;
for (var i = 0; i < self.length; i++) {
if (Anim.isPaused(self[i])) {
return true;
}
}
return false;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Anim",
".",
"isPaused",
"(",
"self",
"[",
"i",
"]",
")",
")",
"{",
"... | whether one of current node list 's animation is paused.
@return {Boolean}
@member KISSY.Node | [
"whether",
"one",
"of",
"current",
"node",
"list",
"s",
"animation",
"is",
"paused",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/node-debug.js#L702-L710 | |
35,865 | craterdog-bali/js-bali-component-framework | src/utilities/Exception.js | Exception | function Exception(attributes, cause) {
this.stack = Error().stack;
if (this.stack) this.stack = 'Exception' + this.stack.slice(5); // replace 'Error' with 'Exception'
this.attributes = this.convert(attributes);
this.message = this.attributes.getValue('$text').getValue();
this.cause = cause;
re... | javascript | function Exception(attributes, cause) {
this.stack = Error().stack;
if (this.stack) this.stack = 'Exception' + this.stack.slice(5); // replace 'Error' with 'Exception'
this.attributes = this.convert(attributes);
this.message = this.attributes.getValue('$text').getValue();
this.cause = cause;
re... | [
"function",
"Exception",
"(",
"attributes",
",",
"cause",
")",
"{",
"this",
".",
"stack",
"=",
"Error",
"(",
")",
".",
"stack",
";",
"if",
"(",
"this",
".",
"stack",
")",
"this",
".",
"stack",
"=",
"'Exception'",
"+",
"this",
".",
"stack",
".",
"sl... | PUBLIC CONSTRUCTORS
This constructor creates a new Bali exception with the specified attributes.
@constructor
@param {Object} attributes An object containing the exception attributes.
@param {Object} cause An optional exception that caused this one.
@returns {Exception} The new exception. | [
"PUBLIC",
"CONSTRUCTORS",
"This",
"constructor",
"creates",
"a",
"new",
"Bali",
"exception",
"with",
"the",
"specified",
"attributes",
"."
] | 57279245e44d6ceef4debdb1d6132f48e464dcb8 | https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/utilities/Exception.js#L23-L30 |
35,866 | UnsignedInt8/LINQ | linq.js | aggregate | function aggregate(transform) {
switch (arguments.length) {
case 1:
return aggregate_seed_transform_selector.apply(this, [undefined, arguments[0]]);
default:
return aggregate_seed_transform_selector.apply(this, arguments);
}
} | javascript | function aggregate(transform) {
switch (arguments.length) {
case 1:
return aggregate_seed_transform_selector.apply(this, [undefined, arguments[0]]);
default:
return aggregate_seed_transform_selector.apply(this, arguments);
}
} | [
"function",
"aggregate",
"(",
"transform",
")",
"{",
"switch",
"(",
"arguments",
".",
"length",
")",
"{",
"case",
"1",
":",
"return",
"aggregate_seed_transform_selector",
".",
"apply",
"(",
"this",
",",
"[",
"undefined",
",",
"arguments",
"[",
"0",
"]",
"]... | Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
@param seed The initial accumulator value.
@param transform An accumulator function to be invoked on each element.
@param resultTransform A ... | [
"Applies",
"an",
"accumulator",
"function",
"over",
"a",
"sequence",
".",
"The",
"specified",
"seed",
"value",
"is",
"used",
"as",
"the",
"initial",
"accumulator",
"value",
"and",
"the",
"specified",
"function",
"is",
"used",
"to",
"select",
"the",
"result",
... | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L26-L33 |
35,867 | UnsignedInt8/LINQ | linq.js | any | function any(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
for (let item of this) {
if (predicate(item)) return true;
}
return false;
} | javascript | function any(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
for (let item of this) {
if (predicate(item)) return true;
}
return false;
} | [
"function",
"any",
"(",
"predicate",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"for",
"(",
"let",
"item",
"of",
"this",
")",
"{",
"if",
"(",
"predicate",
"(",
"ite... | Determines whether a sequence contains any elements.
@param {(Function)} predicate The function called per iteraction till returns true.
@return Any elements satisfy a condition returns true, or returns false.
predicate: (T) -> Boolean | [
"Determines",
"whether",
"a",
"sequence",
"contains",
"any",
"elements",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L79-L87 |
35,868 | UnsignedInt8/LINQ | linq.js | contains | function contains(item, equalityComparer) {
equalityComparer = typeof equalityComparer === 'function' ? equalityComparer : util.defaultEqualityComparer;
for (let i of this) {
if (equalityComparer(i, item)) return true;
}
return false;
} | javascript | function contains(item, equalityComparer) {
equalityComparer = typeof equalityComparer === 'function' ? equalityComparer : util.defaultEqualityComparer;
for (let i of this) {
if (equalityComparer(i, item)) return true;
}
return false;
} | [
"function",
"contains",
"(",
"item",
",",
"equalityComparer",
")",
"{",
"equalityComparer",
"=",
"typeof",
"equalityComparer",
"===",
"'function'",
"?",
"equalityComparer",
":",
"util",
".",
"defaultEqualityComparer",
";",
"for",
"(",
"let",
"i",
"of",
"this",
"... | Determines whether a sequence contains a specified element by using the default equality comparer.
@param item The item which you want to check.
@param {(Function)} equalityComparer The equality comparer.
equalityComparer: (item1, item2) -> Boolean | [
"Determines",
"whether",
"a",
"sequence",
"contains",
"a",
"specified",
"element",
"by",
"using",
"the",
"default",
"equality",
"comparer",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L122-L130 |
35,869 | UnsignedInt8/LINQ | linq.js | count | function count(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let c = 0;
for (let item of this) {
if (predicate(item)) c++;
}
return c;
} | javascript | function count(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let c = 0;
for (let item of this) {
if (predicate(item)) c++;
}
return c;
} | [
"function",
"count",
"(",
"predicate",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"let",
"c",
"=",
"0",
";",
"for",
"(",
"let",
"item",
"of",
"this",
")",
"{",
"i... | Returns a number that represents how many elements in the specified sequence satisfy a condition.
@param {(Function)} predicate The condition for compute item counts
@return Return the count which satisfy a condition. | [
"Returns",
"a",
"number",
"that",
"represents",
"how",
"many",
"elements",
"in",
"the",
"specified",
"sequence",
"satisfy",
"a",
"condition",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L138-L148 |
35,870 | UnsignedInt8/LINQ | linq.js | elementAt | function elementAt(index, defaultValue) {
let i = 0;
for (let item of this) {
if (i === index) return item;
i++;
}
return defaultValue;
} | javascript | function elementAt(index, defaultValue) {
let i = 0;
for (let item of this) {
if (i === index) return item;
i++;
}
return defaultValue;
} | [
"function",
"elementAt",
"(",
"index",
",",
"defaultValue",
")",
"{",
"let",
"i",
"=",
"0",
";",
"for",
"(",
"let",
"item",
"of",
"this",
")",
"{",
"if",
"(",
"i",
"===",
"index",
")",
"return",
"item",
";",
"i",
"++",
";",
"}",
"return",
"defaul... | Returns the element at a specified index in a sequence.
@param positon The zero-base index of element which you want.
@param defaultValue The default value if the index is out of range.
@return The element at a specified index or default value | [
"Returns",
"the",
"element",
"at",
"a",
"specified",
"index",
"in",
"a",
"sequence",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L203-L212 |
35,871 | UnsignedInt8/LINQ | linq.js | first | function first(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let error = new Error('No element satisfies the condition in predicate.');
let firstElement = firstOrDefault.apply(this, [predicate, error]);
if (firstElement === error) throw error;
return firstElem... | javascript | function first(predicate) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let error = new Error('No element satisfies the condition in predicate.');
let firstElement = firstOrDefault.apply(this, [predicate, error]);
if (firstElement === error) throw error;
return firstElem... | [
"function",
"first",
"(",
"predicate",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"let",
"error",
"=",
"new",
"Error",
"(",
"'No element satisfies the condition in predicate.'"... | Returns the first element in a sequence that satisfies a specified condition or throws an error if not found.
@param {(Function)} predicate The function called per iteraction till returns true.
@param defaultValue The default value.
@return The first element which satisfy condition or default value. | [
"Returns",
"the",
"first",
"element",
"in",
"a",
"sequence",
"that",
"satisfies",
"a",
"specified",
"condition",
"or",
"throws",
"an",
"error",
"if",
"not",
"found",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L265-L273 |
35,872 | UnsignedInt8/LINQ | linq.js | firstOrDefault | function firstOrDefault(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
for (let item of this) {
if (predicate(item)) return item;
}
return defaultValue;
} | javascript | function firstOrDefault(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
for (let item of this) {
if (predicate(item)) return item;
}
return defaultValue;
} | [
"function",
"firstOrDefault",
"(",
"predicate",
",",
"defaultValue",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"for",
"(",
"let",
"item",
"of",
"this",
")",
"{",
"if",... | Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
@param {(Function)} predicate The function called per iteraction till returns true.
@param defaultValue The default value. | [
"Returns",
"the",
"first",
"element",
"of",
"the",
"sequence",
"that",
"satisfies",
"a",
"condition",
"or",
"a",
"default",
"value",
"if",
"no",
"such",
"element",
"is",
"found",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L281-L289 |
35,873 | UnsignedInt8/LINQ | linq.js | last | function last(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let lastValue;
let found = false;
for (let item of this.where(predicate)) {
lastValue = item;
found = true;
}
return found ? lastValue : defaultValue;
} | javascript | function last(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let lastValue;
let found = false;
for (let item of this.where(predicate)) {
lastValue = item;
found = true;
}
return found ? lastValue : defaultValue;
} | [
"function",
"last",
"(",
"predicate",
",",
"defaultValue",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"let",
"lastValue",
";",
"let",
"found",
"=",
"false",
";",
"for",... | Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
@param predicate A function to test each element for a condition.
@param defaultValue The default value if no such element is found.
@return Default value if the sequence is empty or if no elements pass th... | [
"Returns",
"the",
"last",
"element",
"of",
"a",
"sequence",
"that",
"satisfies",
"a",
"condition",
"or",
"a",
"default",
"value",
"if",
"no",
"such",
"element",
"is",
"found",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L439-L450 |
35,874 | UnsignedInt8/LINQ | linq.js | max | function max(keySelector, comparer) {
let itComparer = typeof comparer === 'function' ? comparer : util.defaultComparer;
let itKeySelector = typeof keySelector === 'function' ? keySelector : (i) => i;
let maximum = this.firstOrDefault();
for (let item of this) {
maximum = itComparer(itKeySelector(item), i... | javascript | function max(keySelector, comparer) {
let itComparer = typeof comparer === 'function' ? comparer : util.defaultComparer;
let itKeySelector = typeof keySelector === 'function' ? keySelector : (i) => i;
let maximum = this.firstOrDefault();
for (let item of this) {
maximum = itComparer(itKeySelector(item), i... | [
"function",
"max",
"(",
"keySelector",
",",
"comparer",
")",
"{",
"let",
"itComparer",
"=",
"typeof",
"comparer",
"===",
"'function'",
"?",
"comparer",
":",
"util",
".",
"defaultComparer",
";",
"let",
"itKeySelector",
"=",
"typeof",
"keySelector",
"===",
"'fun... | Returns the maximum value in a sequence.
@param keySelector A transform function to apply to each element.
@param comparer A comparer function to check with item is greater.
@return The maximum value in the sequence.
keySelector: (T) -> key
comparer: (item1, item2) -> -1|0|1 | [
"Returns",
"the",
"maximum",
"value",
"in",
"a",
"sequence",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L461-L472 |
35,875 | UnsignedInt8/LINQ | linq.js | min | function min(keySelector, comparer) {
let itComparer = typeof comparer === 'function' ? comparer : util.defaultComparer;
let itKeySelector = typeof keySelector === 'function' ? keySelector : (i) => i;
let minimum = this.firstOrDefault();
for (let item of this) {
minimum = itComparer(itKeySelector(item), i... | javascript | function min(keySelector, comparer) {
let itComparer = typeof comparer === 'function' ? comparer : util.defaultComparer;
let itKeySelector = typeof keySelector === 'function' ? keySelector : (i) => i;
let minimum = this.firstOrDefault();
for (let item of this) {
minimum = itComparer(itKeySelector(item), i... | [
"function",
"min",
"(",
"keySelector",
",",
"comparer",
")",
"{",
"let",
"itComparer",
"=",
"typeof",
"comparer",
"===",
"'function'",
"?",
"comparer",
":",
"util",
".",
"defaultComparer",
";",
"let",
"itKeySelector",
"=",
"typeof",
"keySelector",
"===",
"'fun... | Returns the minimum value in a sequence.
@param keySelector A transform function to apply to each element.
@param comparer A comparer function to check with item is less.
@return The minimum value in the sequence. | [
"Returns",
"the",
"minimum",
"value",
"in",
"a",
"sequence",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L481-L492 |
35,876 | UnsignedInt8/LINQ | linq.js | sequenceEqual | function sequenceEqual(otherSequence, equalityComparer) {
equalityComparer = typeof equalityComparer === 'function' ? equalityComparer : util.defaultEqualityComparer;
let selfIterator = this[Symbol.iterator] ? this[Symbol.iterator]() : undefined;
let otherIterator = otherSequence[Symbol.iterator] ? otherSequence[... | javascript | function sequenceEqual(otherSequence, equalityComparer) {
equalityComparer = typeof equalityComparer === 'function' ? equalityComparer : util.defaultEqualityComparer;
let selfIterator = this[Symbol.iterator] ? this[Symbol.iterator]() : undefined;
let otherIterator = otherSequence[Symbol.iterator] ? otherSequence[... | [
"function",
"sequenceEqual",
"(",
"otherSequence",
",",
"equalityComparer",
")",
"{",
"equalityComparer",
"=",
"typeof",
"equalityComparer",
"===",
"'function'",
"?",
"equalityComparer",
":",
"util",
".",
"defaultEqualityComparer",
";",
"let",
"selfIterator",
"=",
"th... | Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
@param otherSequence A sequence to compare to the first sequence.
@return true if the two source sequences are of equal length and their corresponding elements are equal according to the equality... | [
"Determines",
"whether",
"two",
"sequences",
"are",
"equal",
"by",
"comparing",
"the",
"elements",
"by",
"using",
"the",
"default",
"equality",
"comparer",
"for",
"their",
"type",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L644-L662 |
35,877 | UnsignedInt8/LINQ | linq.js | single | function single(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let count = 0;
let singleItem = undefined;
for (let item of this) {
if (predicate(item)) {
if (singleItem === undefined) {
singleItem = item;
} else {
thro... | javascript | function single(predicate, defaultValue) {
predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;
let count = 0;
let singleItem = undefined;
for (let item of this) {
if (predicate(item)) {
if (singleItem === undefined) {
singleItem = item;
} else {
thro... | [
"function",
"single",
"(",
"predicate",
",",
"defaultValue",
")",
"{",
"predicate",
"=",
"typeof",
"predicate",
"===",
"'function'",
"?",
"predicate",
":",
"util",
".",
"defaultPredicate",
";",
"let",
"count",
"=",
"0",
";",
"let",
"singleItem",
"=",
"undefi... | Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition or sequence is empty.
@param predicate A function to test an element for a condition.
@param defaultValue The defaul... | [
"Returns",
"the",
"only",
"element",
"of",
"a",
"sequence",
"that",
"satisfies",
"a",
"specified",
"condition",
"or",
"a",
"default",
"value",
"if",
"no",
"such",
"element",
"exists",
";",
"this",
"method",
"throws",
"an",
"exception",
"if",
"more",
"than",
... | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L671-L694 |
35,878 | UnsignedInt8/LINQ | linq.js | sum | function sum(transform) {
let sum = 0;
let seq = typeof transform === 'function' ? this.select(transform) : this;
for (let item of seq) {
sum += Number.parseFloat(item);
}
return sum;
} | javascript | function sum(transform) {
let sum = 0;
let seq = typeof transform === 'function' ? this.select(transform) : this;
for (let item of seq) {
sum += Number.parseFloat(item);
}
return sum;
} | [
"function",
"sum",
"(",
"transform",
")",
"{",
"let",
"sum",
"=",
"0",
";",
"let",
"seq",
"=",
"typeof",
"transform",
"===",
"'function'",
"?",
"this",
".",
"select",
"(",
"transform",
")",
":",
"this",
";",
"for",
"(",
"let",
"item",
"of",
"seq",
... | Computes the sum of a sequence.
@param transform The transform function called per interaction.
@return The sum of the values in the sequence. | [
"Computes",
"the",
"sum",
"of",
"a",
"sequence",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L742-L751 |
35,879 | UnsignedInt8/LINQ | linq.js | toMap | function toMap(keySelector, elementSelector) {
if (!keySelector) return new Map(this);
elementSelector = typeof elementSelector === 'function' ? elementSelector : i => i;
let map = new Map();
for (let item of this) {
let key = keySelector(item);
let element = elementSelector(item);
map.set(key, el... | javascript | function toMap(keySelector, elementSelector) {
if (!keySelector) return new Map(this);
elementSelector = typeof elementSelector === 'function' ? elementSelector : i => i;
let map = new Map();
for (let item of this) {
let key = keySelector(item);
let element = elementSelector(item);
map.set(key, el... | [
"function",
"toMap",
"(",
"keySelector",
",",
"elementSelector",
")",
"{",
"if",
"(",
"!",
"keySelector",
")",
"return",
"new",
"Map",
"(",
"this",
")",
";",
"elementSelector",
"=",
"typeof",
"elementSelector",
"===",
"'function'",
"?",
"elementSelector",
":",... | Creates a map from a sequenece according to a specified key selector function, a comparer, and an element selector function.
@param keySelector A function to extract a key from each element.
@param elementSelector A transform function to produce a result element value from each element.
@return A map that contains val... | [
"Creates",
"a",
"map",
"from",
"a",
"sequenece",
"according",
"to",
"a",
"specified",
"key",
"selector",
"function",
"a",
"comparer",
"and",
"an",
"element",
"selector",
"function",
"."
] | 24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8 | https://github.com/UnsignedInt8/LINQ/blob/24d2a88ab3687b6c72c2d21d392bc39f1af7a0f8/linq.js#L837-L850 |
35,880 | pogosandbox/pogobuf-signature | encryption/builder.js | function(options) {
if (!options) options = {};
this.initTime = options.initTime || new Date().getTime();
this.time_since_start = options.time_since_start || null;
this.time = options.time || null;
this.version = options.version || '0.45';
this.forcedUk25 = options.uk25 || null;
if (options.... | javascript | function(options) {
if (!options) options = {};
this.initTime = options.initTime || new Date().getTime();
this.time_since_start = options.time_since_start || null;
this.time = options.time || null;
this.version = options.version || '0.45';
this.forcedUk25 = options.uk25 || null;
if (options.... | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"options",
")",
"options",
"=",
"{",
"}",
";",
"this",
".",
"initTime",
"=",
"options",
".",
"initTime",
"||",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"this",
".",
"time_since_st... | the signature builder
@constructor
@param {Object} [options] - a set of options and defaults to send to the signature builder
@param {number} [options[].initTime] - time in ms to use as the app's startup time
@param {Buffer} [options[].unk22] - a 32-byte Buffer to use as `unk22`
@param {String} [options[].version] - Th... | [
"the",
"signature",
"builder"
] | 85be21ec2d7cf58eb569447c44bc46c55095d226 | https://github.com/pogosandbox/pogobuf-signature/blob/85be21ec2d7cf58eb569447c44bc46c55095d226/encryption/builder.js#L15-L33 | |
35,881 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/date/format.js | function (calendar) {
var time = calendar.getTime();
calendar = /**@type {KISSY.Date.Gregorian}
@ignore*/
new GregorianCalendar(this.timezoneOffset, this.locale);
calendar.setTime(time);
var i, ret = [], pattern = this.pattern, len = pattern.length;
... | javascript | function (calendar) {
var time = calendar.getTime();
calendar = /**@type {KISSY.Date.Gregorian}
@ignore*/
new GregorianCalendar(this.timezoneOffset, this.locale);
calendar.setTime(time);
var i, ret = [], pattern = this.pattern, len = pattern.length;
... | [
"function",
"(",
"calendar",
")",
"{",
"var",
"time",
"=",
"calendar",
".",
"getTime",
"(",
")",
";",
"calendar",
"=",
"/**@type {KISSY.Date.Gregorian}\n @ignore*/",
"new",
"GregorianCalendar",
"(",
"this",
".",
"timezoneOffset",
",",
"this",
".",
"locale"... | format a GregorianDate instance according to specified pattern
@param {KISSY.Date.Gregorian} calendar GregorianDate instance
@returns {string} formatted string of GregorianDate instance | [
"format",
"a",
"GregorianDate",
"instance",
"according",
"to",
"specified",
"pattern"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/date/format.js#L729-L745 | |
35,882 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/date/format.js | function (dateStr) {
var calendar = /**@type {KISSY.Date.Gregorian}
@ignore*/
new GregorianCalendar(this.timezoneOffset, this.locale), i, j, tmp = {}, obeyCount = false, dateStrLen = dateStr.length, errorIndex = -1, startIndex = 0, oldStartIndex = 0, pattern = this.pattern, len ... | javascript | function (dateStr) {
var calendar = /**@type {KISSY.Date.Gregorian}
@ignore*/
new GregorianCalendar(this.timezoneOffset, this.locale), i, j, tmp = {}, obeyCount = false, dateStrLen = dateStr.length, errorIndex = -1, startIndex = 0, oldStartIndex = 0, pattern = this.pattern, len ... | [
"function",
"(",
"dateStr",
")",
"{",
"var",
"calendar",
"=",
"/**@type {KISSY.Date.Gregorian}\n @ignore*/",
"new",
"GregorianCalendar",
"(",
"this",
".",
"timezoneOffset",
",",
"this",
".",
"locale",
")",
",",
"i",
",",
"j",
",",
"tmp",
"=",
"{",
... | parse a formatted string of GregorianDate instance according to specified pattern
@param {String} dateStr formatted string of GregorianDate
@returns {KISSY.Date.Gregorian} | [
"parse",
"a",
"formatted",
"string",
"of",
"GregorianDate",
"instance",
"according",
"to",
"specified",
"pattern"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/date/format.js#L751-L799 | |
35,883 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/lib/build/date/format.js | function (dateStyle, timeStyle, locale, timeZoneOffset) {
locale = locale || defaultLocale;
var datePattern = '';
if (dateStyle !== undefined) {
datePattern = locale.datePatterns[dateStyle];
}
var timePattern = '';
if (timeStyle !==... | javascript | function (dateStyle, timeStyle, locale, timeZoneOffset) {
locale = locale || defaultLocale;
var datePattern = '';
if (dateStyle !== undefined) {
datePattern = locale.datePatterns[dateStyle];
}
var timePattern = '';
if (timeStyle !==... | [
"function",
"(",
"dateStyle",
",",
"timeStyle",
",",
"locale",
",",
"timeZoneOffset",
")",
"{",
"locale",
"=",
"locale",
"||",
"defaultLocale",
";",
"var",
"datePattern",
"=",
"''",
";",
"if",
"(",
"dateStyle",
"!==",
"undefined",
")",
"{",
"datePattern",
... | get a formatter instance of specified date style and time style.
@param {KISSY.Date.Formatter.Style} dateStyle date format style
@param {KISSY.Date.Formatter.Style} timeStyle time format style
@param {Object} locale
@param {Number} timeZoneOffset time zone offset by minutes
@returns {KISSY.Date.Gregorian}
@static | [
"get",
"a",
"formatter",
"instance",
"of",
"specified",
"date",
"style",
"and",
"time",
"style",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/date/format.js#L835-L857 | |
35,884 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | __fireAttrChange | function __fireAttrChange(self, when, name, prevVal, newVal, subAttrName, attrName, data) {
attrName = attrName || name;
return self.fire(whenAttrChangeEventName(when, name), util.mix({
attrName: attrName,
subAttrName: subAttrName,
prevVal: prevVal,
newVal... | javascript | function __fireAttrChange(self, when, name, prevVal, newVal, subAttrName, attrName, data) {
attrName = attrName || name;
return self.fire(whenAttrChangeEventName(when, name), util.mix({
attrName: attrName,
subAttrName: subAttrName,
prevVal: prevVal,
newVal... | [
"function",
"__fireAttrChange",
"(",
"self",
",",
"when",
",",
"name",
",",
"prevVal",
",",
"newVal",
",",
"subAttrName",
",",
"attrName",
",",
"data",
")",
"{",
"attrName",
"=",
"attrName",
"||",
"name",
";",
"return",
"self",
".",
"fire",
"(",
"whenAtt... | fire attribute value change fire attribute value change | [
"fire",
"attribute",
"value",
"change",
"fire",
"attribute",
"value",
"change"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L48-L56 |
35,885 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function () {
var self = this, o = {}, a, attrs = self.getAttrs();
for (a in attrs) {
o[a] = self.get(a);
}
return o;
} | javascript | function () {
var self = this, o = {}, a, attrs = self.getAttrs();
for (a in attrs) {
o[a] = self.get(a);
}
return o;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"o",
"=",
"{",
"}",
",",
"a",
",",
"attrs",
"=",
"self",
".",
"getAttrs",
"(",
")",
";",
"for",
"(",
"a",
"in",
"attrs",
")",
"{",
"o",
"[",
"a",
"]",
"=",
"self",
".",
"get",
"(... | get un-cloned attr value collections
@return {Object} | [
"get",
"un",
"-",
"cloned",
"attr",
"value",
"collections"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L354-L360 | |
35,886 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (name, attrConfig, override) {
var self = this, attrs = self.getAttrs(), attr,
// shadow clone
cfg = util.merge(attrConfig);
if (cfg.value && typeof cfg.value === 'object') {
cfg.value = util.clone(cfg.value);
LoggerManger.... | javascript | function (name, attrConfig, override) {
var self = this, attrs = self.getAttrs(), attr,
// shadow clone
cfg = util.merge(attrConfig);
if (cfg.value && typeof cfg.value === 'object') {
cfg.value = util.clone(cfg.value);
LoggerManger.... | [
"function",
"(",
"name",
",",
"attrConfig",
",",
"override",
")",
"{",
"var",
"self",
"=",
"this",
",",
"attrs",
"=",
"self",
".",
"getAttrs",
"(",
")",
",",
"attr",
",",
"// shadow clone",
"cfg",
"=",
"util",
".",
"merge",
"(",
"attrConfig",
")",
";... | Adds an attribute with the provided configuration to the host object.
@param {String} name attrName
@param {Object} attrConfig The config supports the following properties
@param [attrConfig.value] simple object or system native object
@param [attrConfig.valueFn] a function which can return current attribute 's default... | [
"Adds",
"an",
"attribute",
"with",
"the",
"provided",
"configuration",
"to",
"the",
"host",
"object",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L378-L392 | |
35,887 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (attrConfigs, initialValues) {
var self = this;
util.each(attrConfigs, function (attrConfig, name) {
self.addAttr(name, attrConfig);
});
if (initialValues) {
self.set(initialValues);
}
return self;
} | javascript | function (attrConfigs, initialValues) {
var self = this;
util.each(attrConfigs, function (attrConfig, name) {
self.addAttr(name, attrConfig);
});
if (initialValues) {
self.set(initialValues);
}
return self;
} | [
"function",
"(",
"attrConfigs",
",",
"initialValues",
")",
"{",
"var",
"self",
"=",
"this",
";",
"util",
".",
"each",
"(",
"attrConfigs",
",",
"function",
"(",
"attrConfig",
",",
"name",
")",
"{",
"self",
".",
"addAttr",
"(",
"name",
",",
"attrConfig",
... | Configures a group of attributes, and sets initial values.
@param {Object} attrConfigs An object with attribute name/configuration pairs.
@param {Object} initialValues user defined initial values
@chainable | [
"Configures",
"a",
"group",
"of",
"attributes",
"and",
"sets",
"initial",
"values",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L399-L408 | |
35,888 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (name) {
var self = this;
var __attrVals = getAttrVals(self);
var __attrs = self.getAttrs();
if (self.hasAttr(name)) {
delete __attrs[name];
delete __attrVals[name];
}
return self;
} | javascript | function (name) {
var self = this;
var __attrVals = getAttrVals(self);
var __attrs = self.getAttrs();
if (self.hasAttr(name)) {
delete __attrs[name];
delete __attrVals[name];
}
return self;
} | [
"function",
"(",
"name",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"__attrVals",
"=",
"getAttrVals",
"(",
"self",
")",
";",
"var",
"__attrs",
"=",
"self",
".",
"getAttrs",
"(",
")",
";",
"if",
"(",
"self",
".",
"hasAttr",
"(",
"name",
")",
... | Removes an attribute from the host object.
@chainable | [
"Removes",
"an",
"attribute",
"from",
"the",
"host",
"object",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L421-L430 | |
35,889 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (name, value, opts) {
var self = this, e;
if (typeof name !== 'string') {
opts = value;
opts = opts || {};
var all = Object(name), attrs = [], errors = [];
for (name in all) {
// bulk validation
... | javascript | function (name, value, opts) {
var self = this, e;
if (typeof name !== 'string') {
opts = value;
opts = opts || {};
var all = Object(name), attrs = [], errors = [];
for (name in all) {
// bulk validation
... | [
"function",
"(",
"name",
",",
"value",
",",
"opts",
")",
"{",
"var",
"self",
"=",
"this",
",",
"e",
";",
"if",
"(",
"typeof",
"name",
"!==",
"'string'",
")",
"{",
"opts",
"=",
"value",
";",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"var",
"all"... | Sets the value of an attribute.
@param {String|Object} name attribute 's name or attribute name and value map
@param [value] attribute 's value
@param {Object} [opts] some options
@param {Boolean} [opts.silent] whether fire change event
@param {Function} [opts.error] error handler
@return {Boolean} whether pass validat... | [
"Sets",
"the",
"value",
"of",
"an",
"attribute",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L440-L484 | |
35,890 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (name, value) {
var self = this, setValue,
// if host does not have meta info corresponding to (name,value)
// then register on demand in order to collect all data meta info
// 一定要注册属性元数据,否则其他模块通过 _attrs 不能枚举到所有有效属性
// 因为属性在声明注册前可以直接设置... | javascript | function (name, value) {
var self = this, setValue,
// if host does not have meta info corresponding to (name,value)
// then register on demand in order to collect all data meta info
// 一定要注册属性元数据,否则其他模块通过 _attrs 不能枚举到所有有效属性
// 因为属性在声明注册前可以直接设置... | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"var",
"self",
"=",
"this",
",",
"setValue",
",",
"// if host does not have meta info corresponding to (name,value)",
"// then register on demand in order to collect all data meta info",
"// 一定要注册属性元数据,否则其他模块通过 _attrs 不能枚举到所有有效属性",
"... | internal use, no event involved, just set.
override by model
@protected | [
"internal",
"use",
"no",
"event",
"involved",
"just",
"set",
".",
"override",
"by",
"model"
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L490-L510 | |
35,891 | kissyteam/kissy-xtemplate | lib/kissy/5.0.0-alpha.3/build/attribute-debug.js | function (name) {
var self = this, dot = '.', path, attrVals = getAttrVals(self), attrConfig, getter, ret;
if (name.indexOf(dot) !== -1) {
path = name.split(dot);
name = path.shift();
}
attrConfig = ensureNonEmpty(self.getAttrs(), name, 1);... | javascript | function (name) {
var self = this, dot = '.', path, attrVals = getAttrVals(self), attrConfig, getter, ret;
if (name.indexOf(dot) !== -1) {
path = name.split(dot);
name = path.shift();
}
attrConfig = ensureNonEmpty(self.getAttrs(), name, 1);... | [
"function",
"(",
"name",
")",
"{",
"var",
"self",
"=",
"this",
",",
"dot",
"=",
"'.'",
",",
"path",
",",
"attrVals",
"=",
"getAttrVals",
"(",
"self",
")",
",",
"attrConfig",
",",
"getter",
",",
"ret",
";",
"if",
"(",
"name",
".",
"indexOf",
"(",
... | Gets the current value of the attribute.
@param {String} name attribute 's name
@return {*} | [
"Gets",
"the",
"current",
"value",
"of",
"the",
"attribute",
"."
] | 1d454ab624c867d6a862d63dba576f8d24c6dcfc | https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/attribute-debug.js#L516-L539 | |
35,892 | craterdog-bali/js-bali-component-framework | src/elements/Text.js | Text | function Text(value, parameters) {
abstractions.Element.call(this, utilities.types.TEXT, parameters);
value = value || ''; // default value
// since this element is immutable the value must be read-only
this.getValue = function() { return value; };
return this;
} | javascript | function Text(value, parameters) {
abstractions.Element.call(this, utilities.types.TEXT, parameters);
value = value || ''; // default value
// since this element is immutable the value must be read-only
this.getValue = function() { return value; };
return this;
} | [
"function",
"Text",
"(",
"value",
",",
"parameters",
")",
"{",
"abstractions",
".",
"Element",
".",
"call",
"(",
"this",
",",
"utilities",
".",
"types",
".",
"TEXT",
",",
"parameters",
")",
";",
"value",
"=",
"value",
"||",
"''",
";",
"// default value",... | PUBLIC CONSTRUCTOR
This constructor creates a new text string element using the specified value.
@constructor
@param {String} value The value of the text string.
@param {Parameters} parameters Optional parameters used to parameterize this element.
@returns {Text} The new text string. | [
"PUBLIC",
"CONSTRUCTOR",
"This",
"constructor",
"creates",
"a",
"new",
"text",
"string",
"element",
"using",
"the",
"specified",
"value",
"."
] | 57279245e44d6ceef4debdb1d6132f48e464dcb8 | https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Text.js#L30-L38 |
35,893 | KTH/kth-node-cortina-block | index.js | _getEnvSpecificConfig | function _getEnvSpecificConfig () {
const prodDefaults = {
env: 'prod',
url: null,
debug: false,
version: 'head',
language: 'en',
redisKey: 'CortinaBlock_',
redisExpire: 600,
redis: null,
blocks: {
title: '1.260060',
megaMenu: '1.855134',
secondaryMenu: '1.865038'... | javascript | function _getEnvSpecificConfig () {
const prodDefaults = {
env: 'prod',
url: null,
debug: false,
version: 'head',
language: 'en',
redisKey: 'CortinaBlock_',
redisExpire: 600,
redis: null,
blocks: {
title: '1.260060',
megaMenu: '1.855134',
secondaryMenu: '1.865038'... | [
"function",
"_getEnvSpecificConfig",
"(",
")",
"{",
"const",
"prodDefaults",
"=",
"{",
"env",
":",
"'prod'",
",",
"url",
":",
"null",
",",
"debug",
":",
"false",
",",
"version",
":",
"'head'",
",",
"language",
":",
"'en'",
",",
"redisKey",
":",
"'Cortina... | This function makes a decision based on the HOST_URL environment variable
on whether we are in production, referens or development and serves the correct config.
Most values are the same but could be different based on the current state in choosen Cortina environment.
Eg. if we have imported a database dum from one en... | [
"This",
"function",
"makes",
"a",
"decision",
"based",
"on",
"the",
"HOST_URL",
"environment",
"variable",
"on",
"whether",
"we",
"are",
"in",
"production",
"referens",
"or",
"development",
"and",
"serves",
"the",
"correct",
"config",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L18-L121 |
35,894 | KTH/kth-node-cortina-block | index.js | _getHostEnv | function _getHostEnv (hostUrl) {
if (hostUrl) {
if (hostUrl.startsWith('https://www.kth')) {
return 'prod'
} else if (hostUrl.startsWith('https://www-r.referens.sys.kth') || hostUrl.startsWith('https://app-r.referens.sys.kth')) {
return 'ref'
} else if (hostUrl.startsWith('http://localhost')) ... | javascript | function _getHostEnv (hostUrl) {
if (hostUrl) {
if (hostUrl.startsWith('https://www.kth')) {
return 'prod'
} else if (hostUrl.startsWith('https://www-r.referens.sys.kth') || hostUrl.startsWith('https://app-r.referens.sys.kth')) {
return 'ref'
} else if (hostUrl.startsWith('http://localhost')) ... | [
"function",
"_getHostEnv",
"(",
"hostUrl",
")",
"{",
"if",
"(",
"hostUrl",
")",
"{",
"if",
"(",
"hostUrl",
".",
"startsWith",
"(",
"'https://www.kth'",
")",
")",
"{",
"return",
"'prod'",
"}",
"else",
"if",
"(",
"hostUrl",
".",
"startsWith",
"(",
"'https:... | Get the current environment from the given Host or Content Management Host.
@param {*} host the given host URL. | [
"Get",
"the",
"current",
"environment",
"from",
"the",
"given",
"Host",
"or",
"Content",
"Management",
"Host",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L127-L139 |
35,895 | KTH/kth-node-cortina-block | index.js | _buildUrl | function _buildUrl (config, type, multi) {
let url = config.url
let language = _getLanguage(config.language)
let block = multi ? config.blocks[type][language] : config.blocks[type]
let version = _getVersion(config.version)
return `${url}${block}?v=${version}&l=${language}`
} | javascript | function _buildUrl (config, type, multi) {
let url = config.url
let language = _getLanguage(config.language)
let block = multi ? config.blocks[type][language] : config.blocks[type]
let version = _getVersion(config.version)
return `${url}${block}?v=${version}&l=${language}`
} | [
"function",
"_buildUrl",
"(",
"config",
",",
"type",
",",
"multi",
")",
"{",
"let",
"url",
"=",
"config",
".",
"url",
"let",
"language",
"=",
"_getLanguage",
"(",
"config",
".",
"language",
")",
"let",
"block",
"=",
"multi",
"?",
"config",
".",
"blocks... | Build API url to Cortins from where to retrieve the blocks.
@param {*} config the given config
@param {*} type the block type eg. image
@param {*} multi | [
"Build",
"API",
"url",
"to",
"Cortins",
"from",
"where",
"to",
"retrieve",
"the",
"blocks",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L171-L177 |
35,896 | KTH/kth-node-cortina-block | index.js | _getBlock | function _getBlock (config, type, multi) {
const options = {
uri: _buildUrl(config, type, multi)
}
if (config.headers) {
options['headers'] = config.headers
}
return request.get(options).then(result => { return { blockName: type, result: result } })
} | javascript | function _getBlock (config, type, multi) {
const options = {
uri: _buildUrl(config, type, multi)
}
if (config.headers) {
options['headers'] = config.headers
}
return request.get(options).then(result => { return { blockName: type, result: result } })
} | [
"function",
"_getBlock",
"(",
"config",
",",
"type",
",",
"multi",
")",
"{",
"const",
"options",
"=",
"{",
"uri",
":",
"_buildUrl",
"(",
"config",
",",
"type",
",",
"multi",
")",
"}",
"if",
"(",
"config",
".",
"headers",
")",
"{",
"options",
"[",
"... | Gets the block based on the given config and type.
@param {*} config the given config
@param {*} type the block type eg. image
@param {*} multi | [
"Gets",
"the",
"block",
"based",
"on",
"the",
"given",
"config",
"and",
"type",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L204-L213 |
35,897 | KTH/kth-node-cortina-block | index.js | _getAll | function _getAll (config) {
return Promise.all(
handleBlocks(config)
).then(function (results) {
let result = {}
results.forEach(function (block) {
result[block.blockName] = block.result
})
return result
})
.catch(err => {
var blockName = err.options ? err.options.uri : 'NO URI... | javascript | function _getAll (config) {
return Promise.all(
handleBlocks(config)
).then(function (results) {
let result = {}
results.forEach(function (block) {
result[block.blockName] = block.result
})
return result
})
.catch(err => {
var blockName = err.options ? err.options.uri : 'NO URI... | [
"function",
"_getAll",
"(",
"config",
")",
"{",
"return",
"Promise",
".",
"all",
"(",
"handleBlocks",
"(",
"config",
")",
")",
".",
"then",
"(",
"function",
"(",
"results",
")",
"{",
"let",
"result",
"=",
"{",
"}",
"results",
".",
"forEach",
"(",
"fu... | Fetch all Cortina blocks from API.
@param config the given cinfig
@returns {Promise}
@private | [
"Fetch",
"all",
"Cortina",
"blocks",
"from",
"API",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L231-L249 |
35,898 | KTH/kth-node-cortina-block | index.js | handleBlocks | function handleBlocks (config) {
let blocks = []
let blocksObj = config.blocks
for (let i in blocksObj) {
if (blocksObj.hasOwnProperty(i)) {
if (isLanguage(blocksObj[i])) {
blocks.push(_getBlock(config, 'language', true))
} else {
blocks.push(_getBlock(config, i))
}
}
}... | javascript | function handleBlocks (config) {
let blocks = []
let blocksObj = config.blocks
for (let i in blocksObj) {
if (blocksObj.hasOwnProperty(i)) {
if (isLanguage(blocksObj[i])) {
blocks.push(_getBlock(config, 'language', true))
} else {
blocks.push(_getBlock(config, i))
}
}
}... | [
"function",
"handleBlocks",
"(",
"config",
")",
"{",
"let",
"blocks",
"=",
"[",
"]",
"let",
"blocksObj",
"=",
"config",
".",
"blocks",
"for",
"(",
"let",
"i",
"in",
"blocksObj",
")",
"{",
"if",
"(",
"blocksObj",
".",
"hasOwnProperty",
"(",
"i",
")",
... | Handles all the blocks based on the given config.
@param config
@returns {Array} | [
"Handles",
"all",
"the",
"blocks",
"based",
"on",
"the",
"given",
"config",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L256-L269 |
35,899 | KTH/kth-node-cortina-block | index.js | _getRedisItem | function _getRedisItem (config) {
let key = _buildRedisKey(config.redisKey, config.language)
return config.redis.hgetallAsync(key)
} | javascript | function _getRedisItem (config) {
let key = _buildRedisKey(config.redisKey, config.language)
return config.redis.hgetallAsync(key)
} | [
"function",
"_getRedisItem",
"(",
"config",
")",
"{",
"let",
"key",
"=",
"_buildRedisKey",
"(",
"config",
".",
"redisKey",
",",
"config",
".",
"language",
")",
"return",
"config",
".",
"redis",
".",
"hgetallAsync",
"(",
"key",
")",
"}"
] | Wrap a Redis get call in a Promise.
@param config
@returns {Promise}
@private | [
"Wrap",
"a",
"Redis",
"get",
"call",
"in",
"a",
"Promise",
"."
] | db07ce1b6e3ffdbb565be312e91e2244aad20042 | https://github.com/KTH/kth-node-cortina-block/blob/db07ce1b6e3ffdbb565be312e91e2244aad20042/index.js#L286-L289 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.