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
9,600
aws/aws-xray-sdk-node
packages/core/lib/patchers/aws_p.js
captureAWS
function captureAWS(awssdk) { if (!semver.gte(awssdk.VERSION, minVersion)) throw new Error ('AWS SDK version ' + minVersion + ' or greater required.'); for (var prop in awssdk) { if (awssdk[prop].serviceIdentifier) { var Service = awssdk[prop]; Service.prototype.customizeRequests(captureAWSRequ...
javascript
function captureAWS(awssdk) { if (!semver.gte(awssdk.VERSION, minVersion)) throw new Error ('AWS SDK version ' + minVersion + ' or greater required.'); for (var prop in awssdk) { if (awssdk[prop].serviceIdentifier) { var Service = awssdk[prop]; Service.prototype.customizeRequests(captureAWSRequ...
[ "function", "captureAWS", "(", "awssdk", ")", "{", "if", "(", "!", "semver", ".", "gte", "(", "awssdk", ".", "VERSION", ",", "minVersion", ")", ")", "throw", "new", "Error", "(", "'AWS SDK version '", "+", "minVersion", "+", "' or greater required.'", ")", ...
Configures the AWS SDK to automatically capture information for the segment. All created clients will automatically be captured. See 'captureAWSClient' for additional details. @param {AWS} awssdk - The Javascript AWS SDK. @alias module:aws_p.captureAWS @returns {AWS} @see https://github.com/aws/aws-sdk-js
[ "Configures", "the", "AWS", "SDK", "to", "automatically", "capture", "information", "for", "the", "segment", ".", "All", "created", "clients", "will", "automatically", "be", "captured", ".", "See", "captureAWSClient", "for", "additional", "details", "." ]
ad817e5ccfbb803ec4140cd8a457be579ea3cc1c
https://github.com/aws/aws-xray-sdk-node/blob/ad817e5ccfbb803ec4140cd8a457be579ea3cc1c/packages/core/lib/patchers/aws_p.js#L31-L43
9,601
aws/aws-xray-sdk-node
packages/core/lib/database/sql_data.js
SqlData
function SqlData(databaseVer, driverVer, user, url, queryType) { this.init(databaseVer, driverVer, user, url, queryType); }
javascript
function SqlData(databaseVer, driverVer, user, url, queryType) { this.init(databaseVer, driverVer, user, url, queryType); }
[ "function", "SqlData", "(", "databaseVer", ",", "driverVer", ",", "user", ",", "url", ",", "queryType", ")", "{", "this", ".", "init", "(", "databaseVer", ",", "driverVer", ",", "user", ",", "url", ",", "queryType", ")", ";", "}" ]
Represents a SQL database call. @constructor @param {string} databaseVer - The version on the database (user supplied). @param {string} driverVer - The version on the database driver (user supplied). @param {string} user - The user associated to the database call. @param {string} queryType - The SQL query type.
[ "Represents", "a", "SQL", "database", "call", "." ]
ad817e5ccfbb803ec4140cd8a457be579ea3cc1c
https://github.com/aws/aws-xray-sdk-node/blob/ad817e5ccfbb803ec4140cd8a457be579ea3cc1c/packages/core/lib/database/sql_data.js#L10-L12
9,602
aws/aws-xray-sdk-node
packages/core/lib/capture.js
captureFunc
function captureFunc(name, fcn, parent) { validate(name, fcn); var current, executeFcn; var parentSeg = contextUtils.resolveSegment(parent); if (!parentSeg) { logger.getLogger().warn('Failed to capture function.'); return fcn(); } current = parentSeg.addNewSubsegment(name); executeFcn = captur...
javascript
function captureFunc(name, fcn, parent) { validate(name, fcn); var current, executeFcn; var parentSeg = contextUtils.resolveSegment(parent); if (!parentSeg) { logger.getLogger().warn('Failed to capture function.'); return fcn(); } current = parentSeg.addNewSubsegment(name); executeFcn = captur...
[ "function", "captureFunc", "(", "name", ",", "fcn", ",", "parent", ")", "{", "validate", "(", "name", ",", "fcn", ")", ";", "var", "current", ",", "executeFcn", ";", "var", "parentSeg", "=", "contextUtils", ".", "resolveSegment", "(", "parent", ")", ";",...
Wrap to automatically capture information for the segment. @param {string} name - The name of the new subsegment. @param {function} fcn - The function context to wrap. Can take a single 'subsegment' argument. @param {Segment|Subsegment} [parent] - The parent for the new subsegment, for manual mode. @alias module:captur...
[ "Wrap", "to", "automatically", "capture", "information", "for", "the", "segment", "." ]
ad817e5ccfbb803ec4140cd8a457be579ea3cc1c
https://github.com/aws/aws-xray-sdk-node/blob/ad817e5ccfbb803ec4140cd8a457be579ea3cc1c/packages/core/lib/capture.js#L18-L40
9,603
aws/aws-xray-sdk-node
packages/core/lib/middleware/sampling/sampling_rule.js
SamplingRule
function SamplingRule(name, priority, rate, reservoirSize, host, httpMethod, urlPath, serviceName, serviceType) { this.init(name, priority, rate, reservoirSize, host, httpMethod, urlPath, serviceName, serviceType); }
javascript
function SamplingRule(name, priority, rate, reservoirSize, host, httpMethod, urlPath, serviceName, serviceType) { this.init(name, priority, rate, reservoirSize, host, httpMethod, urlPath, serviceName, serviceType); }
[ "function", "SamplingRule", "(", "name", ",", "priority", ",", "rate", ",", "reservoirSize", ",", "host", ",", "httpMethod", ",", "urlPath", ",", "serviceName", ",", "serviceType", ")", "{", "this", ".", "init", "(", "name", ",", "priority", ",", "rate", ...
The data model for a sampling rule defined using X-Ray API CreateSamplingRules. It should be only instantiated directly from the X-Ray API response. @constructor
[ "The", "data", "model", "for", "a", "sampling", "rule", "defined", "using", "X", "-", "Ray", "API", "CreateSamplingRules", ".", "It", "should", "be", "only", "instantiated", "directly", "from", "the", "X", "-", "Ray", "API", "response", "." ]
ad817e5ccfbb803ec4140cd8a457be579ea3cc1c
https://github.com/aws/aws-xray-sdk-node/blob/ad817e5ccfbb803ec4140cd8a457be579ea3cc1c/packages/core/lib/middleware/sampling/sampling_rule.js#L10-L14
9,604
aws/aws-xray-sdk-node
packages/core/lib/aws-xray.js
function(plugins) { var pluginData = {}; plugins.forEach(function(plugin) { plugin.getData(function(data) { if (data) { for (var attribute in data) { pluginData[attribute] = data[attribute]; } } }); segmentUtils.setOrigin(plugin.originName); segmentUtils.setPlug...
javascript
function(plugins) { var pluginData = {}; plugins.forEach(function(plugin) { plugin.getData(function(data) { if (data) { for (var attribute in data) { pluginData[attribute] = data[attribute]; } } }); segmentUtils.setOrigin(plugin.originName); segmentUtils.setPlug...
[ "function", "(", "plugins", ")", "{", "var", "pluginData", "=", "{", "}", ";", "plugins", ".", "forEach", "(", "function", "(", "plugin", ")", "{", "plugin", ".", "getData", "(", "function", "(", "data", ")", "{", "if", "(", "data", ")", "{", "for"...
Enables use of plugins to capture additional data for segments. @param {Array} plugins - A configurable subset of AWSXRay.plugins. @memberof AWSXRay @see AWSXRay.plugins
[ "Enables", "use", "of", "plugins", "to", "capture", "additional", "data", "for", "segments", "." ]
ad817e5ccfbb803ec4140cd8a457be579ea3cc1c
https://github.com/aws/aws-xray-sdk-node/blob/ad817e5ccfbb803ec4140cd8a457be579ea3cc1c/packages/core/lib/aws-xray.js#L56-L67
9,605
nats-io/node-nats-streaming
lib/stan.js
Message
function Message(stanClient, msg, subscription) { this.stanClient = stanClient; this.msg = msg; this.subscription = subscription; }
javascript
function Message(stanClient, msg, subscription) { this.stanClient = stanClient; this.msg = msg; this.subscription = subscription; }
[ "function", "Message", "(", "stanClient", ",", "msg", ",", "subscription", ")", "{", "this", ".", "stanClient", "=", "stanClient", ";", "this", ".", "msg", "=", "msg", ";", "this", ".", "subscription", "=", "subscription", ";", "}" ]
Represents a message received from the streaming server. @param stanClient @param msg @param subscription @constructor
[ "Represents", "a", "message", "received", "from", "the", "streaming", "server", "." ]
d7a3cdc758c1c8a7f08f5aa8d8311fd5f189c6dd
https://github.com/nats-io/node-nats-streaming/blob/d7a3cdc758c1c8a7f08f5aa8d8311fd5f189c6dd/lib/stan.js#L881-L885
9,606
BabylonJS/Spector.js
sample/js/transient.js
runTransient
function runTransient() { var c = document.createElement('canvas'); var gl = c.getContext('webgl'); var ext = gl.getExtension('WEBGL_debug_renderer_info'); var renderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL); console.log(renderer); }
javascript
function runTransient() { var c = document.createElement('canvas'); var gl = c.getContext('webgl'); var ext = gl.getExtension('WEBGL_debug_renderer_info'); var renderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL); console.log(renderer); }
[ "function", "runTransient", "(", ")", "{", "var", "c", "=", "document", ".", "createElement", "(", "'canvas'", ")", ";", "var", "gl", "=", "c", ".", "getContext", "(", "'webgl'", ")", ";", "var", "ext", "=", "gl", ".", "getExtension", "(", "'WEBGL_debu...
start Called when the canvas is created to get the ball rolling.
[ "start", "Called", "when", "the", "canvas", "is", "created", "to", "get", "the", "ball", "rolling", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/js/transient.js#L51-L57
9,607
BabylonJS/Spector.js
sample/js/transient.js
initWebGL
function initWebGL() { gl = null; try { gl = canvas.getContext("experimental-webgl"); } catch(e) { alert(e); } // If we don't have a GL context, give up now if (!gl) { alert("Unable to initialize WebGL. Your browser may not support it."); } }
javascript
function initWebGL() { gl = null; try { gl = canvas.getContext("experimental-webgl"); } catch(e) { alert(e); } // If we don't have a GL context, give up now if (!gl) { alert("Unable to initialize WebGL. Your browser may not support it."); } }
[ "function", "initWebGL", "(", ")", "{", "gl", "=", "null", ";", "try", "{", "gl", "=", "canvas", ".", "getContext", "(", "\"experimental-webgl\"", ")", ";", "}", "catch", "(", "e", ")", "{", "alert", "(", "e", ")", ";", "}", "// If we don't have a GL c...
initWebGL Initialize WebGL, returning the GL context or null if WebGL isn't available or could not be initialized.
[ "initWebGL", "Initialize", "WebGL", "returning", "the", "GL", "context", "or", "null", "if", "WebGL", "isn", "t", "available", "or", "could", "not", "be", "initialized", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/js/transient.js#L95-L110
9,608
BabylonJS/Spector.js
sample/js/transient.js
getShader
function getShader(gl, source, isVertex) { var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER); gl.shaderSource(shader, source); gl.compileShader(shader); // See if it compiled successfully if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { alert("An error occurred compi...
javascript
function getShader(gl, source, isVertex) { var shader = gl.createShader(isVertex ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER); gl.shaderSource(shader, source); gl.compileShader(shader); // See if it compiled successfully if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { alert("An error occurred compi...
[ "function", "getShader", "(", "gl", ",", "source", ",", "isVertex", ")", "{", "var", "shader", "=", "gl", ".", "createShader", "(", "isVertex", "?", "gl", ".", "VERTEX_SHADER", ":", "gl", ".", "FRAGMENT_SHADER", ")", ";", "gl", ".", "shaderSource", "(", ...
getShader Loads a shader program
[ "getShader", "Loads", "a", "shader", "program" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/js/transient.js#L345-L358
9,609
BabylonJS/Spector.js
sample/assets/js/babylon.objFileLoader.js
function (arr, obj) { if (!arr[obj[0]]) arr[obj[0]] = { normals: [], idx: [] }; var idx = arr[obj[0]].normals.indexOf(obj[1]); return idx === -1 ? -1 : arr[obj[0]].idx[idx]; }
javascript
function (arr, obj) { if (!arr[obj[0]]) arr[obj[0]] = { normals: [], idx: [] }; var idx = arr[obj[0]].normals.indexOf(obj[1]); return idx === -1 ? -1 : arr[obj[0]].idx[idx]; }
[ "function", "(", "arr", ",", "obj", ")", "{", "if", "(", "!", "arr", "[", "obj", "[", "0", "]", "]", ")", "arr", "[", "obj", "[", "0", "]", "]", "=", "{", "normals", ":", "[", "]", ",", "idx", ":", "[", "]", "}", ";", "var", "idx", "=",...
Search for obj in the given array. This function is called to check if a couple of data already exists in an array. If found, returns the index of the founded tuple index. Returns -1 if not found @param arr Array<{ normals: Array<number>, idx: Array<number> }> @param obj Array<number> @returns {boolean}
[ "Search", "for", "obj", "in", "the", "given", "array", ".", "This", "function", "is", "called", "to", "check", "if", "a", "couple", "of", "data", "already", "exists", "in", "an", "array", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.objFileLoader.js#L305-L310
9,610
BabylonJS/Spector.js
sample/assets/js/babylon.objFileLoader.js
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); //For each element in the triangles array. //This var could contains 1 to an infinity of triangles for (var k = 0; k < triangles.length; k++) { ...
javascript
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); //For each element in the triangles array. //This var could contains 1 to an infinity of triangles for (var k = 0; k < triangles.length; k++) { ...
[ "function", "(", "face", ",", "v", ")", "{", "//Get the indices of triangles for each polygon", "getTriangles", "(", "face", ",", "v", ")", ";", "//For each element in the triangles array.", "//This var could contains 1 to an infinity of triangles", "for", "(", "var", "k", ...
Create triangles and push the data for each polygon for the pattern 1 In this pattern we get vertice positions @param face @param v
[ "Create", "triangles", "and", "push", "the", "data", "for", "each", "polygon", "for", "the", "pattern", "1", "In", "this", "pattern", "we", "get", "vertice", "positions" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.objFileLoader.js#L430-L445
9,611
BabylonJS/Spector.js
sample/assets/js/babylon.objFileLoader.js
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1/1" //Split the data for getting position and uv var poin...
javascript
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1/1" //Split the data for getting position and uv var poin...
[ "function", "(", "face", ",", "v", ")", "{", "//Get the indices of triangles for each polygon", "getTriangles", "(", "face", ",", "v", ")", ";", "for", "(", "var", "k", "=", "0", ";", "k", "<", "triangles", ".", "length", ";", "k", "++", ")", "{", "//t...
Create triangles and push the data for each polygon for the pattern 2 In this pattern we get vertice positions and uvsu @param face @param v
[ "Create", "triangles", "and", "push", "the", "data", "for", "each", "polygon", "for", "the", "pattern", "2", "In", "this", "pattern", "we", "get", "vertice", "positions", "and", "uvsu" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.objFileLoader.js#L452-L470
9,612
BabylonJS/Spector.js
sample/assets/js/babylon.objFileLoader.js
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1/1/1" //Split the data for getting position, uv, and normals ...
javascript
function (face, v) { //Get the indices of triangles for each polygon getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1/1/1" //Split the data for getting position, uv, and normals ...
[ "function", "(", "face", ",", "v", ")", "{", "//Get the indices of triangles for each polygon", "getTriangles", "(", "face", ",", "v", ")", ";", "for", "(", "var", "k", "=", "0", ";", "k", "<", "triangles", ".", "length", ";", "k", "++", ")", "{", "//t...
Create triangles and push the data for each polygon for the pattern 3 In this pattern we get vertice positions, uvs and normals @param face @param v
[ "Create", "triangles", "and", "push", "the", "data", "for", "each", "polygon", "for", "the", "pattern", "3", "In", "this", "pattern", "we", "get", "vertice", "positions", "uvs", "and", "normals" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.objFileLoader.js#L477-L495
9,613
BabylonJS/Spector.js
sample/assets/js/babylon.objFileLoader.js
function (face, v) { getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1//1" //Split the data for getting position and normals var point = triangles[k].split("//"); // ["1", "1"] ...
javascript
function (face, v) { getTriangles(face, v); for (var k = 0; k < triangles.length; k++) { //triangle[k] = "1//1" //Split the data for getting position and normals var point = triangles[k].split("//"); // ["1", "1"] ...
[ "function", "(", "face", ",", "v", ")", "{", "getTriangles", "(", "face", ",", "v", ")", ";", "for", "(", "var", "k", "=", "0", ";", "k", "<", "triangles", ".", "length", ";", "k", "++", ")", "{", "//triangle[k] = \"1//1\"", "//Split the data for getti...
Create triangles and push the data for each polygon for the pattern 4 In this pattern we get vertice positions and normals @param face @param v
[ "Create", "triangles", "and", "push", "the", "data", "for", "each", "polygon", "for", "the", "pattern", "4", "In", "this", "pattern", "we", "get", "vertice", "positions", "and", "normals" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.objFileLoader.js#L502-L517
9,614
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
Color3
function Color3(r, g, b) { if (r === void 0) { r = 0; } if (g === void 0) { g = 0; } if (b === void 0) { b = 0; } this.r = r; this.g = g; this.b = b; }
javascript
function Color3(r, g, b) { if (r === void 0) { r = 0; } if (g === void 0) { g = 0; } if (b === void 0) { b = 0; } this.r = r; this.g = g; this.b = b; }
[ "function", "Color3", "(", "r", ",", "g", ",", "b", ")", "{", "if", "(", "r", "===", "void", "0", ")", "{", "r", "=", "0", ";", "}", "if", "(", "g", "===", "void", "0", ")", "{", "g", "=", "0", ";", "}", "if", "(", "b", "===", "void", ...
Creates a new Color3 object from red, green, blue values, all between 0 and 1.
[ "Creates", "a", "new", "Color3", "object", "from", "red", "green", "blue", "values", "all", "between", "0", "and", "1", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L183-L190
9,615
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
Quaternion
function Quaternion(x, y, z, w) { if (x === void 0) { x = 0.0; } if (y === void 0) { y = 0.0; } if (z === void 0) { z = 0.0; } if (w === void 0) { w = 1.0; } this.x = x; this.y = y; this.z = z; this.w = w; }
javascript
function Quaternion(x, y, z, w) { if (x === void 0) { x = 0.0; } if (y === void 0) { y = 0.0; } if (z === void 0) { z = 0.0; } if (w === void 0) { w = 1.0; } this.x = x; this.y = y; this.z = z; this.w = w; }
[ "function", "Quaternion", "(", "x", ",", "y", ",", "z", ",", "w", ")", "{", "if", "(", "x", "===", "void", "0", ")", "{", "x", "=", "0.0", ";", "}", "if", "(", "y", "===", "void", "0", ")", "{", "y", "=", "0.0", ";", "}", "if", "(", "z"...
Creates a new Quaternion from the passed floats.
[ "Creates", "a", "new", "Quaternion", "from", "the", "passed", "floats", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L2393-L2402
9,616
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
Path2
function Path2(x, y) { this._points = new Array(); this._length = 0.0; this.closed = false; this._points.push(new Vector2(x, y)); }
javascript
function Path2(x, y) { this._points = new Array(); this._length = 0.0; this.closed = false; this._points.push(new Vector2(x, y)); }
[ "function", "Path2", "(", "x", ",", "y", ")", "{", "this", ".", "_points", "=", "new", "Array", "(", ")", ";", "this", ".", "_length", "=", "0.0", ";", "this", ".", "closed", "=", "false", ";", "this", ".", "_points", ".", "push", "(", "new", "...
Creates a Path2 object from the starting 2D coordinates x and y.
[ "Creates", "a", "Path2", "object", "from", "the", "starting", "2D", "coordinates", "x", "and", "y", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L4376-L4381
9,617
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
getMergedStore
function getMergedStore(target) { var classKey = target.getClassName(); if (__mergedStore[classKey]) { return __mergedStore[classKey]; } __mergedStore[classKey] = {}; var store = __mergedStore[classKey]; var currentTarget = target; var currentKey = cla...
javascript
function getMergedStore(target) { var classKey = target.getClassName(); if (__mergedStore[classKey]) { return __mergedStore[classKey]; } __mergedStore[classKey] = {}; var store = __mergedStore[classKey]; var currentTarget = target; var currentKey = cla...
[ "function", "getMergedStore", "(", "target", ")", "{", "var", "classKey", "=", "target", ".", "getClassName", "(", ")", ";", "if", "(", "__mergedStore", "[", "classKey", "]", ")", "{", "return", "__mergedStore", "[", "classKey", "]", ";", "}", "__mergedSto...
Return the list of properties flagged as serializable @param target: host object
[ "Return", "the", "list", "of", "properties", "flagged", "as", "serializable" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L5104-L5138
9,618
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function () { var boundingBox = this.boundingBox; var size = boundingBox.maximumWorld.subtract(boundingBox.minimumWorld); return size.length(); }
javascript
function () { var boundingBox = this.boundingBox; var size = boundingBox.maximumWorld.subtract(boundingBox.minimumWorld); return size.length(); }
[ "function", "(", ")", "{", "var", "boundingBox", "=", "this", ".", "boundingBox", ";", "var", "size", "=", "boundingBox", ".", "maximumWorld", ".", "subtract", "(", "boundingBox", ".", "minimumWorld", ")", ";", "return", "size", ".", "length", "(", ")", ...
Gets the world distance between the min and max points of the bounding box
[ "Gets", "the", "world", "distance", "between", "the", "min", "and", "max", "points", "of", "the", "bounding", "box" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L12235-L12239
9,619
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
RenderingGroup
function RenderingGroup(index, scene, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } if (transparentSortCompareFn ==...
javascript
function RenderingGroup(index, scene, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } if (transparentSortCompareFn ==...
[ "function", "RenderingGroup", "(", "index", ",", "scene", ",", "opaqueSortCompareFn", ",", "alphaTestSortCompareFn", ",", "transparentSortCompareFn", ")", "{", "if", "(", "opaqueSortCompareFn", "===", "void", "0", ")", "{", "opaqueSortCompareFn", "=", "null", ";", ...
Creates a new rendering group. @param index The rendering group index @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied @param transparentSortCompareFn The transparent sort compar...
[ "Creates", "a", "new", "rendering", "group", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L16290-L16306
9,620
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
UniformBuffer
function UniformBuffer(engine, data, dynamic) { this._engine = engine; this._noUBO = !engine.supportsUniformBuffers; this._dynamic = dynamic; this._data = data || []; this._uniformLocations = {}; this._uniformSizes = {}; this._uniformLo...
javascript
function UniformBuffer(engine, data, dynamic) { this._engine = engine; this._noUBO = !engine.supportsUniformBuffers; this._dynamic = dynamic; this._data = data || []; this._uniformLocations = {}; this._uniformSizes = {}; this._uniformLo...
[ "function", "UniformBuffer", "(", "engine", ",", "data", ",", "dynamic", ")", "{", "this", ".", "_engine", "=", "engine", ";", "this", ".", "_noUBO", "=", "!", "engine", ".", "supportsUniformBuffers", ";", "this", ".", "_dynamic", "=", "dynamic", ";", "t...
Uniform buffer objects. Handles blocks of uniform on the GPU. If WebGL 2 is not available, this class falls back on traditionnal setUniformXXX calls. For more information, please refer to : https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
[ "Uniform", "buffer", "objects", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L26585-L26621
9,621
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
ColorGradingTexture
function ColorGradingTexture(url, scene) { var _this = _super.call(this, scene) || this; if (!url) { return _this; } _this._textureMatrix = BABYLON.Matrix.Identity(); _this.name = url; _this.url = url; _this.hasAlpha = f...
javascript
function ColorGradingTexture(url, scene) { var _this = _super.call(this, scene) || this; if (!url) { return _this; } _this._textureMatrix = BABYLON.Matrix.Identity(); _this.name = url; _this.url = url; _this.hasAlpha = f...
[ "function", "ColorGradingTexture", "(", "url", ",", "scene", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "scene", ")", "||", "this", ";", "if", "(", "!", "url", ")", "{", "return", "_this", ";", "}", "_this", ".", "_text...
Instantiates a ColorGradingTexture from the following parameters. @param url The location of the color gradind data (currently only supporting 3dl) @param scene The scene the texture will be used in
[ "Instantiates", "a", "ColorGradingTexture", "from", "the", "following", "parameters", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L31449-L31472
9,622
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (value) { if (this._transparencyMode === value) { return; } this._transparencyMode = value; if (value === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND) { this._forceAlphaTest = t...
javascript
function (value) { if (this._transparencyMode === value) { return; } this._transparencyMode = value; if (value === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND) { this._forceAlphaTest = t...
[ "function", "(", "value", ")", "{", "if", "(", "this", ".", "_transparencyMode", "===", "value", ")", "{", "return", ";", "}", "this", ".", "_transparencyMode", "=", "value", ";", "if", "(", "value", "===", "BABYLON", ".", "PBRMaterial", ".", "PBRMATERIA...
Sets the transparency mode of the material.
[ "Sets", "the", "transparency", "mode", "of", "the", "material", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L34801-L34813
9,623
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
PBRMetallicRoughnessMaterial
function PBRMetallicRoughnessMaterial(name, scene) { var _this = _super.call(this, name, scene) || this; _this._useRoughnessFromMetallicTextureAlpha = false; _this._useRoughnessFromMetallicTextureGreen = true; _this._useMetallnessFromMetallicTextureBlue = true; ...
javascript
function PBRMetallicRoughnessMaterial(name, scene) { var _this = _super.call(this, name, scene) || this; _this._useRoughnessFromMetallicTextureAlpha = false; _this._useRoughnessFromMetallicTextureGreen = true; _this._useMetallnessFromMetallicTextureBlue = true; ...
[ "function", "PBRMetallicRoughnessMaterial", "(", "name", ",", "scene", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "name", ",", "scene", ")", "||", "this", ";", "_this", ".", "_useRoughnessFromMetallicTextureAlpha", "=", "false", ...
Instantiates a new PBRMetalRoughnessMaterial instance. @param name The material name @param scene The scene the material will be use in.
[ "Instantiates", "a", "new", "PBRMetalRoughnessMaterial", "instance", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L35676-L35682
9,624
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
PBRSpecularGlossinessMaterial
function PBRSpecularGlossinessMaterial(name, scene) { var _this = _super.call(this, name, scene) || this; _this._useMicroSurfaceFromReflectivityMapAlpha = true; return _this; }
javascript
function PBRSpecularGlossinessMaterial(name, scene) { var _this = _super.call(this, name, scene) || this; _this._useMicroSurfaceFromReflectivityMapAlpha = true; return _this; }
[ "function", "PBRSpecularGlossinessMaterial", "(", "name", ",", "scene", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "name", ",", "scene", ")", "||", "this", ";", "_this", ".", "_useMicroSurfaceFromReflectivityMapAlpha", "=", "true",...
Instantiates a new PBRSpecularGlossinessMaterial instance. @param name The material name @param scene The scene the material will be use in.
[ "Instantiates", "a", "new", "PBRSpecularGlossinessMaterial", "instance", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L35784-L35788
9,625
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (value) { var previousNeedCube = this.needCube(); this._direction = value; if (this.needCube() !== previousNeedCube && this._shadowGenerator) { this._shadowGenerator.recreateShadowMap(); } }
javascript
function (value) { var previousNeedCube = this.needCube(); this._direction = value; if (this.needCube() !== previousNeedCube && this._shadowGenerator) { this._shadowGenerator.recreateShadowMap(); } }
[ "function", "(", "value", ")", "{", "var", "previousNeedCube", "=", "this", ".", "needCube", "(", ")", ";", "this", ".", "_direction", "=", "value", ";", "if", "(", "this", ".", "needCube", "(", ")", "!==", "previousNeedCube", "&&", "this", ".", "_shad...
In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
[ "In", "case", "of", "direction", "provided", "the", "shadow", "will", "not", "use", "a", "cube", "texture", "but", "simulate", "a", "spot", "shadow", "as", "a", "fallback" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L38480-L38486
9,626
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function () { for (var index = 0; index < this.actions.length; index++) { var action = this.actions[index]; if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) { return true; ...
javascript
function () { for (var index = 0; index < this.actions.length; index++) { var action = this.actions[index]; if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) { return true; ...
[ "function", "(", ")", "{", "for", "(", "var", "index", "=", "0", ";", "index", "<", "this", ".", "actions", ".", "length", ";", "index", "++", ")", "{", "var", "action", "=", "this", ".", "actions", "[", "index", "]", ";", "if", "(", "action", ...
Does this action manager has pointer triggers @return {boolean} whether or not it has pointer triggers
[ "Does", "this", "action", "manager", "has", "pointer", "triggers" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L40749-L40757
9,627
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function () { for (var t in ActionManager.Triggers) { if (ActionManager.Triggers.hasOwnProperty(t)) { var t_int = parseInt(t); if (t_int >= ActionManager._OnPickTrigger && t_int <= ActionManager._OnPickUpTrigger) { ...
javascript
function () { for (var t in ActionManager.Triggers) { if (ActionManager.Triggers.hasOwnProperty(t)) { var t_int = parseInt(t); if (t_int >= ActionManager._OnPickTrigger && t_int <= ActionManager._OnPickUpTrigger) { ...
[ "function", "(", ")", "{", "for", "(", "var", "t", "in", "ActionManager", ".", "Triggers", ")", "{", "if", "(", "ActionManager", ".", "Triggers", ".", "hasOwnProperty", "(", "t", ")", ")", "{", "var", "t_int", "=", "parseInt", "(", "t", ")", ";", "...
Does exist one action manager with at least one pick trigger @return {boolean} whether or not it exists one action manager with one pick trigger
[ "Does", "exist", "one", "action", "manager", "with", "at", "least", "one", "pick", "trigger" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L40799-L40809
9,628
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (name, params) { var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype); newInstance.constructor.apply(newInstance, params); return newInstance; }
javascript
function (name, params) { var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype); newInstance.constructor.apply(newInstance, params); return newInstance; }
[ "function", "(", "name", ",", "params", ")", "{", "var", "newInstance", "=", "Object", ".", "create", "(", "BABYLON", ".", "Tools", ".", "Instantiate", "(", "\"BABYLON.\"", "+", "name", ")", ".", "prototype", ")", ";", "newInstance", ".", "constructor", ...
instanciate a new object
[ "instanciate", "a", "new", "object" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L40935-L40939
9,629
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (value) { if (this._intersectionThreshold === value) { return; } this._intersectionThreshold = value; if (this.geometry) { this.geometry.boundingBias = new BABYLON.Vector2(0, value); } ...
javascript
function (value) { if (this._intersectionThreshold === value) { return; } this._intersectionThreshold = value; if (this.geometry) { this.geometry.boundingBias = new BABYLON.Vector2(0, value); } ...
[ "function", "(", "value", ")", "{", "if", "(", "this", ".", "_intersectionThreshold", "===", "value", ")", "{", "return", ";", "}", "this", ".", "_intersectionThreshold", "=", "value", ";", "if", "(", "this", ".", "geometry", ")", "{", "this", ".", "ge...
The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray. This margin is expressed in world space coordinates, so its value may vary. @param value the new threshold to apply
[ "The", "intersection", "Threshold", "is", "the", "margin", "applied", "when", "intersection", "a", "segment", "of", "the", "LinesMesh", "with", "a", "Ray", ".", "This", "margin", "is", "expressed", "in", "world", "space", "coordinates", "so", "its", "value", ...
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L45158-L45166
9,630
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
getChildByName
function getChildByName(node, name) { return node.getChildMeshes(false, function (n) { return n.name === name; })[0]; }
javascript
function getChildByName(node, name) { return node.getChildMeshes(false, function (n) { return n.name === name; })[0]; }
[ "function", "getChildByName", "(", "node", ",", "name", ")", "{", "return", "node", ".", "getChildMeshes", "(", "false", ",", "function", "(", "n", ")", "{", "return", "n", ".", "name", "===", "name", ";", "}", ")", "[", "0", "]", ";", "}" ]
Look through all children recursively. This will return null if no mesh exists with the given name.
[ "Look", "through", "all", "children", "recursively", ".", "This", "will", "return", "null", "if", "no", "mesh", "exists", "with", "the", "given", "name", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L54933-L54935
9,631
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
getImmediateChildByName
function getImmediateChildByName(node, name) { return node.getChildMeshes(true, function (n) { return n.name == name; })[0]; }
javascript
function getImmediateChildByName(node, name) { return node.getChildMeshes(true, function (n) { return n.name == name; })[0]; }
[ "function", "getImmediateChildByName", "(", "node", ",", "name", ")", "{", "return", "node", ".", "getChildMeshes", "(", "true", ",", "function", "(", "n", ")", "{", "return", "n", ".", "name", "==", "name", ";", "}", ")", "[", "0", "]", ";", "}" ]
Look through only immediate children. This will return null if no mesh exists with the given name.
[ "Look", "through", "only", "immediate", "children", ".", "This", "will", "return", "null", "if", "no", "mesh", "exists", "with", "the", "given", "name", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L54937-L54939
9,632
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (subMesh) { var mesh = subMesh.getRenderingMesh(); if (_this._meshExcluded(mesh)) { return; } var scene = mesh.getScene(); var engine = scene.getEngine(); // Culling engine.setSta...
javascript
function (subMesh) { var mesh = subMesh.getRenderingMesh(); if (_this._meshExcluded(mesh)) { return; } var scene = mesh.getScene(); var engine = scene.getEngine(); // Culling engine.setSta...
[ "function", "(", "subMesh", ")", "{", "var", "mesh", "=", "subMesh", ".", "getRenderingMesh", "(", ")", ";", "if", "(", "_this", ".", "_meshExcluded", "(", "mesh", ")", ")", "{", "return", ";", "}", "var", "scene", "=", "mesh", ".", "getScene", "(", ...
Custom render function for submeshes
[ "Custom", "render", "function", "for", "submeshes" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L58169-L58218
9,633
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (v) { if (this._idealKernel === v) { return; } v = Math.max(v, 1); this._idealKernel = v; this._kernel = this._nearestBestKernel(v); this._updateParameters(); }
javascript
function (v) { if (this._idealKernel === v) { return; } v = Math.max(v, 1); this._idealKernel = v; this._kernel = this._nearestBestKernel(v); this._updateParameters(); }
[ "function", "(", "v", ")", "{", "if", "(", "this", ".", "_idealKernel", "===", "v", ")", "{", "return", ";", "}", "v", "=", "Math", ".", "max", "(", "v", ",", "1", ")", ";", "this", ".", "_idealKernel", "=", "v", ";", "this", ".", "_kernel", ...
Sets the length in pixels of the blur sample region
[ "Sets", "the", "length", "in", "pixels", "of", "the", "blur", "sample", "region" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L58884-L58892
9,634
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
HDRCubeTexture
function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator, onLoad, onError) { if (noMipmap === void 0) { noMipmap = false; } if (generateHarmonics === void 0) { generateHarmonics = true; } if (useInGammaSpace === void 0) { useInGammaSpa...
javascript
function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator, onLoad, onError) { if (noMipmap === void 0) { noMipmap = false; } if (generateHarmonics === void 0) { generateHarmonics = true; } if (useInGammaSpace === void 0) { useInGammaSpa...
[ "function", "HDRCubeTexture", "(", "url", ",", "scene", ",", "size", ",", "noMipmap", ",", "generateHarmonics", ",", "useInGammaSpace", ",", "usePMREMGenerator", ",", "onLoad", ",", "onError", ")", "{", "if", "(", "noMipmap", "===", "void", "0", ")", "{", ...
Instantiates an HDRTexture from the following parameters. @param url The location of the HDR raw data (Panorama stored in RGBE format) @param scene The scene the texture will be used in @param size The cubemap desired size (the more it increases the longer the generation will be) If the size is omitted this implies yo...
[ "Instantiates", "an", "HDRTexture", "from", "the", "following", "parameters", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L61623-L61686
9,635
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
zOrder
function zOrder(x, y, minX, minY, size) { // coords are transformed into non-negative 15-bit integer range x = 32767 * (x - minX) / size; y = 32767 * (y - minY) / size; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; ...
javascript
function zOrder(x, y, minX, minY, size) { // coords are transformed into non-negative 15-bit integer range x = 32767 * (x - minX) / size; y = 32767 * (y - minY) / size; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; ...
[ "function", "zOrder", "(", "x", ",", "y", ",", "minX", ",", "minY", ",", "size", ")", "{", "// coords are transformed into non-negative 15-bit integer range", "x", "=", "32767", "*", "(", "x", "-", "minX", ")", "/", "size", ";", "y", "=", "32767", "*", "...
z-order of a point given coords and size of the data bounding box
[ "z", "-", "order", "of", "a", "point", "given", "coords", "and", "size", "of", "the", "data", "bounding", "box" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L62408-L62421
9,636
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
DynamicFloatArray
function DynamicFloatArray(stride, initialElementCount) { this.compareValueOffset = null; this.sortingAscending = true; this._stride = stride; this.buffer = new Float32Array(stride * initialElementCount); this._lastUsed = 0; this._firstFree = 0; ...
javascript
function DynamicFloatArray(stride, initialElementCount) { this.compareValueOffset = null; this.sortingAscending = true; this._stride = stride; this.buffer = new Float32Array(stride * initialElementCount); this._lastUsed = 0; this._firstFree = 0; ...
[ "function", "DynamicFloatArray", "(", "stride", ",", "initialElementCount", ")", "{", "this", ".", "compareValueOffset", "=", "null", ";", "this", ".", "sortingAscending", "=", "true", ";", "this", ".", "_stride", "=", "stride", ";", "this", ".", "buffer", "...
Construct an instance of the dynamic float array @param stride size of one element in float (i.e. not bytes!) @param initialElementCount the number of available entries at construction
[ "Construct", "an", "instance", "of", "the", "dynamic", "float", "array" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L66150-L66165
9,637
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
EdgesRenderer
function EdgesRenderer(source, epsilon, checkVerticesInsteadOfIndices) { if (epsilon === void 0) { epsilon = 0.95; } if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; } this.edgesWidthScalerForOrthographic = 1000.0; this.edgesWidthScal...
javascript
function EdgesRenderer(source, epsilon, checkVerticesInsteadOfIndices) { if (epsilon === void 0) { epsilon = 0.95; } if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; } this.edgesWidthScalerForOrthographic = 1000.0; this.edgesWidthScal...
[ "function", "EdgesRenderer", "(", "source", ",", "epsilon", ",", "checkVerticesInsteadOfIndices", ")", "{", "if", "(", "epsilon", "===", "void", "0", ")", "{", "epsilon", "=", "0.95", ";", "}", "if", "(", "checkVerticesInsteadOfIndices", "===", "void", "0", ...
Beware when you use this class with complex objects as the adjacencies computation can be really long
[ "Beware", "when", "you", "use", "this", "class", "with", "complex", "objects", "as", "the", "adjacencies", "computation", "can", "be", "really", "long" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L70414-L70429
9,638
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
HighlightLayer
function HighlightLayer(name, scene, options) { this.name = name; this._vertexBuffers = {}; this._mainTextureDesiredSize = { width: 0, height: 0 }; this._meshes = {}; this._maxSize = 0; this._shouldRender = false; this._instanceGlowingM...
javascript
function HighlightLayer(name, scene, options) { this.name = name; this._vertexBuffers = {}; this._mainTextureDesiredSize = { width: 0, height: 0 }; this._meshes = {}; this._maxSize = 0; this._shouldRender = false; this._instanceGlowingM...
[ "function", "HighlightLayer", "(", "name", ",", "scene", ",", "options", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "_vertexBuffers", "=", "{", "}", ";", "this", ".", "_mainTextureDesiredSize", "=", "{", "width", ":", "0", ",", "heig...
Instantiates a new highlight Layer and references it to the scene.. @param name The name of the layer @param scene The scene to use the layer in @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)
[ "Instantiates", "a", "new", "highlight", "Layer", "and", "references", "it", "to", "the", "scene", ".." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L70710-L70803
9,639
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
RectPackingMap
function RectPackingMap(size, margin) { if (margin === void 0) { margin = 0; } var _this = _super.call(this, null, null, BABYLON.Vector2.Zero(), size) || this; _this._margin = margin; _this._root = _this; return _this; }
javascript
function RectPackingMap(size, margin) { if (margin === void 0) { margin = 0; } var _this = _super.call(this, null, null, BABYLON.Vector2.Zero(), size) || this; _this._margin = margin; _this._root = _this; return _this; }
[ "function", "RectPackingMap", "(", "size", ",", "margin", ")", "{", "if", "(", "margin", "===", "void", "0", ")", "{", "margin", "=", "0", ";", "}", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "null", ",", "null", ",", "BABYLON", ...
Create an instance of the object with a dimension using the given size @param size The dimension of the rectangle that will contain all the sub ones. @param margin The margin (empty space) created (in pixels) around the allocated Rectangles
[ "Create", "an", "instance", "of", "the", "object", "with", "a", "dimension", "using", "the", "given", "size" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L72021-L72027
9,640
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function () { return this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._...
javascript
function () { return this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._...
[ "function", "(", ")", "{", "return", "this", ".", "_attachedCamera", ".", "inertialAlphaOffset", "!==", "0", "||", "this", ".", "_attachedCamera", ".", "inertialBetaOffset", "!==", "0", "||", "this", ".", "_attachedCamera", ".", "inertialRadiusOffset", "!==", "0...
Gets a value indicating if the user is moving the camera
[ "Gets", "a", "value", "indicating", "if", "the", "user", "is", "moving", "the", "camera" ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L73044-L73051
9,641
BabylonJS/Spector.js
sample/assets/js/babylon.max.js
function (value) { var _this = this; if (this._autoTransitionRange === value) { return; } this._autoTransitionRange = value; var camera = this._attachedCamera; if (value) { this._onMes...
javascript
function (value) { var _this = this; if (this._autoTransitionRange === value) { return; } this._autoTransitionRange = value; var camera = this._attachedCamera; if (value) { this._onMes...
[ "function", "(", "value", ")", "{", "var", "_this", "=", "this", ";", "if", "(", "this", ".", "_autoTransitionRange", "===", "value", ")", "{", "return", ";", "}", "this", ".", "_autoTransitionRange", "=", "value", ";", "var", "camera", "=", "this", "....
Sets a value indicating if the lowerRadiusTransitionRange and upperRadiusTransitionRange are defined automatically Transition ranges will be set to 5% of the bounding box diagonal in world space
[ "Sets", "a", "value", "indicating", "if", "the", "lowerRadiusTransitionRange", "and", "upperRadiusTransitionRange", "are", "defined", "automatically", "Transition", "ranges", "will", "be", "set", "to", "5%", "of", "the", "bounding", "box", "diagonal", "in", "world",...
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/assets/js/babylon.max.js#L73122-L73143
9,642
BabylonJS/Spector.js
sample/js/uniformArray.js
drawScene
function drawScene() { // Clear the canvas before we start drawing on it. gl.clearColor(0, 0, 0, 1); gl.clearDepth(1.0); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Establish the perspective with which we want to view the // scene. Our field of view is 45 degrees, with a width/height // ratio...
javascript
function drawScene() { // Clear the canvas before we start drawing on it. gl.clearColor(0, 0, 0, 1); gl.clearDepth(1.0); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Establish the perspective with which we want to view the // scene. Our field of view is 45 degrees, with a width/height // ratio...
[ "function", "drawScene", "(", ")", "{", "// Clear the canvas before we start drawing on it.", "gl", ".", "clearColor", "(", "0", ",", "0", ",", "0", ",", "1", ")", ";", "gl", ".", "clearDepth", "(", "1.0", ")", ";", "gl", ".", "clear", "(", "gl", ".", ...
drawScene Draw the scene.
[ "drawScene", "Draw", "the", "scene", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/js/uniformArray.js#L191-L263
9,643
BabylonJS/Spector.js
sample/js/uniformArray.js
initShaders
function initShaders() { var fragmentShader = getShader(gl, fragmentShaderSource, false); var vertexShader = getShader(gl, vertexShaderSource, true); // Create the shader program shaderProgram = gl.createProgram(); gl.attachShader(shaderProgram, vertexShader); gl.attachShader(shaderProgram, fragmentShader...
javascript
function initShaders() { var fragmentShader = getShader(gl, fragmentShaderSource, false); var vertexShader = getShader(gl, vertexShaderSource, true); // Create the shader program shaderProgram = gl.createProgram(); gl.attachShader(shaderProgram, vertexShader); gl.attachShader(shaderProgram, fragmentShader...
[ "function", "initShaders", "(", ")", "{", "var", "fragmentShader", "=", "getShader", "(", "gl", ",", "fragmentShaderSource", ",", "false", ")", ";", "var", "vertexShader", "=", "getShader", "(", "gl", ",", "vertexShaderSource", ",", "true", ")", ";", "// Cre...
initShaders Initialize the shaders, so WebGL knows how to light our scene.
[ "initShaders", "Initialize", "the", "shaders", "so", "WebGL", "knows", "how", "to", "light", "our", "scene", "." ]
42602c83a0515b60338edad27c3330a7c0523bbe
https://github.com/BabylonJS/Spector.js/blob/42602c83a0515b60338edad27c3330a7c0523bbe/sample/js/uniformArray.js#L270-L291
9,644
googleapis/nodejs-tasks
samples/createHttpTaskWithToken.js
createHttpTaskWithToken
async function createHttpTaskWithToken( project, location, queue, url, email, payload, inSeconds ) { // [START cloud_tasks_create_http_task_with_token] // Imports the Google Cloud Tasks library. const {v2beta3} = require('@google-cloud/tasks'); // Instantiates a client. const client = new v2bet...
javascript
async function createHttpTaskWithToken( project, location, queue, url, email, payload, inSeconds ) { // [START cloud_tasks_create_http_task_with_token] // Imports the Google Cloud Tasks library. const {v2beta3} = require('@google-cloud/tasks'); // Instantiates a client. const client = new v2bet...
[ "async", "function", "createHttpTaskWithToken", "(", "project", ",", "location", ",", "queue", ",", "url", ",", "email", ",", "payload", ",", "inSeconds", ")", "{", "// [START cloud_tasks_create_http_task_with_token]", "// Imports the Google Cloud Tasks library.", "const", ...
Create a task with an HTTP target for a given queue with an arbitrary payload.
[ "Create", "a", "task", "with", "an", "HTTP", "target", "for", "a", "given", "queue", "with", "an", "arbitrary", "payload", "." ]
df5ee7359e140511f68d21e933fea6f987cf5077
https://github.com/googleapis/nodejs-tasks/blob/df5ee7359e140511f68d21e933fea6f987cf5077/samples/createHttpTaskWithToken.js#L21-L81
9,645
googleapis/nodejs-tasks
samples/createQueue.js
createQueue
async function createQueue( project = 'my-project-id', // Your GCP Project id queue = 'my-appengine-queue', // Name of the Queue to create location = 'us-central1' // The GCP region in which to create the queue ) { // Imports the Google Cloud Tasks library. const cloudTasks = require('@google-cloud/tasks'); ...
javascript
async function createQueue( project = 'my-project-id', // Your GCP Project id queue = 'my-appengine-queue', // Name of the Queue to create location = 'us-central1' // The GCP region in which to create the queue ) { // Imports the Google Cloud Tasks library. const cloudTasks = require('@google-cloud/tasks'); ...
[ "async", "function", "createQueue", "(", "project", "=", "'my-project-id'", ",", "// Your GCP Project id", "queue", "=", "'my-appengine-queue'", ",", "// Name of the Queue to create", "location", "=", "'us-central1'", "// The GCP region in which to create the queue", ")", "{", ...
Create a new Task Queue
[ "Create", "a", "new", "Task", "Queue" ]
df5ee7359e140511f68d21e933fea6f987cf5077
https://github.com/googleapis/nodejs-tasks/blob/df5ee7359e140511f68d21e933fea6f987cf5077/samples/createQueue.js#L20-L47
9,646
googleapis/nodejs-tasks
samples/deleteQueue.js
deleteQueue
async function deleteQueue( project = 'my-project-id', // Your GCP Project id queue = 'my-appengine-queue', // Name of the Queue to delete location = 'us-central1' // The GCP region in which to delete the queue ) { // Imports the Google Cloud Tasks library. const cloudTasks = require('@google-cloud/tasks'); ...
javascript
async function deleteQueue( project = 'my-project-id', // Your GCP Project id queue = 'my-appengine-queue', // Name of the Queue to delete location = 'us-central1' // The GCP region in which to delete the queue ) { // Imports the Google Cloud Tasks library. const cloudTasks = require('@google-cloud/tasks'); ...
[ "async", "function", "deleteQueue", "(", "project", "=", "'my-project-id'", ",", "// Your GCP Project id", "queue", "=", "'my-appengine-queue'", ",", "// Name of the Queue to delete", "location", "=", "'us-central1'", "// The GCP region in which to delete the queue", ")", "{", ...
Delete a given Queue
[ "Delete", "a", "given", "Queue" ]
df5ee7359e140511f68d21e933fea6f987cf5077
https://github.com/googleapis/nodejs-tasks/blob/df5ee7359e140511f68d21e933fea6f987cf5077/samples/deleteQueue.js#L20-L37
9,647
uiwjs/uiw
packages/core/src/table/util.js
getColspanNum
function getColspanNum(data = [], num = 1) { let childs = []; for (let i = 0; i < data.length; i += 1) { if (data[i].children) { childs = childs.concat(data[i].children); } } if (childs && childs.length > 0) { num = getColspanNum(childs, num + 1); } return num; }
javascript
function getColspanNum(data = [], num = 1) { let childs = []; for (let i = 0; i < data.length; i += 1) { if (data[i].children) { childs = childs.concat(data[i].children); } } if (childs && childs.length > 0) { num = getColspanNum(childs, num + 1); } return num; }
[ "function", "getColspanNum", "(", "data", "=", "[", "]", ",", "num", "=", "1", ")", "{", "let", "childs", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "data", ".", "length", ";", "i", "+=", "1", ")", "{", "if", "(", ...
Get colspan number @param {Array} date
[ "Get", "colspan", "number" ]
28d57c797c1b827681dc04c5885c6c310fb690b4
https://github.com/uiwjs/uiw/blob/28d57c797c1b827681dc04c5885c6c310fb690b4/packages/core/src/table/util.js#L7-L18
9,648
uiwjs/uiw
packages/core/src/table/util.js
getRowspanNum
function getRowspanNum(data = [], child = []) { let childs = []; for (let i = 0; i < data.length; i += 1) { if (!data[i].children) { childs.push(data[i]); } else if (data[i].children && data[i].children.length > 0) { childs = childs.concat(getRowspanNum(data[i].children, child)); } } ret...
javascript
function getRowspanNum(data = [], child = []) { let childs = []; for (let i = 0; i < data.length; i += 1) { if (!data[i].children) { childs.push(data[i]); } else if (data[i].children && data[i].children.length > 0) { childs = childs.concat(getRowspanNum(data[i].children, child)); } } ret...
[ "function", "getRowspanNum", "(", "data", "=", "[", "]", ",", "child", "=", "[", "]", ")", "{", "let", "childs", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "data", ".", "length", ";", "i", "+=", "1", ")", "{", "if"...
Get rowspan number @param {Array} date
[ "Get", "rowspan", "number" ]
28d57c797c1b827681dc04c5885c6c310fb690b4
https://github.com/uiwjs/uiw/blob/28d57c797c1b827681dc04c5885c6c310fb690b4/packages/core/src/table/util.js#L24-L34
9,649
newsuk/times-components
packages/article-skeleton/src/head.web.js
getSectionName
function getSectionName(article) { const { tiles } = article; if (!tiles) { return null; } const slices = tiles.reduce((acc, tile) => { acc.push(...tile.slices); return acc; }, []); const sections = slices.reduce((acc, slice) => { acc.push(...slice.sections); return acc; }, []); co...
javascript
function getSectionName(article) { const { tiles } = article; if (!tiles) { return null; } const slices = tiles.reduce((acc, tile) => { acc.push(...tile.slices); return acc; }, []); const sections = slices.reduce((acc, slice) => { acc.push(...slice.sections); return acc; }, []); co...
[ "function", "getSectionName", "(", "article", ")", "{", "const", "{", "tiles", "}", "=", "article", ";", "if", "(", "!", "tiles", ")", "{", "return", "null", ";", "}", "const", "slices", "=", "tiles", ".", "reduce", "(", "(", "acc", ",", "tile", ")...
Get the section for an article, preferring it not to be News
[ "Get", "the", "section", "for", "an", "article", "preferring", "it", "not", "to", "be", "News" ]
06bdf1b6e42ee94101e50731c62fa51d55dadbef
https://github.com/newsuk/times-components/blob/06bdf1b6e42ee94101e50731c62fa51d55dadbef/packages/article-skeleton/src/head.web.js#L9-L33
9,650
keen/keen-tracking.js
lib/utils/serializeForm.js
str_serialize
function str_serialize(result, key, value) { // encode newlines as \r\n cause the html spec says so value = value.replace(/(\r)?\n/g, '\r\n'); value = encodeURIComponent(value); // spaces should be '+' rather than '%20'. value = value.replace(/%20/g, '+'); return result + (result ? '&' : '') + encodeURICom...
javascript
function str_serialize(result, key, value) { // encode newlines as \r\n cause the html spec says so value = value.replace(/(\r)?\n/g, '\r\n'); value = encodeURIComponent(value); // spaces should be '+' rather than '%20'. value = value.replace(/%20/g, '+'); return result + (result ? '&' : '') + encodeURICom...
[ "function", "str_serialize", "(", "result", ",", "key", ",", "value", ")", "{", "// encode newlines as \\r\\n cause the html spec says so", "value", "=", "value", ".", "replace", "(", "/", "(\\r)?\\n", "/", "g", ",", "'\\r\\n'", ")", ";", "value", "=", "encodeUR...
urlform encoding serializer
[ "urlform", "encoding", "serializer" ]
9101cef8e105a80ea12354423d6f563a3853aa8c
https://github.com/keen/keen-tracking.js/blob/9101cef8e105a80ea12354423d6f563a3853aa8c/lib/utils/serializeForm.js#L253-L261
9,651
keen/keen-tracking.js
lib/record-events-browser.js
sendBeacon
function sendBeacon(url, callback){ var self = this, img = document.createElement('img'), loaded = false; img.onload = function() { loaded = true; if ('naturalHeight' in this) { if (this.naturalHeight + this.naturalWidth === 0) { this.onerror(); return; } } else ...
javascript
function sendBeacon(url, callback){ var self = this, img = document.createElement('img'), loaded = false; img.onload = function() { loaded = true; if ('naturalHeight' in this) { if (this.naturalHeight + this.naturalWidth === 0) { this.onerror(); return; } } else ...
[ "function", "sendBeacon", "(", "url", ",", "callback", ")", "{", "var", "self", "=", "this", ",", "img", "=", "document", ".", "createElement", "(", "'img'", ")", ",", "loaded", "=", "false", ";", "img", ".", "onload", "=", "function", "(", ")", "{",...
Image Beacon Requests DEPRECATED
[ "Image", "Beacon", "Requests", "DEPRECATED" ]
9101cef8e105a80ea12354423d6f563a3853aa8c
https://github.com/keen/keen-tracking.js/blob/9101cef8e105a80ea12354423d6f563a3853aa8c/lib/record-events-browser.js#L327-L354
9,652
ballercat/walt
packages/walt-parser-tools/src/map-node.js
mapNode
function mapNode(visitor) { const nodeMapper = node => { if (node == null) { return node; } const mappingFunction = (() => { if ('*' in visitor && typeof visitor['*'] === 'function') { return visitor['*']; } if (node.Type in visitor && typeof visitor[node.Type] === 'funct...
javascript
function mapNode(visitor) { const nodeMapper = node => { if (node == null) { return node; } const mappingFunction = (() => { if ('*' in visitor && typeof visitor['*'] === 'function') { return visitor['*']; } if (node.Type in visitor && typeof visitor[node.Type] === 'funct...
[ "function", "mapNode", "(", "visitor", ")", "{", "const", "nodeMapper", "=", "node", "=>", "{", "if", "(", "node", "==", "null", ")", "{", "return", "node", ";", "}", "const", "mappingFunction", "=", "(", "(", ")", "=>", "{", "if", "(", "'*'", "in"...
This should maybe be it's own module.
[ "This", "should", "maybe", "be", "it", "s", "own", "module", "." ]
024533f483e0dc8f234638134948d686409187b4
https://github.com/ballercat/walt/blob/024533f483e0dc8f234638134948d686409187b4/packages/walt-parser-tools/src/map-node.js#L36-L64
9,653
ballercat/walt
packages/walt-compiler/src/parser/index.js
makeLexer
function makeLexer() { const mooLexer = moo.compile(tokens); return { current: null, lines: [], get line() { return mooLexer.line; }, get col() { return mooLexer.col; }, save() { return mooLexer.save(); }, reset(chunk, info) { this.lines = chunk.split('\n...
javascript
function makeLexer() { const mooLexer = moo.compile(tokens); return { current: null, lines: [], get line() { return mooLexer.line; }, get col() { return mooLexer.col; }, save() { return mooLexer.save(); }, reset(chunk, info) { this.lines = chunk.split('\n...
[ "function", "makeLexer", "(", ")", "{", "const", "mooLexer", "=", "moo", ".", "compile", "(", "tokens", ")", ";", "return", "{", "current", ":", "null", ",", "lines", ":", "[", "]", ",", "get", "line", "(", ")", "{", "return", "mooLexer", ".", "lin...
Returns a custom lexer. This wrapper API is necessary to ignore comments in all of the subsequent compiler phases, unfortunately. TODO: Maybe consider adding comment nodes back to the AST. IIRC this causes lots of ambiguous grammar for whatever reason.
[ "Returns", "a", "custom", "lexer", ".", "This", "wrapper", "API", "is", "necessary", "to", "ignore", "comments", "in", "all", "of", "the", "subsequent", "compiler", "phases", "unfortunately", "." ]
024533f483e0dc8f234638134948d686409187b4
https://github.com/ballercat/walt/blob/024533f483e0dc8f234638134948d686409187b4/packages/walt-compiler/src/parser/index.js#L35-L71
9,654
ballercat/walt
packages/walt-buildtools/src/index.js
parseImports
function parseImports(ast, compiler) { const imports = {}; let hasMemory = false; compiler.walkNode({ Import(node, _) { // Import nodes consist of field and a string literal node const [fields, module] = node.params; if (imports[module.value] == null) { imports[module.value] = []; ...
javascript
function parseImports(ast, compiler) { const imports = {}; let hasMemory = false; compiler.walkNode({ Import(node, _) { // Import nodes consist of field and a string literal node const [fields, module] = node.params; if (imports[module.value] == null) { imports[module.value] = []; ...
[ "function", "parseImports", "(", "ast", ",", "compiler", ")", "{", "const", "imports", "=", "{", "}", ";", "let", "hasMemory", "=", "false", ";", "compiler", ".", "walkNode", "(", "{", "Import", "(", "node", ",", "_", ")", "{", "// Import nodes consist o...
Parse imports out of an ast
[ "Parse", "imports", "out", "of", "an", "ast" ]
024533f483e0dc8f234638134948d686409187b4
https://github.com/ballercat/walt/blob/024533f483e0dc8f234638134948d686409187b4/packages/walt-buildtools/src/index.js#L26-L55
9,655
ballercat/walt
packages/walt-buildtools/src/index.js
buildTree
function buildTree(index, api) { const modules = {}; const dependency = (module, parent) => { const filepath = api.resolve(module, parent); if (modules[filepath] != null) { return modules[filepath]; } const src = api.getFileContents(module, parent, "utf8"); const basic = api.parser(src);...
javascript
function buildTree(index, api) { const modules = {}; const dependency = (module, parent) => { const filepath = api.resolve(module, parent); if (modules[filepath] != null) { return modules[filepath]; } const src = api.getFileContents(module, parent, "utf8"); const basic = api.parser(src);...
[ "function", "buildTree", "(", "index", ",", "api", ")", "{", "const", "modules", "=", "{", "}", ";", "const", "dependency", "=", "(", "module", ",", "parent", ")", "=>", "{", "const", "filepath", "=", "api", ".", "resolve", "(", "module", ",", "paren...
Build a dependency tree of ASTs given a root module
[ "Build", "a", "dependency", "tree", "of", "ASTs", "given", "a", "root", "module" ]
024533f483e0dc8f234638134948d686409187b4
https://github.com/ballercat/walt/blob/024533f483e0dc8f234638134948d686409187b4/packages/walt-buildtools/src/index.js#L58-L105
9,656
ballercat/walt
packages/walt-buildtools/src/index.js
build
function build(importsObj, tree) { const modules = {}; const instantiate = filepath => { if (modules[filepath] != null) { return modules[filepath]; } const mod = tree.modules[filepath]; const promise = Promise.all( Object.entries(mod.deps).map(([key, dep]) => { return instantia...
javascript
function build(importsObj, tree) { const modules = {}; const instantiate = filepath => { if (modules[filepath] != null) { return modules[filepath]; } const mod = tree.modules[filepath]; const promise = Promise.all( Object.entries(mod.deps).map(([key, dep]) => { return instantia...
[ "function", "build", "(", "importsObj", ",", "tree", ")", "{", "const", "modules", "=", "{", "}", ";", "const", "instantiate", "=", "filepath", "=>", "{", "if", "(", "modules", "[", "filepath", "]", "!=", "null", ")", "{", "return", "modules", "[", "...
Build the final binary Module set
[ "Build", "the", "final", "binary", "Module", "set" ]
024533f483e0dc8f234638134948d686409187b4
https://github.com/ballercat/walt/blob/024533f483e0dc8f234638134948d686409187b4/packages/walt-buildtools/src/index.js#L157-L195
9,657
apache/couchdb-fauxton
tasks/fauxton.js
_getHost
function _getHost (fauxton_ip) { if (fauxton_ip) { return fauxton_ip; } //making some assumptions here const interfaces = os.networkInterfaces(); const eth0 = interfaces[Object.keys(interfaces)[1]]; return eth0.find(function (item) { return item.family === 'IPv4'; }).address; }
javascript
function _getHost (fauxton_ip) { if (fauxton_ip) { return fauxton_ip; } //making some assumptions here const interfaces = os.networkInterfaces(); const eth0 = interfaces[Object.keys(interfaces)[1]]; return eth0.find(function (item) { return item.family === 'IPv4'; }).address; }
[ "function", "_getHost", "(", "fauxton_ip", ")", "{", "if", "(", "fauxton_ip", ")", "{", "return", "fauxton_ip", ";", "}", "//making some assumptions here", "const", "interfaces", "=", "os", ".", "networkInterfaces", "(", ")", ";", "const", "eth0", "=", "interf...
HELPERS if FAUXTON_HOST not set use ip address
[ "HELPERS", "if", "FAUXTON_HOST", "not", "set", "use", "ip", "address" ]
8773b054de9ec818c2a8555e342392abbd9dddec
https://github.com/apache/couchdb-fauxton/blob/8773b054de9ec818c2a8555e342392abbd9dddec/tasks/fauxton.js#L117-L127
9,658
apache/couchdb-fauxton
app/core/base.js
function (options) { options = Object.assign({ msg: 'Notification Event Triggered!', type: 'info', escape: true, clear: false }, options); if (FauxtonAPI.reduxDispatch) { FauxtonAPI.reduxDispatch({ type: 'ADD_NOTIFICATION', options: { info: options ...
javascript
function (options) { options = Object.assign({ msg: 'Notification Event Triggered!', type: 'info', escape: true, clear: false }, options); if (FauxtonAPI.reduxDispatch) { FauxtonAPI.reduxDispatch({ type: 'ADD_NOTIFICATION', options: { info: options ...
[ "function", "(", "options", ")", "{", "options", "=", "Object", ".", "assign", "(", "{", "msg", ":", "'Notification Event Triggered!'", ",", "type", ":", "'info'", ",", "escape", ":", "true", ",", "clear", ":", "false", "}", ",", "options", ")", ";", "...
Displays a notification message. The message is only displayed for a few seconds. The option visibleTime can be provided to set for how long the message should be displayed. @param {object} options Options are of the form { message: "string", type: "success"|"error"|"info", clear: true|false, escape: true|false, visib...
[ "Displays", "a", "notification", "message", ".", "The", "message", "is", "only", "displayed", "for", "a", "few", "seconds", ".", "The", "option", "visibleTime", "can", "be", "provided", "to", "set", "for", "how", "long", "the", "message", "should", "be", "...
8773b054de9ec818c2a8555e342392abbd9dddec
https://github.com/apache/couchdb-fauxton/blob/8773b054de9ec818c2a8555e342392abbd9dddec/app/core/base.js#L58-L74
9,659
gijsroge/OwlCarousel2-Thumbs
dist/owl.carousel2.thumbs.js
function (carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this.owl = carousel; /** * All DOM elements for thumbnails * @protected * @type {Object} */ this._thumbcontent = []; /** ...
javascript
function (carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this.owl = carousel; /** * All DOM elements for thumbnails * @protected * @type {Object} */ this._thumbcontent = []; /** ...
[ "function", "(", "carousel", ")", "{", "/**\n * Reference to the core.\n * @protected\n * @type {Owl}\n */", "this", ".", "owl", "=", "carousel", ";", "/**\n * All DOM elements for thumbnails\n * @protected\n * @type {Object}\n ...
Creates the thumbs plugin. @class The thumbs Plugin @param {Owl} carousel - The Owl Carousel
[ "Creates", "the", "thumbs", "plugin", "." ]
f4d2ca24dbdbf769f0915c721507809479492e74
https://github.com/gijsroge/OwlCarousel2-Thumbs/blob/f4d2ca24dbdbf769f0915c721507809479492e74/dist/owl.carousel2.thumbs.js#L16-L97
9,660
mercadopago/dx-nodejs
lib/mercadopago-support.js
showWarning
function showWarning() { var method = showWarning.caller.name; if (!configurations.areTestsRunnning()) { console.warn('This method (' + method + ') is deprecated and its going to be removed on next versions'); } }
javascript
function showWarning() { var method = showWarning.caller.name; if (!configurations.areTestsRunnning()) { console.warn('This method (' + method + ') is deprecated and its going to be removed on next versions'); } }
[ "function", "showWarning", "(", ")", "{", "var", "method", "=", "showWarning", ".", "caller", ".", "name", ";", "if", "(", "!", "configurations", ".", "areTestsRunnning", "(", ")", ")", "{", "console", ".", "warn", "(", "'This method ('", "+", "method", ...
Show Warning for method deprecation
[ "Show", "Warning", "for", "method", "deprecation" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L15-L20
9,661
mercadopago/dx-nodejs
lib/mercadopago-support.js
sandboxMode
function sandboxMode(enabled) { showWarning(); configurations.sandbox = (enabled !== undefined) ? (enabled === true) : configurations.sandbox; }
javascript
function sandboxMode(enabled) { showWarning(); configurations.sandbox = (enabled !== undefined) ? (enabled === true) : configurations.sandbox; }
[ "function", "sandboxMode", "(", "enabled", ")", "{", "showWarning", "(", ")", ";", "configurations", ".", "sandbox", "=", "(", "enabled", "!==", "undefined", ")", "?", "(", "enabled", "===", "true", ")", ":", "configurations", ".", "sandbox", ";", "}" ]
Enabled or disabled sandbox @param enabled
[ "Enabled", "or", "disabled", "sandbox" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L26-L29
9,662
mercadopago/dx-nodejs
lib/mercadopago-support.js
getAccessToken
function getAccessToken() { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return requestManager.generateAccessToken(callback); }
javascript
function getAccessToken() { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return requestManager.generateAccessToken(callback); }
[ "function", "getAccessToken", "(", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "requestManager", ".", "generateAcce...
Get access_token using the client_id and client_secret configure @param callback @returns {string}
[ "Get", "access_token", "using", "the", "client_id", "and", "client_secret", "configure" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L36-L42
9,663
mercadopago/dx-nodejs
lib/mercadopago-support.js
createPreference
function createPreference(preferences) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preferencesModule.create(preferences, callback); }
javascript
function createPreference(preferences) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preferencesModule.create(preferences, callback); }
[ "function", "createPreference", "(", "preferences", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "preferencesModule", ...
Create a preference using preferenceModule @param preferences @param callback @returns {preferences}
[ "Create", "a", "preference", "using", "preferenceModule" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L169-L175
9,664
mercadopago/dx-nodejs
lib/mercadopago-support.js
getPreference
function getPreference(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preferencesModule.get(id, callback); }
javascript
function getPreference(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preferencesModule.get(id, callback); }
[ "function", "getPreference", "(", "id", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "preferencesModule", ".", "ge...
Get a preference using preferenceModule @param id @param callback @returns {*}
[ "Get", "a", "preference", "using", "preferenceModule" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L201-L207
9,665
mercadopago/dx-nodejs
lib/mercadopago-support.js
createPreapprovalPayment
function createPreapprovalPayment(preapproval) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.create(preapproval, callback); }
javascript
function createPreapprovalPayment(preapproval) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.create(preapproval, callback); }
[ "function", "createPreapprovalPayment", "(", "preapproval", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "preapprovalM...
Create a preapproval payment using the preapprovalModule @param preapproval @param callback @returns {preapproval}
[ "Create", "a", "preapproval", "payment", "using", "the", "preapprovalModule" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L215-L221
9,666
mercadopago/dx-nodejs
lib/mercadopago-support.js
getPreapprovalPayment
function getPreapprovalPayment(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.get(id, callback); }
javascript
function getPreapprovalPayment(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.get(id, callback); }
[ "function", "getPreapprovalPayment", "(", "id", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "preapprovalModule", "....
Get a preapproval payment using the preapprovalModule @param id @param callback @returns {*}
[ "Get", "a", "preapproval", "payment", "using", "the", "preapprovalModule" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L247-L253
9,667
mercadopago/dx-nodejs
lib/mercadopago-support.js
cancelPreapprovalPayment
function cancelPreapprovalPayment(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.update({ id: id, status: 'cancelled' }, callback); }
javascript
function cancelPreapprovalPayment(id) { var callback = preConditions.getCallback(arguments[arguments.length - 1]); showWarning(); return preapprovalModule.update({ id: id, status: 'cancelled' }, callback); }
[ "function", "cancelPreapprovalPayment", "(", "id", ")", "{", "var", "callback", "=", "preConditions", ".", "getCallback", "(", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ")", ";", "showWarning", "(", ")", ";", "return", "preapprovalModule", ...
Canacel a preapproval payment using the preapprovalModule @param id @param callback @returns {*}
[ "Canacel", "a", "preapproval", "payment", "using", "the", "preapprovalModule" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/mercadopago-support.js#L343-L352
9,668
mercadopago/dx-nodejs
lib/utils/mercadopagoError.js
function (resolve, reject, callback) { callback = preConditions.getCallback(callback); return requestManager.generateAccessToken().then(function () { return requestManager.exec(execOptions); }).then(function (response) { resolve(response); return callback.apply(null, [null, response]); }).catch(fun...
javascript
function (resolve, reject, callback) { callback = preConditions.getCallback(callback); return requestManager.generateAccessToken().then(function () { return requestManager.exec(execOptions); }).then(function (response) { resolve(response); return callback.apply(null, [null, response]); }).catch(fun...
[ "function", "(", "resolve", ",", "reject", ",", "callback", ")", "{", "callback", "=", "preConditions", ".", "getCallback", "(", "callback", ")", ";", "return", "requestManager", ".", "generateAccessToken", "(", ")", ".", "then", "(", "function", "(", ")", ...
Execute request using the requestManager and execOptions @param resolve @param reject @param callback @returns {*}
[ "Execute", "request", "using", "the", "requestManager", "and", "execOptions" ]
6b0c1c4bf9ba363cd247358de62d01c3bb07820e
https://github.com/mercadopago/dx-nodejs/blob/6b0c1c4bf9ba363cd247358de62d01c3bb07820e/lib/utils/mercadopagoError.js#L28-L40
9,669
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
setCSS
function setCSS(el, properties) { var key; for (key in properties) { if (properties.hasOwnProperty(key)) { el.style[key] = properties[key]; } } }
javascript
function setCSS(el, properties) { var key; for (key in properties) { if (properties.hasOwnProperty(key)) { el.style[key] = properties[key]; } } }
[ "function", "setCSS", "(", "el", ",", "properties", ")", "{", "var", "key", ";", "for", "(", "key", "in", "properties", ")", "{", "if", "(", "properties", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "el", ".", "style", "[", "key", "]", "=", ...
Update multiple css values on an object
[ "Update", "multiple", "css", "values", "on", "an", "object" ]
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L60-L67
9,670
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
bulkUpdateCSS
function bulkUpdateCSS(data, callback) { executeNextFrame(function () { var i, item; for (i = 0; i < data.length; i++) { item = data[i]; setCSS(item.el, item.css); } // Run optional callback if (typeof callback === 'function') { executeNextFrame(callback); ...
javascript
function bulkUpdateCSS(data, callback) { executeNextFrame(function () { var i, item; for (i = 0; i < data.length; i++) { item = data[i]; setCSS(item.el, item.css); } // Run optional callback if (typeof callback === 'function') { executeNextFrame(callback); ...
[ "function", "bulkUpdateCSS", "(", "data", ",", "callback", ")", "{", "executeNextFrame", "(", "function", "(", ")", "{", "var", "i", ",", "item", ";", "for", "(", "i", "=", "0", ";", "i", "<", "data", ".", "length", ";", "i", "++", ")", "{", "ite...
Update the css properties of multiple elements at the same time befor the browsers next animation frame. The parameter `data` has to be an array containing objects, each with the element and the desired css properties.
[ "Update", "the", "css", "properties", "of", "multiple", "elements", "at", "the", "same", "time", "befor", "the", "browsers", "next", "animation", "frame", ".", "The", "parameter", "data", "has", "to", "be", "an", "array", "containing", "objects", "each", "wi...
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L73-L85
9,671
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
getData
function getData(el, attr, isInt, prefix) { if (prefix === undefined) { prefix = 'wookmark-'; } var val = el.getAttribute('data-' + prefix + attr); if (isInt === true) { return parseInt(val, 10); } return val; }
javascript
function getData(el, attr, isInt, prefix) { if (prefix === undefined) { prefix = 'wookmark-'; } var val = el.getAttribute('data-' + prefix + attr); if (isInt === true) { return parseInt(val, 10); } return val; }
[ "function", "getData", "(", "el", ",", "attr", ",", "isInt", ",", "prefix", ")", "{", "if", "(", "prefix", "===", "undefined", ")", "{", "prefix", "=", "'wookmark-'", ";", "}", "var", "val", "=", "el", ".", "getAttribute", "(", "'data-'", "+", "prefi...
Get value of specified data attribute
[ "Get", "value", "of", "specified", "data", "attribute" ]
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L160-L169
9,672
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
setData
function setData(el, attr, val, prefix) { if (prefix === undefined) { prefix = 'wookmark-'; } el.setAttribute('data-' + prefix + attr, val); }
javascript
function setData(el, attr, val, prefix) { if (prefix === undefined) { prefix = 'wookmark-'; } el.setAttribute('data-' + prefix + attr, val); }
[ "function", "setData", "(", "el", ",", "attr", ",", "val", ",", "prefix", ")", "{", "if", "(", "prefix", "===", "undefined", ")", "{", "prefix", "=", "'wookmark-'", ";", "}", "el", ".", "setAttribute", "(", "'data-'", "+", "prefix", "+", "attr", ",",...
Set value of specified data attribute
[ "Set", "value", "of", "specified", "data", "attribute" ]
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L172-L177
9,673
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
removeDuplicates
function removeDuplicates(items) { var temp = {}, result = [], x, i = items.length; while (i--) { x = getData(items[i], 'id', true); if (!temp.hasOwnProperty(x)) { temp[x] = 1; result.push(items[i]); } } return result; }
javascript
function removeDuplicates(items) { var temp = {}, result = [], x, i = items.length; while (i--) { x = getData(items[i], 'id', true); if (!temp.hasOwnProperty(x)) { temp[x] = 1; result.push(items[i]); } } return result; }
[ "function", "removeDuplicates", "(", "items", ")", "{", "var", "temp", "=", "{", "}", ",", "result", "=", "[", "]", ",", "x", ",", "i", "=", "items", ".", "length", ";", "while", "(", "i", "--", ")", "{", "x", "=", "getData", "(", "items", "[",...
Remove duplicates from given array
[ "Remove", "duplicates", "from", "given", "array" ]
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L180-L190
9,674
germanysbestkeptsecret/Wookmark-jQuery
wookmark.js
indexOf
function indexOf(items, item) { var len = items.length, i; for (i = 0; i < len; i++) { if (items[i] === item) { return i; } } return -1; }
javascript
function indexOf(items, item) { var len = items.length, i; for (i = 0; i < len; i++) { if (items[i] === item) { return i; } } return -1; }
[ "function", "indexOf", "(", "items", ",", "item", ")", "{", "var", "len", "=", "items", ".", "length", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "items", "[", "i", "]", "===", "item...
IE 8 compatible indexOf
[ "IE", "8", "compatible", "indexOf" ]
ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47
https://github.com/germanysbestkeptsecret/Wookmark-jQuery/blob/ef96eb34ec653c4a0c1ec09fd3c7b6a615e6ab47/wookmark.js#L199-L207
9,675
SparkPost/heml
packages/heml/src/bin/commands/develop.js
renderCLI
function renderCLI ({ url, status, time, size }) { return logUpdate(boxen( `${chalk.bgBlue.black(' HEML ')}\n\n` + `- ${chalk.bold('Preview:')} ${url}\n` + `- ${chalk.bold('Status:')} ${status}\n` + `- ${chalk.bold('Compile time:')} ${time}ms\n` + `- ${chalk.bold('Total size:')...
javascript
function renderCLI ({ url, status, time, size }) { return logUpdate(boxen( `${chalk.bgBlue.black(' HEML ')}\n\n` + `- ${chalk.bold('Preview:')} ${url}\n` + `- ${chalk.bold('Status:')} ${status}\n` + `- ${chalk.bold('Compile time:')} ${time}ms\n` + `- ${chalk.bold('Total size:')...
[ "function", "renderCLI", "(", "{", "url", ",", "status", ",", "time", ",", "size", "}", ")", "{", "return", "logUpdate", "(", "boxen", "(", "`", "${", "chalk", ".", "bgBlue", ".", "black", "(", "' HEML '", ")", "}", "\\n", "\\n", "`", "+", "`", "...
update the cli UI @param {String} params.url URL for preview server @param {String} params.status the current status @param {String} params.time time to compile the heml @param {String} params.size size of the HTML in mb
[ "update", "the", "cli", "UI" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml/src/bin/commands/develop.js#L69-L77
9,676
SparkPost/heml
packages/heml/src/bin/commands/develop.js
startDevServer
function startDevServer (directory, port = 3000) { let url const app = express() const { reload } = reloadServer(app) let preview = '' app.get('/', (req, res) => res.send(preview)) app.use(express.static(directory)) function update ({ html, errors, metadata }) { let status = errors.length ? chalk.re...
javascript
function startDevServer (directory, port = 3000) { let url const app = express() const { reload } = reloadServer(app) let preview = '' app.get('/', (req, res) => res.send(preview)) app.use(express.static(directory)) function update ({ html, errors, metadata }) { let status = errors.length ? chalk.re...
[ "function", "startDevServer", "(", "directory", ",", "port", "=", "3000", ")", "{", "let", "url", "const", "app", "=", "express", "(", ")", "const", "{", "reload", "}", "=", "reloadServer", "(", "app", ")", "let", "preview", "=", "''", "app", ".", "g...
Launches a server that reloads when the update function is called @param {String} defaultPreview the default content for when the sever loads @return {Object} { server, port, update }
[ "Launches", "a", "server", "that", "reloads", "when", "the", "update", "function", "is", "called" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml/src/bin/commands/develop.js#L84-L112
9,677
SparkPost/heml
packages/heml/src/index.js
heml
async function heml (contents, options = {}) { const results = {} const { beautify: beautifyOptions = {}, validate: validateOption = 'soft' } = options options.elements = flattenDeep(toArray(coreElements).concat(options.elements || [])) /** parse it ✂️ */ const $heml = parse(contents, options) ...
javascript
async function heml (contents, options = {}) { const results = {} const { beautify: beautifyOptions = {}, validate: validateOption = 'soft' } = options options.elements = flattenDeep(toArray(coreElements).concat(options.elements || [])) /** parse it ✂️ */ const $heml = parse(contents, options) ...
[ "async", "function", "heml", "(", "contents", ",", "options", "=", "{", "}", ")", "{", "const", "results", "=", "{", "}", "const", "{", "beautify", ":", "beautifyOptions", "=", "{", "}", ",", "validate", ":", "validateOption", "=", "'soft'", "}", "=", ...
renders the given HEML string with the config provided @param {String} HEML the heml to render @param {Object} options the options @return {Object} { metadata, html, errors }
[ "renders", "the", "given", "HEML", "string", "with", "the", "config", "provided" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml/src/index.js#L17-L57
9,678
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/expanders.js
replaceElementTagMentions
function replaceElementTagMentions (element, selector) { const processor = selectorParser((selectors) => { let nodesToReplace = [] /** * looping breaks if we replace dynamically * so instead collect an array of nodes to swap and do it at the end */ selectors.walk((node) => { if (node...
javascript
function replaceElementTagMentions (element, selector) { const processor = selectorParser((selectors) => { let nodesToReplace = [] /** * looping breaks if we replace dynamically * so instead collect an array of nodes to swap and do it at the end */ selectors.walk((node) => { if (node...
[ "function", "replaceElementTagMentions", "(", "element", ",", "selector", ")", "{", "const", "processor", "=", "selectorParser", "(", "(", "selectors", ")", "=>", "{", "let", "nodesToReplace", "=", "[", "]", "/**\n * looping breaks if we replace dynamically\n * ...
replace all custom element tag selectors @param {Object} element the element definition @param {String} selector the selector @return {String} the replaced selector
[ "replace", "all", "custom", "element", "tag", "selectors" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/expanders.js#L9-L25
9,679
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/expanders.js
replaceElementPseudoMentions
function replaceElementPseudoMentions (element, selector) { const processor = selectorParser((selectors) => { let nodesToReplace = [] /** * looping breaks if we replace dynamically * so instead collect an array of nodes to swap and do it at the end */ selectors.each((selector) => { l...
javascript
function replaceElementPseudoMentions (element, selector) { const processor = selectorParser((selectors) => { let nodesToReplace = [] /** * looping breaks if we replace dynamically * so instead collect an array of nodes to swap and do it at the end */ selectors.each((selector) => { l...
[ "function", "replaceElementPseudoMentions", "(", "element", ",", "selector", ")", "{", "const", "processor", "=", "selectorParser", "(", "(", "selectors", ")", "=>", "{", "let", "nodesToReplace", "=", "[", "]", "/**\n * looping breaks if we replace dynamically\n ...
replace all custom element pseudo selectors @param {Object} element the element definiton @param {String} selector the selector @return {String} the replaced selector
[ "replace", "all", "custom", "element", "pseudo", "selectors" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/expanders.js#L33-L66
9,680
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/expanders.js
expandElementRule
function expandElementRule (element, selectors = [], originalRule) { /** early return if we don't have any selectors */ if (selectors.length === 0) return [] let usedProps = [] let expandedRules = [] let defaultRules = [] /** create the base rule */ const baseRule = originalRule.clone() baseRule.selec...
javascript
function expandElementRule (element, selectors = [], originalRule) { /** early return if we don't have any selectors */ if (selectors.length === 0) return [] let usedProps = [] let expandedRules = [] let defaultRules = [] /** create the base rule */ const baseRule = originalRule.clone() baseRule.selec...
[ "function", "expandElementRule", "(", "element", ",", "selectors", "=", "[", "]", ",", "originalRule", ")", "{", "/** early return if we don't have any selectors */", "if", "(", "selectors", ".", "length", "===", "0", ")", "return", "[", "]", "let", "usedProps", ...
expand the given rule to correctly the style the element @param {Object} element element The element definition @param {Array} selectors the matched selectors to for @return {Array[Rule]} an array of the expanded rules
[ "expand", "the", "given", "rule", "to", "correctly", "the", "style", "the", "element" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/expanders.js#L74-L119
9,681
SparkPost/heml
packages/heml-render/src/index.js
preRenderElements
async function preRenderElements (elements, globals) { for (let element of elements) { await element.preRender(globals) } }
javascript
async function preRenderElements (elements, globals) { for (let element of elements) { await element.preRender(globals) } }
[ "async", "function", "preRenderElements", "(", "elements", ",", "globals", ")", "{", "for", "(", "let", "element", "of", "elements", ")", "{", "await", "element", ".", "preRender", "(", "globals", ")", "}", "}" ]
Run the async preRender functions for each element @param {Array} elements List of element definitons @param {Object} globals @return {Promise}
[ "Run", "the", "async", "preRender", "functions", "for", "each", "element" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-render/src/index.js#L33-L37
9,682
SparkPost/heml
packages/heml-render/src/index.js
postRenderElements
async function postRenderElements (elements, globals) { for (let element of elements) { await element.postRender(globals) } }
javascript
async function postRenderElements (elements, globals) { for (let element of elements) { await element.postRender(globals) } }
[ "async", "function", "postRenderElements", "(", "elements", ",", "globals", ")", "{", "for", "(", "let", "element", "of", "elements", ")", "{", "await", "element", ".", "postRender", "(", "globals", ")", "}", "}" ]
Run the async postRender functions for each element @param {Array} elements List of element definitons @param {Object} globals @return {Promise}
[ "Run", "the", "async", "postRender", "functions", "for", "each", "element" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-render/src/index.js#L45-L49
9,683
SparkPost/heml
packages/heml-render/src/index.js
renderElements
async function renderElements (elements, globals) { const { $ } = globals const elementMap = keyBy(elements, 'tagName') const metaTagNames = filter(elements, { parent: [ 'head' ] }).map(({ tagName }) => tagName) const nonMetaTagNames = difference(elements.map(({ tagName }) => tagName), metaTagNames) const $n...
javascript
async function renderElements (elements, globals) { const { $ } = globals const elementMap = keyBy(elements, 'tagName') const metaTagNames = filter(elements, { parent: [ 'head' ] }).map(({ tagName }) => tagName) const nonMetaTagNames = difference(elements.map(({ tagName }) => tagName), metaTagNames) const $n...
[ "async", "function", "renderElements", "(", "elements", ",", "globals", ")", "{", "const", "{", "$", "}", "=", "globals", "const", "elementMap", "=", "keyBy", "(", "elements", ",", "'tagName'", ")", "const", "metaTagNames", "=", "filter", "(", "elements", ...
Renders all HEML elements @param {Array} elements List of element definitons @param {Object} globals @return {Promise}
[ "Renders", "all", "HEML", "elements" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-render/src/index.js#L57-L77
9,684
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/coerceElements.js
findAtDecl
function findAtDecl (decls, prop) { const foundDecls = decls.filter((decl) => { return (isPlainObject(decl) && Object.keys(decl).length > 0 && Object.keys(decl)[0] === `@${prop}`) || decl === `@${prop}` }) if (foundDecls.length === 0) { return } const decl = foundDecls[0] return isP...
javascript
function findAtDecl (decls, prop) { const foundDecls = decls.filter((decl) => { return (isPlainObject(decl) && Object.keys(decl).length > 0 && Object.keys(decl)[0] === `@${prop}`) || decl === `@${prop}` }) if (foundDecls.length === 0) { return } const decl = foundDecls[0] return isP...
[ "function", "findAtDecl", "(", "decls", ",", "prop", ")", "{", "const", "foundDecls", "=", "decls", ".", "filter", "(", "(", "decl", ")", "=>", "{", "return", "(", "isPlainObject", "(", "decl", ")", "&&", "Object", ".", "keys", "(", "decl", ")", ".",...
finds the given at declaration value @param {Array[Object]} decls the decls from an element @param {String} the prop @return {Any} the found value
[ "finds", "the", "given", "at", "declaration", "value" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/coerceElements.js#L65-L77
9,685
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/coerceElements.js
toRegExp
function toRegExp (string) { if (isString(string) && string.startsWith('/') && string.lastIndexOf('/') !== 0) { const pattern = string.substr(1, string.lastIndexOf('/') - 1) const opts = string.substr(string.lastIndexOf('/') + 1).toLowerCase() return new RegExp(pattern, opts.includes('i') ? opts : `${opt...
javascript
function toRegExp (string) { if (isString(string) && string.startsWith('/') && string.lastIndexOf('/') !== 0) { const pattern = string.substr(1, string.lastIndexOf('/') - 1) const opts = string.substr(string.lastIndexOf('/') + 1).toLowerCase() return new RegExp(pattern, opts.includes('i') ? opts : `${opt...
[ "function", "toRegExp", "(", "string", ")", "{", "if", "(", "isString", "(", "string", ")", "&&", "string", ".", "startsWith", "(", "'/'", ")", "&&", "string", ".", "lastIndexOf", "(", "'/'", ")", "!==", "0", ")", "{", "const", "pattern", "=", "strin...
convert the given string to a regular expression @param {String|RegExp} prop the string to convert @return {RegExp} the regular expression
[ "convert", "the", "given", "string", "to", "a", "regular", "expression" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/coerceElements.js#L84-L97
9,686
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js
targetsTag
function targetsTag (selector) { const selectors = simpleSelectorParser.process(selector).res return selectors.filter((selector) => { let selectorNodes = selector.nodes.concat([]).reverse() // clone the array for (const node of selectorNodes) { if (node.type === 'cominator') { break } if (nod...
javascript
function targetsTag (selector) { const selectors = simpleSelectorParser.process(selector).res return selectors.filter((selector) => { let selectorNodes = selector.nodes.concat([]).reverse() // clone the array for (const node of selectorNodes) { if (node.type === 'cominator') { break } if (nod...
[ "function", "targetsTag", "(", "selector", ")", "{", "const", "selectors", "=", "simpleSelectorParser", ".", "process", "(", "selector", ")", ".", "res", "return", "selectors", ".", "filter", "(", "(", "selector", ")", "=>", "{", "let", "selectorNodes", "=",...
checks if selector targets a tag @param {String} selector the selector @return {Boolean} if the selector targets a tag
[ "checks", "if", "selector", "targets", "a", "tag" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js#L36-L50
9,687
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js
targetsElementPseudo
function targetsElementPseudo (element, selector) { const selectors = simpleSelectorParser.process(selector).res return selectors.filter((selector) => { let selectorNodes = selector.nodes.concat([]).reverse() // clone the array for (const node of selectorNodes) { if (node.type === 'cominator') { bre...
javascript
function targetsElementPseudo (element, selector) { const selectors = simpleSelectorParser.process(selector).res return selectors.filter((selector) => { let selectorNodes = selector.nodes.concat([]).reverse() // clone the array for (const node of selectorNodes) { if (node.type === 'cominator') { bre...
[ "function", "targetsElementPseudo", "(", "element", ",", "selector", ")", "{", "const", "selectors", "=", "simpleSelectorParser", ".", "process", "(", "selector", ")", ".", "res", "return", "selectors", ".", "filter", "(", "(", "selector", ")", "=>", "{", "l...
find all selectors that target the give element @param {Object} element the element definition @param {String} selector the selector @return {Array} the matched selectors
[ "find", "all", "selectors", "that", "target", "the", "give", "element" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js#L58-L76
9,688
SparkPost/heml
packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js
appendElementSelector
function appendElementSelector (element, selector) { const processor = selectorParser((selectors) => { let combinatorNode = null /** * looping breaks if we insert dynamically */ selectors.each((selector) => { const elementNode = selectorParser.tag({ value: element.tag }) selector.wa...
javascript
function appendElementSelector (element, selector) { const processor = selectorParser((selectors) => { let combinatorNode = null /** * looping breaks if we insert dynamically */ selectors.each((selector) => { const elementNode = selectorParser.tag({ value: element.tag }) selector.wa...
[ "function", "appendElementSelector", "(", "element", ",", "selector", ")", "{", "const", "processor", "=", "selectorParser", "(", "(", "selectors", ")", "=>", "{", "let", "combinatorNode", "=", "null", "/**\n * looping breaks if we insert dynamically\n */", "sel...
Add the element tag to the end of the selector @param {Object} element element definition @param {String} selector the selector @return {String} the modified selector
[ "Add", "the", "element", "tag", "to", "the", "end", "of", "the", "selector" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js#L84-L106
9,689
SparkPost/heml
packages/heml-inline/src/inlineMargins.js
inlineMargins
function inlineMargins ($) { $('table[style*=margin]').toNodes().forEach(($el) => { const { left, right } = getSideMargins($el.attr('style')) if (left === 'auto' && right === 'auto') { $el.attr('align', 'center') } else if (left === 'auto' && right !== 'auto') { $el.attr('align', 'right') ...
javascript
function inlineMargins ($) { $('table[style*=margin]').toNodes().forEach(($el) => { const { left, right } = getSideMargins($el.attr('style')) if (left === 'auto' && right === 'auto') { $el.attr('align', 'center') } else if (left === 'auto' && right !== 'auto') { $el.attr('align', 'right') ...
[ "function", "inlineMargins", "(", "$", ")", "{", "$", "(", "'table[style*=margin]'", ")", ".", "toNodes", "(", ")", ".", "forEach", "(", "(", "$el", ")", "=>", "{", "const", "{", "left", ",", "right", "}", "=", "getSideMargins", "(", "$el", ".", "att...
finds all the tables that are centered with margins and centers them with the align attribute @param {Cheerio} $
[ "finds", "all", "the", "tables", "that", "are", "centered", "with", "margins", "and", "centers", "them", "with", "the", "align", "attribute" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-inline/src/inlineMargins.js#L8-L20
9,690
SparkPost/heml
packages/heml-inline/src/inlineMargins.js
getSideMargins
function getSideMargins (style) { const margins = compact(style.split(';')).map((decl) => { const split = decl.split(':') return { prop: first(split).trim().toLowerCase(), value: last(split).trim().toLowerCase() } }).filter(({ prop, value }) => prop.indexOf('margin') === 0) let left = 0 ...
javascript
function getSideMargins (style) { const margins = compact(style.split(';')).map((decl) => { const split = decl.split(':') return { prop: first(split).trim().toLowerCase(), value: last(split).trim().toLowerCase() } }).filter(({ prop, value }) => prop.indexOf('margin') === 0) let left = 0 ...
[ "function", "getSideMargins", "(", "style", ")", "{", "const", "margins", "=", "compact", "(", "style", ".", "split", "(", "';'", ")", ")", ".", "map", "(", "(", "decl", ")", "=>", "{", "const", "split", "=", "decl", ".", "split", "(", "':'", ")", ...
pulls the left and right margins from the given inline styles @param {String} style the inline styles @return {Object} object with left and right margins
[ "pulls", "the", "left", "and", "right", "margins", "from", "the", "given", "inline", "styles" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-inline/src/inlineMargins.js#L27-L78
9,691
SparkPost/heml
packages/heml-elements/src/Typography.js
createTextElement
function createTextElement (name, element = {}) { let classToAdd = '' const Tag = name if (/^h\d$/i.test(name)) { classToAdd = 'header' } else { classToAdd = 'text' } return createElement(name, merge({ attrs: true, rules: { [`.${name}.${classToAdd}`]: [ { '@pseudo': 'root' }, '@defau...
javascript
function createTextElement (name, element = {}) { let classToAdd = '' const Tag = name if (/^h\d$/i.test(name)) { classToAdd = 'header' } else { classToAdd = 'text' } return createElement(name, merge({ attrs: true, rules: { [`.${name}.${classToAdd}`]: [ { '@pseudo': 'root' }, '@defau...
[ "function", "createTextElement", "(", "name", ",", "element", "=", "{", "}", ")", "{", "let", "classToAdd", "=", "''", "const", "Tag", "=", "name", "if", "(", "/", "^h\\d$", "/", "i", ".", "test", "(", "name", ")", ")", "{", "classToAdd", "=", "'he...
create mergable text element @param {String} name @param {Object} element @return {Object}
[ "create", "mergable", "text", "element" ]
9c600cb97b4d5f46a97a0c8af75851c15d5c681c
https://github.com/SparkPost/heml/blob/9c600cb97b4d5f46a97a0c8af75851c15d5c681c/packages/heml-elements/src/Typography.js#L14-L35
9,692
mhart/kinesalite
db/index.js
sumShards
function sumShards(store, cb) { exports.lazy(store.metaDb.createValueStream(), cb) .map(function(stream) { return stream.Shards.filter(function(shard) { return shard.SequenceNumberRange.EndingSequenceNumber == null }).length }) .sum(function(sum) { return cb(null, sum) }) }
javascript
function sumShards(store, cb) { exports.lazy(store.metaDb.createValueStream(), cb) .map(function(stream) { return stream.Shards.filter(function(shard) { return shard.SequenceNumberRange.EndingSequenceNumber == null }).length }) .sum(function(sum) { return cb(null, sum) }) }
[ "function", "sumShards", "(", "store", ",", "cb", ")", "{", "exports", ".", "lazy", "(", "store", ".", "metaDb", ".", "createValueStream", "(", ")", ",", "cb", ")", ".", "map", "(", "function", "(", "stream", ")", "{", "return", "stream", ".", "Shard...
Sum shards that haven't closed yet
[ "Sum", "shards", "that", "haven", "t", "closed", "yet" ]
d2cea0a7890c305d4bdf312ce5c67c24c84d0c03
https://github.com/mhart/kinesalite/blob/d2cea0a7890c305d4bdf312ce5c67c24c84d0c03/db/index.js#L266-L274
9,693
hemerajs/hemera
packages/hemera/lib/extensions.js
onActFinished
function onActFinished(context, next) { const msg = context.response.payload // pass to act context if (msg) { context.request$ = msg.request || {} context.trace$ = msg.trace || {} context.meta$ = msg.meta || {} } // calculate request duration const now = Util.nowHrTime() const diff = now - ...
javascript
function onActFinished(context, next) { const msg = context.response.payload // pass to act context if (msg) { context.request$ = msg.request || {} context.trace$ = msg.trace || {} context.meta$ = msg.meta || {} } // calculate request duration const now = Util.nowHrTime() const diff = now - ...
[ "function", "onActFinished", "(", "context", ",", "next", ")", "{", "const", "msg", "=", "context", ".", "response", ".", "payload", "// pass to act context", "if", "(", "msg", ")", "{", "context", ".", "request$", "=", "msg", ".", "request", "||", "{", ...
- Restore context - Measure request duration @param {*} context @param {*} next
[ "-", "Restore", "context", "-", "Measure", "request", "duration" ]
f429eead7a3e479a55008ee1d35e8f92d55f213e
https://github.com/hemerajs/hemera/blob/f429eead7a3e479a55008ee1d35e8f92d55f213e/packages/hemera/lib/extensions.js#L133-L175
9,694
qlik-oss/enigma.js
examples/basics/parameters/parameter-passing.js
print
function print(tableContent) { for (let i = 0; i < tableContent.length; i += 1) { console.log(`dim: ${tableContent[i].qValue[0].qText} val: ${tableContent[i].qValue[1].qText}`); } }
javascript
function print(tableContent) { for (let i = 0; i < tableContent.length; i += 1) { console.log(`dim: ${tableContent[i].qValue[0].qText} val: ${tableContent[i].qValue[1].qText}`); } }
[ "function", "print", "(", "tableContent", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "tableContent", ".", "length", ";", "i", "+=", "1", ")", "{", "console", ".", "log", "(", "`", "${", "tableContent", "[", "i", "]", ".", "qValue"...
Write the tabelContent to console. @param {*} tabelContent
[ "Write", "the", "tabelContent", "to", "console", "." ]
d47661846ba23b7705a54ae1d663b6a71d772b19
https://github.com/qlik-oss/enigma.js/blob/d47661846ba23b7705a54ae1d663b6a71d772b19/examples/basics/parameters/parameter-passing.js#L21-L25
9,695
qlik-oss/enigma.js
src/json-patch.js
emptyObject
function emptyObject(obj) { Object.keys(obj).forEach((key) => { const config = Object.getOwnPropertyDescriptor(obj, key); if (config.configurable && !isSpecialProperty(obj, key)) { delete obj[key]; } }); }
javascript
function emptyObject(obj) { Object.keys(obj).forEach((key) => { const config = Object.getOwnPropertyDescriptor(obj, key); if (config.configurable && !isSpecialProperty(obj, key)) { delete obj[key]; } }); }
[ "function", "emptyObject", "(", "obj", ")", "{", "Object", ".", "keys", "(", "obj", ")", ".", "forEach", "(", "(", "key", ")", "=>", "{", "const", "config", "=", "Object", ".", "getOwnPropertyDescriptor", "(", "obj", ",", "key", ")", ";", "if", "(", ...
Cleans an object of all its properties, unless they're deemed special or cannot be removed by configuration. @private @param {Object} obj The object to clean
[ "Cleans", "an", "object", "of", "all", "its", "properties", "unless", "they", "re", "deemed", "special", "or", "cannot", "be", "removed", "by", "configuration", "." ]
d47661846ba23b7705a54ae1d663b6a71d772b19
https://github.com/qlik-oss/enigma.js/blob/d47661846ba23b7705a54ae1d663b6a71d772b19/src/json-patch.js#L75-L83
9,696
qlik-oss/enigma.js
src/json-patch.js
compare
function compare(a, b) { let isIdentical = true; if (isObject(a) && isObject(b)) { if (Object.keys(a).length !== Object.keys(b).length) { return false; } Object.keys(a).forEach((key) => { if (!compare(a[key], b[key])) { isIdentical = false; } }); return isIdentical; ...
javascript
function compare(a, b) { let isIdentical = true; if (isObject(a) && isObject(b)) { if (Object.keys(a).length !== Object.keys(b).length) { return false; } Object.keys(a).forEach((key) => { if (!compare(a[key], b[key])) { isIdentical = false; } }); return isIdentical; ...
[ "function", "compare", "(", "a", ",", "b", ")", "{", "let", "isIdentical", "=", "true", ";", "if", "(", "isObject", "(", "a", ")", "&&", "isObject", "(", "b", ")", ")", "{", "if", "(", "Object", ".", "keys", "(", "a", ")", ".", "length", "!==",...
Compare an object with another, could be object, array, number, string, bool. @private @param {Object} a The first object to compare @param {Object} a The second object to compare @returns {Boolean} Whether the objects are identical
[ "Compare", "an", "object", "with", "another", "could", "be", "object", "array", "number", "string", "bool", "." ]
d47661846ba23b7705a54ae1d663b6a71d772b19
https://github.com/qlik-oss/enigma.js/blob/d47661846ba23b7705a54ae1d663b6a71d772b19/src/json-patch.js#L92-L117
9,697
qlik-oss/enigma.js
src/json-patch.js
patchArray
function patchArray(original, newA, basePath) { let patches = []; const oldA = original.slice(); let tmpIdx = -1; function findIndex(a, id, idx) { if (a[idx] && isUndef(a[idx].qInfo)) { return null; } if (a[idx] && a[idx].qInfo.qId === id) { // shortcut if identical return idx; } ...
javascript
function patchArray(original, newA, basePath) { let patches = []; const oldA = original.slice(); let tmpIdx = -1; function findIndex(a, id, idx) { if (a[idx] && isUndef(a[idx].qInfo)) { return null; } if (a[idx] && a[idx].qInfo.qId === id) { // shortcut if identical return idx; } ...
[ "function", "patchArray", "(", "original", ",", "newA", ",", "basePath", ")", "{", "let", "patches", "=", "[", "]", ";", "const", "oldA", "=", "original", ".", "slice", "(", ")", ";", "let", "tmpIdx", "=", "-", "1", ";", "function", "findIndex", "(",...
Generates patches by comparing two arrays. @private @param {Array} oldA The old (original) array, which will be patched @param {Array} newA The new array, which will be used to compare against @returns {Array} An array of patches (if any)
[ "Generates", "patches", "by", "comparing", "two", "arrays", "." ]
d47661846ba23b7705a54ae1d663b6a71d772b19
https://github.com/qlik-oss/enigma.js/blob/d47661846ba23b7705a54ae1d663b6a71d772b19/src/json-patch.js#L127-L194
9,698
ethjs/ethjs
src/index.js
Eth
function Eth(cprovider, options) { if (!(this instanceof Eth)) { throw new Error('[ethjs] the Eth object requires you construct it with the "new" flag (i.e. `const eth = new Eth(...);`).'); } const self = this; self.options = options || {}; const query = new EthQuery(cprovider, self.options.query); Object.key...
javascript
function Eth(cprovider, options) { if (!(this instanceof Eth)) { throw new Error('[ethjs] the Eth object requires you construct it with the "new" flag (i.e. `const eth = new Eth(...);`).'); } const self = this; self.options = options || {}; const query = new EthQuery(cprovider, self.options.query); Object.key...
[ "function", "Eth", "(", "cprovider", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Eth", ")", ")", "{", "throw", "new", "Error", "(", "'[ethjs] the Eth object requires you construct it with the \"new\" flag (i.e. `const eth = new Eth(...);`).'", ...
Returns the ethjs Eth instance. @method Eth @param {Object} cprovider the web3 standard provider object @param {Object} options the Eth options object @returns {Object} eth Eth object instance @throws if the new flag is not used in construction
[ "Returns", "the", "ethjs", "Eth", "instance", "." ]
68229b93e72bfba0c9a37ea1d979347e8f7395e4
https://github.com/ethjs/ethjs/blob/68229b93e72bfba0c9a37ea1d979347e8f7395e4/src/index.js#L26-L39
9,699
SAP/ui5-builder
lib/processors/jsdoc/jsdocGenerator.js
generateJsdocConfig
async function generateJsdocConfig({targetPath, tmpPath, namespace, projectName, version, variants}) { // Backlash needs to be escaped as double-backslash // This is not only relevant for win32 paths but also for // Unix directory names that contain a backslash in their name const backslashRegex = /\\/g; // Resol...
javascript
async function generateJsdocConfig({targetPath, tmpPath, namespace, projectName, version, variants}) { // Backlash needs to be escaped as double-backslash // This is not only relevant for win32 paths but also for // Unix directory names that contain a backslash in their name const backslashRegex = /\\/g; // Resol...
[ "async", "function", "generateJsdocConfig", "(", "{", "targetPath", ",", "tmpPath", ",", "namespace", ",", "projectName", ",", "version", ",", "variants", "}", ")", "{", "// Backlash needs to be escaped as double-backslash", "// This is not only relevant for win32 paths but a...
Generate jsdoc-config.json content @private @param {Object} parameters Parameters @param {string} parameters.targetPath Path to write any output files @param {string} parameters.tmpPath Path to write temporary and debug files @param {string} parameters.projectName Project name @param {string} parameters.version Projec...
[ "Generate", "jsdoc", "-", "config", ".", "json", "content" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/processors/jsdoc/jsdocGenerator.js#L74-L113