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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,000 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | callMethod | function callMethod(name, params) {
return (methodCache.has(name) || typeof params === 'undefined')
? asyncCall(name, params)
: cacheCall(name, params);
} | javascript | function callMethod(name, params) {
return (methodCache.has(name) || typeof params === 'undefined')
? asyncCall(name, params)
: cacheCall(name, params);
} | [
"function",
"callMethod",
"(",
"name",
",",
"params",
")",
"{",
"return",
"(",
"methodCache",
".",
"has",
"(",
"name",
")",
"||",
"typeof",
"params",
"===",
"'undefined'",
")",
"?",
"asyncCall",
"(",
"name",
",",
"params",
")",
":",
"cacheCall",
"(",
"... | Call a method as async via Asteroid, or through cache if one is created.
If the method doesn't have or need parameters, it can't use them for caching
so it will always call asynchronously.
@param name The Rocket.Chat server method to call
@param params Single or array of parameters of the method to call | [
"Call",
"a",
"method",
"as",
"async",
"via",
"Asteroid",
"or",
"through",
"cache",
"if",
"one",
"is",
"created",
".",
"If",
"the",
"method",
"doesn",
"t",
"have",
"or",
"need",
"parameters",
"it",
"can",
"t",
"use",
"them",
"for",
"caching",
"so",
"it"... | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L172-L176 |
15,001 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | cacheCall | function cacheCall(method, key) {
return methodCache.call(method, key)
.catch((err) => {
log_1.logger.error(`[${method}] Error:`, err);
throw err; // throw after log to stop async chain
})
.then((result) => {
(result)
? log_1.logger.debug(`[${method}] Success:... | javascript | function cacheCall(method, key) {
return methodCache.call(method, key)
.catch((err) => {
log_1.logger.error(`[${method}] Error:`, err);
throw err; // throw after log to stop async chain
})
.then((result) => {
(result)
? log_1.logger.debug(`[${method}] Success:... | [
"function",
"cacheCall",
"(",
"method",
",",
"key",
")",
"{",
"return",
"methodCache",
".",
"call",
"(",
"method",
",",
"key",
")",
".",
"catch",
"(",
"(",
"err",
")",
"=>",
"{",
"log_1",
".",
"logger",
".",
"error",
"(",
"`",
"${",
"method",
"}",
... | Wraps Asteroid method calls, passed through method cache if cache is valid.
@param method The Rocket.Chat server method, to call through Asteroid
@param key Single string parameters only, required to use as cache key | [
"Wraps",
"Asteroid",
"method",
"calls",
"passed",
"through",
"method",
"cache",
"if",
"cache",
"is",
"valid",
"."
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L183-L195 |
15,002 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | logout | function logout() {
return exports.asteroid.logout()
.catch((err) => {
log_1.logger.error('[Logout] Error:', err);
throw err; // throw after log to stop async chain
});
} | javascript | function logout() {
return exports.asteroid.logout()
.catch((err) => {
log_1.logger.error('[Logout] Error:', err);
throw err; // throw after log to stop async chain
});
} | [
"function",
"logout",
"(",
")",
"{",
"return",
"exports",
".",
"asteroid",
".",
"logout",
"(",
")",
".",
"catch",
"(",
"(",
"err",
")",
"=>",
"{",
"log_1",
".",
"logger",
".",
"error",
"(",
"'[Logout] Error:'",
",",
"err",
")",
";",
"throw",
"err",
... | Logout of Rocket.Chat via Asteroid | [
"Logout",
"of",
"Rocket",
".",
"Chat",
"via",
"Asteroid"
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L229-L235 |
15,003 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | unsubscribe | function unsubscribe(subscription) {
const index = exports.subscriptions.indexOf(subscription);
if (index === -1)
return;
subscription.stop();
// asteroid.unsubscribe(subscription.id) // v2
exports.subscriptions.splice(index, 1); // remove from collection
log_1.logger.info(`[${subscripti... | javascript | function unsubscribe(subscription) {
const index = exports.subscriptions.indexOf(subscription);
if (index === -1)
return;
subscription.stop();
// asteroid.unsubscribe(subscription.id) // v2
exports.subscriptions.splice(index, 1); // remove from collection
log_1.logger.info(`[${subscripti... | [
"function",
"unsubscribe",
"(",
"subscription",
")",
"{",
"const",
"index",
"=",
"exports",
".",
"subscriptions",
".",
"indexOf",
"(",
"subscription",
")",
";",
"if",
"(",
"index",
"===",
"-",
"1",
")",
"return",
";",
"subscription",
".",
"stop",
"(",
")... | Unsubscribe from Meteor subscription | [
"Unsubscribe",
"from",
"Meteor",
"subscription"
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L256-L264 |
15,004 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | subscribeToMessages | function subscribeToMessages() {
return subscribe(_messageCollectionName, _messageStreamName)
.then((subscription) => {
exports.messages = exports.asteroid.getCollection(_messageCollectionName);
return subscription;
});
} | javascript | function subscribeToMessages() {
return subscribe(_messageCollectionName, _messageStreamName)
.then((subscription) => {
exports.messages = exports.asteroid.getCollection(_messageCollectionName);
return subscription;
});
} | [
"function",
"subscribeToMessages",
"(",
")",
"{",
"return",
"subscribe",
"(",
"_messageCollectionName",
",",
"_messageStreamName",
")",
".",
"then",
"(",
"(",
"subscription",
")",
"=>",
"{",
"exports",
".",
"messages",
"=",
"exports",
".",
"asteroid",
".",
"ge... | Begin subscription to room events for user.
Older adapters used an option for this method but it was always the default. | [
"Begin",
"subscription",
"to",
"room",
"events",
"for",
"user",
".",
"Older",
"adapters",
"used",
"an",
"option",
"for",
"this",
"method",
"but",
"it",
"was",
"always",
"the",
"default",
"."
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L275-L281 |
15,005 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | respondToMessages | function respondToMessages(callback, options = {}) {
const config = Object.assign({}, settings, options);
// return value, may be replaced by async ops
let promise = Promise.resolve();
// Join configured rooms if they haven't been already, unless listening to all
// public rooms, in which case it do... | javascript | function respondToMessages(callback, options = {}) {
const config = Object.assign({}, settings, options);
// return value, may be replaced by async ops
let promise = Promise.resolve();
// Join configured rooms if they haven't been already, unless listening to all
// public rooms, in which case it do... | [
"function",
"respondToMessages",
"(",
"callback",
",",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"config",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"settings",
",",
"options",
")",
";",
"// return value, may be replaced by async ops",
"let",
"promi... | Proxy for `reactToMessages` with some filtering of messages based on config.
@param callback Function called after filters run on subscription events.
- Uses error-first callback pattern
- Second argument is the changed item
- Third argument is additional attributes, such as `roomType`
@param options Sets filters for ... | [
"Proxy",
"for",
"reactToMessages",
"with",
"some",
"filtering",
"of",
"messages",
"based",
"on",
"config",
"."
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L335-L388 |
15,006 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | leaveRoom | function leaveRoom(room) {
return __awaiter(this, void 0, void 0, function* () {
let roomId = yield getRoomId(room);
let joinedIndex = exports.joinedIds.indexOf(room);
if (joinedIndex === -1) {
log_1.logger.error(`[leaveRoom] failed because bot has not joined ${room}`);
}... | javascript | function leaveRoom(room) {
return __awaiter(this, void 0, void 0, function* () {
let roomId = yield getRoomId(room);
let joinedIndex = exports.joinedIds.indexOf(room);
if (joinedIndex === -1) {
log_1.logger.error(`[leaveRoom] failed because bot has not joined ${room}`);
}... | [
"function",
"leaveRoom",
"(",
"room",
")",
"{",
"return",
"__awaiter",
"(",
"this",
",",
"void",
"0",
",",
"void",
"0",
",",
"function",
"*",
"(",
")",
"{",
"let",
"roomId",
"=",
"yield",
"getRoomId",
"(",
"room",
")",
";",
"let",
"joinedIndex",
"=",... | Exit a room the bot has joined | [
"Exit",
"a",
"room",
"the",
"bot",
"has",
"joined"
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L428-L440 |
15,007 | RocketChat/Rocket.Chat.js.SDK | dist/lib/driver.js | prepareMessage | function prepareMessage(content, roomId) {
const message = new message_1.Message(content, exports.integrationId);
if (roomId)
message.setRoomId(roomId);
return message;
} | javascript | function prepareMessage(content, roomId) {
const message = new message_1.Message(content, exports.integrationId);
if (roomId)
message.setRoomId(roomId);
return message;
} | [
"function",
"prepareMessage",
"(",
"content",
",",
"roomId",
")",
"{",
"const",
"message",
"=",
"new",
"message_1",
".",
"Message",
"(",
"content",
",",
"exports",
".",
"integrationId",
")",
";",
"if",
"(",
"roomId",
")",
"message",
".",
"setRoomId",
"(",
... | Structure message content, optionally addressing to room ID.
Accepts message text string or a structured message object. | [
"Structure",
"message",
"content",
"optionally",
"addressing",
"to",
"room",
"ID",
".",
"Accepts",
"message",
"text",
"string",
"or",
"a",
"structured",
"message",
"object",
"."
] | 3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6 | https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/3ebfbff3d6354b3e6dcb9f579c36d6433484a5f6/dist/lib/driver.js#L451-L456 |
15,008 | MeisterTR/ioBroker.landroid-s | lib/utils.js | getControllerDir | function getControllerDir(isInstall) {
var fs = require('fs');
// Find the js-controller location
var controllerDir = __dirname.replace(/\\/g, '/');
controllerDir = controllerDir.split('/');
if (controllerDir[controllerDir.length - 3] === 'adapter') {
controllerDir.splice(controllerDir... | javascript | function getControllerDir(isInstall) {
var fs = require('fs');
// Find the js-controller location
var controllerDir = __dirname.replace(/\\/g, '/');
controllerDir = controllerDir.split('/');
if (controllerDir[controllerDir.length - 3] === 'adapter') {
controllerDir.splice(controllerDir... | [
"function",
"getControllerDir",
"(",
"isInstall",
")",
"{",
"var",
"fs",
"=",
"require",
"(",
"'fs'",
")",
";",
"// Find the js-controller location\r",
"var",
"controllerDir",
"=",
"__dirname",
".",
"replace",
"(",
"/",
"\\\\",
"/",
"g",
",",
"'/'",
")",
";"... | Get js-controller directory to load libs | [
"Get",
"js",
"-",
"controller",
"directory",
"to",
"load",
"libs"
] | 51494d79f0dca674783af2d4284288181ea99683 | https://github.com/MeisterTR/ioBroker.landroid-s/blob/51494d79f0dca674783af2d4284288181ea99683/lib/utils.js#L10-L45 |
15,009 | MeisterTR/ioBroker.landroid-s | lib/utils.js | getConfig | function getConfig() {
var fs = require('fs');
if (fs.existsSync(controllerDir + '/conf/' + appName + '.json')) {
return JSON.parse(fs.readFileSync(controllerDir + '/conf/' + appName + '.json'));
} else if (fs.existsSync(controllerDir + '/conf/' + appName.toLowerCase() + '.json')) {
ret... | javascript | function getConfig() {
var fs = require('fs');
if (fs.existsSync(controllerDir + '/conf/' + appName + '.json')) {
return JSON.parse(fs.readFileSync(controllerDir + '/conf/' + appName + '.json'));
} else if (fs.existsSync(controllerDir + '/conf/' + appName.toLowerCase() + '.json')) {
ret... | [
"function",
"getConfig",
"(",
")",
"{",
"var",
"fs",
"=",
"require",
"(",
"'fs'",
")",
";",
"if",
"(",
"fs",
".",
"existsSync",
"(",
"controllerDir",
"+",
"'/conf/'",
"+",
"appName",
"+",
"'.json'",
")",
")",
"{",
"return",
"JSON",
".",
"parse",
"(",... | Read controller configuration file | [
"Read",
"controller",
"configuration",
"file"
] | 51494d79f0dca674783af2d4284288181ea99683 | https://github.com/MeisterTR/ioBroker.landroid-s/blob/51494d79f0dca674783af2d4284288181ea99683/lib/utils.js#L48-L57 |
15,010 | heigeo/leaflet.wms | lib/leaflet.js | function (remove) {
if (!L.DomEvent) { return; }
this._targets = {};
this._targets[L.stamp(this._container)] = this;
var onOff = remove ? 'off' : 'on';
// @event click: MouseEvent
// Fired when the user clicks (or taps) the map.
// @event dblclick: MouseEvent
// Fired when the user double-... | javascript | function (remove) {
if (!L.DomEvent) { return; }
this._targets = {};
this._targets[L.stamp(this._container)] = this;
var onOff = remove ? 'off' : 'on';
// @event click: MouseEvent
// Fired when the user clicks (or taps) the map.
// @event dblclick: MouseEvent
// Fired when the user double-... | [
"function",
"(",
"remove",
")",
"{",
"if",
"(",
"!",
"L",
".",
"DomEvent",
")",
"{",
"return",
";",
"}",
"this",
".",
"_targets",
"=",
"{",
"}",
";",
"this",
".",
"_targets",
"[",
"L",
".",
"stamp",
"(",
"this",
".",
"_container",
")",
"]",
"="... | DOM event handling @section Interaction events | [
"DOM",
"event",
"handling"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L3185-L3224 | |
15,011 | heigeo/leaflet.wms | lib/leaflet.js | function (center, zoom, bounds) {
if (!bounds) { return center; }
var centerPoint = this.project(center, zoom),
viewHalf = this.getSize().divideBy(2),
viewBounds = new L.Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),
offset = this._getBoundsOffset(viewBounds, bounds, z... | javascript | function (center, zoom, bounds) {
if (!bounds) { return center; }
var centerPoint = this.project(center, zoom),
viewHalf = this.getSize().divideBy(2),
viewBounds = new L.Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),
offset = this._getBoundsOffset(viewBounds, bounds, z... | [
"function",
"(",
"center",
",",
"zoom",
",",
"bounds",
")",
"{",
"if",
"(",
"!",
"bounds",
")",
"{",
"return",
"center",
";",
"}",
"var",
"centerPoint",
"=",
"this",
".",
"project",
"(",
"center",
",",
"zoom",
")",
",",
"viewHalf",
"=",
"this",
"."... | adjust center for view to get inside bounds | [
"adjust",
"center",
"for",
"view",
"to",
"get",
"inside",
"bounds"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L3397-L3414 | |
15,012 | heigeo/leaflet.wms | lib/leaflet.js | function (center) {
var map = this._map;
if (!map) { return; }
var zoom = map.getZoom();
if (center === undefined) { center = map.getCenter(); }
if (this._tileZoom === undefined) { return; } // if out of minzoom/maxzoom
var pixelBounds = this._getTiledPixelBounds(center),
tileRange = this._pxBoundsT... | javascript | function (center) {
var map = this._map;
if (!map) { return; }
var zoom = map.getZoom();
if (center === undefined) { center = map.getCenter(); }
if (this._tileZoom === undefined) { return; } // if out of minzoom/maxzoom
var pixelBounds = this._getTiledPixelBounds(center),
tileRange = this._pxBoundsT... | [
"function",
"(",
"center",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_map",
";",
"if",
"(",
"!",
"map",
")",
"{",
"return",
";",
"}",
"var",
"zoom",
"=",
"map",
".",
"getZoom",
"(",
")",
";",
"if",
"(",
"center",
"===",
"undefined",
")",
"{",
... | Private method to load tiles in the grid's active zoom level according to map bounds | [
"Private",
"method",
"to",
"load",
"tiles",
"in",
"the",
"grid",
"s",
"active",
"zoom",
"level",
"according",
"to",
"map",
"bounds"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L4388-L4455 | |
15,013 | heigeo/leaflet.wms | lib/leaflet.js | function (coords) {
var map = this._map,
tileSize = this.getTileSize(),
nwPoint = coords.scaleBy(tileSize),
sePoint = nwPoint.add(tileSize),
nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),
se = map.wrapLatLng(map.unproject(sePoint, coords.z));
return new L.LatLngBounds(nw, s... | javascript | function (coords) {
var map = this._map,
tileSize = this.getTileSize(),
nwPoint = coords.scaleBy(tileSize),
sePoint = nwPoint.add(tileSize),
nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),
se = map.wrapLatLng(map.unproject(sePoint, coords.z));
return new L.LatLngBounds(nw, s... | [
"function",
"(",
"coords",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_map",
",",
"tileSize",
"=",
"this",
".",
"getTileSize",
"(",
")",
",",
"nwPoint",
"=",
"coords",
".",
"scaleBy",
"(",
"tileSize",
")",
",",
"sePoint",
"=",
"nwPoint",
".",
"add",
... | converts tile coordinates to its geographical bounds | [
"converts",
"tile",
"coordinates",
"to",
"its",
"geographical",
"bounds"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L4479-L4491 | |
15,014 | heigeo/leaflet.wms | lib/leaflet.js | function (key) {
var k = key.split(':'),
coords = new L.Point(+k[0], +k[1]);
coords.z = +k[2];
return coords;
} | javascript | function (key) {
var k = key.split(':'),
coords = new L.Point(+k[0], +k[1]);
coords.z = +k[2];
return coords;
} | [
"function",
"(",
"key",
")",
"{",
"var",
"k",
"=",
"key",
".",
"split",
"(",
"':'",
")",
",",
"coords",
"=",
"new",
"L",
".",
"Point",
"(",
"+",
"k",
"[",
"0",
"]",
",",
"+",
"k",
"[",
"1",
"]",
")",
";",
"coords",
".",
"z",
"=",
"+",
"... | converts tile cache key to coordinates | [
"converts",
"tile",
"cache",
"key",
"to",
"coordinates"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L4499-L4504 | |
15,015 | heigeo/leaflet.wms | lib/leaflet.js | function (latlngs) {
var result = [],
flat = L.Polyline._flat(latlngs);
for (var i = 0, len = latlngs.length; i < len; i++) {
if (flat) {
result[i] = L.latLng(latlngs[i]);
this._bounds.extend(result[i]);
} else {
result[i] = this._convertLatLngs(latlngs[i]);
}
}
return result;
} | javascript | function (latlngs) {
var result = [],
flat = L.Polyline._flat(latlngs);
for (var i = 0, len = latlngs.length; i < len; i++) {
if (flat) {
result[i] = L.latLng(latlngs[i]);
this._bounds.extend(result[i]);
} else {
result[i] = this._convertLatLngs(latlngs[i]);
}
}
return result;
} | [
"function",
"(",
"latlngs",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"flat",
"=",
"L",
".",
"Polyline",
".",
"_flat",
"(",
"latlngs",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"latlngs",
".",
"length",
";",
"i",
"<",
... | recursively convert latlngs input into actual LatLng instances; calculate bounds along the way | [
"recursively",
"convert",
"latlngs",
"input",
"into",
"actual",
"LatLng",
"instances",
";",
"calculate",
"bounds",
"along",
"the",
"way"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L7924-L7938 | |
15,016 | heigeo/leaflet.wms | lib/leaflet.js | function (latlngs, result, projectedBounds) {
var flat = latlngs[0] instanceof L.LatLng,
len = latlngs.length,
i, ring;
if (flat) {
ring = [];
for (i = 0; i < len; i++) {
ring[i] = this._map.latLngToLayerPoint(latlngs[i]);
projectedBounds.extend(ring[i]);
}
result.push(ring);
} el... | javascript | function (latlngs, result, projectedBounds) {
var flat = latlngs[0] instanceof L.LatLng,
len = latlngs.length,
i, ring;
if (flat) {
ring = [];
for (i = 0; i < len; i++) {
ring[i] = this._map.latLngToLayerPoint(latlngs[i]);
projectedBounds.extend(ring[i]);
}
result.push(ring);
} el... | [
"function",
"(",
"latlngs",
",",
"result",
",",
"projectedBounds",
")",
"{",
"var",
"flat",
"=",
"latlngs",
"[",
"0",
"]",
"instanceof",
"L",
".",
"LatLng",
",",
"len",
"=",
"latlngs",
".",
"length",
",",
"i",
",",
"ring",
";",
"if",
"(",
"flat",
"... | recursively turns latlngs into a set of rings with projected coordinates | [
"recursively",
"turns",
"latlngs",
"into",
"a",
"set",
"of",
"rings",
"with",
"projected",
"coordinates"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L7956-L7973 | |
15,017 | heigeo/leaflet.wms | lib/leaflet.js | function () {
var bounds = this._renderer._bounds;
this._parts = [];
if (!this._pxBounds || !this._pxBounds.intersects(bounds)) {
return;
}
if (this.options.noClip) {
this._parts = this._rings;
return;
}
var parts = this._parts,
i, j, k, len, len2, segment, points;
for (i = 0, k = 0, ... | javascript | function () {
var bounds = this._renderer._bounds;
this._parts = [];
if (!this._pxBounds || !this._pxBounds.intersects(bounds)) {
return;
}
if (this.options.noClip) {
this._parts = this._rings;
return;
}
var parts = this._parts,
i, j, k, len, len2, segment, points;
for (i = 0, k = 0, ... | [
"function",
"(",
")",
"{",
"var",
"bounds",
"=",
"this",
".",
"_renderer",
".",
"_bounds",
";",
"this",
".",
"_parts",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"this",
".",
"_pxBounds",
"||",
"!",
"this",
".",
"_pxBounds",
".",
"intersects",
"(",
"bound... | clip polyline by renderer bounds so that we have less to render for performance | [
"clip",
"polyline",
"by",
"renderer",
"bounds",
"so",
"that",
"we",
"have",
"less",
"to",
"render",
"for",
"performance"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L7976-L8010 | |
15,018 | heigeo/leaflet.wms | lib/leaflet.js | function () {
var parts = this._parts,
tolerance = this.options.smoothFactor;
for (var i = 0, len = parts.length; i < len; i++) {
parts[i] = L.LineUtil.simplify(parts[i], tolerance);
}
} | javascript | function () {
var parts = this._parts,
tolerance = this.options.smoothFactor;
for (var i = 0, len = parts.length; i < len; i++) {
parts[i] = L.LineUtil.simplify(parts[i], tolerance);
}
} | [
"function",
"(",
")",
"{",
"var",
"parts",
"=",
"this",
".",
"_parts",
",",
"tolerance",
"=",
"this",
".",
"options",
".",
"smoothFactor",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"parts",
".",
"length",
";",
"i",
"<",
"len",
";",
... | simplify each clipped part of the polyline for performance | [
"simplify",
"each",
"clipped",
"part",
"of",
"the",
"polyline",
"for",
"performance"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L8013-L8020 | |
15,019 | heigeo/leaflet.wms | lib/leaflet.js | function (layer) {
var path = layer._path = L.SVG.create('path');
// @namespace Path
// @option className: String = null
// Custom class name set on an element. Only for SVG renderer.
if (layer.options.className) {
L.DomUtil.addClass(path, layer.options.className);
}
if (layer.options.interactive) {
... | javascript | function (layer) {
var path = layer._path = L.SVG.create('path');
// @namespace Path
// @option className: String = null
// Custom class name set on an element. Only for SVG renderer.
if (layer.options.className) {
L.DomUtil.addClass(path, layer.options.className);
}
if (layer.options.interactive) {
... | [
"function",
"(",
"layer",
")",
"{",
"var",
"path",
"=",
"layer",
".",
"_path",
"=",
"L",
".",
"SVG",
".",
"create",
"(",
"'path'",
")",
";",
"// @namespace Path",
"// @option className: String = null",
"// Custom class name set on an element. Only for SVG renderer.",
... | methods below are called by vector layers implementations | [
"methods",
"below",
"are",
"called",
"by",
"vector",
"layers",
"implementations"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L8605-L8620 | |
15,020 | heigeo/leaflet.wms | lib/leaflet.js | function (e, handler) {
var timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),
elapsed = L.DomEvent._lastClick && (timeStamp - L.DomEvent._lastClick);
// are they closer together than 500ms yet more than 100ms?
// Android typically triggers them ~300ms apart while multiple li... | javascript | function (e, handler) {
var timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),
elapsed = L.DomEvent._lastClick && (timeStamp - L.DomEvent._lastClick);
// are they closer together than 500ms yet more than 100ms?
// Android typically triggers them ~300ms apart while multiple li... | [
"function",
"(",
"e",
",",
"handler",
")",
"{",
"var",
"timeStamp",
"=",
"(",
"e",
".",
"timeStamp",
"||",
"(",
"e",
".",
"originalEvent",
"&&",
"e",
".",
"originalEvent",
".",
"timeStamp",
")",
")",
",",
"elapsed",
"=",
"L",
".",
"DomEvent",
".",
... | this is a horrible workaround for a bug in Android where a single touch triggers two click events | [
"this",
"is",
"a",
"horrible",
"workaround",
"for",
"a",
"bug",
"in",
"Android",
"where",
"a",
"single",
"touch",
"triggers",
"two",
"click",
"events"
] | 1f3542158b1743a681b375e3853cd147af742d91 | https://github.com/heigeo/leaflet.wms/blob/1f3542158b1743a681b375e3853cd147af742d91/lib/leaflet.js#L9960-L9976 | |
15,021 | keen/explorer | lib/js/app/utils/ExplorerUtils.js | function(config) {
config.client
.query(config.query.analysis_type, _.omit(config.query, 'analysis_type'))
.then(function(res, err){
if (err) {
config.error(err);
}
else {
config.success(res);
}
if (config.complete) config.complete(err, res);
... | javascript | function(config) {
config.client
.query(config.query.analysis_type, _.omit(config.query, 'analysis_type'))
.then(function(res, err){
if (err) {
config.error(err);
}
else {
config.success(res);
}
if (config.complete) config.complete(err, res);
... | [
"function",
"(",
"config",
")",
"{",
"config",
".",
"client",
".",
"query",
"(",
"config",
".",
"query",
".",
"analysis_type",
",",
"_",
".",
"omit",
"(",
"config",
".",
"query",
",",
"'analysis_type'",
")",
")",
".",
"then",
"(",
"function",
"(",
"r... | Execures a Keen.js query with the provided client and query params, calling the
callbacks after execution.
@param {Object} config The runQuery configuration
Expected structure:
{
client: {The Keen.js client},
query: {The object with the query parameters},
success: {Success callback function},
error: {Error cal... | [
"Execures",
"a",
"Keen",
".",
"js",
"query",
"with",
"the",
"provided",
"client",
"and",
"query",
"params",
"calling",
"the",
"callbacks",
"after",
"execution",
"."
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/utils/ExplorerUtils.js#L185-L198 | |
15,022 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _getDefaultFilterCoercionType | function _getDefaultFilterCoercionType(explorer, filter) {
var propertyType = ProjectUtils.getPropertyType(
ProjectStore.getProject(),
explorer.query.event_collection,
filter.property_name);
var targetCoercionType = FormatUtils.coercionTypeForPropertyType(propertyType);
return targetCoercionType;
} | javascript | function _getDefaultFilterCoercionType(explorer, filter) {
var propertyType = ProjectUtils.getPropertyType(
ProjectStore.getProject(),
explorer.query.event_collection,
filter.property_name);
var targetCoercionType = FormatUtils.coercionTypeForPropertyType(propertyType);
return targetCoercionType;
} | [
"function",
"_getDefaultFilterCoercionType",
"(",
"explorer",
",",
"filter",
")",
"{",
"var",
"propertyType",
"=",
"ProjectUtils",
".",
"getPropertyType",
"(",
"ProjectStore",
".",
"getProject",
"(",
")",
",",
"explorer",
".",
"query",
".",
"event_collection",
","... | Get the default coercion type for this filter based off the filter's property_name's set type
in the project schema.
@param {Object} explorer The explorer model that the filter belongs to
@param {Object} filter The filter
@return {String} The default coercion type | [
"Get",
"the",
"default",
"coercion",
"type",
"for",
"this",
"filter",
"based",
"off",
"the",
"filter",
"s",
"property_name",
"s",
"set",
"type",
"in",
"the",
"project",
"schema",
"."
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L121-L128 |
15,023 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _prepareUpdates | function _prepareUpdates(explorer, updates) {
// TODO: We're assigning the response object directly onto the model so we
// don't have to loop through the (sometimes) massive response object.
function customizer(objValue, srcValue, key) {
if (_.isArray(objValue)) {
return srcValue;
} else if (key ==... | javascript | function _prepareUpdates(explorer, updates) {
// TODO: We're assigning the response object directly onto the model so we
// don't have to loop through the (sometimes) massive response object.
function customizer(objValue, srcValue, key) {
if (_.isArray(objValue)) {
return srcValue;
} else if (key ==... | [
"function",
"_prepareUpdates",
"(",
"explorer",
",",
"updates",
")",
"{",
"// TODO: We're assigning the response object directly onto the model so we",
"// don't have to loop through the (sometimes) massive response object.",
"function",
"customizer",
"(",
"objValue",
",",
"srcValue",
... | Runs through the changeset and moves data around if necessary
@param {Object} explorer The explorer model that is being updated
@param {Object} updates The updated explorer model
@return {Object} The new set of updates | [
"Runs",
"through",
"the",
"changeset",
"and",
"moves",
"data",
"around",
"if",
"necessary"
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L136-L162 |
15,024 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _migrateToFunnel | function _migrateToFunnel(explorer, newModel) {
var firstStep = _defaultStep();
firstStep.active = true;
_.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
if(!_.isUndefined(explorer.query[key]) && !_.isNull(explorer.query[key])) {
firstStep[key] = explorer.query[key]
}
newModel.query[key]... | javascript | function _migrateToFunnel(explorer, newModel) {
var firstStep = _defaultStep();
firstStep.active = true;
_.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
if(!_.isUndefined(explorer.query[key]) && !_.isNull(explorer.query[key])) {
firstStep[key] = explorer.query[key]
}
newModel.query[key]... | [
"function",
"_migrateToFunnel",
"(",
"explorer",
",",
"newModel",
")",
"{",
"var",
"firstStep",
"=",
"_defaultStep",
"(",
")",
";",
"firstStep",
".",
"active",
"=",
"true",
";",
"_",
".",
"each",
"(",
"SHARED_FUNNEL_STEP_PROPERTIES",
",",
"function",
"(",
"k... | If the query got changed to a funnel, move the step-specific parameters to a steps object.
@param {Object} explorer The explorer model that is being updated
@param {Object} newModel The updated explorer model
@return {Object} The new set of updates | [
"If",
"the",
"query",
"got",
"changed",
"to",
"a",
"funnel",
"move",
"the",
"step",
"-",
"specific",
"parameters",
"to",
"a",
"steps",
"object",
"."
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L170-L190 |
15,025 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _migrateFromFunnel | function _migrateFromFunnel(explorer, newModel) {
if (explorer.query.steps.length < 1) return newModel;
var activeStep = _.find(explorer.query.steps, { active: true }) || explorer.query.steps[0];
_.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
if (!_.isUndefined(activeStep[key])) {
newModel.quer... | javascript | function _migrateFromFunnel(explorer, newModel) {
if (explorer.query.steps.length < 1) return newModel;
var activeStep = _.find(explorer.query.steps, { active: true }) || explorer.query.steps[0];
_.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
if (!_.isUndefined(activeStep[key])) {
newModel.quer... | [
"function",
"_migrateFromFunnel",
"(",
"explorer",
",",
"newModel",
")",
"{",
"if",
"(",
"explorer",
".",
"query",
".",
"steps",
".",
"length",
"<",
"1",
")",
"return",
"newModel",
";",
"var",
"activeStep",
"=",
"_",
".",
"find",
"(",
"explorer",
".",
... | If the query got changed from a funnel, move the applicable parameters out to the root query
@param {Object} explorer The explorer model that is being updated
@param {Object} newModel The updated explorer model
@return {Object} The new set of updates | [
"If",
"the",
"query",
"got",
"changed",
"from",
"a",
"funnel",
"move",
"the",
"applicable",
"parameters",
"out",
"to",
"the",
"root",
"query"
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L198-L215 |
15,026 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _removeInvalidFields | function _removeInvalidFields(newModel) {
if (!ExplorerUtils.isEmailExtraction(newModel)) {
newModel.query.latest = null;
newModel.query.email = null;
}
if (newModel.query.analysis_type === 'extraction') {
newModel.query.group_by = null;
newModel.query.order_by = null;
newModel.query.limit = n... | javascript | function _removeInvalidFields(newModel) {
if (!ExplorerUtils.isEmailExtraction(newModel)) {
newModel.query.latest = null;
newModel.query.email = null;
}
if (newModel.query.analysis_type === 'extraction') {
newModel.query.group_by = null;
newModel.query.order_by = null;
newModel.query.limit = n... | [
"function",
"_removeInvalidFields",
"(",
"newModel",
")",
"{",
"if",
"(",
"!",
"ExplorerUtils",
".",
"isEmailExtraction",
"(",
"newModel",
")",
")",
"{",
"newModel",
".",
"query",
".",
"latest",
"=",
"null",
";",
"newModel",
".",
"query",
".",
"email",
"="... | Removes fields from the query that aren't valid given the new analysis type.
@param {Object} newModel The updated explorer model
@return {Object} The new set of updates | [
"Removes",
"fields",
"from",
"the",
"query",
"that",
"aren",
"t",
"valid",
"given",
"the",
"new",
"analysis",
"type",
"."
] | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L222-L256 |
15,027 | keen/explorer | lib/js/app/stores/ExplorerStore.js | _prepareFilterUpdates | function _prepareFilterUpdates(explorer, filter, updates) {
if (updates.property_name && updates.property_name !== filter.property_name) {
if (filter.operator === 'exists') {
updates.coercion_type = 'Boolean';
} else {
// No need to update the operator - we allow any operator for any property type... | javascript | function _prepareFilterUpdates(explorer, filter, updates) {
if (updates.property_name && updates.property_name !== filter.property_name) {
if (filter.operator === 'exists') {
updates.coercion_type = 'Boolean';
} else {
// No need to update the operator - we allow any operator for any property type... | [
"function",
"_prepareFilterUpdates",
"(",
"explorer",
",",
"filter",
",",
"updates",
")",
"{",
"if",
"(",
"updates",
".",
"property_name",
"&&",
"updates",
".",
"property_name",
"!==",
"filter",
".",
"property_name",
")",
"{",
"if",
"(",
"filter",
".",
"oper... | Looks at updates about to be made to a filter and performs a series of operations to
change the filter values depending on the coercion_type, operator and type of property_value.
@param {Object} explorer The explorer model that owns the filter to be updated
@param {Object} filter The filter to be updated
@param ... | [
"Looks",
"at",
"updates",
"about",
"to",
"be",
"made",
"to",
"a",
"filter",
"and",
"performs",
"a",
"series",
"of",
"operations",
"to",
"change",
"the",
"filter",
"values",
"depending",
"on",
"the",
"coercion_type",
"operator",
"and",
"type",
"of",
"property... | 910765df704dfd38ef053a15a18a1e5fa3b6289e | https://github.com/keen/explorer/blob/910765df704dfd38ef053a15a18a1e5fa3b6289e/lib/js/app/stores/ExplorerStore.js#L266-L297 |
15,028 | ember-fastboot/ember-cli-fastboot | lib/build-utilities/migrate-initializers.js | _migrateAddonInitializers | function _migrateAddonInitializers(project) {
project.addons.forEach(addon => {
const currentAddonPath = addon.root;
_checkBrowserInitializers(currentAddonPath);
_moveFastBootInitializers(project, currentAddonPath);
});
} | javascript | function _migrateAddonInitializers(project) {
project.addons.forEach(addon => {
const currentAddonPath = addon.root;
_checkBrowserInitializers(currentAddonPath);
_moveFastBootInitializers(project, currentAddonPath);
});
} | [
"function",
"_migrateAddonInitializers",
"(",
"project",
")",
"{",
"project",
".",
"addons",
".",
"forEach",
"(",
"addon",
"=>",
"{",
"const",
"currentAddonPath",
"=",
"addon",
".",
"root",
";",
"_checkBrowserInitializers",
"(",
"currentAddonPath",
")",
";",
"_m... | Function that migrates the fastboot initializers for all addons.
@param {Object} project | [
"Function",
"that",
"migrates",
"the",
"fastboot",
"initializers",
"for",
"all",
"addons",
"."
] | 9a8856b08ffbd32443a69b3de1077a53a0a931e3 | https://github.com/ember-fastboot/ember-cli-fastboot/blob/9a8856b08ffbd32443a69b3de1077a53a0a931e3/lib/build-utilities/migrate-initializers.js#L91-L98 |
15,029 | ember-fastboot/ember-cli-fastboot | lib/build-utilities/migrate-initializers.js | _migrateHostAppInitializers | function _migrateHostAppInitializers(project) {
const hostAppPath = path.join(project.root);
_checkBrowserInitializers(hostAppPath);
_moveFastBootInitializers(project, hostAppPath);
} | javascript | function _migrateHostAppInitializers(project) {
const hostAppPath = path.join(project.root);
_checkBrowserInitializers(hostAppPath);
_moveFastBootInitializers(project, hostAppPath);
} | [
"function",
"_migrateHostAppInitializers",
"(",
"project",
")",
"{",
"const",
"hostAppPath",
"=",
"path",
".",
"join",
"(",
"project",
".",
"root",
")",
";",
"_checkBrowserInitializers",
"(",
"hostAppPath",
")",
";",
"_moveFastBootInitializers",
"(",
"project",
",... | Function to migrate fastboot initializers for host app.
@param {Object} project | [
"Function",
"to",
"migrate",
"fastboot",
"initializers",
"for",
"host",
"app",
"."
] | 9a8856b08ffbd32443a69b3de1077a53a0a931e3 | https://github.com/ember-fastboot/ember-cli-fastboot/blob/9a8856b08ffbd32443a69b3de1077a53a0a931e3/lib/build-utilities/migrate-initializers.js#L105-L110 |
15,030 | angular-wizard/angular-wizard | dist/angular-wizard.js | function() {
var editMode = $scope.editMode;
if (angular.isUndefined(editMode) || (editMode === null)) return;
//Set completed for all steps to the value of editMode
angular.forEach($scope.steps, function (step) {
step.completed = edit... | javascript | function() {
var editMode = $scope.editMode;
if (angular.isUndefined(editMode) || (editMode === null)) return;
//Set completed for all steps to the value of editMode
angular.forEach($scope.steps, function (step) {
step.completed = edit... | [
"function",
"(",
")",
"{",
"var",
"editMode",
"=",
"$scope",
".",
"editMode",
";",
"if",
"(",
"angular",
".",
"isUndefined",
"(",
"editMode",
")",
"||",
"(",
"editMode",
"===",
"null",
")",
")",
"return",
";",
"//Set completed for all steps to the value of edi... | update completed state for each step based on the editMode and current step number | [
"update",
"completed",
"state",
"for",
"each",
"step",
"based",
"on",
"the",
"editMode",
"and",
"current",
"step",
"number"
] | 9823e1f67d1fc60c88125f41dfc3fc5ab62e505c | https://github.com/angular-wizard/angular-wizard/blob/9823e1f67d1fc60c88125f41dfc3fc5ab62e505c/dist/angular-wizard.js#L126-L144 | |
15,031 | angular-wizard/angular-wizard | dist/angular-wizard.js | unselectAll | function unselectAll() {
//traverse steps array and set each "selected" property to false
angular.forEach($scope.getEnabledSteps(), function (step) {
step.selected = false;
});
//set selectedStep variable to null
$scope.... | javascript | function unselectAll() {
//traverse steps array and set each "selected" property to false
angular.forEach($scope.getEnabledSteps(), function (step) {
step.selected = false;
});
//set selectedStep variable to null
$scope.... | [
"function",
"unselectAll",
"(",
")",
"{",
"//traverse steps array and set each \"selected\" property to false",
"angular",
".",
"forEach",
"(",
"$scope",
".",
"getEnabledSteps",
"(",
")",
",",
"function",
"(",
"step",
")",
"{",
"step",
".",
"selected",
"=",
"false",... | unSelect All Steps | [
"unSelect",
"All",
"Steps"
] | 9823e1f67d1fc60c88125f41dfc3fc5ab62e505c | https://github.com/angular-wizard/angular-wizard/blob/9823e1f67d1fc60c88125f41dfc3fc5ab62e505c/dist/angular-wizard.js#L314-L321 |
15,032 | IHCantabria/Leaflet.CanvasLayer.Field | src/layer/L.CanvasLayer.ScalarField.js | function() {
const bounds = this._pixelBounds();
const pixelSize = (bounds.max.x - bounds.min.x) / this._field.nCols;
var stride = Math.max(
1,
Math.floor(1.2 * this.options.vectorSize / pixelSize)
);
const ctx = this._getDrawingContext();
ctx.st... | javascript | function() {
const bounds = this._pixelBounds();
const pixelSize = (bounds.max.x - bounds.min.x) / this._field.nCols;
var stride = Math.max(
1,
Math.floor(1.2 * this.options.vectorSize / pixelSize)
);
const ctx = this._getDrawingContext();
ctx.st... | [
"function",
"(",
")",
"{",
"const",
"bounds",
"=",
"this",
".",
"_pixelBounds",
"(",
")",
";",
"const",
"pixelSize",
"=",
"(",
"bounds",
".",
"max",
".",
"x",
"-",
"bounds",
".",
"min",
".",
"x",
")",
"/",
"this",
".",
"_field",
".",
"nCols",
";"... | Draws the field as a set of arrows. Direction from 0 to 360 is assumed. | [
"Draws",
"the",
"field",
"as",
"a",
"set",
"of",
"arrows",
".",
"Direction",
"from",
"0",
"to",
"360",
"is",
"assumed",
"."
] | 7c861b246d619ba6e04d8c8486a9bf7f57be7a09 | https://github.com/IHCantabria/Leaflet.CanvasLayer.Field/blob/7c861b246d619ba6e04d8c8486a9bf7f57be7a09/src/layer/L.CanvasLayer.ScalarField.js#L120-L150 | |
15,033 | IHCantabria/Leaflet.CanvasLayer.Field | src/layer/L.CanvasLayer.VectorFieldAnim.js | _drawParticles | function _drawParticles() {
// Previous paths...
let prev = ctx.globalCompositeOperation;
ctx.globalCompositeOperation = 'destination-in';
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
//ctx.globalCompositeOperation = 'source-over';
ctx.... | javascript | function _drawParticles() {
// Previous paths...
let prev = ctx.globalCompositeOperation;
ctx.globalCompositeOperation = 'destination-in';
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
//ctx.globalCompositeOperation = 'source-over';
ctx.... | [
"function",
"_drawParticles",
"(",
")",
"{",
"// Previous paths...",
"let",
"prev",
"=",
"ctx",
".",
"globalCompositeOperation",
";",
"ctx",
".",
"globalCompositeOperation",
"=",
"'destination-in'",
";",
"ctx",
".",
"fillRect",
"(",
"0",
",",
"0",
",",
"ctx",
... | Draws the paths on each step | [
"Draws",
"the",
"paths",
"on",
"each",
"step"
] | 7c861b246d619ba6e04d8c8486a9bf7f57be7a09 | https://github.com/IHCantabria/Leaflet.CanvasLayer.Field/blob/7c861b246d619ba6e04d8c8486a9bf7f57be7a09/src/layer/L.CanvasLayer.VectorFieldAnim.js#L94-L111 |
15,034 | senchalabs/cssbeautify | assets/thirdparty/codemirror.js | updateLines | function updateLines(from, to, newText, selFrom, selTo) {
if (suppressEdits) return;
var old = [];
doc.iter(from.line, to.line + 1, function(line) {
old.push(newHL(line.text, line.markedSpans));
});
if (history) {
history.addChange(from.line, newText.length, old);
w... | javascript | function updateLines(from, to, newText, selFrom, selTo) {
if (suppressEdits) return;
var old = [];
doc.iter(from.line, to.line + 1, function(line) {
old.push(newHL(line.text, line.markedSpans));
});
if (history) {
history.addChange(from.line, newText.length, old);
w... | [
"function",
"updateLines",
"(",
"from",
",",
"to",
",",
"newText",
",",
"selFrom",
",",
"selTo",
")",
"{",
"if",
"(",
"suppressEdits",
")",
"return",
";",
"var",
"old",
"=",
"[",
"]",
";",
"doc",
".",
"iter",
"(",
"from",
".",
"line",
",",
"to",
... | Replace the range from from to to by the strings in newText. Afterwards, set the selection to selFrom, selTo. | [
"Replace",
"the",
"range",
"from",
"from",
"to",
"to",
"by",
"the",
"strings",
"in",
"newText",
".",
"Afterwards",
"set",
"the",
"selection",
"to",
"selFrom",
"selTo",
"."
] | 4a1f5d8aff8886c6790655acbccd9b478f8fee32 | https://github.com/senchalabs/cssbeautify/blob/4a1f5d8aff8886c6790655acbccd9b478f8fee32/assets/thirdparty/codemirror.js#L717-L729 |
15,035 | senchalabs/cssbeautify | assets/thirdparty/codemirror.js | setSelection | function setSelection(from, to, oldFrom, oldTo) {
goalColumn = null;
if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}
if (posEq(sel.from, from) && posEq(sel.to, to)) return;
if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
// Skip over hidden lines.
... | javascript | function setSelection(from, to, oldFrom, oldTo) {
goalColumn = null;
if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}
if (posEq(sel.from, from) && posEq(sel.to, to)) return;
if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
// Skip over hidden lines.
... | [
"function",
"setSelection",
"(",
"from",
",",
"to",
",",
"oldFrom",
",",
"oldTo",
")",
"{",
"goalColumn",
"=",
"null",
";",
"if",
"(",
"oldFrom",
"==",
"null",
")",
"{",
"oldFrom",
"=",
"sel",
".",
"from",
".",
"line",
";",
"oldTo",
"=",
"sel",
"."... | Update the selection. Last two args are only used by updateLines, since they have to be expressed in the line numbers before the update. | [
"Update",
"the",
"selection",
".",
"Last",
"two",
"args",
"are",
"only",
"used",
"by",
"updateLines",
"since",
"they",
"have",
"to",
"be",
"expressed",
"in",
"the",
"line",
"numbers",
"before",
"the",
"update",
"."
] | 4a1f5d8aff8886c6790655acbccd9b478f8fee32 | https://github.com/senchalabs/cssbeautify/blob/4a1f5d8aff8886c6790655acbccd9b478f8fee32/assets/thirdparty/codemirror.js#L1288-L1323 |
15,036 | senchalabs/cssbeautify | assets/thirdparty/codemirror.js | restartBlink | function restartBlink() {
clearInterval(blinker);
var on = true;
cursor.style.visibility = "";
blinker = setInterval(function() {
cursor.style.visibility = (on = !on) ? "" : "hidden";
}, options.cursorBlinkRate);
} | javascript | function restartBlink() {
clearInterval(blinker);
var on = true;
cursor.style.visibility = "";
blinker = setInterval(function() {
cursor.style.visibility = (on = !on) ? "" : "hidden";
}, options.cursorBlinkRate);
} | [
"function",
"restartBlink",
"(",
")",
"{",
"clearInterval",
"(",
"blinker",
")",
";",
"var",
"on",
"=",
"true",
";",
"cursor",
".",
"style",
".",
"visibility",
"=",
"\"\"",
";",
"blinker",
"=",
"setInterval",
"(",
"function",
"(",
")",
"{",
"cursor",
"... | Cursor-blinking | [
"Cursor",
"-",
"blinking"
] | 4a1f5d8aff8886c6790655acbccd9b478f8fee32 | https://github.com/senchalabs/cssbeautify/blob/4a1f5d8aff8886c6790655acbccd9b478f8fee32/assets/thirdparty/codemirror.js#L1812-L1819 |
15,037 | senchalabs/cssbeautify | assets/thirdparty/codemirror.js | connect | function connect(node, type, handler, disconnect) {
if (typeof node.addEventListener == "function") {
node.addEventListener(type, handler, false);
if (disconnect) return function() {node.removeEventListener(type, handler, false);};
} else {
var wrapHandler = function(event) {handler(event || w... | javascript | function connect(node, type, handler, disconnect) {
if (typeof node.addEventListener == "function") {
node.addEventListener(type, handler, false);
if (disconnect) return function() {node.removeEventListener(type, handler, false);};
} else {
var wrapHandler = function(event) {handler(event || w... | [
"function",
"connect",
"(",
"node",
",",
"type",
",",
"handler",
",",
"disconnect",
")",
"{",
"if",
"(",
"typeof",
"node",
".",
"addEventListener",
"==",
"\"function\"",
")",
"{",
"node",
".",
"addEventListener",
"(",
"type",
",",
"handler",
",",
"false",
... | Event handler registration. If disconnect is true, it'll return a function that unregisters the handler. | [
"Event",
"handler",
"registration",
".",
"If",
"disconnect",
"is",
"true",
"it",
"ll",
"return",
"a",
"function",
"that",
"unregisters",
"the",
"handler",
"."
] | 4a1f5d8aff8886c6790655acbccd9b478f8fee32 | https://github.com/senchalabs/cssbeautify/blob/4a1f5d8aff8886c6790655acbccd9b478f8fee32/assets/thirdparty/codemirror.js#L2942-L2951 |
15,038 | ember-cli/ember-fetch | fastboot/instance-initializers/setup-fetch.js | patchFetchForRelativeURLs | function patchFetchForRelativeURLs(instance) {
const fastboot = instance.lookup('service:fastboot');
const request = fastboot.get('request');
// Prember is not sending protocol
const protocol = request.protocol === 'undefined:' ? 'http:' : request.protocol;
// host is cp
setupFastboot(protocol, request.get(... | javascript | function patchFetchForRelativeURLs(instance) {
const fastboot = instance.lookup('service:fastboot');
const request = fastboot.get('request');
// Prember is not sending protocol
const protocol = request.protocol === 'undefined:' ? 'http:' : request.protocol;
// host is cp
setupFastboot(protocol, request.get(... | [
"function",
"patchFetchForRelativeURLs",
"(",
"instance",
")",
"{",
"const",
"fastboot",
"=",
"instance",
".",
"lookup",
"(",
"'service:fastboot'",
")",
";",
"const",
"request",
"=",
"fastboot",
".",
"get",
"(",
"'request'",
")",
";",
"// Prember is not sending pr... | To allow relative URLs for Fastboot mode, we need the per request information
from the fastboot service. Then we set the protocol and host to fetch module. | [
"To",
"allow",
"relative",
"URLs",
"for",
"Fastboot",
"mode",
"we",
"need",
"the",
"per",
"request",
"information",
"from",
"the",
"fastboot",
"service",
".",
"Then",
"we",
"set",
"the",
"protocol",
"and",
"host",
"to",
"fetch",
"module",
"."
] | 5e3dee2d1fcd41f113b392a33d97d19691805f61 | https://github.com/ember-cli/ember-fetch/blob/5e3dee2d1fcd41f113b392a33d97d19691805f61/fastboot/instance-initializers/setup-fetch.js#L7-L14 |
15,039 | SAP/node-hdb | lib/protocol/Connection.js | ondata | function ondata(chunk) {
packet.push(chunk);
if (packet.isReady()) {
if (self._state.sessionId !== packet.header.sessionId) {
self._state.sessionId = packet.header.sessionId;
self._state.packetCount = -1;
}
var buffer = packet.getData();
packet.clear();
var cb = sel... | javascript | function ondata(chunk) {
packet.push(chunk);
if (packet.isReady()) {
if (self._state.sessionId !== packet.header.sessionId) {
self._state.sessionId = packet.header.sessionId;
self._state.packetCount = -1;
}
var buffer = packet.getData();
packet.clear();
var cb = sel... | [
"function",
"ondata",
"(",
"chunk",
")",
"{",
"packet",
".",
"push",
"(",
"chunk",
")",
";",
"if",
"(",
"packet",
".",
"isReady",
"(",
")",
")",
"{",
"if",
"(",
"self",
".",
"_state",
".",
"sessionId",
"!==",
"packet",
".",
"header",
".",
"sessionI... | register listerners on socket | [
"register",
"listerners",
"on",
"socket"
] | 807fe50e02e5a8bc6a146f250369436634f6d57f | https://github.com/SAP/node-hdb/blob/807fe50e02e5a8bc6a146f250369436634f6d57f/lib/protocol/Connection.js#L211-L225 |
15,040 | wikimedia/parsoid | lib/wt2html/DOMPostProcessor.js | appendToHead | function appendToHead(document, tagName, attrs) {
var elt = document.createElement(tagName);
DOMDataUtils.addAttributes(elt, attrs || Object.create(null));
document.head.appendChild(elt);
} | javascript | function appendToHead(document, tagName, attrs) {
var elt = document.createElement(tagName);
DOMDataUtils.addAttributes(elt, attrs || Object.create(null));
document.head.appendChild(elt);
} | [
"function",
"appendToHead",
"(",
"document",
",",
"tagName",
",",
"attrs",
")",
"{",
"var",
"elt",
"=",
"document",
".",
"createElement",
"(",
"tagName",
")",
";",
"DOMDataUtils",
".",
"addAttributes",
"(",
"elt",
",",
"attrs",
"||",
"Object",
".",
"create... | Create an element in the document.head with the given attrs. | [
"Create",
"an",
"element",
"in",
"the",
"document",
".",
"head",
"with",
"the",
"given",
"attrs",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/wt2html/DOMPostProcessor.js#L437-L441 |
15,041 | wikimedia/parsoid | lib/utils/DOMPostOrder.js | DOMPostOrder | function DOMPostOrder(root, visitFunc) {
let node = root;
while (true) {
// Find leftmost (grand)child, and visit that first.
while (node.firstChild) {
node = node.firstChild;
}
visitFunc(node);
while (true) {
if (node === root) {
return; // Visiting the root is the last thing we do.
}
/* Lo... | javascript | function DOMPostOrder(root, visitFunc) {
let node = root;
while (true) {
// Find leftmost (grand)child, and visit that first.
while (node.firstChild) {
node = node.firstChild;
}
visitFunc(node);
while (true) {
if (node === root) {
return; // Visiting the root is the last thing we do.
}
/* Lo... | [
"function",
"DOMPostOrder",
"(",
"root",
",",
"visitFunc",
")",
"{",
"let",
"node",
"=",
"root",
";",
"while",
"(",
"true",
")",
"{",
"// Find leftmost (grand)child, and visit that first.",
"while",
"(",
"node",
".",
"firstChild",
")",
"{",
"node",
"=",
"node"... | Non-recursive post-order traversal of a DOM tree.
@param {Node} root
@param {Function} visitFunc Called in post-order on each node. | [
"Non",
"-",
"recursive",
"post",
"-",
"order",
"traversal",
"of",
"a",
"DOM",
"tree",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/utils/DOMPostOrder.js#L13-L36 |
15,042 | wikimedia/parsoid | lib/wt2html/tt/ParserFunctions.js | buildAsyncOutputBufferCB | function buildAsyncOutputBufferCB(cb) {
function AsyncOutputBufferCB(cb2) {
this.accum = [];
this.targetCB = cb2;
}
AsyncOutputBufferCB.prototype.processAsyncOutput = function(res) {
// * Ignore switch-to-async mode calls since
// we are actually collapsing async calls.
// * Accumulate async call result... | javascript | function buildAsyncOutputBufferCB(cb) {
function AsyncOutputBufferCB(cb2) {
this.accum = [];
this.targetCB = cb2;
}
AsyncOutputBufferCB.prototype.processAsyncOutput = function(res) {
// * Ignore switch-to-async mode calls since
// we are actually collapsing async calls.
// * Accumulate async call result... | [
"function",
"buildAsyncOutputBufferCB",
"(",
"cb",
")",
"{",
"function",
"AsyncOutputBufferCB",
"(",
"cb2",
")",
"{",
"this",
".",
"accum",
"=",
"[",
"]",
";",
"this",
".",
"targetCB",
"=",
"cb2",
";",
"}",
"AsyncOutputBufferCB",
".",
"prototype",
".",
"pr... | 'cb' can only be called once after "everything" is done. But, we need something that can be used in async context where it is called repeatedly till we are done. Primarily needed in the context of async.map calls that requires a 1-shot callback. Use with caution! If the async stream that we are accumulating into the... | [
"cb",
"can",
"only",
"be",
"called",
"once",
"after",
"everything",
"is",
"done",
".",
"But",
"we",
"need",
"something",
"that",
"can",
"be",
"used",
"in",
"async",
"context",
"where",
"it",
"is",
"called",
"repeatedly",
"till",
"we",
"are",
"done",
".",... | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/wt2html/tt/ParserFunctions.js#L49-L98 |
15,043 | wikimedia/parsoid | lib/api/routes.js | function(res, text, httpStatus) {
processLogger.log('fatal/request', text);
apiUtils.errorResponse(res, text, httpStatus || 404);
} | javascript | function(res, text, httpStatus) {
processLogger.log('fatal/request', text);
apiUtils.errorResponse(res, text, httpStatus || 404);
} | [
"function",
"(",
"res",
",",
"text",
",",
"httpStatus",
")",
"{",
"processLogger",
".",
"log",
"(",
"'fatal/request'",
",",
"text",
")",
";",
"apiUtils",
".",
"errorResponse",
"(",
"res",
",",
"text",
",",
"httpStatus",
"||",
"404",
")",
";",
"}"
] | This helper is only to be used in middleware, before an environment is setup. The logger doesn't emit the expected location info. You probably want `apiUtils.fatalRequest` instead. | [
"This",
"helper",
"is",
"only",
"to",
"be",
"used",
"in",
"middleware",
"before",
"an",
"environment",
"is",
"setup",
".",
"The",
"logger",
"doesn",
"t",
"emit",
"the",
"expected",
"location",
"info",
".",
"You",
"probably",
"want",
"apiUtils",
".",
"fatal... | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/api/routes.js#L37-L40 | |
15,044 | wikimedia/parsoid | lib/api/apiUtils.js | function(doc, pb) {
// Effectively, skip applying data-parsoid. Note that if we were to
// support a pb2html downgrade, we'd need to apply the full thing,
// but that would create complications where ids would be left behind.
// See the comment in around `DOMDataUtils.applyPageBundle`
DOMDataUtils.applyPageBundle... | javascript | function(doc, pb) {
// Effectively, skip applying data-parsoid. Note that if we were to
// support a pb2html downgrade, we'd need to apply the full thing,
// but that would create complications where ids would be left behind.
// See the comment in around `DOMDataUtils.applyPageBundle`
DOMDataUtils.applyPageBundle... | [
"function",
"(",
"doc",
",",
"pb",
")",
"{",
"// Effectively, skip applying data-parsoid. Note that if we were to",
"// support a pb2html downgrade, we'd need to apply the full thing,",
"// but that would create complications where ids would be left behind.",
"// See the comment in around `DOMD... | Downgrade content from 999.x to 2.x.
@param {Document} doc
@param {Object} pb | [
"Downgrade",
"content",
"from",
"999",
".",
"x",
"to",
"2",
".",
"x",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/api/apiUtils.js#L490-L501 | |
15,045 | wikimedia/parsoid | lib/wt2html/tt/Sanitizer.js | function(codepoint) {
// U+000C is valid in HTML5 but not allowed in XML.
// U+000D is valid in XML but not allowed in HTML5.
// U+007F - U+009F are disallowed in HTML5 (control characters).
return codepoint === 0x09
|| codepoint === 0x0a
|| (codepoint >= 0x20 && codepoint <= 0x7e)
|| (codepoint >= 0xa... | javascript | function(codepoint) {
// U+000C is valid in HTML5 but not allowed in XML.
// U+000D is valid in XML but not allowed in HTML5.
// U+007F - U+009F are disallowed in HTML5 (control characters).
return codepoint === 0x09
|| codepoint === 0x0a
|| (codepoint >= 0x20 && codepoint <= 0x7e)
|| (codepoint >= 0xa... | [
"function",
"(",
"codepoint",
")",
"{",
"// U+000C is valid in HTML5 but not allowed in XML.",
"// U+000D is valid in XML but not allowed in HTML5.",
"// U+007F - U+009F are disallowed in HTML5 (control characters).",
"return",
"codepoint",
"===",
"0x09",
"||",
"codepoint",
"===",
"0x0... | Returns true if a given Unicode codepoint is a valid character in
both HTML5 and XML. | [
"Returns",
"true",
"if",
"a",
"given",
"Unicode",
"codepoint",
"is",
"a",
"valid",
"character",
"in",
"both",
"HTML5",
"and",
"XML",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/wt2html/tt/Sanitizer.js#L28-L38 | |
15,046 | wikimedia/parsoid | lib/mw/Batcher.js | Batcher | function Batcher(env) {
this.env = env;
this.itemCallbacks = {};
this.currentBatch = [];
this.pendingBatches = [];
this.resultCache = {};
this.numOutstanding = 0;
this.forwardProgressTimer = null;
this.maxBatchSize = env.conf.parsoid.batchSize;
this.targetConcurrency = env.conf.parsoid.batchConcurrency;
// Ma... | javascript | function Batcher(env) {
this.env = env;
this.itemCallbacks = {};
this.currentBatch = [];
this.pendingBatches = [];
this.resultCache = {};
this.numOutstanding = 0;
this.forwardProgressTimer = null;
this.maxBatchSize = env.conf.parsoid.batchSize;
this.targetConcurrency = env.conf.parsoid.batchConcurrency;
// Ma... | [
"function",
"Batcher",
"(",
"env",
")",
"{",
"this",
".",
"env",
"=",
"env",
";",
"this",
".",
"itemCallbacks",
"=",
"{",
"}",
";",
"this",
".",
"currentBatch",
"=",
"[",
"]",
";",
"this",
".",
"pendingBatches",
"=",
"[",
"]",
";",
"this",
".",
"... | This class combines requests into batches for dispatch to the
ParsoidBatchAPI extension, and calls the item callbacks when the batch
result is returned. It handles scheduling and concurrency of batch requests.
It also has a legacy mode which sends requests to the MW core API.
@class
@param {MWParserEnvironment} env | [
"This",
"class",
"combines",
"requests",
"into",
"batches",
"for",
"dispatch",
"to",
"the",
"ParsoidBatchAPI",
"extension",
"and",
"calls",
"the",
"item",
"callbacks",
"when",
"the",
"batch",
"result",
"is",
"returned",
".",
"It",
"handles",
"scheduling",
"and",... | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/Batcher.js#L20-L33 |
15,047 | wikimedia/parsoid | bin/inspectTokenizer.js | function(node) {
if (node.code) {
// remove trailing whitespace for single-line predicates
var code = node.code.replace(/[ \t]+$/, '');
// wrap with a function, to prevent spurious errors caused
// by redeclarations or multiple returns in a block.
rulesSource += tab + '(function() {\n' + code + '\n' +
... | javascript | function(node) {
if (node.code) {
// remove trailing whitespace for single-line predicates
var code = node.code.replace(/[ \t]+$/, '');
// wrap with a function, to prevent spurious errors caused
// by redeclarations or multiple returns in a block.
rulesSource += tab + '(function() {\n' + code + '\n' +
... | [
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"code",
")",
"{",
"// remove trailing whitespace for single-line predicates",
"var",
"code",
"=",
"node",
".",
"code",
".",
"replace",
"(",
"/",
"[ \\t]+$",
"/",
",",
"''",
")",
";",
"// wrap with a ... | Collect all the code blocks in the AST. | [
"Collect",
"all",
"the",
"code",
"blocks",
"in",
"the",
"AST",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/bin/inspectTokenizer.js#L101-L110 | |
15,048 | wikimedia/parsoid | lib/wt2html/parser.js | function(options) {
if (!options) { options = {}; }
Object.keys(options).forEach(function(k) {
console.assert(supportedOptions.has(k), 'Invalid cacheKey option: ' + k);
});
// default: not an include context
if (options.isInclude === undefined) {
options.isInclude = false;
}
// default: wrap templates
if... | javascript | function(options) {
if (!options) { options = {}; }
Object.keys(options).forEach(function(k) {
console.assert(supportedOptions.has(k), 'Invalid cacheKey option: ' + k);
});
// default: not an include context
if (options.isInclude === undefined) {
options.isInclude = false;
}
// default: wrap templates
if... | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"options",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"Object",
".",
"keys",
"(",
"options",
")",
".",
"forEach",
"(",
"function",
"(",
"k",
")",
"{",
"console",
".",
"assert",
"(",
"suppor... | Default options processing | [
"Default",
"options",
"processing"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/wt2html/parser.js#L213-L231 | |
15,049 | wikimedia/parsoid | lib/html2wt/WikitextEscapeHandlers.js | startsOnANewLine | function startsOnANewLine(node) {
var name = node.nodeName.toUpperCase();
return Consts.BlockScopeOpenTags.has(name) &&
!WTUtils.isLiteralHTMLNode(node) &&
name !== "BLOCKQUOTE";
} | javascript | function startsOnANewLine(node) {
var name = node.nodeName.toUpperCase();
return Consts.BlockScopeOpenTags.has(name) &&
!WTUtils.isLiteralHTMLNode(node) &&
name !== "BLOCKQUOTE";
} | [
"function",
"startsOnANewLine",
"(",
"node",
")",
"{",
"var",
"name",
"=",
"node",
".",
"nodeName",
".",
"toUpperCase",
"(",
")",
";",
"return",
"Consts",
".",
"BlockScopeOpenTags",
".",
"has",
"(",
"name",
")",
"&&",
"!",
"WTUtils",
".",
"isLiteralHTMLNod... | ignore the cases where the serializer adds newlines not present in the dom | [
"ignore",
"the",
"cases",
"where",
"the",
"serializer",
"adds",
"newlines",
"not",
"present",
"in",
"the",
"dom"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/WikitextEscapeHandlers.js#L18-L23 |
15,050 | wikimedia/parsoid | lib/html2wt/WikitextEscapeHandlers.js | hasBlocksOnLine | function hasBlocksOnLine(node, first) {
// special case for firstNode:
// we're at sol so ignore possible \n at first char
if (first) {
if (node.textContent.substring(1).match(/\n/)) {
return false;
}
node = node.nextSibling;
}
while (node) {
if (DOMUtils.isElt(node)) {
if (DOMUtils.isBlockNode(nod... | javascript | function hasBlocksOnLine(node, first) {
// special case for firstNode:
// we're at sol so ignore possible \n at first char
if (first) {
if (node.textContent.substring(1).match(/\n/)) {
return false;
}
node = node.nextSibling;
}
while (node) {
if (DOMUtils.isElt(node)) {
if (DOMUtils.isBlockNode(nod... | [
"function",
"hasBlocksOnLine",
"(",
"node",
",",
"first",
")",
"{",
"// special case for firstNode:",
"// we're at sol so ignore possible \\n at first char",
"if",
"(",
"first",
")",
"{",
"if",
"(",
"node",
".",
"textContent",
".",
"substring",
"(",
"1",
")",
".",
... | look ahead on current line for block content | [
"look",
"ahead",
"on",
"current",
"line",
"for",
"block",
"content"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/WikitextEscapeHandlers.js#L26-L55 |
15,051 | wikimedia/parsoid | lib/logger/Logger.js | logTypeToString | function logTypeToString(logType) {
var logTypeString;
if (logType instanceof RegExp) {
logTypeString = logType.source;
} else if (typeof (logType) === 'string') {
logTypeString = '^' + JSUtils.escapeRegExp(logType) + '$';
} else {
throw new Error('logType is neither a regular expression nor a string.');
}
... | javascript | function logTypeToString(logType) {
var logTypeString;
if (logType instanceof RegExp) {
logTypeString = logType.source;
} else if (typeof (logType) === 'string') {
logTypeString = '^' + JSUtils.escapeRegExp(logType) + '$';
} else {
throw new Error('logType is neither a regular expression nor a string.');
}
... | [
"function",
"logTypeToString",
"(",
"logType",
")",
"{",
"var",
"logTypeString",
";",
"if",
"(",
"logType",
"instanceof",
"RegExp",
")",
"{",
"logTypeString",
"=",
"logType",
".",
"source",
";",
"}",
"else",
"if",
"(",
"typeof",
"(",
"logType",
")",
"===",... | Convert logType into a source string for a regExp that we can
subsequently use to test logTypes passed in from Logger.log.
@param {RegExp} logType
@return {string}
@private | [
"Convert",
"logType",
"into",
"a",
"source",
"string",
"for",
"a",
"regExp",
"that",
"we",
"can",
"subsequently",
"use",
"to",
"test",
"logTypes",
"passed",
"in",
"from",
"Logger",
".",
"log",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/logger/Logger.js#L123-L133 |
15,052 | wikimedia/parsoid | lib/config/MWParserEnvironment.js | function(parsoidConfig, options) {
options = options || {};
// page information
this.page = new Page();
Object.assign(this, options);
// Record time spent in various passes
this.timeProfile = {};
this.ioProfile = {};
this.mwProfile = {};
this.timeCategories = {};
this.counts = {};
// execution state
thi... | javascript | function(parsoidConfig, options) {
options = options || {};
// page information
this.page = new Page();
Object.assign(this, options);
// Record time spent in various passes
this.timeProfile = {};
this.ioProfile = {};
this.mwProfile = {};
this.timeCategories = {};
this.counts = {};
// execution state
thi... | [
"function",
"(",
"parsoidConfig",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// page information",
"this",
".",
"page",
"=",
"new",
"Page",
"(",
")",
";",
"Object",
".",
"assign",
"(",
"this",
",",
"options",
")",
";",
... | Holds configuration data that isn't modified at runtime, debugging objects,
a page object that represents the page we're parsing, and more.
The title of the page is held in `this.page.name` and is stored
as a "true" url-decoded title, ie without any url-encoding which
might be necessary if the title were referenced in ... | [
"Holds",
"configuration",
"data",
"that",
"isn",
"t",
"modified",
"at",
"runtime",
"debugging",
"objects",
"a",
"page",
"object",
"that",
"represents",
"the",
"page",
"we",
"re",
"parsing",
"and",
"more",
".",
"The",
"title",
"of",
"the",
"page",
"is",
"he... | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/config/MWParserEnvironment.js#L137-L190 | |
15,053 | wikimedia/parsoid | lib/mw/ApiRequest.js | TemplateRequest | function TemplateRequest(env, title, oldid, opts) {
ApiRequest.call(this, env, title);
// IMPORTANT: Set queueKey to the 'title'
// since TemplateHandler uses it for recording listeners
this.queueKey = title;
this.reqType = "Template Fetch";
opts = opts || {}; // optional extra arguments
var apiargs = {
forma... | javascript | function TemplateRequest(env, title, oldid, opts) {
ApiRequest.call(this, env, title);
// IMPORTANT: Set queueKey to the 'title'
// since TemplateHandler uses it for recording listeners
this.queueKey = title;
this.reqType = "Template Fetch";
opts = opts || {}; // optional extra arguments
var apiargs = {
forma... | [
"function",
"TemplateRequest",
"(",
"env",
",",
"title",
",",
"oldid",
",",
"opts",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"title",
")",
";",
"// IMPORTANT: Set queueKey to the 'title'",
"// since TemplateHandler uses it for recording liste... | Template fetch request helper class.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} title The template (or really, page) we should fetch from the wiki.
@param {string} oldid The revision ID you want to get, defaults to "latest revision". | [
"Template",
"fetch",
"request",
"helper",
"class",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L502-L537 |
15,054 | wikimedia/parsoid | lib/mw/ApiRequest.js | PreprocessorRequest | function PreprocessorRequest(env, title, text, queueKey) {
ApiRequest.call(this, env, title);
this.queueKey = queueKey;
this.text = text;
this.reqType = "Template Expansion";
var apiargs = {
format: 'json',
formatversion: 2,
action: 'expandtemplates',
prop: 'wikitext|categories|properties|modules|jsconfig... | javascript | function PreprocessorRequest(env, title, text, queueKey) {
ApiRequest.call(this, env, title);
this.queueKey = queueKey;
this.text = text;
this.reqType = "Template Expansion";
var apiargs = {
format: 'json',
formatversion: 2,
action: 'expandtemplates',
prop: 'wikitext|categories|properties|modules|jsconfig... | [
"function",
"PreprocessorRequest",
"(",
"env",
",",
"title",
",",
"text",
",",
"queueKey",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"title",
")",
";",
"this",
".",
"queueKey",
"=",
"queueKey",
";",
"this",
".",
"text",
"=",
... | Passes the source of a single preprocessor construct including its
parameters to action=expandtemplates.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} title The title of the page to use as the context.
@param {string} text
@param {string} queueKey The queue key. | [
"Passes",
"the",
"source",
"of",
"a",
"single",
"preprocessor",
"construct",
"including",
"its",
"parameters",
"to",
"action",
"=",
"expandtemplates",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L639-L675 |
15,055 | wikimedia/parsoid | lib/mw/ApiRequest.js | PHPParseRequest | function PHPParseRequest(env, title, text, onlypst, queueKey) {
ApiRequest.call(this, env, title);
this.text = text;
this.queueKey = queueKey || text;
this.reqType = "Extension Parse";
var apiargs = {
format: 'json',
formatversion: 2,
action: 'parse',
text: text,
disablelimitreport: 'true',
contentmod... | javascript | function PHPParseRequest(env, title, text, onlypst, queueKey) {
ApiRequest.call(this, env, title);
this.text = text;
this.queueKey = queueKey || text;
this.reqType = "Extension Parse";
var apiargs = {
format: 'json',
formatversion: 2,
action: 'parse',
text: text,
disablelimitreport: 'true',
contentmod... | [
"function",
"PHPParseRequest",
"(",
"env",
",",
"title",
",",
"text",
",",
"onlypst",
",",
"queueKey",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"title",
")",
";",
"this",
".",
"text",
"=",
"text",
";",
"this",
".",
"queueKey... | Gets the PHP parser to parse content for us.
Used for handling extension content right now.
And, probably magic words later on.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} title The title of the page to use as context.
@param {string} text
@param {boolean} [onlypst] Pass onlypst to PHP... | [
"Gets",
"the",
"PHP",
"parser",
"to",
"parse",
"content",
"for",
"us",
".",
"Used",
"for",
"handling",
"extension",
"content",
"right",
"now",
".",
"And",
"probably",
"magic",
"words",
"later",
"on",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L706-L747 |
15,056 | wikimedia/parsoid | lib/mw/ApiRequest.js | BatchRequest | function BatchRequest(env, batchParams, key) {
ApiRequest.call(this, env);
this.queueKey = key;
this.batchParams = batchParams;
this.reqType = 'Batch request';
this.batchText = JSON.stringify(batchParams);
var apiargs = {
format: 'json',
formatversion: 2,
action: 'parsoid-batch',
batch: this.batchText,
... | javascript | function BatchRequest(env, batchParams, key) {
ApiRequest.call(this, env);
this.queueKey = key;
this.batchParams = batchParams;
this.reqType = 'Batch request';
this.batchText = JSON.stringify(batchParams);
var apiargs = {
format: 'json',
formatversion: 2,
action: 'parsoid-batch',
batch: this.batchText,
... | [
"function",
"BatchRequest",
"(",
"env",
",",
"batchParams",
",",
"key",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
")",
";",
"this",
".",
"queueKey",
"=",
"key",
";",
"this",
".",
"batchParams",
"=",
"batchParams",
";",
"this",
".",
... | Do a mixed-action batch request using the ParsoidBatchAPI extension.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {Array} batchParams An array of objects.
@param {string} key The queue key. | [
"Do",
"a",
"mixed",
"-",
"action",
"batch",
"request",
"using",
"the",
"ParsoidBatchAPI",
"extension",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L776-L806 |
15,057 | wikimedia/parsoid | lib/mw/ApiRequest.js | function(env) {
ApiRequest.call(this, env, null);
this.queueKey = env.conf.wiki.apiURI;
this.reqType = "Config Request";
var metas = [ 'siteinfo' ];
var siprops = [
'namespaces',
'namespacealiases',
'magicwords',
'functionhooks',
'extensiontags',
'general',
'interwikimap',
'languages',
'language... | javascript | function(env) {
ApiRequest.call(this, env, null);
this.queueKey = env.conf.wiki.apiURI;
this.reqType = "Config Request";
var metas = [ 'siteinfo' ];
var siprops = [
'namespaces',
'namespacealiases',
'magicwords',
'functionhooks',
'extensiontags',
'general',
'interwikimap',
'languages',
'language... | [
"function",
"(",
"env",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"null",
")",
";",
"this",
".",
"queueKey",
"=",
"env",
".",
"conf",
".",
"wiki",
".",
"apiURI",
";",
"this",
".",
"reqType",
"=",
"\"Config Request\"",
";",
... | A request for the wiki's configuration variables.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env | [
"A",
"request",
"for",
"the",
"wiki",
"s",
"configuration",
"variables",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L867-L906 | |
15,058 | wikimedia/parsoid | lib/mw/ApiRequest.js | ImageInfoRequest | function ImageInfoRequest(env, filename, dims, key) {
ApiRequest.call(this, env, null);
this.env = env;
this.queueKey = key;
this.reqType = "Image Info Request";
var conf = env.conf.wiki;
var filenames = [ filename ];
var imgnsid = conf.canonicalNamespaces.image;
var imgns = conf.namespaceNames[imgnsid];
var ... | javascript | function ImageInfoRequest(env, filename, dims, key) {
ApiRequest.call(this, env, null);
this.env = env;
this.queueKey = key;
this.reqType = "Image Info Request";
var conf = env.conf.wiki;
var filenames = [ filename ];
var imgnsid = conf.canonicalNamespaces.image;
var imgns = conf.namespaceNames[imgnsid];
var ... | [
"function",
"ImageInfoRequest",
"(",
"env",
",",
"filename",
",",
"dims",
",",
"key",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"null",
")",
";",
"this",
".",
"env",
"=",
"env",
";",
"this",
".",
"queueKey",
"=",
"key",
";"... | Fetch information about an image.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} filename
@param {Object} [dims]
@param {number} [dims.width]
@param {number} [dims.height] | [
"Fetch",
"information",
"about",
"an",
"image",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L947-L1027 |
15,059 | wikimedia/parsoid | lib/mw/ApiRequest.js | TemplateDataRequest | function TemplateDataRequest(env, template, queueKey) {
ApiRequest.call(this, env, null);
this.env = env;
this.text = template;
this.queueKey = queueKey;
this.reqType = "TemplateData Request";
var apiargs = {
format: 'json',
// XXX: should use formatversion=2
action: 'templatedata',
includeMissingTitles:... | javascript | function TemplateDataRequest(env, template, queueKey) {
ApiRequest.call(this, env, null);
this.env = env;
this.text = template;
this.queueKey = queueKey;
this.reqType = "TemplateData Request";
var apiargs = {
format: 'json',
// XXX: should use formatversion=2
action: 'templatedata',
includeMissingTitles:... | [
"function",
"TemplateDataRequest",
"(",
"env",
",",
"template",
",",
"queueKey",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"null",
")",
";",
"this",
".",
"env",
"=",
"env",
";",
"this",
".",
"text",
"=",
"template",
";",
"thi... | Fetch TemplateData info for a template.
This is used by the html -> wt serialization path.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} template
@param {string} [queueKey] The queue key. | [
"Fetch",
"TemplateData",
"info",
"for",
"a",
"template",
".",
"This",
"is",
"used",
"by",
"the",
"html",
"-",
">",
"wt",
"serialization",
"path",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L1098-L1123 |
15,060 | wikimedia/parsoid | lib/mw/ApiRequest.js | LintRequest | function LintRequest(env, data, queueKey) {
ApiRequest.call(this, env, null);
this.queueKey = queueKey || data;
this.reqType = 'Lint Request';
var apiargs = {
data: data,
page: env.page.name,
revision: env.page.meta.revision.revid,
action: 'record-lint',
format: 'json',
formatversion: 2,
};
this.req... | javascript | function LintRequest(env, data, queueKey) {
ApiRequest.call(this, env, null);
this.queueKey = queueKey || data;
this.reqType = 'Lint Request';
var apiargs = {
data: data,
page: env.page.name,
revision: env.page.meta.revision.revid,
action: 'record-lint',
format: 'json',
formatversion: 2,
};
this.req... | [
"function",
"LintRequest",
"(",
"env",
",",
"data",
",",
"queueKey",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"null",
")",
";",
"this",
".",
"queueKey",
"=",
"queueKey",
"||",
"data",
";",
"this",
".",
"reqType",
"=",
"'Lint... | Record lint information.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} data
@param {string} [queueKey] The queue key. | [
"Record",
"lint",
"information",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L1152-L1175 |
15,061 | wikimedia/parsoid | lib/mw/ApiRequest.js | ParamInfoRequest | function ParamInfoRequest(env, queueKey) {
ApiRequest.call(this, env, null);
this.reqType = 'ParamInfo Request';
var apiargs = {
format: 'json',
// XXX: should use formatversion=2
action: 'paraminfo',
modules: 'query',
rawcontinue: 1,
};
this.queueKey = queueKey || JSON.stringify(apiargs);
this.reque... | javascript | function ParamInfoRequest(env, queueKey) {
ApiRequest.call(this, env, null);
this.reqType = 'ParamInfo Request';
var apiargs = {
format: 'json',
// XXX: should use formatversion=2
action: 'paraminfo',
modules: 'query',
rawcontinue: 1,
};
this.queueKey = queueKey || JSON.stringify(apiargs);
this.reque... | [
"function",
"ParamInfoRequest",
"(",
"env",
",",
"queueKey",
")",
"{",
"ApiRequest",
".",
"call",
"(",
"this",
",",
"env",
",",
"null",
")",
";",
"this",
".",
"reqType",
"=",
"'ParamInfo Request'",
";",
"var",
"apiargs",
"=",
"{",
"format",
":",
"'json'"... | Obtain information about MediaWiki API modules.
@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} [queueKey] The queue key. | [
"Obtain",
"information",
"about",
"MediaWiki",
"API",
"modules",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/mw/ApiRequest.js#L1194-L1217 |
15,062 | wikimedia/parsoid | lib/html2wt/separators.js | getSepNlConstraints | function getSepNlConstraints(state, nodeA, aCons, nodeB, bCons) {
const env = state.env;
const nlConstraints = {
min: aCons.min,
max: aCons.max,
force: aCons.force || bCons.force,
};
// now figure out if this conflicts with the nlConstraints so far
if (bCons.min !== undefined) {
if (nlConstraints.max !==... | javascript | function getSepNlConstraints(state, nodeA, aCons, nodeB, bCons) {
const env = state.env;
const nlConstraints = {
min: aCons.min,
max: aCons.max,
force: aCons.force || bCons.force,
};
// now figure out if this conflicts with the nlConstraints so far
if (bCons.min !== undefined) {
if (nlConstraints.max !==... | [
"function",
"getSepNlConstraints",
"(",
"state",
",",
"nodeA",
",",
"aCons",
",",
"nodeB",
",",
"bCons",
")",
"{",
"const",
"env",
"=",
"state",
".",
"env",
";",
"const",
"nlConstraints",
"=",
"{",
"min",
":",
"aCons",
".",
"min",
",",
"max",
":",
"a... | Helper for updateSeparatorConstraints.
Collects, checks and integrates separator newline requirements to a simple
min, max structure.
@param {SerializerState} state
@param {Node} nodeA
@param {Object} aCons
@param {Node} nodeB
@param {Object} bCons
@return {Object}
@return {Object} [return.a]
@return {Object} [return.... | [
"Helper",
"for",
"updateSeparatorConstraints",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/separators.js#L91-L134 |
15,063 | wikimedia/parsoid | lib/html2wt/separators.js | mergeConstraints | function mergeConstraints(env, oldConstraints, newConstraints) {
const res = {
min: Math.max(oldConstraints.min || 0, newConstraints.min || 0),
max: Math.min(
oldConstraints.max !== undefined ? oldConstraints.max : 2,
newConstraints.max !== undefined ? newConstraints.max : 2
),
force: oldConstraints.forc... | javascript | function mergeConstraints(env, oldConstraints, newConstraints) {
const res = {
min: Math.max(oldConstraints.min || 0, newConstraints.min || 0),
max: Math.min(
oldConstraints.max !== undefined ? oldConstraints.max : 2,
newConstraints.max !== undefined ? newConstraints.max : 2
),
force: oldConstraints.forc... | [
"function",
"mergeConstraints",
"(",
"env",
",",
"oldConstraints",
",",
"newConstraints",
")",
"{",
"const",
"res",
"=",
"{",
"min",
":",
"Math",
".",
"max",
"(",
"oldConstraints",
".",
"min",
"||",
"0",
",",
"newConstraints",
".",
"min",
"||",
"0",
")",... | Merge two constraints.
@private | [
"Merge",
"two",
"constraints",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/separators.js#L251-L277 |
15,064 | wikimedia/parsoid | lib/html2wt/separators.js | function(state, nodeA, sepHandlerA, nodeB, sepHandlerB) {
let sepType, nlConstraints, aCons, bCons;
if (nodeA.nextSibling === nodeB) {
// sibling separator
sepType = "sibling";
aCons = sepHandlerA.after(nodeA, nodeB, state);
bCons = sepHandlerB.before(nodeB, nodeA, state);
nlConstraints = getSepNlConstrain... | javascript | function(state, nodeA, sepHandlerA, nodeB, sepHandlerB) {
let sepType, nlConstraints, aCons, bCons;
if (nodeA.nextSibling === nodeB) {
// sibling separator
sepType = "sibling";
aCons = sepHandlerA.after(nodeA, nodeB, state);
bCons = sepHandlerB.before(nodeB, nodeA, state);
nlConstraints = getSepNlConstrain... | [
"function",
"(",
"state",
",",
"nodeA",
",",
"sepHandlerA",
",",
"nodeB",
",",
"sepHandlerB",
")",
"{",
"let",
"sepType",
",",
"nlConstraints",
",",
"aCons",
",",
"bCons",
";",
"if",
"(",
"nodeA",
".",
"nextSibling",
"===",
"nodeB",
")",
"{",
"// sibling... | Figure out separator constraints and merge them with existing constraints
in state so that they can be emitted when the next content emits source.
@param {Node} nodeA
@param {DOMHandler} sepHandlerA
@param {Node} nodeB
@param {DOMHandler} sepHandlerB | [
"Figure",
"out",
"separator",
"constraints",
"and",
"merge",
"them",
"with",
"existing",
"constraints",
"in",
"state",
"so",
"that",
"they",
"can",
"be",
"emitted",
"when",
"the",
"next",
"content",
"emits",
"source",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/separators.js#L291-L352 | |
15,065 | wikimedia/parsoid | lib/html2wt/separators.js | function(node) {
var dp = DOMDataUtils.getDataParsoid(node);
var dsr = Util.clone(dp.dsr);
if (dp.autoInsertedStart) { dsr[2] = null; }
if (dp.autoInsertedEnd) { dsr[3] = null; }
return dsr;
} | javascript | function(node) {
var dp = DOMDataUtils.getDataParsoid(node);
var dsr = Util.clone(dp.dsr);
if (dp.autoInsertedStart) { dsr[2] = null; }
if (dp.autoInsertedEnd) { dsr[3] = null; }
return dsr;
} | [
"function",
"(",
"node",
")",
"{",
"var",
"dp",
"=",
"DOMDataUtils",
".",
"getDataParsoid",
"(",
"node",
")",
";",
"var",
"dsr",
"=",
"Util",
".",
"clone",
"(",
"dp",
".",
"dsr",
")",
";",
"if",
"(",
"dp",
".",
"autoInsertedStart",
")",
"{",
"dsr",... | Serializing auto inserted content should invalidate the original separator | [
"Serializing",
"auto",
"inserted",
"content",
"should",
"invalidate",
"the",
"original",
"separator"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/separators.js#L490-L496 | |
15,066 | wikimedia/parsoid | lib/utils/Diff.js | function(diff) {
var ret = [];
diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
// Formats a given set of lines for printing as context lines in a patch
function contextLines(lines) {
return lines.map(function(entry) { return ' ' + entry; });
}
var oldRangeStart = 0;
var... | javascript | function(diff) {
var ret = [];
diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
// Formats a given set of lines for printing as context lines in a patch
function contextLines(lines) {
return lines.map(function(entry) { return ' ' + entry; });
}
var oldRangeStart = 0;
var... | [
"function",
"(",
"diff",
")",
"{",
"var",
"ret",
"=",
"[",
"]",
";",
"diff",
".",
"push",
"(",
"{",
"value",
":",
"''",
",",
"lines",
":",
"[",
"]",
"}",
")",
";",
"// Append an empty value to make cleanup easier",
"// Formats a given set of lines for printing... | This is essentially lifted from [email protected], but using our diff and
without the header and no newline warning.
@private | [
"This",
"is",
"essentially",
"lifted",
"from",
"jsDiff"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/utils/Diff.js#L211-L285 | |
15,067 | wikimedia/parsoid | lib/utils/Diff.js | function(value) {
var ret = [];
var linesAndNewlines = value.split(/(\n|\r\n)/);
// Ignore the final empty token that occurs if the string ends with a new line
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
linesAndNewlines.pop();
}
// Merge the content and line separators into single tokens
for... | javascript | function(value) {
var ret = [];
var linesAndNewlines = value.split(/(\n|\r\n)/);
// Ignore the final empty token that occurs if the string ends with a new line
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
linesAndNewlines.pop();
}
// Merge the content and line separators into single tokens
for... | [
"function",
"(",
"value",
")",
"{",
"var",
"ret",
"=",
"[",
"]",
";",
"var",
"linesAndNewlines",
"=",
"value",
".",
"split",
"(",
"/",
"(\\n|\\r\\n)",
"/",
")",
";",
"// Ignore the final empty token that occurs if the string ends with a new line",
"if",
"(",
"!",
... | Essentially lifted from [email protected]'s PatchDiff.tokenize | [
"Essentially",
"lifted",
"from",
"jsDiff"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/utils/Diff.js#L290-L307 | |
15,068 | wikimedia/parsoid | lib/html2wt/DOMNormalizer.js | mergable | function mergable(a, b) {
return a.nodeName === b.nodeName && similar(a, b);
} | javascript | function mergable(a, b) {
return a.nodeName === b.nodeName && similar(a, b);
} | [
"function",
"mergable",
"(",
"a",
",",
"b",
")",
"{",
"return",
"a",
".",
"nodeName",
"===",
"b",
".",
"nodeName",
"&&",
"similar",
"(",
"a",
",",
"b",
")",
";",
"}"
] | Can a and b be merged into a single node? | [
"Can",
"a",
"and",
"b",
"be",
"merged",
"into",
"a",
"single",
"node?"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/DOMNormalizer.js#L53-L55 |
15,069 | wikimedia/parsoid | lib/html2wt/DOMNormalizer.js | swappable | function swappable(a, b) {
return DOMUtils.numNonDeletedChildNodes(a) === 1 &&
similar(a, DOMUtils.firstNonDeletedChild(a)) &&
mergable(DOMUtils.firstNonDeletedChild(a), b);
} | javascript | function swappable(a, b) {
return DOMUtils.numNonDeletedChildNodes(a) === 1 &&
similar(a, DOMUtils.firstNonDeletedChild(a)) &&
mergable(DOMUtils.firstNonDeletedChild(a), b);
} | [
"function",
"swappable",
"(",
"a",
",",
"b",
")",
"{",
"return",
"DOMUtils",
".",
"numNonDeletedChildNodes",
"(",
"a",
")",
"===",
"1",
"&&",
"similar",
"(",
"a",
",",
"DOMUtils",
".",
"firstNonDeletedChild",
"(",
"a",
")",
")",
"&&",
"mergable",
"(",
... | Can a and b be combined into a single node
if we swap a and a.firstChild?
For example: A='<b><i>x</i></b>' b='<i>y</i>' => '<i><b>x</b>y</i>'. | [
"Can",
"a",
"and",
"b",
"be",
"combined",
"into",
"a",
"single",
"node",
"if",
"we",
"swap",
"a",
"and",
"a",
".",
"firstChild?"
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/lib/html2wt/DOMNormalizer.js#L63-L67 |
15,070 | wikimedia/parsoid | tools/ScriptUtils.js | function(parsoidOptions, cliOpts) {
[
'fetchConfig',
'fetchTemplates',
'fetchImageInfo',
'expandExtensions',
'rtTestMode',
'addHTMLTemplateParameters',
].forEach(function(c) {
if (cliOpts[c] !== undefined) {
parsoidOptions[c] = ScriptUtils.booleanOption(cliOpts[c]);
}
});
if (cliOpts... | javascript | function(parsoidOptions, cliOpts) {
[
'fetchConfig',
'fetchTemplates',
'fetchImageInfo',
'expandExtensions',
'rtTestMode',
'addHTMLTemplateParameters',
].forEach(function(c) {
if (cliOpts[c] !== undefined) {
parsoidOptions[c] = ScriptUtils.booleanOption(cliOpts[c]);
}
});
if (cliOpts... | [
"function",
"(",
"parsoidOptions",
",",
"cliOpts",
")",
"{",
"[",
"'fetchConfig'",
",",
"'fetchTemplates'",
",",
"'fetchImageInfo'",
",",
"'expandExtensions'",
",",
"'rtTestMode'",
",",
"'addHTMLTemplateParameters'",
",",
"]",
".",
"forEach",
"(",
"function",
"(",
... | Sets templating and processing flags on an object,
based on an options object.
@param {Object} parsoidOptions Object to be assigned to the ParsoidConfig.
@param {Object} cliOpts The options object to use for setting the debug flags.
@return {Object} The modified object. | [
"Sets",
"templating",
"and",
"processing",
"flags",
"on",
"an",
"object",
"based",
"on",
"an",
"options",
"object",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/tools/ScriptUtils.js#L270-L316 | |
15,071 | wikimedia/parsoid | tools/ScriptUtils.js | function(options) {
var colors = require('colors');
if (options.color === 'auto') {
if (!process.stdout.isTTY) {
colors.mode = 'none';
}
} else if (!ScriptUtils.booleanOption(options.color)) {
colors.mode = 'none';
}
} | javascript | function(options) {
var colors = require('colors');
if (options.color === 'auto') {
if (!process.stdout.isTTY) {
colors.mode = 'none';
}
} else if (!ScriptUtils.booleanOption(options.color)) {
colors.mode = 'none';
}
} | [
"function",
"(",
"options",
")",
"{",
"var",
"colors",
"=",
"require",
"(",
"'colors'",
")",
";",
"if",
"(",
"options",
".",
"color",
"===",
"'auto'",
")",
"{",
"if",
"(",
"!",
"process",
".",
"stdout",
".",
"isTTY",
")",
"{",
"colors",
".",
"mode"... | Set the color flags, based on an options object.
@param {Object} options
The options object to use for setting the mode of the 'color' package.
@param {string|boolean} options.color
Whether to use color. Passing 'auto' will enable color only if
stdout is a TTY device. | [
"Set",
"the",
"color",
"flags",
"based",
"on",
"an",
"options",
"object",
"."
] | 641ded74d8f736c2a18259d509525f96e83cd570 | https://github.com/wikimedia/parsoid/blob/641ded74d8f736c2a18259d509525f96e83cd570/tools/ScriptUtils.js#L345-L354 | |
15,072 | mapbox/geojson-merge | index.js | merge | function merge (inputs) {
var output = {
type: 'FeatureCollection',
features: []
};
for (var i = 0; i < inputs.length; i++) {
var normalized = normalize(inputs[i]);
for (var j = 0; j < normalized.features.length; j++) {
output.features.push(normalized.features[j])... | javascript | function merge (inputs) {
var output = {
type: 'FeatureCollection',
features: []
};
for (var i = 0; i < inputs.length; i++) {
var normalized = normalize(inputs[i]);
for (var j = 0; j < normalized.features.length; j++) {
output.features.push(normalized.features[j])... | [
"function",
"merge",
"(",
"inputs",
")",
"{",
"var",
"output",
"=",
"{",
"type",
":",
"'FeatureCollection'",
",",
"features",
":",
"[",
"]",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"inputs",
".",
"length",
";",
"i",
"++",
")",
... | Merge a series of GeoJSON objects into one FeatureCollection containing all
features in all files. The objects can be any valid GeoJSON root object,
including FeatureCollection, Feature, and Geometry types.
@param {Array<Object>} inputs a list of GeoJSON objects of any type
@return {Object} a geojson FeatureCollectio... | [
"Merge",
"a",
"series",
"of",
"GeoJSON",
"objects",
"into",
"one",
"FeatureCollection",
"containing",
"all",
"features",
"in",
"all",
"files",
".",
"The",
"objects",
"can",
"be",
"any",
"valid",
"GeoJSON",
"root",
"object",
"including",
"FeatureCollection",
"Fea... | a4e8ed3cb2e8ce61a59cb5c160f4a3506937dd7d | https://github.com/mapbox/geojson-merge/blob/a4e8ed3cb2e8ce61a59cb5c160f4a3506937dd7d/index.js#L22-L34 |
15,073 | mapbox/geojson-merge | index.js | mergeFeatureCollectionStream | function mergeFeatureCollectionStream (inputs) {
var out = geojsonStream.stringify();
inputs.forEach(function(file) {
fs.createReadStream(file)
.pipe(geojsonStream.parse())
.pipe(out);
});
return out;
} | javascript | function mergeFeatureCollectionStream (inputs) {
var out = geojsonStream.stringify();
inputs.forEach(function(file) {
fs.createReadStream(file)
.pipe(geojsonStream.parse())
.pipe(out);
});
return out;
} | [
"function",
"mergeFeatureCollectionStream",
"(",
"inputs",
")",
"{",
"var",
"out",
"=",
"geojsonStream",
".",
"stringify",
"(",
")",
";",
"inputs",
".",
"forEach",
"(",
"function",
"(",
"file",
")",
"{",
"fs",
".",
"createReadStream",
"(",
"file",
")",
"."... | Merge GeoJSON files containing GeoJSON FeatureCollections
into a single stream of a FeatureCollection as a JSON string.
This is more limited than merge - it only supports FeatureCollections
as input - but more performant, since it can operate on GeoJSON files
larger than what you can keep in memory at one time.
@param... | [
"Merge",
"GeoJSON",
"files",
"containing",
"GeoJSON",
"FeatureCollections",
"into",
"a",
"single",
"stream",
"of",
"a",
"FeatureCollection",
"as",
"a",
"JSON",
"string",
"."
] | a4e8ed3cb2e8ce61a59cb5c160f4a3506937dd7d | https://github.com/mapbox/geojson-merge/blob/a4e8ed3cb2e8ce61a59cb5c160f4a3506937dd7d/index.js#L54-L62 |
15,074 | midwayjs/pandora | packages/pandora/3rd/fork.js | onerror | function onerror(err) {
if (!err) {
return;
}
debug('[%s] [cfork:master:%s] master uncaughtException: %s', Date(), process.pid, err.stack);
debug(err);
debug('(total %d disconnect, %d unexpected exit)', disconnectCount, unexpectedCount);
} | javascript | function onerror(err) {
if (!err) {
return;
}
debug('[%s] [cfork:master:%s] master uncaughtException: %s', Date(), process.pid, err.stack);
debug(err);
debug('(total %d disconnect, %d unexpected exit)', disconnectCount, unexpectedCount);
} | [
"function",
"onerror",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"return",
";",
"}",
"debug",
"(",
"'[%s] [cfork:master:%s] master uncaughtException: %s'",
",",
"Date",
"(",
")",
",",
"process",
".",
"pid",
",",
"err",
".",
"stack",
")",
";"... | uncaughtException default handler | [
"uncaughtException",
"default",
"handler"
] | 7310db12af93ef353b4d2014f7b5d276b81aaeec | https://github.com/midwayjs/pandora/blob/7310db12af93ef353b4d2014f7b5d276b81aaeec/packages/pandora/3rd/fork.js#L213-L220 |
15,075 | midwayjs/pandora | packages/pandora/3rd/fork.js | onUnexpected | function onUnexpected(worker, code, signal) {
var exitCode = worker.process.exitCode;
var err = new Error(util.format('worker:%s died unexpected (code: %s, signal: %s, exitedAfterDisconnect: %s, state: %s)',
worker.process.pid, exitCode, signal, worker.exitedAfterDisconnect, worker.state));
err.name =... | javascript | function onUnexpected(worker, code, signal) {
var exitCode = worker.process.exitCode;
var err = new Error(util.format('worker:%s died unexpected (code: %s, signal: %s, exitedAfterDisconnect: %s, state: %s)',
worker.process.pid, exitCode, signal, worker.exitedAfterDisconnect, worker.state));
err.name =... | [
"function",
"onUnexpected",
"(",
"worker",
",",
"code",
",",
"signal",
")",
"{",
"var",
"exitCode",
"=",
"worker",
".",
"process",
".",
"exitCode",
";",
"var",
"err",
"=",
"new",
"Error",
"(",
"util",
".",
"format",
"(",
"'worker:%s died unexpected (code: %s... | unexpectedExit default handler | [
"unexpectedExit",
"default",
"handler"
] | 7310db12af93ef353b4d2014f7b5d276b81aaeec | https://github.com/midwayjs/pandora/blob/7310db12af93ef353b4d2014f7b5d276b81aaeec/packages/pandora/3rd/fork.js#L226-L234 |
15,076 | midwayjs/pandora | packages/pandora/3rd/fork.js | normalizeSlaveConfig | function normalizeSlaveConfig(opt) {
// exec path
if (typeof opt === 'string') {
opt = { exec: opt };
}
if (!opt.exec) {
return null;
} else {
return opt;
}
} | javascript | function normalizeSlaveConfig(opt) {
// exec path
if (typeof opt === 'string') {
opt = { exec: opt };
}
if (!opt.exec) {
return null;
} else {
return opt;
}
} | [
"function",
"normalizeSlaveConfig",
"(",
"opt",
")",
"{",
"// exec path",
"if",
"(",
"typeof",
"opt",
"===",
"'string'",
")",
"{",
"opt",
"=",
"{",
"exec",
":",
"opt",
"}",
";",
"}",
"if",
"(",
"!",
"opt",
".",
"exec",
")",
"{",
"return",
"null",
"... | normalize slave config | [
"normalize",
"slave",
"config"
] | 7310db12af93ef353b4d2014f7b5d276b81aaeec | https://github.com/midwayjs/pandora/blob/7310db12af93ef353b4d2014f7b5d276b81aaeec/packages/pandora/3rd/fork.js#L248-L258 |
15,077 | midwayjs/pandora | packages/pandora/3rd/fork.js | forkWorker | function forkWorker(settings, env) {
if (settings) {
cluster.settings = settings;
cluster.setupMaster();
}
return cluster.fork(env);
} | javascript | function forkWorker(settings, env) {
if (settings) {
cluster.settings = settings;
cluster.setupMaster();
}
return cluster.fork(env);
} | [
"function",
"forkWorker",
"(",
"settings",
",",
"env",
")",
"{",
"if",
"(",
"settings",
")",
"{",
"cluster",
".",
"settings",
"=",
"settings",
";",
"cluster",
".",
"setupMaster",
"(",
")",
";",
"}",
"return",
"cluster",
".",
"fork",
"(",
"env",
")",
... | fork worker with certain settings | [
"fork",
"worker",
"with",
"certain",
"settings"
] | 7310db12af93ef353b4d2014f7b5d276b81aaeec | https://github.com/midwayjs/pandora/blob/7310db12af93ef353b4d2014f7b5d276b81aaeec/packages/pandora/3rd/fork.js#L263-L269 |
15,078 | jamesssooi/Croppr.js | src/polyfills.js | MouseEvent | function MouseEvent(eventType, params) {
params = params || { bubbles: false, cancelable: false };
var mouseEvent = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
return mouseEvent;... | javascript | function MouseEvent(eventType, params) {
params = params || { bubbles: false, cancelable: false };
var mouseEvent = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
return mouseEvent;... | [
"function",
"MouseEvent",
"(",
"eventType",
",",
"params",
")",
"{",
"params",
"=",
"params",
"||",
"{",
"bubbles",
":",
"false",
",",
"cancelable",
":",
"false",
"}",
";",
"var",
"mouseEvent",
"=",
"document",
".",
"createEvent",
"(",
"'MouseEvent'",
")",... | Polyfills DOM4 CustomEvent | [
"Polyfills",
"DOM4",
"CustomEvent"
] | df27b32e8c7cd14d1fa8a63de74e74035aecc06e | https://github.com/jamesssooi/Croppr.js/blob/df27b32e8c7cd14d1fa8a63de74e74035aecc06e/src/polyfills.js#L58-L64 |
15,079 | jamesssooi/Croppr.js | src/touch.js | simulateMouseEvent | function simulateMouseEvent(e) {
e.preventDefault();
const touch = e.changedTouches[0];
const eventMap = {
'touchstart': 'mousedown',
'touchmove': 'mousemove',
'touchend': 'mouseup'
}
touch.target.dispatchEvent(new MouseEvent(eventMap[e.type], {
bubbles: true,
cancelable: true,
view: ... | javascript | function simulateMouseEvent(e) {
e.preventDefault();
const touch = e.changedTouches[0];
const eventMap = {
'touchstart': 'mousedown',
'touchmove': 'mousemove',
'touchend': 'mouseup'
}
touch.target.dispatchEvent(new MouseEvent(eventMap[e.type], {
bubbles: true,
cancelable: true,
view: ... | [
"function",
"simulateMouseEvent",
"(",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"const",
"touch",
"=",
"e",
".",
"changedTouches",
"[",
"0",
"]",
";",
"const",
"eventMap",
"=",
"{",
"'touchstart'",
":",
"'mousedown'",
",",
"'touchmove'",
... | Translates a touch event to a mouse event.
@param {Event} e | [
"Translates",
"a",
"touch",
"event",
"to",
"a",
"mouse",
"event",
"."
] | df27b32e8c7cd14d1fa8a63de74e74035aecc06e | https://github.com/jamesssooi/Croppr.js/blob/df27b32e8c7cd14d1fa8a63de74e74035aecc06e/src/touch.js#L21-L39 |
15,080 | jleyba/js-dossier | src/js/app.js | onCardHeaderClick | function onCardHeaderClick(e) {
if (/** @type {!Element} */(e.target).nodeName == 'A') {
return;
}
/** @type {?Node} */
const node = /** @type {!Element} */(e.currentTarget).parentNode;
if (node && node.nodeType === NodeType.ELEMENT) {
const card = /** @type {!Element} */(node);
if (card.classLis... | javascript | function onCardHeaderClick(e) {
if (/** @type {!Element} */(e.target).nodeName == 'A') {
return;
}
/** @type {?Node} */
const node = /** @type {!Element} */(e.currentTarget).parentNode;
if (node && node.nodeType === NodeType.ELEMENT) {
const card = /** @type {!Element} */(node);
if (card.classLis... | [
"function",
"onCardHeaderClick",
"(",
"e",
")",
"{",
"if",
"(",
"/** @type {!Element} */",
"(",
"e",
".",
"target",
")",
".",
"nodeName",
"==",
"'A'",
")",
"{",
"return",
";",
"}",
"/** @type {?Node} */",
"const",
"node",
"=",
"/** @type {!Element} */",
"(",
... | Responds to click events on a property card.
@param {!Event} e The click event. | [
"Responds",
"to",
"click",
"events",
"on",
"a",
"property",
"card",
"."
] | c58032be37d8c138312c9f2ee77a867c8d9a944c | https://github.com/jleyba/js-dossier/blob/c58032be37d8c138312c9f2ee77a867c8d9a944c/src/js/app.js#L44-L57 |
15,081 | Falconerd/discord-bot-github | src/main.js | parseMessage | function parseMessage(message) {
const parts = message.content.split(' ');
const command = parts[1];
const args = parts.slice(2);
if (typeof Commands[command] === 'function') {
// @TODO We could check the command validity here
return { command, args };
} else {
return null;
}
} | javascript | function parseMessage(message) {
const parts = message.content.split(' ');
const command = parts[1];
const args = parts.slice(2);
if (typeof Commands[command] === 'function') {
// @TODO We could check the command validity here
return { command, args };
} else {
return null;
}
} | [
"function",
"parseMessage",
"(",
"message",
")",
"{",
"const",
"parts",
"=",
"message",
".",
"content",
".",
"split",
"(",
"' '",
")",
";",
"const",
"command",
"=",
"parts",
"[",
"1",
"]",
";",
"const",
"args",
"=",
"parts",
".",
"slice",
"(",
"2",
... | Take in the content of a message and return a command
@param {Message} message The Discord.Message object
@return {Object} An object continaing a command name and arguments | [
"Take",
"in",
"the",
"content",
"of",
"a",
"message",
"and",
"return",
"a",
"command"
] | 44ecf5b2e1cc69190df4863c67a66989d412cf7d | https://github.com/Falconerd/discord-bot-github/blob/44ecf5b2e1cc69190df4863c67a66989d412cf7d/src/main.js#L87-L98 |
15,082 | postmanlabs/postman-collection | npm/publish-wiki.js | function (next) {
console.log(chalk.yellow.bold('Publishing wiki...'));
// create a location to clone repository
// @todo - maybe do this outside in an os-level temp folder to avoid recursive .git
mkdir('-p', WIKI_GIT_PATH);
rm('-rf', WIKI_GIT_PATH);
... | javascript | function (next) {
console.log(chalk.yellow.bold('Publishing wiki...'));
// create a location to clone repository
// @todo - maybe do this outside in an os-level temp folder to avoid recursive .git
mkdir('-p', WIKI_GIT_PATH);
rm('-rf', WIKI_GIT_PATH);
... | [
"function",
"(",
"next",
")",
"{",
"console",
".",
"log",
"(",
"chalk",
".",
"yellow",
".",
"bold",
"(",
"'Publishing wiki...'",
")",
")",
";",
"// create a location to clone repository",
"// @todo - maybe do this outside in an os-level temp folder to avoid recursive .git",
... | prepare a separate wiki output folder | [
"prepare",
"a",
"separate",
"wiki",
"output",
"folder"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/npm/publish-wiki.js#L21-L33 | |
15,083 | postmanlabs/postman-collection | npm/publish-wiki.js | function (next) {
var source = fs.readFileSync(path.join('out', 'wiki', 'REFERENCE.md')).toString(),
home,
sidebar;
// extract sidebar from source
sidebar = source.replace(/<a name="Collection"><\/a>[\s\S]+/g, '');
// remove sidebar data ... | javascript | function (next) {
var source = fs.readFileSync(path.join('out', 'wiki', 'REFERENCE.md')).toString(),
home,
sidebar;
// extract sidebar from source
sidebar = source.replace(/<a name="Collection"><\/a>[\s\S]+/g, '');
// remove sidebar data ... | [
"function",
"(",
"next",
")",
"{",
"var",
"source",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"join",
"(",
"'out'",
",",
"'wiki'",
",",
"'REFERENCE.md'",
")",
")",
".",
"toString",
"(",
")",
",",
"home",
",",
"sidebar",
";",
"// extract sidebar... | update contents of repository | [
"update",
"contents",
"of",
"repository"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/npm/publish-wiki.js#L36-L59 | |
15,084 | postmanlabs/postman-collection | npm/publish-wiki.js | function (next) {
// silence terminal output to prevent leaking sensitive information
config.silent = true;
pushd(WIKI_GIT_PATH);
exec('git add --all');
exec('git commit -m "[auto] ' + WIKI_VERSION + '"');
exec('git push origin master', function (... | javascript | function (next) {
// silence terminal output to prevent leaking sensitive information
config.silent = true;
pushd(WIKI_GIT_PATH);
exec('git add --all');
exec('git commit -m "[auto] ' + WIKI_VERSION + '"');
exec('git push origin master', function (... | [
"function",
"(",
"next",
")",
"{",
"// silence terminal output to prevent leaking sensitive information",
"config",
".",
"silent",
"=",
"true",
";",
"pushd",
"(",
"WIKI_GIT_PATH",
")",
";",
"exec",
"(",
"'git add --all'",
")",
";",
"exec",
"(",
"'git commit -m \"[auto... | publish the wiki where it should go | [
"publish",
"the",
"wiki",
"where",
"it",
"should",
"go"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/npm/publish-wiki.js#L62-L73 | |
15,085 | postmanlabs/postman-collection | lib/collection/variable-list.js | function (obj, overrides, mutate) {
var resolutionQueue = [], // we use this to store the queue of variable hierarchy
// this is an intermediate object to stimulate a property (makes the do-while loop easier)
variableSource = {
variables: this,
__parent: ... | javascript | function (obj, overrides, mutate) {
var resolutionQueue = [], // we use this to store the queue of variable hierarchy
// this is an intermediate object to stimulate a property (makes the do-while loop easier)
variableSource = {
variables: this,
__parent: ... | [
"function",
"(",
"obj",
",",
"overrides",
",",
"mutate",
")",
"{",
"var",
"resolutionQueue",
"=",
"[",
"]",
",",
"// we use this to store the queue of variable hierarchy",
"// this is an intermediate object to stimulate a property (makes the do-while loop easier)",
"variableSource"... | Recursively replace strings in an object with instances of variables. Note that it clones the original object. If
the `mutate` param is set to true, then it replaces the same object instead of creating a new one.
@param {Array|Object} obj
@param {?Array<Object>=} [overrides] - additional objects to lookup for variable... | [
"Recursively",
"replace",
"strings",
"in",
"an",
"object",
"with",
"instances",
"of",
"variables",
".",
"Note",
"that",
"it",
"clones",
"the",
"original",
"object",
".",
"If",
"the",
"mutate",
"param",
"is",
"set",
"to",
"true",
"then",
"it",
"replaces",
"... | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/variable-list.js#L43-L60 | |
15,086 | postmanlabs/postman-collection | lib/collection/variable-list.js | function (obj, track, prune) {
var list = this,
ops = track && {
created: [],
updated: [],
deleted: []
},
indexer = list._postman_listIndexKey,
tmp;
if (!_.isObject(obj)) { return ops; }
// ensure t... | javascript | function (obj, track, prune) {
var list = this,
ops = track && {
created: [],
updated: [],
deleted: []
},
indexer = list._postman_listIndexKey,
tmp;
if (!_.isObject(obj)) { return ops; }
// ensure t... | [
"function",
"(",
"obj",
",",
"track",
",",
"prune",
")",
"{",
"var",
"list",
"=",
"this",
",",
"ops",
"=",
"track",
"&&",
"{",
"created",
":",
"[",
"]",
",",
"updated",
":",
"[",
"]",
",",
"deleted",
":",
"[",
"]",
"}",
",",
"indexer",
"=",
"... | Using this function, one can sync the values of this variable list from a reference object.
@param {Object} obj
@param {Boolean=} track
@param {Boolean} [prune=true]
@returns {Object} | [
"Using",
"this",
"function",
"one",
"can",
"sync",
"the",
"values",
"of",
"this",
"variable",
"list",
"from",
"a",
"reference",
"object",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/variable-list.js#L71-L111 | |
15,087 | postmanlabs/postman-collection | lib/collection/variable-list.js | function (obj) {
var list = this;
// in case user did not provide an object to mutate, create a new one
!_.isObject(obj) && (obj = {});
// delete extra variables from object that are not present in list
_.forEach(obj, function (value, key) {
!_.has(list.reference, k... | javascript | function (obj) {
var list = this;
// in case user did not provide an object to mutate, create a new one
!_.isObject(obj) && (obj = {});
// delete extra variables from object that are not present in list
_.forEach(obj, function (value, key) {
!_.has(list.reference, k... | [
"function",
"(",
"obj",
")",
"{",
"var",
"list",
"=",
"this",
";",
"// in case user did not provide an object to mutate, create a new one",
"!",
"_",
".",
"isObject",
"(",
"obj",
")",
"&&",
"(",
"obj",
"=",
"{",
"}",
")",
";",
"// delete extra variables from objec... | Transfer all variables from this list to an object
@param {Object=} [obj]
@returns {Object} | [
"Transfer",
"all",
"variables",
"from",
"this",
"list",
"to",
"an",
"object"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/variable-list.js#L119-L136 | |
15,088 | postmanlabs/postman-collection | lib/collection/variable-list.js | function (obj) {
return Boolean(obj) && ((obj instanceof VariableList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', VariableList._postman_propertyName));
} | javascript | function (obj) {
return Boolean(obj) && ((obj instanceof VariableList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', VariableList._postman_propertyName));
} | [
"function",
"(",
"obj",
")",
"{",
"return",
"Boolean",
"(",
"obj",
")",
"&&",
"(",
"(",
"obj",
"instanceof",
"VariableList",
")",
"||",
"_",
".",
"inSuperChain",
"(",
"obj",
".",
"constructor",
",",
"'_postman_propertyName'",
",",
"VariableList",
".",
"_po... | Checks whether an object is a VariableList
@param {*} obj
@returns {Boolean} | [
"Checks",
"whether",
"an",
"object",
"is",
"a",
"VariableList"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/variable-list.js#L187-L190 | |
15,089 | postmanlabs/postman-collection | lib/collection/certificate-list.js | function (url) {
// url must be either string or an instance of url.
if (!_.isString(url) && !Url.isUrl(url)) {
return;
}
// find a certificate that can be applied to the url
return this.find(function (certificate) {
return certificate.canApplyTo(url);
... | javascript | function (url) {
// url must be either string or an instance of url.
if (!_.isString(url) && !Url.isUrl(url)) {
return;
}
// find a certificate that can be applied to the url
return this.find(function (certificate) {
return certificate.canApplyTo(url);
... | [
"function",
"(",
"url",
")",
"{",
"// url must be either string or an instance of url.",
"if",
"(",
"!",
"_",
".",
"isString",
"(",
"url",
")",
"&&",
"!",
"Url",
".",
"isUrl",
"(",
"url",
")",
")",
"{",
"return",
";",
"}",
"// find a certificate that can be ap... | Matches the given url against the member certificates' allowed matches
and returns the certificate that can be used for the url.
@param {String} url The url to find the certificate for
@return {Certificate~definition=} The matched certificate | [
"Matches",
"the",
"given",
"url",
"against",
"the",
"member",
"certificates",
"allowed",
"matches",
"and",
"returns",
"the",
"certificate",
"that",
"can",
"be",
"used",
"for",
"the",
"url",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/certificate-list.js#L47-L57 | |
15,090 | postmanlabs/postman-collection | lib/collection/certificate-list.js | function (obj) {
return Boolean(obj) && ((obj instanceof CertificateList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', CertificateList._postman_propertyName));
} | javascript | function (obj) {
return Boolean(obj) && ((obj instanceof CertificateList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', CertificateList._postman_propertyName));
} | [
"function",
"(",
"obj",
")",
"{",
"return",
"Boolean",
"(",
"obj",
")",
"&&",
"(",
"(",
"obj",
"instanceof",
"CertificateList",
")",
"||",
"_",
".",
"inSuperChain",
"(",
"obj",
".",
"constructor",
",",
"'_postman_propertyName'",
",",
"CertificateList",
".",
... | Checks if the given object is a CertificateList
@param {*} obj
@returns {Boolean} | [
"Checks",
"if",
"the",
"given",
"object",
"is",
"a",
"CertificateList"
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/certificate-list.js#L75-L78 | |
15,091 | postmanlabs/postman-collection | lib/collection/mutation-tracker.js | function (mutation) {
// bail out for empty or unsupported mutations
if (!(mutation && isPrimitiveMutation(mutation))) {
return;
}
// if autoCompact is set, we need to compact while adding
if (this.autoCompact) {
this.addAndCompact(mutation);
... | javascript | function (mutation) {
// bail out for empty or unsupported mutations
if (!(mutation && isPrimitiveMutation(mutation))) {
return;
}
// if autoCompact is set, we need to compact while adding
if (this.autoCompact) {
this.addAndCompact(mutation);
... | [
"function",
"(",
"mutation",
")",
"{",
"// bail out for empty or unsupported mutations",
"if",
"(",
"!",
"(",
"mutation",
"&&",
"isPrimitiveMutation",
"(",
"mutation",
")",
")",
")",
"{",
"return",
";",
"}",
"// if autoCompact is set, we need to compact while adding",
"... | Records a new mutation.
@private
@param {MutationTracker~mutation} mutation | [
"Records",
"a",
"new",
"mutation",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/mutation-tracker.js#L112-L126 | |
15,092 | postmanlabs/postman-collection | lib/collection/mutation-tracker.js | function (mutation) {
// for `set` and `unset` mutations the key to compact with is the `keyPath`
var key = mutation[0];
// convert `keyPath` to a string
key = Array.isArray(key) ? key.join('.') : key;
this.compacted[key] = mutation;
} | javascript | function (mutation) {
// for `set` and `unset` mutations the key to compact with is the `keyPath`
var key = mutation[0];
// convert `keyPath` to a string
key = Array.isArray(key) ? key.join('.') : key;
this.compacted[key] = mutation;
} | [
"function",
"(",
"mutation",
")",
"{",
"// for `set` and `unset` mutations the key to compact with is the `keyPath`",
"var",
"key",
"=",
"mutation",
"[",
"0",
"]",
";",
"// convert `keyPath` to a string",
"key",
"=",
"Array",
".",
"isArray",
"(",
"key",
")",
"?",
"key... | Records a mutation compacting existing mutations for the same key path.
@private
@param {MutationTracker~mutation} mutation | [
"Records",
"a",
"mutation",
"compacting",
"existing",
"mutations",
"for",
"the",
"same",
"key",
"path",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/mutation-tracker.js#L134-L142 | |
15,093 | postmanlabs/postman-collection | lib/collection/mutation-tracker.js | function (instruction) {
// @todo: use argument spread here once we drop support for node v4
var payload = Array.prototype.slice.call(arguments, 1);
// invalid call
if (!(instruction && payload)) {
return;
}
// unknown instruction
if (!(instruction =... | javascript | function (instruction) {
// @todo: use argument spread here once we drop support for node v4
var payload = Array.prototype.slice.call(arguments, 1);
// invalid call
if (!(instruction && payload)) {
return;
}
// unknown instruction
if (!(instruction =... | [
"function",
"(",
"instruction",
")",
"{",
"// @todo: use argument spread here once we drop support for node v4",
"var",
"payload",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"// invalid call",
"if",
"(",
"!",
"... | Track a mutation.
@param {String} instruction the type of mutation | [
"Track",
"a",
"mutation",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/mutation-tracker.js#L149-L166 | |
15,094 | postmanlabs/postman-collection | lib/collection/mutation-tracker.js | function (target) {
if (!(target && target.applyMutation)) {
return;
}
var applyIndividualMutation = function applyIndividualMutation (mutation) {
applyMutation(target, mutation);
};
// mutations move from `stream` to `compacted`, so we apply the compact... | javascript | function (target) {
if (!(target && target.applyMutation)) {
return;
}
var applyIndividualMutation = function applyIndividualMutation (mutation) {
applyMutation(target, mutation);
};
// mutations move from `stream` to `compacted`, so we apply the compact... | [
"function",
"(",
"target",
")",
"{",
"if",
"(",
"!",
"(",
"target",
"&&",
"target",
".",
"applyMutation",
")",
")",
"{",
"return",
";",
"}",
"var",
"applyIndividualMutation",
"=",
"function",
"applyIndividualMutation",
"(",
"mutation",
")",
"{",
"applyMutati... | Applies all the recorded mutations on a target object.
@param {*} target Target to apply mutations. Must implement `applyMutation`. | [
"Applies",
"all",
"the",
"recorded",
"mutations",
"on",
"a",
"target",
"object",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/collection/mutation-tracker.js#L200-L217 | |
15,095 | postmanlabs/postman-collection | lib/url-pattern/url-match-pattern.js | function (options) {
_.has(options, 'pattern') && (_.isString(options.pattern) && !_.isEmpty(options.pattern)) &&
(this.pattern = options.pattern);
// create a match pattern and store it on cache
this._matchPatternObject = this.createMatchPattern();
} | javascript | function (options) {
_.has(options, 'pattern') && (_.isString(options.pattern) && !_.isEmpty(options.pattern)) &&
(this.pattern = options.pattern);
// create a match pattern and store it on cache
this._matchPatternObject = this.createMatchPattern();
} | [
"function",
"(",
"options",
")",
"{",
"_",
".",
"has",
"(",
"options",
",",
"'pattern'",
")",
"&&",
"(",
"_",
".",
"isString",
"(",
"options",
".",
"pattern",
")",
"&&",
"!",
"_",
".",
"isEmpty",
"(",
"options",
".",
"pattern",
")",
")",
"&&",
"(... | Assigns the given properties to the UrlMatchPattern.
@param {{ pattern: (string) }} options | [
"Assigns",
"the",
"given",
"properties",
"to",
"the",
"UrlMatchPattern",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/url-pattern/url-match-pattern.js#L75-L81 | |
15,096 | postmanlabs/postman-collection | lib/url-pattern/url-match-pattern.js | function () {
var matchPattern = this.pattern,
// Check the match pattern of sanity and split it into protocol, host and path
match = matchPattern.match(regexes.patternSplit);
if (!match) {
// This ensures it is a invalid match pattern
return;
}
... | javascript | function () {
var matchPattern = this.pattern,
// Check the match pattern of sanity and split it into protocol, host and path
match = matchPattern.match(regexes.patternSplit);
if (!match) {
// This ensures it is a invalid match pattern
return;
}
... | [
"function",
"(",
")",
"{",
"var",
"matchPattern",
"=",
"this",
".",
"pattern",
",",
"// Check the match pattern of sanity and split it into protocol, host and path",
"match",
"=",
"matchPattern",
".",
"match",
"(",
"regexes",
".",
"patternSplit",
")",
";",
"if",
"(",
... | Used to generate the match regex object from the match string we have.
@private
@returns {*} Match regex object | [
"Used",
"to",
"generate",
"the",
"match",
"regex",
"object",
"from",
"the",
"match",
"string",
"we",
"have",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/url-pattern/url-match-pattern.js#L89-L105 | |
15,097 | postmanlabs/postman-collection | lib/url-pattern/url-match-pattern.js | function (pattern) {
// Escape everything except ? and *.
pattern = pattern.replace(regexes.escapeMatcher, regexes.escapeMatchReplacement);
pattern = pattern.replace(regexes.questionmarkMatcher, regexes.questionmarkReplacment);
pattern = pattern.replace(regexes.starMatcher, regexes.starR... | javascript | function (pattern) {
// Escape everything except ? and *.
pattern = pattern.replace(regexes.escapeMatcher, regexes.escapeMatchReplacement);
pattern = pattern.replace(regexes.questionmarkMatcher, regexes.questionmarkReplacment);
pattern = pattern.replace(regexes.starMatcher, regexes.starR... | [
"function",
"(",
"pattern",
")",
"{",
"// Escape everything except ? and *.",
"pattern",
"=",
"pattern",
".",
"replace",
"(",
"regexes",
".",
"escapeMatcher",
",",
"regexes",
".",
"escapeMatchReplacement",
")",
";",
"pattern",
"=",
"pattern",
".",
"replace",
"(",
... | Converts a given glob pattern into a regular expression.
@private
@param {String} pattern Glob pattern string
@return {RegExp=} | [
"Converts",
"a",
"given",
"glob",
"pattern",
"into",
"a",
"regular",
"expression",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/url-pattern/url-match-pattern.js#L114-L120 | |
15,098 | postmanlabs/postman-collection | lib/url-pattern/url-match-pattern.js | function (protocol) {
var matchRegexObject = this._matchPatternObject;
return _.includes(ALLOWED_PROTOCOLS, protocol) &&
(_.includes(matchRegexObject.protocols, MATCH_ALL) || _.includes(matchRegexObject.protocols, protocol));
} | javascript | function (protocol) {
var matchRegexObject = this._matchPatternObject;
return _.includes(ALLOWED_PROTOCOLS, protocol) &&
(_.includes(matchRegexObject.protocols, MATCH_ALL) || _.includes(matchRegexObject.protocols, protocol));
} | [
"function",
"(",
"protocol",
")",
"{",
"var",
"matchRegexObject",
"=",
"this",
".",
"_matchPatternObject",
";",
"return",
"_",
".",
"includes",
"(",
"ALLOWED_PROTOCOLS",
",",
"protocol",
")",
"&&",
"(",
"_",
".",
"includes",
"(",
"matchRegexObject",
".",
"pr... | Tests if the given protocol string, is allowed by the pattern.
@param {String=} protocol The protocol to be checked if the pattern allows.
@return {Boolean=} | [
"Tests",
"if",
"the",
"given",
"protocol",
"string",
"is",
"allowed",
"by",
"the",
"pattern",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/url-pattern/url-match-pattern.js#L128-L133 | |
15,099 | postmanlabs/postman-collection | lib/url-pattern/url-match-pattern.js | function (host) {
/*
* For Host match, we are considering the port with the host, hence we are using getRemote() instead of getHost()
* We need to address three cases for the host urlStr
* 1. * It matches all the host + protocol, hence we are not having any parsing logic for it.
... | javascript | function (host) {
/*
* For Host match, we are considering the port with the host, hence we are using getRemote() instead of getHost()
* We need to address three cases for the host urlStr
* 1. * It matches all the host + protocol, hence we are not having any parsing logic for it.
... | [
"function",
"(",
"host",
")",
"{",
"/*\n * For Host match, we are considering the port with the host, hence we are using getRemote() instead of getHost()\n * We need to address three cases for the host urlStr\n * 1. * It matches all the host + protocol, hence we are not having any pa... | Tests if the given host string, is allowed by the pattern.
@param {String=} host The host to be checked if the pattern allows.
@return {Boolean=} | [
"Tests",
"if",
"the",
"given",
"host",
"string",
"is",
"allowed",
"by",
"the",
"pattern",
"."
] | 1cacd38a98c82f86d3f6c61d16a57465bbd78b63 | https://github.com/postmanlabs/postman-collection/blob/1cacd38a98c82f86d3f6c61d16a57465bbd78b63/lib/url-pattern/url-match-pattern.js#L150-L164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.