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
30,500
duniter/duniter-ui
public/libraries.js
function (chart, options) { var series = this, eventType, events, chartSeries = chart.series, sortByIndex = function (a, b) { return pick(a.options.index, a._i) - pick(b.options.index, b._i); }; series.chart...
javascript
function (chart, options) { var series = this, eventType, events, chartSeries = chart.series, sortByIndex = function (a, b) { return pick(a.options.index, a._i) - pick(b.options.index, b._i); }; series.chart...
[ "function", "(", "chart", ",", "options", ")", "{", "var", "series", "=", "this", ",", "eventType", ",", "events", ",", "chartSeries", "=", "chart", ".", "series", ",", "sortByIndex", "=", "function", "(", "a", ",", "b", ")", "{", "return", "pick", "...
each point's x and y values are stored in this.xData and this.yData
[ "each", "point", "s", "x", "and", "y", "values", "are", "stored", "in", "this", ".", "xData", "and", "this", ".", "yData" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64287-L64359
30,501
duniter/duniter-ui
public/libraries.js
function () { var series = this, seriesOptions = series.options, chart = series.chart, axisOptions; each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis each(chart[AXIS], function (axis) { // loop through the cha...
javascript
function () { var series = this, seriesOptions = series.options, chart = series.chart, axisOptions; each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis each(chart[AXIS], function (axis) { // loop through the cha...
[ "function", "(", ")", "{", "var", "series", "=", "this", ",", "seriesOptions", "=", "series", ".", "options", ",", "chart", "=", "series", ".", "chart", ",", "axisOptions", ";", "each", "(", "series", ".", "axisTypes", "||", "[", "]", ",", "function", ...
Set the xAxis and yAxis properties of cartesian series, and register the series in the axis.series array
[ "Set", "the", "xAxis", "and", "yAxis", "properties", "of", "cartesian", "series", "and", "register", "the", "series", "in", "the", "axis", ".", "series", "array" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64365-L64399
30,502
duniter/duniter-ui
public/libraries.js
function (point, i) { var series = point.series, args = arguments, fn = typeof i === 'number' ? // Insert the value in the given position function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point...
javascript
function (point, i) { var series = point.series, args = arguments, fn = typeof i === 'number' ? // Insert the value in the given position function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point...
[ "function", "(", "point", ",", "i", ")", "{", "var", "series", "=", "point", ".", "series", ",", "args", "=", "arguments", ",", "fn", "=", "typeof", "i", "===", "'number'", "?", "// Insert the value in the given position", "function", "(", "key", ")", "{",...
For simple series types like line and column, the data values are held in arrays like xData and yData for quick lookup to find extremes and more. For multidimensional series like bubble and map, this can be extended with arrays like zData and valueData by adding to the series.parallelArrays array.
[ "For", "simple", "series", "types", "like", "line", "and", "column", "the", "data", "values", "are", "held", "in", "arrays", "like", "xData", "and", "yData", "for", "quick", "lookup", "to", "find", "extremes", "and", "more", ".", "For", "multidimensional", ...
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64407-L64422
30,503
duniter/duniter-ui
public/libraries.js
function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point[key]; series[key + 'Data'][i] = val; }
javascript
function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point[key]; series[key + 'Data'][i] = val; }
[ "function", "(", "key", ")", "{", "var", "val", "=", "key", "===", "'y'", "&&", "series", ".", "toYData", "?", "series", ".", "toYData", "(", "point", ")", ":", "point", "[", "key", "]", ";", "series", "[", "key", "+", "'Data'", "]", "[", "i", ...
Insert the value in the given position
[ "Insert", "the", "value", "in", "the", "given", "position" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64412-L64415
30,504
duniter/duniter-ui
public/libraries.js
function (key) { Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2)); }
javascript
function (key) { Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2)); }
[ "function", "(", "key", ")", "{", "Array", ".", "prototype", "[", "i", "]", ".", "apply", "(", "series", "[", "key", "+", "'Data'", "]", ",", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "args", ",", "2", ")", ")", ";", "}" ]
Apply the method specified in i with the following arguments as arguments
[ "Apply", "the", "method", "specified", "in", "i", "with", "the", "following", "arguments", "as", "arguments" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64417-L64419
30,505
duniter/duniter-ui
public/libraries.js
function (force) { var series = this, processedXData = series.xData, // copied during slice operation below processedYData = series.yData, dataLength = processedXData.length, croppedData, cropStart = 0, cropped, ...
javascript
function (force) { var series = this, processedXData = series.xData, // copied during slice operation below processedYData = series.yData, dataLength = processedXData.length, croppedData, cropStart = 0, cropped, ...
[ "function", "(", "force", ")", "{", "var", "series", "=", "this", ",", "processedXData", "=", "series", ".", "xData", ",", "// copied during slice operation below", "processedYData", "=", "series", ".", "yData", ",", "dataLength", "=", "processedXData", ".", "le...
Process the data by cropping away unused data points if the series is longer than the crop threshold. This saves computing time for lage series.
[ "Process", "the", "data", "by", "cropping", "away", "unused", "data", "points", "if", "the", "series", "is", "longer", "than", "the", "crop", "threshold", ".", "This", "saves", "computing", "time", "for", "lage", "series", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64708-L64790
30,506
duniter/duniter-ui
public/libraries.js
function () { var series = this, options = series.options, dataOptions = options.data, data = series.data, dataLength, processedXData = series.processedXData, processedYData = series.processedYData, pointClass ...
javascript
function () { var series = this, options = series.options, dataOptions = options.data, data = series.data, dataLength, processedXData = series.processedXData, processedYData = series.processedYData, pointClass ...
[ "function", "(", ")", "{", "var", "series", "=", "this", ",", "options", "=", "series", ".", "options", ",", "dataOptions", "=", "options", ".", "data", ",", "data", "=", "series", ".", "data", ",", "dataLength", ",", "processedXData", "=", "series", "...
Generate the data point after the data has been processed by cropping away unused points and optionally grouped in Highcharts Stock.
[ "Generate", "the", "data", "point", "after", "the", "data", "has", "been", "processed", "by", "cropping", "away", "unused", "points", "and", "optionally", "grouped", "in", "Highcharts", "Stock", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L64832-L64887
30,507
duniter/duniter-ui
public/libraries.js
StackItem
function StackItem(axis, options, isNegative, x, stackOption) { var inverted = axis.chart.inverted; this.axis = axis; // Tells if the stack is negative this.isNegative = isNegative; // Save the options to be able to style the label this.options = options; // ...
javascript
function StackItem(axis, options, isNegative, x, stackOption) { var inverted = axis.chart.inverted; this.axis = axis; // Tells if the stack is negative this.isNegative = isNegative; // Save the options to be able to style the label this.options = options; // ...
[ "function", "StackItem", "(", "axis", ",", "options", ",", "isNegative", ",", "x", ",", "stackOption", ")", "{", "var", "inverted", "=", "axis", ".", "chart", ".", "inverted", ";", "this", ".", "axis", "=", "axis", ";", "// Tells if the stack is negative", ...
end Series prototype The class for stack items
[ "end", "Series", "prototype", "The", "class", "for", "stack", "items" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L65906-L65941
30,508
duniter/duniter-ui
public/libraries.js
function (newOptions, redraw) { var series = this, chart = this.chart, // must use user options when changing type because this.options is merged // in with type specific plotOptions oldOptions = this.userOptions, oldType = this.type, ...
javascript
function (newOptions, redraw) { var series = this, chart = this.chart, // must use user options when changing type because this.options is merged // in with type specific plotOptions oldOptions = this.userOptions, oldType = this.type, ...
[ "function", "(", "newOptions", ",", "redraw", ")", "{", "var", "series", "=", "this", ",", "chart", "=", "this", ".", "chart", ",", "// must use user options when changing type because this.options is merged", "// in with type specific plotOptions", "oldOptions", "=", "th...
Update the series with a new set of options
[ "Update", "the", "series", "with", "a", "new", "set", "of", "options" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L66585-L66629
30,509
duniter/duniter-ui
public/libraries.js
function () { var series = this, segments = [], segment = [], keys = [], xAxis = this.xAxis, yAxis = this.yAxis, stack = yAxis.stacks[this.stackKey], pointMap = {}, plotX, plotY, ...
javascript
function () { var series = this, segments = [], segment = [], keys = [], xAxis = this.xAxis, yAxis = this.yAxis, stack = yAxis.stacks[this.stackKey], pointMap = {}, plotX, plotY, ...
[ "function", "(", ")", "{", "var", "series", "=", "this", ",", "segments", "=", "[", "]", ",", "segment", "=", "[", "]", ",", "keys", "=", "[", "]", ",", "xAxis", "=", "this", ".", "xAxis", ",", "yAxis", "=", "this", ".", "yAxis", ",", "stack", ...
For stacks, don't split segments on null values. Instead, draw null values with no marker. Also insert dummy points for any X position that exists in other series in the stack.
[ "For", "stacks", "don", "t", "split", "segments", "on", "null", "values", ".", "Instead", "draw", "null", "values", "with", "no", "marker", ".", "Also", "insert", "dummy", "points", "for", "any", "X", "position", "that", "exists", "in", "other", "series", ...
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L66731-L66812
30,510
duniter/duniter-ui
public/libraries.js
function (segment) { var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path i, options = this.options, segLength = segmentPath.length, ...
javascript
function (segment) { var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path i, options = this.options, segLength = segmentPath.length, ...
[ "function", "(", "segment", ")", "{", "var", "segmentPath", "=", "Series", ".", "prototype", ".", "getSegmentPath", ".", "call", "(", "this", ",", "segment", ")", ",", "// call base method", "areaSegmentPath", "=", "[", "]", ".", "concat", "(", "segmentPath"...
Extend the base Series getSegmentPath method by adding the path for the area. This path is pushed to the series.areaPath property.
[ "Extend", "the", "base", "Series", "getSegmentPath", "method", "by", "adding", "the", "path", "for", "the", "area", ".", "This", "path", "is", "pushed", "to", "the", "series", ".", "areaPath", "property", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L66818-L66853
30,511
duniter/duniter-ui
public/libraries.js
function () { var chart = this.series.chart, hoverPoints = chart.hoverPoints; this.firePointEvent('mouseOut'); if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240 this.setState(); chart.hoverPoint = null; ...
javascript
function () { var chart = this.series.chart, hoverPoints = chart.hoverPoints; this.firePointEvent('mouseOut'); if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240 this.setState(); chart.hoverPoint = null; ...
[ "function", "(", ")", "{", "var", "chart", "=", "this", ".", "series", ".", "chart", ",", "hoverPoints", "=", "chart", ".", "hoverPoints", ";", "this", ".", "firePointEvent", "(", "'mouseOut'", ")", ";", "if", "(", "!", "hoverPoints", "||", "inArray", ...
Runs on mouse out from the point
[ "Runs", "on", "mouse", "out", "from", "the", "point" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L69093-L69103
30,512
duniter/duniter-ui
public/libraries.js
onScroll
function onScroll() { // unique tick id ++ticks; // viewport rectangle var top = jWindow.scrollTop(), left = jWindow.scrollLeft(), right = left + jWindow.width(), bottom = top + jWindow.height(); // determine which elements are in view // + 60 accounts for fixed nav var intersections = fin...
javascript
function onScroll() { // unique tick id ++ticks; // viewport rectangle var top = jWindow.scrollTop(), left = jWindow.scrollLeft(), right = left + jWindow.width(), bottom = top + jWindow.height(); // determine which elements are in view // + 60 accounts for fixed nav var intersections = fin...
[ "function", "onScroll", "(", ")", "{", "// unique tick id", "++", "ticks", ";", "// viewport rectangle", "var", "top", "=", "jWindow", ".", "scrollTop", "(", ")", ",", "left", "=", "jWindow", ".", "scrollLeft", "(", ")", ",", "right", "=", "left", "+", "...
Called when the user scrolls the window
[ "Called", "when", "the", "user", "scrolls", "the", "window" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L71936-L71973
30,513
duniter/duniter-ui
public/libraries.js
function(e){ // TAB - switch to another input if(e.which == 9){ $newSelect.trigger('close'); return; } // ARROW DOWN WHEN SELECT IS CLOSED - open select options if(e.which == 40 && !options.is(':visible')){ $newSelect...
javascript
function(e){ // TAB - switch to another input if(e.which == 9){ $newSelect.trigger('close'); return; } // ARROW DOWN WHEN SELECT IS CLOSED - open select options if(e.which == 40 && !options.is(':visible')){ $newSelect...
[ "function", "(", "e", ")", "{", "// TAB - switch to another input", "if", "(", "e", ".", "which", "==", "9", ")", "{", "$newSelect", ".", "trigger", "(", "'close'", ")", ";", "return", ";", "}", "// ARROW DOWN WHEN SELECT IS CLOSED - open select options", "if", ...
Allow user to search by typing this array is cleared after 1 second
[ "Allow", "user", "to", "search", "by", "typing", "this", "array", "is", "cleared", "after", "1", "second" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L72625-L72696
30,514
duniter/duniter-ui
public/libraries.js
captionTransition
function captionTransition(caption, duration) { if (caption.hasClass("center-align")) { caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false}); } else if (caption.hasClass("right-align")) { caption.velocity({opacity: 0, translateX: 100}...
javascript
function captionTransition(caption, duration) { if (caption.hasClass("center-align")) { caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false}); } else if (caption.hasClass("right-align")) { caption.velocity({opacity: 0, translateX: 100}...
[ "function", "captionTransition", "(", "caption", ",", "duration", ")", "{", "if", "(", "caption", ".", "hasClass", "(", "\"center-align\"", ")", ")", "{", "caption", ".", "velocity", "(", "{", "opacity", ":", "0", ",", "translateY", ":", "-", "100", "}",...
Transitions the caption depending on alignment
[ "Transitions", "the", "caption", "depending", "on", "alignment" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L72763-L72773
30,515
duniter/duniter-ui
public/libraries.js
moveToSlide
function moveToSlide(index) { // Wrap around indices. if (index >= $slides.length) index = 0; else if (index < 0) index = $slides.length -1; $active_index = $slider.find('.active').index(); // Only do if index changes if ($active_index != index) { ...
javascript
function moveToSlide(index) { // Wrap around indices. if (index >= $slides.length) index = 0; else if (index < 0) index = $slides.length -1; $active_index = $slider.find('.active').index(); // Only do if index changes if ($active_index != index) { ...
[ "function", "moveToSlide", "(", "index", ")", "{", "// Wrap around indices.", "if", "(", "index", ">=", "$slides", ".", "length", ")", "index", "=", "0", ";", "else", "if", "(", "index", "<", "0", ")", "index", "=", "$slides", ".", "length", "-", "1", ...
This function will transition the slide to any index of the next slide
[ "This", "function", "will", "transition", "the", "slide", "to", "any", "index", "of", "the", "next", "slide" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L72776-L72811
30,516
duniter/duniter-ui
public/libraries.js
function( entireComponent ) { // Insert a new component holder in the root or box. if ( entireComponent ) P.$root.html( createWrappedComponent() ) else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) ) // Trigger the queued “rende...
javascript
function( entireComponent ) { // Insert a new component holder in the root or box. if ( entireComponent ) P.$root.html( createWrappedComponent() ) else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) ) // Trigger the queued “rende...
[ "function", "(", "entireComponent", ")", "{", "// Insert a new component holder in the root or box.", "if", "(", "entireComponent", ")", "P", ".", "$root", ".", "html", "(", "createWrappedComponent", "(", ")", ")", "else", "P", ".", "$root", ".", "find", "(", "'...
start Render a new picker
[ "start", "Render", "a", "new", "picker" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73601-L73609
30,517
duniter/duniter-ui
public/libraries.js
function() { // If it’s already stopped, do nothing. if ( !STATE.start ) return P // Then close the picker. P.close() // Remove the hidden field. if ( P._hidden ) { P._hidden.parentNode.removeChild( P....
javascript
function() { // If it’s already stopped, do nothing. if ( !STATE.start ) return P // Then close the picker. P.close() // Remove the hidden field. if ( P._hidden ) { P._hidden.parentNode.removeChild( P....
[ "function", "(", ")", "{", "// If it’s already stopped, do nothing.", "if", "(", "!", "STATE", ".", "start", ")", "return", "P", "// Then close the picker.", "P", ".", "close", "(", ")", "// Remove the hidden field.", "if", "(", "P", ".", "_hidden", ")", "{", ...
render Destroy everything
[ "render", "Destroy", "everything" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73615-L73650
30,518
duniter/duniter-ui
public/libraries.js
function( dontGiveFocus ) { // If it’s already open, do nothing. if ( STATE.open ) return P // Add the “active” class. $ELEMENT.addClass( CLASSES.active ) aria( ELEMENT, 'expanded', true ) // * A Firefox bug, when `html` ...
javascript
function( dontGiveFocus ) { // If it’s already open, do nothing. if ( STATE.open ) return P // Add the “active” class. $ELEMENT.addClass( CLASSES.active ) aria( ELEMENT, 'expanded', true ) // * A Firefox bug, when `html` ...
[ "function", "(", "dontGiveFocus", ")", "{", "// If it’s already open, do nothing.", "if", "(", "STATE", ".", "open", ")", "return", "P", "// Add the “active” class.", "$ELEMENT", ".", "addClass", "(", "CLASSES", ".", "active", ")", "aria", "(", "ELEMENT", ",", "...
stop Open up the picker
[ "stop", "Open", "up", "the", "picker" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73656-L73760
30,519
duniter/duniter-ui
public/libraries.js
function( thing, value, options ) { var thingItem, thingValue, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} // Make sure we have usable options. options = thingIsObject && $.isPlainObject( val...
javascript
function( thing, value, options ) { var thingItem, thingValue, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} // Make sure we have usable options. options = thingIsObject && $.isPlainObject( val...
[ "function", "(", "thing", ",", "value", ",", "options", ")", "{", "var", "thingItem", ",", "thingValue", ",", "thingIsObject", "=", "$", ".", "isPlainObject", "(", "thing", ")", ",", "thingObject", "=", "thingIsObject", "?", "thing", ":", "{", "}", "// M...
clear Set something
[ "clear", "Set", "something" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73826-L73868
30,520
duniter/duniter-ui
public/libraries.js
function( thing, format ) { // Make sure there’s something to get. thing = thing || 'value' // If a picker state exists, return that. if ( STATE[ thing ] != null ) { return STATE[ thing ] } // Return t...
javascript
function( thing, format ) { // Make sure there’s something to get. thing = thing || 'value' // If a picker state exists, return that. if ( STATE[ thing ] != null ) { return STATE[ thing ] } // Return t...
[ "function", "(", "thing", ",", "format", ")", "{", "// Make sure there’s something to get.", "thing", "=", "thing", "||", "'value'", "// If a picker state exists, return that.", "if", "(", "STATE", "[", "thing", "]", "!=", "null", ")", "{", "return", "STATE", "[",...
set Get something
[ "set", "Get", "something" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73874-L73910
30,521
duniter/duniter-ui
public/libraries.js
function( thing, method, internal ) { var thingName, thingMethod, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} if ( thing ) { // If the thing isn’t an object, make it one. ...
javascript
function( thing, method, internal ) { var thingName, thingMethod, thingIsObject = $.isPlainObject( thing ), thingObject = thingIsObject ? thing : {} if ( thing ) { // If the thing isn’t an object, make it one. ...
[ "function", "(", "thing", ",", "method", ",", "internal", ")", "{", "var", "thingName", ",", "thingMethod", ",", "thingIsObject", "=", "$", ".", "isPlainObject", "(", "thing", ")", ",", "thingObject", "=", "thingIsObject", "?", "thing", ":", "{", "}", "i...
get Bind events on the things.
[ "get", "Bind", "events", "on", "the", "things", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73917-L73950
30,522
duniter/duniter-ui
public/libraries.js
function() { var i, thingName, names = arguments; for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) { thingName = names[i] if ( thingName in STATE.methods ) { delete STATE.methods[thingName...
javascript
function() { var i, thingName, names = arguments; for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) { thingName = names[i] if ( thingName in STATE.methods ) { delete STATE.methods[thingName...
[ "function", "(", ")", "{", "var", "i", ",", "thingName", ",", "names", "=", "arguments", ";", "for", "(", "i", "=", "0", ",", "namesCount", "=", "names", ".", "length", ";", "i", "<", "namesCount", ";", "i", "+=", "1", ")", "{", "thingName", "=",...
on Unbind events on the things.
[ "on", "Unbind", "events", "on", "the", "things", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73957-L73967
30,523
duniter/duniter-ui
public/libraries.js
function( name, data ) { var _trigger = function( name ) { var methodList = STATE.methods[ name ] if ( methodList ) { methodList.map( function( method ) { PickerConstructor._.trigger( method, P, [ data ] ) ...
javascript
function( name, data ) { var _trigger = function( name ) { var methodList = STATE.methods[ name ] if ( methodList ) { methodList.map( function( method ) { PickerConstructor._.trigger( method, P, [ data ] ) ...
[ "function", "(", "name", ",", "data", ")", "{", "var", "_trigger", "=", "function", "(", "name", ")", "{", "var", "methodList", "=", "STATE", ".", "methods", "[", "name", "]", "if", "(", "methodList", ")", "{", "methodList", ".", "map", "(", "functio...
Fire off method events.
[ "Fire", "off", "method", "events", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73973-L73985
30,524
duniter/duniter-ui
public/libraries.js
createWrappedComponent
function createWrappedComponent() { // Create a picker wrapper holder return PickerConstructor._.node( 'div', // Create a picker wrapper node PickerConstructor._.node( 'div', // Create a picker frame PickerConstructor._.node( 'div', ...
javascript
function createWrappedComponent() { // Create a picker wrapper holder return PickerConstructor._.node( 'div', // Create a picker wrapper node PickerConstructor._.node( 'div', // Create a picker frame PickerConstructor._.node( 'div', ...
[ "function", "createWrappedComponent", "(", ")", "{", "// Create a picker wrapper holder", "return", "PickerConstructor", ".", "_", ".", "node", "(", "'div'", ",", "// Create a picker wrapper node", "PickerConstructor", ".", "_", ".", "node", "(", "'div'", ",", "// Cre...
Wrap the picker holder components together.
[ "Wrap", "the", "picker", "holder", "components", "together", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L73992-L74024
30,525
duniter/duniter-ui
public/libraries.js
prepareElement
function prepareElement() { $ELEMENT. // Store the picker data by component name. data(NAME, P). // Add the “input” class name. addClass(CLASSES.input). // Remove the tabindex. attr('tabindex', -1). // If there’s a `data-va...
javascript
function prepareElement() { $ELEMENT. // Store the picker data by component name. data(NAME, P). // Add the “input” class name. addClass(CLASSES.input). // Remove the tabindex. attr('tabindex', -1). // If there’s a `data-va...
[ "function", "prepareElement", "(", ")", "{", "$ELEMENT", ".", "// Store the picker data by component name.", "data", "(", "NAME", ",", "P", ")", ".", "// Add the “input” class name.", "addClass", "(", "CLASSES", ".", "input", ")", ".", "// Remove the tabindex.", "attr...
createWrappedComponent Prepare the input element with all bindings.
[ "createWrappedComponent", "Prepare", "the", "input", "element", "with", "all", "bindings", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74031-L74074
30,526
duniter/duniter-ui
public/libraries.js
prepareElementRoot
function prepareElementRoot() { P.$root. on({ // For iOS8. keydown: handleKeydownEvent, // When something within the root is focused, stop from bubbling // to the doc and remove the “focused” state from the root. foc...
javascript
function prepareElementRoot() { P.$root. on({ // For iOS8. keydown: handleKeydownEvent, // When something within the root is focused, stop from bubbling // to the doc and remove the “focused” state from the root. foc...
[ "function", "prepareElementRoot", "(", ")", "{", "P", ".", "$root", ".", "on", "(", "{", "// For iOS8.", "keydown", ":", "handleKeydownEvent", ",", "// When something within the root is focused, stop from bubbling", "// to the doc and remove the “focused” state from the root.", ...
Prepare the root picker element with all bindings.
[ "Prepare", "the", "root", "picker", "element", "with", "all", "bindings", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74080-L74175
30,527
duniter/duniter-ui
public/libraries.js
function( event ) { var target = event.target // Make sure the target isn’t the root holder so it can bubble up. if ( target != P.$root.children()[ 0 ] ) { event.stopPropagation() // * For mousedown events, c...
javascript
function( event ) { var target = event.target // Make sure the target isn’t the root holder so it can bubble up. if ( target != P.$root.children()[ 0 ] ) { event.stopPropagation() // * For mousedown events, c...
[ "function", "(", "event", ")", "{", "var", "target", "=", "event", ".", "target", "// Make sure the target isn’t the root holder so it can bubble up.", "if", "(", "target", "!=", "P", ".", "$root", ".", "children", "(", ")", "[", "0", "]", ")", "{", "event", ...
When something within the root holder is clicked, stop it from bubbling to the doc.
[ "When", "something", "within", "the", "root", "holder", "is", "clicked", "stop", "it", "from", "bubbling", "to", "the", "doc", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74098-L74120
30,528
duniter/duniter-ui
public/libraries.js
prepareElementHidden
function prepareElementHidden() { var name if ( SETTINGS.hiddenName === true ) { name = ELEMENT.name ELEMENT.name = '' } else { name = [ typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SET...
javascript
function prepareElementHidden() { var name if ( SETTINGS.hiddenName === true ) { name = ELEMENT.name ELEMENT.name = '' } else { name = [ typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SET...
[ "function", "prepareElementHidden", "(", ")", "{", "var", "name", "if", "(", "SETTINGS", ".", "hiddenName", "===", "true", ")", "{", "name", "=", "ELEMENT", ".", "name", "ELEMENT", ".", "name", "=", "''", "}", "else", "{", "name", "=", "[", "typeof", ...
Prepare the hidden input element along with all bindings.
[ "Prepare", "the", "hidden", "input", "element", "along", "with", "all", "bindings", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74181-L74226
30,529
duniter/duniter-ui
public/libraries.js
handleKeydownEvent
function handleKeydownEvent( event ) { var keycode = event.keyCode, // Check if one of the delete keys was pressed. isKeycodeDelete = /^(8|46)$/.test(keycode) // For some reason IE clears the input value on “escape”. if ( keycode == 27 ) { P.close() ...
javascript
function handleKeydownEvent( event ) { var keycode = event.keyCode, // Check if one of the delete keys was pressed. isKeycodeDelete = /^(8|46)$/.test(keycode) // For some reason IE clears the input value on “escape”. if ( keycode == 27 ) { P.close() ...
[ "function", "handleKeydownEvent", "(", "event", ")", "{", "var", "keycode", "=", "event", ".", "keyCode", ",", "// Check if one of the delete keys was pressed.", "isKeycodeDelete", "=", "/", "^(8|46)$", "/", ".", "test", "(", "keycode", ")", "// For some reason IE cle...
For iOS8.
[ "For", "iOS8", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74230-L74255
30,530
duniter/duniter-ui
public/libraries.js
handleFocusToOpenEvent
function handleFocusToOpenEvent( event ) { // Stop the event from propagating to the doc. event.stopPropagation() // If it’s a focus event, add the “focused” class to the root. if ( event.type == 'focus' ) { P.$root.addClass( CLASSES.focused ) } // And then...
javascript
function handleFocusToOpenEvent( event ) { // Stop the event from propagating to the doc. event.stopPropagation() // If it’s a focus event, add the “focused” class to the root. if ( event.type == 'focus' ) { P.$root.addClass( CLASSES.focused ) } // And then...
[ "function", "handleFocusToOpenEvent", "(", "event", ")", "{", "// Stop the event from propagating to the doc.", "event", ".", "stopPropagation", "(", ")", "// If it’s a focus event, add the “focused” class to the root.", "if", "(", "event", ".", "type", "==", "'focus'", ")", ...
Separated for IE
[ "Separated", "for", "IE" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74259-L74271
30,531
duniter/duniter-ui
public/libraries.js
isUsingDefaultTheme
function isUsingDefaultTheme( element ) { var theme, prop = 'position' // For IE. if ( element.currentStyle ) { theme = element.currentStyle[prop] } // For normal browsers. else if ( window.getComputedStyle ) { theme = getComputedStyle( element )[prop] } retur...
javascript
function isUsingDefaultTheme( element ) { var theme, prop = 'position' // For IE. if ( element.currentStyle ) { theme = element.currentStyle[prop] } // For normal browsers. else if ( window.getComputedStyle ) { theme = getComputedStyle( element )[prop] } retur...
[ "function", "isUsingDefaultTheme", "(", "element", ")", "{", "var", "theme", ",", "prop", "=", "'position'", "// For IE.", "if", "(", "element", ".", "currentStyle", ")", "{", "theme", "=", "element", ".", "currentStyle", "[", "prop", "]", "}", "// For norma...
Check if the default theme is being used.
[ "Check", "if", "the", "default", "theme", "is", "being", "used", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74309-L74325
30,532
duniter/duniter-ui
public/libraries.js
function( wrapper, item, klass, attribute ) { // If the item is false-y, just return an empty string if ( !item ) return '' // If the item is an array, do a join item = $.isArray( item ) ? item.join( '' ) : item // Check for the class klass = klass ? ' class="' + klass...
javascript
function( wrapper, item, klass, attribute ) { // If the item is false-y, just return an empty string if ( !item ) return '' // If the item is an array, do a join item = $.isArray( item ) ? item.join( '' ) : item // Check for the class klass = klass ? ' class="' + klass...
[ "function", "(", "wrapper", ",", "item", ",", "klass", ",", "attribute", ")", "{", "// If the item is false-y, just return an empty string", "if", "(", "!", "item", ")", "return", "''", "// If the item is an array, do a join", "item", "=", "$", ".", "isArray", "(", ...
group Create a dom node string
[ "group", "Create", "a", "dom", "node", "string" ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L74416-L74432
30,533
duniter/duniter-ui
public/libraries.js
getWordLengthFromCollection
function getWordLengthFromCollection( string, collection, dateObject ) { // Grab the first word from the string. var word = string.match( /\w+/ )[ 0 ] // If there's no month index, add it to the date object if ( !dateObject.mm && !dateObject.m ) { dateObject.m = collection....
javascript
function getWordLengthFromCollection( string, collection, dateObject ) { // Grab the first word from the string. var word = string.match( /\w+/ )[ 0 ] // If there's no month index, add it to the date object if ( !dateObject.mm && !dateObject.m ) { dateObject.m = collection....
[ "function", "getWordLengthFromCollection", "(", "string", ",", "collection", ",", "dateObject", ")", "{", "// Grab the first word from the string.", "var", "word", "=", "string", ".", "match", "(", "/", "\\w+", "/", ")", "[", "0", "]", "// If there's no month index,...
Return the length of the first word in a collection.
[ "Return", "the", "length", "of", "the", "first", "word", "in", "a", "collection", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L75209-L75221
30,534
duniter/duniter-ui
public/libraries.js
function ( formatString, itemObject ) { var calendar = this return calendar.formats.toArray( formatString ).map( function( label ) { return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' ) }).join( '' ) }
javascript
function ( formatString, itemObject ) { var calendar = this return calendar.formats.toArray( formatString ).map( function( label ) { return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' ) }).join( '' ) }
[ "function", "(", "formatString", ",", "itemObject", ")", "{", "var", "calendar", "=", "this", "return", "calendar", ".", "formats", ".", "toArray", "(", "formatString", ")", ".", "map", "(", "function", "(", "label", ")", "{", "return", "_", ".", "trigge...
Format an object into a string using the formatting options.
[ "Format", "an", "object", "into", "a", "string", "using", "the", "formatting", "options", "." ]
de5c73aa4fe9add95711f3efba2f883645f315d1
https://github.com/duniter/duniter-ui/blob/de5c73aa4fe9add95711f3efba2f883645f315d1/public/libraries.js#L75299-L75304
30,535
weepower/wee-core
scripts/routes/route-map.js
_addRouteRecord
function _addRouteRecord(route, parent, exclude = false, ancestors = []) { const { path, name, handler } = route; const finalPath = _normalizePath(path, parent, ancestors); // Push path into ancestors array ancestors.push(path); const record = { name, parent, handler, ...
javascript
function _addRouteRecord(route, parent, exclude = false, ancestors = []) { const { path, name, handler } = route; const finalPath = _normalizePath(path, parent, ancestors); // Push path into ancestors array ancestors.push(path); const record = { name, parent, handler, ...
[ "function", "_addRouteRecord", "(", "route", ",", "parent", ",", "exclude", "=", "false", ",", "ancestors", "=", "[", "]", ")", "{", "const", "{", "path", ",", "name", ",", "handler", "}", "=", "route", ";", "const", "finalPath", "=", "_normalizePath", ...
Register new route @param {Object} route @param {Object} [parent] @param {boolean} exclude @private
[ "Register", "new", "route" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/routes/route-map.js#L25-L74
30,536
weepower/wee-core
scripts/routes/route-map.js
_normalizePath
function _normalizePath(path, parent, ancestors) { if (path === '/') { return path; } path = path.replace(/\/$/, ''); // If path begins with / then assume it is independent route if (path[0] === '/') { return path; } // If no parent, and route doesn't start with /, then pr...
javascript
function _normalizePath(path, parent, ancestors) { if (path === '/') { return path; } path = path.replace(/\/$/, ''); // If path begins with / then assume it is independent route if (path[0] === '/') { return path; } // If no parent, and route doesn't start with /, then pr...
[ "function", "_normalizePath", "(", "path", ",", "parent", ",", "ancestors", ")", "{", "if", "(", "path", "===", "'/'", ")", "{", "return", "path", ";", "}", "path", "=", "path", ".", "replace", "(", "/", "\\/$", "/", ",", "''", ")", ";", "// If pat...
Find full path of route @param {string} path @param {Object} [parent] @returns {*} @private
[ "Find", "full", "path", "of", "route" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/routes/route-map.js#L84-L106
30,537
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_type.js
build_doc_map
function build_doc_map(docs) { var map = {}; _.each(docs, function(tag) { if (map[tag["tagname"]]) map[tag["tagname"]].push(tag); else map[tag["tagname"]] = new Array(tag); }); return map; }
javascript
function build_doc_map(docs) { var map = {}; _.each(docs, function(tag) { if (map[tag["tagname"]]) map[tag["tagname"]].push(tag); else map[tag["tagname"]] = new Array(tag); }); return map; }
[ "function", "build_doc_map", "(", "docs", ")", "{", "var", "map", "=", "{", "}", ";", "_", ".", "each", "(", "docs", ",", "function", "(", "tag", ")", "{", "if", "(", "map", "[", "tag", "[", "\"tagname\"", "]", "]", ")", "map", "[", "tag", "[",...
Build map of at-tags for quick lookup
[ "Build", "map", "of", "at", "-", "tags", "for", "quick", "lookup" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_type.js#L56-L65
30,538
OldSneerJaw/couchster
templates/validation-function/time-module.js
isIso8601DateTimeString
function isIso8601DateTimeString(value) { var regex = /^(([+-]\d{6}|\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?)(T((([01]\d|2[0-3])(:[0-5]\d)(:[0-5]\d(\.\d{1,3})?)?)|(24:00(:00(\.0{1,3})?)?))(Z|([+-])([01]\d|2[0-3]):([0-5]\d))?)?$/; // Verify that it's in ISO 8601 format (via the regex) and that it repr...
javascript
function isIso8601DateTimeString(value) { var regex = /^(([+-]\d{6}|\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?)(T((([01]\d|2[0-3])(:[0-5]\d)(:[0-5]\d(\.\d{1,3})?)?)|(24:00(:00(\.0{1,3})?)?))(Z|([+-])([01]\d|2[0-3]):([0-5]\d))?)?$/; // Verify that it's in ISO 8601 format (via the regex) and that it repr...
[ "function", "isIso8601DateTimeString", "(", "value", ")", "{", "var", "regex", "=", "/", "^(([+-]\\d{6}|\\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\\d|3[01]))?)?)(T((([01]\\d|2[0-3])(:[0-5]\\d)(:[0-5]\\d(\\.\\d{1,3})?)?)|(24:00(:00(\\.0{1,3})?)?))(Z|([+-])([01]\\d|2[0-3]):([0-5]\\d))?)?$", "/", "...
Check that a given value is a valid ISO 8601 format date string with optional time and time zone components
[ "Check", "that", "a", "given", "value", "is", "a", "valid", "ISO", "8601", "format", "date", "string", "with", "optional", "time", "and", "time", "zone", "components" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L13-L18
30,539
OldSneerJaw/couchster
templates/validation-function/time-module.js
isIso8601DateString
function isIso8601DateString(value) { var regex = /^([+-]\d{6}|\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?$/; // Verify that it's in ISO 8601 format (via the regex) and that it represents a valid day (via Date.parse) return regex.test(value) && !isNaN(Date.parse(value)); }
javascript
function isIso8601DateString(value) { var regex = /^([+-]\d{6}|\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?$/; // Verify that it's in ISO 8601 format (via the regex) and that it represents a valid day (via Date.parse) return regex.test(value) && !isNaN(Date.parse(value)); }
[ "function", "isIso8601DateString", "(", "value", ")", "{", "var", "regex", "=", "/", "^([+-]\\d{6}|\\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\\d|3[01]))?)?$", "/", ";", "// Verify that it's in ISO 8601 format (via the regex) and that it represents a valid day (via Date.parse)", "return", "...
Check that a given value is a valid ISO 8601 date string without time and time zone components
[ "Check", "that", "a", "given", "value", "is", "a", "valid", "ISO", "8601", "date", "string", "without", "time", "and", "time", "zone", "components" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L21-L26
30,540
OldSneerJaw/couchster
templates/validation-function/time-module.js
extractIso8601TimePieces
function extractIso8601TimePieces(value) { var timePieces = /^(\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?$/.exec(value); if (timePieces === null) { return null; } var hour = timePieces[1] ? parseInt(timePieces[1], 10) : 0; var minute = timePieces[2] ? parseInt(timePieces[2], 10) : 0; va...
javascript
function extractIso8601TimePieces(value) { var timePieces = /^(\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?$/.exec(value); if (timePieces === null) { return null; } var hour = timePieces[1] ? parseInt(timePieces[1], 10) : 0; var minute = timePieces[2] ? parseInt(timePieces[2], 10) : 0; va...
[ "function", "extractIso8601TimePieces", "(", "value", ")", "{", "var", "timePieces", "=", "/", "^(\\d{2}):(\\d{2})(?:\\:(\\d{2}))?(?:\\.(\\d{1,3}))?$", "/", ".", "exec", "(", "value", ")", ";", "if", "(", "timePieces", "===", "null", ")", "{", "return", "null", ...
Converts an ISO 8601 time into an array of its component pieces
[ "Converts", "an", "ISO", "8601", "time", "into", "an", "array", "of", "its", "component", "pieces" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L43-L57
30,541
OldSneerJaw/couchster
templates/validation-function/time-module.js
compareTimes
function compareTimes(a, b) { if (typeof a !== 'string' || typeof b !== 'string') { return NaN; } var aTimePieces = extractIso8601TimePieces(a); var bTimePieces = extractIso8601TimePieces(b); if (aTimePieces === null || bTimePieces === null) { return NaN; } for (var timePieceI...
javascript
function compareTimes(a, b) { if (typeof a !== 'string' || typeof b !== 'string') { return NaN; } var aTimePieces = extractIso8601TimePieces(a); var bTimePieces = extractIso8601TimePieces(b); if (aTimePieces === null || bTimePieces === null) { return NaN; } for (var timePieceI...
[ "function", "compareTimes", "(", "a", ",", "b", ")", "{", "if", "(", "typeof", "a", "!==", "'string'", "||", "typeof", "b", "!==", "'string'", ")", "{", "return", "NaN", ";", "}", "var", "aTimePieces", "=", "extractIso8601TimePieces", "(", "a", ")", ";...
Compares the given time strings. Returns a negative number if a is less than b, a positive number if a is greater than b, or zero if a and b are equal.
[ "Compares", "the", "given", "time", "strings", ".", "Returns", "a", "negative", "number", "if", "a", "is", "less", "than", "b", "a", "positive", "number", "if", "a", "is", "greater", "than", "b", "or", "zero", "if", "a", "and", "b", "are", "equal", "...
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L61-L83
30,542
OldSneerJaw/couchster
templates/validation-function/time-module.js
convertToTimestamp
function convertToTimestamp(value) { if (value instanceof Date) { return value.getTime(); } else if (typeof value === 'number') { return Math.floor(value); } else if (typeof value === 'string') { return Date.parse(value); } else { return NaN; } }
javascript
function convertToTimestamp(value) { if (value instanceof Date) { return value.getTime(); } else if (typeof value === 'number') { return Math.floor(value); } else if (typeof value === 'string') { return Date.parse(value); } else { return NaN; } }
[ "function", "convertToTimestamp", "(", "value", ")", "{", "if", "(", "value", "instanceof", "Date", ")", "{", "return", "value", ".", "getTime", "(", ")", ";", "}", "else", "if", "(", "typeof", "value", "===", "'number'", ")", "{", "return", "Math", "....
Converts the given date representation to a timestamp that represents the number of ms since the Unix epoch
[ "Converts", "the", "given", "date", "representation", "to", "a", "timestamp", "that", "represents", "the", "number", "of", "ms", "since", "the", "Unix", "epoch" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L86-L96
30,543
OldSneerJaw/couchster
templates/validation-function/time-module.js
compareDates
function compareDates(a, b) { var aTimestamp = convertToTimestamp(a); var bTimestamp = convertToTimestamp(b); if (isNaN(aTimestamp) || isNaN(bTimestamp)) { return NaN; } else { return aTimestamp - bTimestamp; } }
javascript
function compareDates(a, b) { var aTimestamp = convertToTimestamp(a); var bTimestamp = convertToTimestamp(b); if (isNaN(aTimestamp) || isNaN(bTimestamp)) { return NaN; } else { return aTimestamp - bTimestamp; } }
[ "function", "compareDates", "(", "a", ",", "b", ")", "{", "var", "aTimestamp", "=", "convertToTimestamp", "(", "a", ")", ";", "var", "bTimestamp", "=", "convertToTimestamp", "(", "b", ")", ";", "if", "(", "isNaN", "(", "aTimestamp", ")", "||", "isNaN", ...
Compares the given date representations. Returns a negative number if a is less than b, a positive number if a is greater than b, or zero if a and b are equal.
[ "Compares", "the", "given", "date", "representations", ".", "Returns", "a", "negative", "number", "if", "a", "is", "less", "than", "b", "a", "positive", "number", "if", "a", "is", "greater", "than", "b", "or", "zero", "if", "a", "and", "b", "are", "equ...
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L100-L109
30,544
OldSneerJaw/couchster
templates/validation-function/time-module.js
normalizeIso8601TimeZone
function normalizeIso8601TimeZone(value) { if (value === 'Z') { return 0; } var regex = /^([+-])(\d\d):?(\d\d)$/; var matches = regex.exec(value); if (matches === null) { return NaN; } else { var multiplicationFactor = (matches[1] === '+') ? 1 : -1; var hour = parseInt(m...
javascript
function normalizeIso8601TimeZone(value) { if (value === 'Z') { return 0; } var regex = /^([+-])(\d\d):?(\d\d)$/; var matches = regex.exec(value); if (matches === null) { return NaN; } else { var multiplicationFactor = (matches[1] === '+') ? 1 : -1; var hour = parseInt(m...
[ "function", "normalizeIso8601TimeZone", "(", "value", ")", "{", "if", "(", "value", "===", "'Z'", ")", "{", "return", "0", ";", "}", "var", "regex", "=", "/", "^([+-])(\\d\\d):?(\\d\\d)$", "/", ";", "var", "matches", "=", "regex", ".", "exec", "(", "valu...
Converts an ISO 8601 time zone into the number of minutes offset from UTC
[ "Converts", "an", "ISO", "8601", "time", "zone", "into", "the", "number", "of", "minutes", "offset", "from", "UTC" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L112-L128
30,545
OldSneerJaw/couchster
templates/validation-function/time-module.js
compareTimeZones
function compareTimeZones(a, b) { if (typeof a !== 'string' || typeof b !== 'string') { return NaN; } return normalizeIso8601TimeZone(a) - normalizeIso8601TimeZone(b); }
javascript
function compareTimeZones(a, b) { if (typeof a !== 'string' || typeof b !== 'string') { return NaN; } return normalizeIso8601TimeZone(a) - normalizeIso8601TimeZone(b); }
[ "function", "compareTimeZones", "(", "a", ",", "b", ")", "{", "if", "(", "typeof", "a", "!==", "'string'", "||", "typeof", "b", "!==", "'string'", ")", "{", "return", "NaN", ";", "}", "return", "normalizeIso8601TimeZone", "(", "a", ")", "-", "normalizeIs...
Compares the given time zone representations. Returns a negative number if a is less than b, a positive number if a is greater than b, or zero if a and b are equal.
[ "Compares", "the", "given", "time", "zone", "representations", ".", "Returns", "a", "negative", "number", "if", "a", "is", "less", "than", "b", "a", "positive", "number", "if", "a", "is", "greater", "than", "b", "or", "zero", "if", "a", "and", "b", "ar...
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/time-module.js#L132-L138
30,546
EduardoRFS/koa-Router
lib/layer.js
decode_param
function decode_param(val) { if (typeof val !== 'string' || val.length === 0) { return val; } try { return decodeURIComponent(val); } catch (err) { if (err instanceof URIError) { err.message = `Failed to decode param '${val}'`; err.status = err.statusCode = 400; } throw err; ...
javascript
function decode_param(val) { if (typeof val !== 'string' || val.length === 0) { return val; } try { return decodeURIComponent(val); } catch (err) { if (err instanceof URIError) { err.message = `Failed to decode param '${val}'`; err.status = err.statusCode = 400; } throw err; ...
[ "function", "decode_param", "(", "val", ")", "{", "if", "(", "typeof", "val", "!==", "'string'", "||", "val", ".", "length", "===", "0", ")", "{", "return", "val", ";", "}", "try", "{", "return", "decodeURIComponent", "(", "val", ")", ";", "}", "catc...
Decode param value. @param {string} val @return {string} @private
[ "Decode", "param", "value", "." ]
5e721821211b8139e83a10d868e2e6b083af5433
https://github.com/EduardoRFS/koa-Router/blob/5e721821211b8139e83a10d868e2e6b083af5433/lib/layer.js#L144-L159
30,547
postmanlabs/mime-format
index.js
function (mime) { var info = { type: UNKNOWN, format: RAW, guessed: true }, match, base; // extract the mime base base = (base = mime.split(SEP)) && base[0] || E; // bail out on the mime types that are...
javascript
function (mime) { var info = { type: UNKNOWN, format: RAW, guessed: true }, match, base; // extract the mime base base = (base = mime.split(SEP)) && base[0] || E; // bail out on the mime types that are...
[ "function", "(", "mime", ")", "{", "var", "info", "=", "{", "type", ":", "UNKNOWN", ",", "format", ":", "RAW", ",", "guessed", ":", "true", "}", ",", "match", ",", "base", ";", "// extract the mime base", "base", "=", "(", "base", "=", "mime", ".", ...
Attempts to guess the format by analysing mime type and not a db lookup @private @param {String} mime - contentType header value @returns {Object}
[ "Attempts", "to", "guess", "the", "format", "by", "analysing", "mime", "type", "and", "not", "a", "db", "lookup" ]
35635e3797bde3a09c2fff55daf22a81c9bd2587
https://github.com/postmanlabs/mime-format/blob/35635e3797bde3a09c2fff55daf22a81c9bd2587/index.js#L99-L153
30,548
travis-hilterbrand/grunt-file-creator
tasks/file-creator.js
function(o) { var a = []; _.each(o, function(value, key) { a.push({file:key,method:value}); }); return a; }
javascript
function(o) { var a = []; _.each(o, function(value, key) { a.push({file:key,method:value}); }); return a; }
[ "function", "(", "o", ")", "{", "var", "a", "=", "[", "]", ";", "_", ".", "each", "(", "o", ",", "function", "(", "value", ",", "key", ")", "{", "a", ".", "push", "(", "{", "file", ":", "key", ",", "method", ":", "value", "}", ")", ";", "...
flattens to array
[ "flattens", "to", "array" ]
fbbea6589e0118972fb9b1f2ff2439469de982e1
https://github.com/travis-hilterbrand/grunt-file-creator/blob/fbbea6589e0118972fb9b1f2ff2439469de982e1/tasks/file-creator.js#L105-L111
30,549
gjtorikian/panino-docs
lib/panino/plugins/parsers/jsd_parser.js
expand
function expand(docset, customTags) { docset["comment"] = DocParser.parse(docset["comment"], customTags); docset["tagname"] = DocType.detect(docset["comment"], docset["code"]); if (docset["tagname"] == "class") return DocExpander.expand(docset); else return docset; }
javascript
function expand(docset, customTags) { docset["comment"] = DocParser.parse(docset["comment"], customTags); docset["tagname"] = DocType.detect(docset["comment"], docset["code"]); if (docset["tagname"] == "class") return DocExpander.expand(docset); else return docset; }
[ "function", "expand", "(", "docset", ",", "customTags", ")", "{", "docset", "[", "\"comment\"", "]", "=", "DocParser", ".", "parse", "(", "docset", "[", "\"comment\"", "]", ",", "customTags", ")", ";", "docset", "[", "\"tagname\"", "]", "=", "DocType", "...
Parses the docs, detects tagname and expands class docset
[ "Parses", "the", "docs", "detects", "tagname", "and", "expands", "class", "docset" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/jsd_parser.js#L438-L446
30,550
gjtorikian/panino-docs
lib/panino/plugins/parsers/jsd_parser.js
merge
function merge(docset, customTags) { doc_ast.linenr = docset["linenr"]; // useful for applying global NS items to the proper NS docset["original_name"] = docset["code"].name; docset["comment"] = doc_ast.detect(docset["tagname"], docset["comment"], customTags); return Merger.merge(docset); }
javascript
function merge(docset, customTags) { doc_ast.linenr = docset["linenr"]; // useful for applying global NS items to the proper NS docset["original_name"] = docset["code"].name; docset["comment"] = doc_ast.detect(docset["tagname"], docset["comment"], customTags); return Merger.merge(docset); }
[ "function", "merge", "(", "docset", ",", "customTags", ")", "{", "doc_ast", ".", "linenr", "=", "docset", "[", "\"linenr\"", "]", ";", "// useful for applying global NS items to the proper NS", "docset", "[", "\"original_name\"", "]", "=", "docset", "[", "\"code\"",...
Merges comment and code parts of docset
[ "Merges", "comment", "and", "code", "parts", "of", "docset" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/jsd_parser.js#L449-L457
30,551
gjtorikian/panino-docs
lib/panino/plugins/parsers/jsd_parser.js
createBasicTranslation
function createBasicTranslation(memberName, type, i, options) { var node = {}; node["id"] = memberName; node["type"] = type; if (i["inheritdoc"] !== undefined) { node["inheritdoc"] = i["inheritdoc"].src; } else if (i["doc"] !== undefined) { node["description"] = i["doc"]; // short description ...
javascript
function createBasicTranslation(memberName, type, i, options) { var node = {}; node["id"] = memberName; node["type"] = type; if (i["inheritdoc"] !== undefined) { node["inheritdoc"] = i["inheritdoc"].src; } else if (i["doc"] !== undefined) { node["description"] = i["doc"]; // short description ...
[ "function", "createBasicTranslation", "(", "memberName", ",", "type", ",", "i", ",", "options", ")", "{", "var", "node", "=", "{", "}", ";", "node", "[", "\"id\"", "]", "=", "memberName", ";", "node", "[", "\"type\"", "]", "=", "type", ";", "if", "("...
creates types for nodes that can be anything
[ "creates", "types", "for", "nodes", "that", "can", "be", "anything" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/jsd_parser.js#L460-L518
30,552
EduardoRFS/koa-Router
lib/route.js
Route
function Route(path) { this.path = path; this.stack = []; this.handle = compose(this.stack); debug('new %s', path); // route handlers for various http methods this.methods = {}; }
javascript
function Route(path) { this.path = path; this.stack = []; this.handle = compose(this.stack); debug('new %s', path); // route handlers for various http methods this.methods = {}; }
[ "function", "Route", "(", "path", ")", "{", "this", ".", "path", "=", "path", ";", "this", ".", "stack", "=", "[", "]", ";", "this", ".", "handle", "=", "compose", "(", "this", ".", "stack", ")", ";", "debug", "(", "'new %s'", ",", "path", ")", ...
Initialize `Route` with the given `path`, @param {String} path @public
[ "Initialize", "Route", "with", "the", "given", "path" ]
5e721821211b8139e83a10d868e2e6b083af5433
https://github.com/EduardoRFS/koa-Router/blob/5e721821211b8139e83a10d868e2e6b083af5433/lib/route.js#L42-L51
30,553
apostrophecms-legacy/apostrophe-schemas
public/js/editor.js
function(data, name, $field, $el, field, callback) { data[name] = self.getArea($el, name); if (field.required && (apos.areaIsEmpty(data[name]))) { return apos.afterYield(_.partial(callback, 'required')); } return apos.afterYield(callback); }
javascript
function(data, name, $field, $el, field, callback) { data[name] = self.getArea($el, name); if (field.required && (apos.areaIsEmpty(data[name]))) { return apos.afterYield(_.partial(callback, 'required')); } return apos.afterYield(callback); }
[ "function", "(", "data", ",", "name", ",", "$field", ",", "$el", ",", "field", ",", "callback", ")", "{", "data", "[", "name", "]", "=", "self", ".", "getArea", "(", "$el", ",", "name", ")", ";", "if", "(", "field", ".", "required", "&&", "(", ...
Convert the tough cases
[ "Convert", "the", "tough", "cases" ]
702e30657a38b31fa1005532f2aa487fd153aac7
https://github.com/apostrophecms-legacy/apostrophe-schemas/blob/702e30657a38b31fa1005532f2aa487fd153aac7/public/js/editor.js#L198-L205
30,554
apostrophecms-legacy/apostrophe-schemas
public/js/editor.js
function(data, name, $field, $el, field, callback) { data[name] = $field.val(); if (field.required && !data[name].length) { return apos.afterYield(_.partial(callback, 'required')); } if (field.max && (data[name].length > field.max)) { var $fieldset = self.findFieldset($el, name);...
javascript
function(data, name, $field, $el, field, callback) { data[name] = $field.val(); if (field.required && !data[name].length) { return apos.afterYield(_.partial(callback, 'required')); } if (field.max && (data[name].length > field.max)) { var $fieldset = self.findFieldset($el, name);...
[ "function", "(", "data", ",", "name", ",", "$field", ",", "$el", ",", "field", ",", "callback", ")", "{", "data", "[", "name", "]", "=", "$field", ".", "val", "(", ")", ";", "if", "(", "field", ".", "required", "&&", "!", "data", "[", "name", "...
The rest are very simple because the server does the serious sanitization work and the representation in the DOM is a simple form element
[ "The", "rest", "are", "very", "simple", "because", "the", "server", "does", "the", "serious", "sanitization", "work", "and", "the", "representation", "in", "the", "DOM", "is", "a", "simple", "form", "element" ]
702e30657a38b31fa1005532f2aa487fd153aac7
https://github.com/apostrophecms-legacy/apostrophe-schemas/blob/702e30657a38b31fa1005532f2aa487fd153aac7/public/js/editor.js#L299-L310
30,555
weepower/wee-core
scripts/routes/pjax.js
_isValid
function _isValid(el, currentPath) { // Link has no destination URL if (! el.href) { return false; } // Link opens a new browser window if (el.target === '_blank') { return false; } // Link is not absolute URL if (! /https?:/.test(el.href)) { return false; } // Link is a download if (el.hasAttribute('downloa...
javascript
function _isValid(el, currentPath) { // Link has no destination URL if (! el.href) { return false; } // Link opens a new browser window if (el.target === '_blank') { return false; } // Link is not absolute URL if (! /https?:/.test(el.href)) { return false; } // Link is a download if (el.hasAttribute('downloa...
[ "function", "_isValid", "(", "el", ",", "currentPath", ")", "{", "// Link has no destination URL", "if", "(", "!", "el", ".", "href", ")", "{", "return", "false", ";", "}", "// Link opens a new browser window", "if", "(", "el", ".", "target", "===", "'_blank'"...
Determine if path is valid for history navigation @param {HTMLElement} el @param {string} [currentPath] @returns {boolean} @private
[ "Determine", "if", "path", "is", "valid", "for", "history", "navigation" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/routes/pjax.js#L48-L71
30,556
weepower/wee-core
scripts/routes/pjax.js
_path
function _path(loc) { loc = loc || location; return loc.pathname + loc.search + loc.hash; }
javascript
function _path(loc) { loc = loc || location; return loc.pathname + loc.search + loc.hash; }
[ "function", "_path", "(", "loc", ")", "{", "loc", "=", "loc", "||", "location", ";", "return", "loc", ".", "pathname", "+", "loc", ".", "search", "+", "loc", ".", "hash", ";", "}" ]
Return current path @private @param {object} [loc] @returns {string}
[ "Return", "current", "path" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/routes/pjax.js#L80-L83
30,557
ChrisWren/grunt-link-checker
tasks/link-checker.js
function (message) { if (options.force) { grunt.log.error(message); } else { grunt.warn(message); } }
javascript
function (message) { if (options.force) { grunt.log.error(message); } else { grunt.warn(message); } }
[ "function", "(", "message", ")", "{", "if", "(", "options", ".", "force", ")", "{", "grunt", ".", "log", ".", "error", "(", "message", ")", ";", "}", "else", "{", "grunt", ".", "warn", "(", "message", ")", ";", "}", "}" ]
Borrowed from grunt-contrib-qunit If options.force then log an error, otherwise exit with a warning
[ "Borrowed", "from", "grunt", "-", "contrib", "-", "qunit", "If", "options", ".", "force", "then", "log", "an", "error", "otherwise", "exit", "with", "a", "warning" ]
96a7826c73c946a1c54c7999f90d11628ffdb47f
https://github.com/ChrisWren/grunt-link-checker/blob/96a7826c73c946a1c54c7999f90d11628ffdb47f/tasks/link-checker.js#L26-L32
30,558
OldSneerJaw/couchster
templates/validation-function/template.js
simpleTypeFilter
function simpleTypeFilter(newDoc, oldDoc, candidateDocType) { if (oldDoc) { if (newDoc._deleted) { return oldDoc.type === candidateDocType; } else { return newDoc.type === oldDoc.type && oldDoc.type === candidateDocType; } } else { return newDoc.type === candidateDocType;...
javascript
function simpleTypeFilter(newDoc, oldDoc, candidateDocType) { if (oldDoc) { if (newDoc._deleted) { return oldDoc.type === candidateDocType; } else { return newDoc.type === oldDoc.type && oldDoc.type === candidateDocType; } } else { return newDoc.type === candidateDocType;...
[ "function", "simpleTypeFilter", "(", "newDoc", ",", "oldDoc", ",", "candidateDocType", ")", "{", "if", "(", "oldDoc", ")", "{", "if", "(", "newDoc", ".", "_deleted", ")", "{", "return", "oldDoc", ".", "type", "===", "candidateDocType", ";", "}", "else", ...
A type filter that matches on the document's type property
[ "A", "type", "filter", "that", "matches", "on", "the", "document", "s", "type", "property" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/templates/validation-function/template.js#L23-L33
30,559
2do2go/mongodbext
lib/collection/index.js
function(methodName, alternatives) { return function() { var callback = Array.prototype.slice.call(arguments).pop(); if (!Array.isArray(alternatives)) { alternatives = [alternatives]; } var alternativeString; if (alternatives.length === 1) { alternativeString = alternatives[0]; } else { var lastI...
javascript
function(methodName, alternatives) { return function() { var callback = Array.prototype.slice.call(arguments).pop(); if (!Array.isArray(alternatives)) { alternatives = [alternatives]; } var alternativeString; if (alternatives.length === 1) { alternativeString = alternatives[0]; } else { var lastI...
[ "function", "(", "methodName", ",", "alternatives", ")", "{", "return", "function", "(", ")", "{", "var", "callback", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ".", "pop", "(", ")", ";", "if", "(", "!", "Array"...
override deprecated methods, throw error
[ "override", "deprecated", "methods", "throw", "error" ]
df045c430c4acdb9e6a55e1aaa8e449b72e7d0b2
https://github.com/2do2go/mongodbext/blob/df045c430c4acdb9e6a55e1aaa8e449b72e7d0b2/lib/collection/index.js#L112-L133
30,560
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_ast.js
add_shared
function add_shared(hash, customTags, doc_map) { hash = utils.merge(hash, { "inheritable" : !!doc_map["inheritable"], "inheritdoc" : extract(doc_map, "inheritdoc"), "related" : extract(doc_map, "related"), "see" : extract(doc_map, "see"), "private" : extract(doc_map, "private") !== nul...
javascript
function add_shared(hash, customTags, doc_map) { hash = utils.merge(hash, { "inheritable" : !!doc_map["inheritable"], "inheritdoc" : extract(doc_map, "inheritdoc"), "related" : extract(doc_map, "related"), "see" : extract(doc_map, "see"), "private" : extract(doc_map, "private") !== nul...
[ "function", "add_shared", "(", "hash", ",", "customTags", ",", "doc_map", ")", "{", "hash", "=", "utils", ".", "merge", "(", "hash", ",", "{", "\"inheritable\"", ":", "!", "!", "doc_map", "[", "\"inheritable\"", "]", ",", "\"inheritdoc\"", ":", "extract", ...
Detects properties common for each doc-object and adds them
[ "Detects", "properties", "common", "for", "each", "doc", "-", "object", "and", "adds", "them" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_ast.js#L170-L198
30,561
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_ast.js
detect_list
function detect_list(type, doc_map) { if (doc_map[type]) return _.flatten(_.map(doc_map[type], function(d) { d[type] })); else return null; }
javascript
function detect_list(type, doc_map) { if (doc_map[type]) return _.flatten(_.map(doc_map[type], function(d) { d[type] })); else return null; }
[ "function", "detect_list", "(", "type", ",", "doc_map", ")", "{", "if", "(", "doc_map", "[", "type", "]", ")", "return", "_", ".", "flatten", "(", "_", ".", "map", "(", "doc_map", "[", "type", "]", ",", "function", "(", "d", ")", "{", "d", "[", ...
for detecting mixins and alternateClassNames
[ "for", "detecting", "mixins", "and", "alternateClassNames" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_ast.js#L236-L241
30,562
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_ast.js
detect_doc
function detect_doc(docs, customTags) { var ignore_tags = _.union(["param", "return", "author", "version", "cancelable", "bubbles", "since", "inherits", "todo", "deprecated"], customTags); var doc_tags = _.filter(docs, function(tag) { return !_.include(ignore_tags, tag["tagname"]...
javascript
function detect_doc(docs, customTags) { var ignore_tags = _.union(["param", "return", "author", "version", "cancelable", "bubbles", "since", "inherits", "todo", "deprecated"], customTags); var doc_tags = _.filter(docs, function(tag) { return !_.include(ignore_tags, tag["tagname"]...
[ "function", "detect_doc", "(", "docs", ",", "customTags", ")", "{", "var", "ignore_tags", "=", "_", ".", "union", "(", "[", "\"param\"", ",", "\"return\"", ",", "\"author\"", ",", "\"version\"", ",", "\"cancelable\"", ",", "\"bubbles\"", ",", "\"since\"", ",...
Combines "doc"-s of most tags Ignore tags that have doc comment themselves and subproperty tags
[ "Combines", "doc", "-", "s", "of", "most", "tags", "Ignore", "tags", "that", "have", "doc", "comment", "themselves", "and", "subproperty", "tags" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_ast.js#L345-L350
30,563
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_parser.js
maybe_name
function maybe_name() { skip_horiz_white(); if (look(ident_pattern_with_dot)) { current_tag["name"] = match(ident_pattern_with_dot); } else if (look(ident_pattern)) { current_tag["name"] = match(ident_pattern); } }
javascript
function maybe_name() { skip_horiz_white(); if (look(ident_pattern_with_dot)) { current_tag["name"] = match(ident_pattern_with_dot); } else if (look(ident_pattern)) { current_tag["name"] = match(ident_pattern); } }
[ "function", "maybe_name", "(", ")", "{", "skip_horiz_white", "(", ")", ";", "if", "(", "look", "(", "ident_pattern_with_dot", ")", ")", "{", "current_tag", "[", "\"name\"", "]", "=", "match", "(", "ident_pattern_with_dot", ")", ";", "}", "else", "if", "(",...
matches identifier name if possible and sets it on @current_tag
[ "matches", "identifier", "name", "if", "possible", "and", "sets", "it", "on" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_parser.js#L640-L648
30,564
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_parser.js
default_value
function default_value() { start_pos = input.pointer(); value = parse_balanced(/\[/, /\]/, /[^\[\]]*/); if (look(/\]/)) { return value; } else { input.setPointer(start_pos); return match(/[^\]]*/); } }
javascript
function default_value() { start_pos = input.pointer(); value = parse_balanced(/\[/, /\]/, /[^\[\]]*/); if (look(/\]/)) { return value; } else { input.setPointer(start_pos); return match(/[^\]]*/); } }
[ "function", "default_value", "(", ")", "{", "start_pos", "=", "input", ".", "pointer", "(", ")", ";", "value", "=", "parse_balanced", "(", "/", "\\[", "/", ",", "/", "\\]", "/", ",", "/", "[^\\[\\]]*", "/", ")", ";", "if", "(", "look", "(", "/", ...
Attempts to allow balanced braces in default value. When the nested parsing doesn't finish at closing "]", roll back to beginning and simply grab anything up to closing "]".
[ "Attempts", "to", "allow", "balanced", "braces", "in", "default", "value", ".", "When", "the", "nested", "parsing", "doesn", "t", "finish", "at", "closing", "]", "roll", "back", "to", "beginning", "and", "simply", "grab", "anything", "up", "to", "closing", ...
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_parser.js#L661-L671
30,565
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_parser.js
parse_balanced
function parse_balanced(re_open, re_close, re_rest) { result = match(re_rest); while (look(re_open)) { result += match(re_open); result += parse_balanced(re_open, re_close, re_rest); result += match(re_close); result += match(re_rest); } return result; }
javascript
function parse_balanced(re_open, re_close, re_rest) { result = match(re_rest); while (look(re_open)) { result += match(re_open); result += parse_balanced(re_open, re_close, re_rest); result += match(re_close); result += match(re_rest); } return result; }
[ "function", "parse_balanced", "(", "re_open", ",", "re_close", ",", "re_rest", ")", "{", "result", "=", "match", "(", "re_rest", ")", ";", "while", "(", "look", "(", "re_open", ")", ")", "{", "result", "+=", "match", "(", "re_open", ")", ";", "result",...
Helper method to parse a string up to a closing brace, balancing opening-closing braces in between. @param re_open The beginning brace regex @param re_close The closing brace regex @param re_rest Regex to match text without any braces
[ "Helper", "method", "to", "parse", "a", "string", "up", "to", "a", "closing", "brace", "balancing", "opening", "-", "closing", "braces", "in", "between", "." ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_parser.js#L698-L707
30,566
CartoDB/node-redis-mpool
index.js
RedisPool
function RedisPool(opts) { if (!(this instanceof RedisPool)) { return new RedisPool(opts); } EventEmitter.call(this); opts = opts || {}; var defaults = { host: '127.0.0.1', port: '6379', max: 50, idleTimeoutMillis: 10000, reapIntervalMillis: 1000, ...
javascript
function RedisPool(opts) { if (!(this instanceof RedisPool)) { return new RedisPool(opts); } EventEmitter.call(this); opts = opts || {}; var defaults = { host: '127.0.0.1', port: '6379', max: 50, idleTimeoutMillis: 10000, reapIntervalMillis: 1000, ...
[ "function", "RedisPool", "(", "opts", ")", "{", "if", "(", "!", "(", "this", "instanceof", "RedisPool", ")", ")", "{", "return", "new", "RedisPool", "(", "opts", ")", ";", "}", "EventEmitter", ".", "call", "(", "this", ")", ";", "opts", "=", "opts", ...
Create a new multi database Redis pool. It will emit `status` event with information about each created pool. @param {Object} opts @returns {RedisPool} @constructor
[ "Create", "a", "new", "multi", "database", "Redis", "pool", ".", "It", "will", "emit", "status", "event", "with", "information", "about", "each", "created", "pool", "." ]
181e8fee869ac0696328a6af06e7be966cb09602
https://github.com/CartoDB/node-redis-mpool/blob/181e8fee869ac0696328a6af06e7be966cb09602/index.js#L20-L74
30,567
CartoDB/node-redis-mpool
index.js
makePool
function makePool(options, database) { return Pool({ name: options.name + ':' + database, create: function(callback) { var callbackCalled = false; var client = redis.createClient(options.port, options.host, { no_ready_check: options.noReadyCheck ...
javascript
function makePool(options, database) { return Pool({ name: options.name + ':' + database, create: function(callback) { var callbackCalled = false; var client = redis.createClient(options.port, options.host, { no_ready_check: options.noReadyCheck ...
[ "function", "makePool", "(", "options", ",", "database", ")", "{", "return", "Pool", "(", "{", "name", ":", "options", ".", "name", "+", "':'", "+", "database", ",", "create", ":", "function", "(", "callback", ")", "{", "var", "callbackCalled", "=", "f...
Factory to create new Redis pools for a given Redis database @param options @param database @returns {Object}
[ "Factory", "to", "create", "new", "Redis", "pools", "for", "a", "given", "Redis", "database" ]
181e8fee869ac0696328a6af06e7be966cb09602
https://github.com/CartoDB/node-redis-mpool/blob/181e8fee869ac0696328a6af06e7be966cb09602/index.js#L130-L176
30,568
weepower/wee-core
scripts/wee-store.js
_storageFactory
function _storageFactory(type) { let storage; if (type === 'local') { storage = window.localStorage; } else if (type === 'session') { storage = window.sessionStorage; } return { getItem(key) { return JSON.parse(storage.getItem(key)); }, setItem(key, value) { value = JSON.stringify(value); ret...
javascript
function _storageFactory(type) { let storage; if (type === 'local') { storage = window.localStorage; } else if (type === 'session') { storage = window.sessionStorage; } return { getItem(key) { return JSON.parse(storage.getItem(key)); }, setItem(key, value) { value = JSON.stringify(value); ret...
[ "function", "_storageFactory", "(", "type", ")", "{", "let", "storage", ";", "if", "(", "type", "===", "'local'", ")", "{", "storage", "=", "window", ".", "localStorage", ";", "}", "else", "if", "(", "type", "===", "'session'", ")", "{", "storage", "="...
Create wrapper for browser storage api @param {string} type @returns {*} @private
[ "Create", "wrapper", "for", "browser", "storage", "api" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/wee-store.js#L17-L39
30,569
alan-wu/ZincJS
src/scene.js
function(numberOfDownloaded, finishCallback, allCompletedCallback) { let downloadedItem = 0; return zincGeometry => { downloadedItem = downloadedItem + 1; if (finishCallback != undefined && (typeof finishCallback == 'function')) finishCallback(zincGeometry); if (downloadedItem == numbe...
javascript
function(numberOfDownloaded, finishCallback, allCompletedCallback) { let downloadedItem = 0; return zincGeometry => { downloadedItem = downloadedItem + 1; if (finishCallback != undefined && (typeof finishCallback == 'function')) finishCallback(zincGeometry); if (downloadedItem == numbe...
[ "function", "(", "numberOfDownloaded", ",", "finishCallback", ",", "allCompletedCallback", ")", "{", "let", "downloadedItem", "=", "0", ";", "return", "zincGeometry", "=>", "{", "downloadedItem", "=", "downloadedItem", "+", "1", ";", "if", "(", "finishCallback", ...
Object to keep track of number of items downloaded and when add items are downloaded allCompletedCallback is called
[ "Object", "to", "keep", "track", "of", "number", "of", "items", "downloaded", "and", "when", "add", "items", "are", "downloaded", "allCompletedCallback", "is", "called" ]
f2c25b63a109b8f09e7329211703a60d49b62676
https://github.com/alan-wu/ZincJS/blob/f2c25b63a109b8f09e7329211703a60d49b62676/src/scene.js#L340-L350
30,570
kaelzhang/neuron.js
lib/ecma5.js
extend
function extend (host, methods) { for (var name in methods) { if (!host[name]) { host[name] = methods[name]; } } }
javascript
function extend (host, methods) { for (var name in methods) { if (!host[name]) { host[name] = methods[name]; } } }
[ "function", "extend", "(", "host", ",", "methods", ")", "{", "for", "(", "var", "name", "in", "methods", ")", "{", "if", "(", "!", "host", "[", "name", "]", ")", "{", "host", "[", "name", "]", "=", "methods", "[", "name", "]", ";", "}", "}", ...
- always has no dependencies on Neuron - always follow ECMA standard strictly, including logic, exception type - throw the same error hint as webkit on a certain exception
[ "-", "always", "has", "no", "dependencies", "on", "Neuron", "-", "always", "follow", "ECMA", "standard", "strictly", "including", "logic", "exception", "type", "-", "throw", "the", "same", "error", "hint", "as", "webkit", "on", "a", "certain", "exception" ]
3e1eed28f08ab14f289f476f886ac7f095036e66
https://github.com/kaelzhang/neuron.js/blob/3e1eed28f08ab14f289f476f886ac7f095036e66/lib/ecma5.js#L40-L46
30,571
OldSneerJaw/couchster
src/validation/property-validator-schema.js
makeTypeConstraintsSchema
function makeTypeConstraintsSchema(typeName) { const allTypeConstraints = typeSpecificConstraintSchemas(); const constraints = Object.assign({ }, universalConstraintSchemas(typeEqualitySchemas[typeName]), allTypeConstraints[typeName]); return joi.object().keys(constraints) // Prevent the use of more than one...
javascript
function makeTypeConstraintsSchema(typeName) { const allTypeConstraints = typeSpecificConstraintSchemas(); const constraints = Object.assign({ }, universalConstraintSchemas(typeEqualitySchemas[typeName]), allTypeConstraints[typeName]); return joi.object().keys(constraints) // Prevent the use of more than one...
[ "function", "makeTypeConstraintsSchema", "(", "typeName", ")", "{", "const", "allTypeConstraints", "=", "typeSpecificConstraintSchemas", "(", ")", ";", "const", "constraints", "=", "Object", ".", "assign", "(", "{", "}", ",", "universalConstraintSchemas", "(", "type...
Creates a validation schema for the constraints of the specified type
[ "Creates", "a", "validation", "schema", "for", "the", "constraints", "of", "the", "specified", "type" ]
59528affeee2c3946829f79f46718d6cbac69412
https://github.com/OldSneerJaw/couchster/blob/59528affeee2c3946829f79f46718d6cbac69412/src/validation/property-validator-schema.js#L209-L240
30,572
gjtorikian/panino-docs
lib/panino/plugins/renderers/c9ac_support/util.js
processOne
function processOne() { var item = array.pop(); fn(item, function(result, err) { if (array.length > 0) processOne(); else callback(result, err); }); }
javascript
function processOne() { var item = array.pop(); fn(item, function(result, err) { if (array.length > 0) processOne(); else callback(result, err); }); }
[ "function", "processOne", "(", ")", "{", "var", "item", "=", "array", ".", "pop", "(", ")", ";", "fn", "(", "item", ",", "function", "(", "result", ",", "err", ")", "{", "if", "(", "array", ".", "length", ">", "0", ")", "processOne", "(", ")", ...
Just to be sure
[ "Just", "to", "be", "sure" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/renderers/c9ac_support/util.js#L22-L30
30,573
weepower/wee-core
scripts/dom/index.js
_setClass
function _setClass(el, className) { el instanceof SVGElement ? el.setAttribute('class', className) : el.className = className; }
javascript
function _setClass(el, className) { el instanceof SVGElement ? el.setAttribute('class', className) : el.className = className; }
[ "function", "_setClass", "(", "el", ",", "className", ")", "{", "el", "instanceof", "SVGElement", "?", "el", ".", "setAttribute", "(", "'class'", ",", "className", ")", ":", "el", ".", "className", "=", "className", ";", "}" ]
Set class value of element @private @param {HTMLElement} el @param {string} className
[ "Set", "class", "value", "of", "element" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/dom/index.js#L26-L30
30,574
weepower/wee-core
scripts/dom/index.js
_toCamel
function _toCamel(name) { return name.toLowerCase() .replace(/-(.)/g, (match, val) => val.toUpperCase()); }
javascript
function _toCamel(name) { return name.toLowerCase() .replace(/-(.)/g, (match, val) => val.toUpperCase()); }
[ "function", "_toCamel", "(", "name", ")", "{", "return", "name", ".", "toLowerCase", "(", ")", ".", "replace", "(", "/", "-(.)", "/", "g", ",", "(", "match", ",", "val", ")", "=>", "val", ".", "toUpperCase", "(", ")", ")", ";", "}" ]
Convert dash-separated string to camel-case @private @param {string} name @returns {string}
[ "Convert", "dash", "-", "separated", "string", "to", "camel", "-", "case" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/dom/index.js#L39-L42
30,575
weepower/wee-core
scripts/dom/index.js
_getSelected
function _getSelected(select) { const arr = []; _slice.call(select.options).map((el) => { if (el.selected) { arr.push(el.value); } }); return arr; }
javascript
function _getSelected(select) { const arr = []; _slice.call(select.options).map((el) => { if (el.selected) { arr.push(el.value); } }); return arr; }
[ "function", "_getSelected", "(", "select", ")", "{", "const", "arr", "=", "[", "]", ";", "_slice", ".", "call", "(", "select", ".", "options", ")", ".", "map", "(", "(", "el", ")", "=>", "{", "if", "(", "el", ".", "selected", ")", "{", "arr", "...
Get the selected options from a select @private @param {HTMLElement} select @returns {Array} selected
[ "Get", "the", "selected", "options", "from", "a", "select" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/dom/index.js#L62-L72
30,576
weepower/wee-core
scripts/dom/index.js
_getSibling
function _getSibling(target, dir, filter, options) { let match; $each(target, (el) => { const index = $index(el) + dir; $children($parent(el)).forEach((el, i) => { if (i === index && (! filter || filter && $is(el, filter, options))) { match = el; ...
javascript
function _getSibling(target, dir, filter, options) { let match; $each(target, (el) => { const index = $index(el) + dir; $children($parent(el)).forEach((el, i) => { if (i === index && (! filter || filter && $is(el, filter, options))) { match = el; ...
[ "function", "_getSibling", "(", "target", ",", "dir", ",", "filter", ",", "options", ")", "{", "let", "match", ";", "$each", "(", "target", ",", "(", "el", ")", "=>", "{", "const", "index", "=", "$index", "(", "el", ")", "+", "dir", ";", "$children...
Return either direct previous or next sibling @private @param {($|HTMLElement|string)} target @param {number} dir @param filter @param {Object} [options] @returns {HTMLElement}
[ "Return", "either", "direct", "previous", "or", "next", "sibling" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/dom/index.js#L84-L99
30,577
alan-wu/ZincJS
src/utilities.js
partialCallback
function partialCallback(text, urlIndex) { result[urlIndex] = text; numComplete++; // When all files have downloaded if (numComplete == numUrls) { callback(result); } }
javascript
function partialCallback(text, urlIndex) { result[urlIndex] = text; numComplete++; // When all files have downloaded if (numComplete == numUrls) { callback(result); } }
[ "function", "partialCallback", "(", "text", ",", "urlIndex", ")", "{", "result", "[", "urlIndex", "]", "=", "text", ";", "numComplete", "++", ";", "// When all files have downloaded", "if", "(", "numComplete", "==", "numUrls", ")", "{", "callback", "(", "resul...
Callback for a single file
[ "Callback", "for", "a", "single", "file" ]
f2c25b63a109b8f09e7329211703a60d49b62676
https://github.com/alan-wu/ZincJS/blob/f2c25b63a109b8f09e7329211703a60d49b62676/src/utilities.js#L29-L37
30,578
c9/vfs-socket
worker.js
write
function write(id, chunk) { // They want to write to our real stream var stream = streams[id]; if (!stream) return; stream.write(chunk); }
javascript
function write(id, chunk) { // They want to write to our real stream var stream = streams[id]; if (!stream) return; stream.write(chunk); }
[ "function", "write", "(", "id", ",", "chunk", ")", "{", "// They want to write to our real stream", "var", "stream", "=", "streams", "[", "id", "]", ";", "if", "(", "!", "stream", ")", "return", ";", "stream", ".", "write", "(", "chunk", ")", ";", "}" ]
Remote side writing to our local writable streams
[ "Remote", "side", "writing", "to", "our", "local", "writable", "streams" ]
1a88b31d8d59f4a9d8226acb5c44e9de7ec15bd5
https://github.com/c9/vfs-socket/blob/1a88b31d8d59f4a9d8226acb5c44e9de7ec15bd5/worker.js#L267-L272
30,579
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_expander.js
expand_comment
function expand_comment(docset) { groups = { "class": [], "cfg": [], "Constructor": [] } // By default everything goes to :class group var group_name = "class"; _.each(docset["comment"], function (tag) { tagname = tag["tagname"]; if (tagname == "cfg" || tagname == "Constructor") { ...
javascript
function expand_comment(docset) { groups = { "class": [], "cfg": [], "Constructor": [] } // By default everything goes to :class group var group_name = "class"; _.each(docset["comment"], function (tag) { tagname = tag["tagname"]; if (tagname == "cfg" || tagname == "Constructor") { ...
[ "function", "expand_comment", "(", "docset", ")", "{", "groups", "=", "{", "\"class\"", ":", "[", "]", ",", "\"cfg\"", ":", "[", "]", ",", "\"Constructor\"", ":", "[", "]", "}", "// By default everything goes to :class group", "var", "group_name", "=", "\"clas...
Handles old syntax where configs and constructor are part of class doc-comment. Gathers all tags until first @cfg or @constructor into the first bare :class group. We have a special case for @xtype which in ExtJS comments often appears after @constructor - so we explicitly place it into :class group. Then gathers ea...
[ "Handles", "old", "syntax", "where", "configs", "and", "constructor", "are", "part", "of", "class", "doc", "-", "comment", ".", "Gathers", "all", "tags", "until", "first" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_expander.js#L35-L63
30,580
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_expander.js
groups_to_docsets
function groups_to_docsets(groups, docset) { var results = [{ "tagname": "class", "type": docset["type"], "comment": groups["class"], "code": docset["code"], "linenr": docset["linenr"] }]; _.each(groups["cfg"], function(cfg) { results.push({ "tagname": "cfg", "type": docset["t...
javascript
function groups_to_docsets(groups, docset) { var results = [{ "tagname": "class", "type": docset["type"], "comment": groups["class"], "code": docset["code"], "linenr": docset["linenr"] }]; _.each(groups["cfg"], function(cfg) { results.push({ "tagname": "cfg", "type": docset["t...
[ "function", "groups_to_docsets", "(", "groups", ",", "docset", ")", "{", "var", "results", "=", "[", "{", "\"tagname\"", ":", "\"class\"", ",", "\"type\"", ":", "docset", "[", "\"type\"", "]", ",", "\"comment\"", ":", "groups", "[", "\"class\"", "]", ",", ...
Turns groups hash into list of docsets
[ "Turns", "groups", "hash", "into", "list", "of", "docsets" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_expander.js#L66-L100
30,581
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/doc_expander.js
expand_code
function expand_code(docset) { var results = []; if (docset["code"] && docset["code"]["members"]) { _.each(docset["code"]["members"], function(m) { if (! (constructor_found && m["name"] == "Constructor") ) results.push(code_to_docset(m)); }); } return results; }
javascript
function expand_code(docset) { var results = []; if (docset["code"] && docset["code"]["members"]) { _.each(docset["code"]["members"], function(m) { if (! (constructor_found && m["name"] == "Constructor") ) results.push(code_to_docset(m)); }); } return results; }
[ "function", "expand_code", "(", "docset", ")", "{", "var", "results", "=", "[", "]", ";", "if", "(", "docset", "[", "\"code\"", "]", "&&", "docset", "[", "\"code\"", "]", "[", "\"members\"", "]", ")", "{", "_", ".", "each", "(", "docset", "[", "\"c...
Turns auto-detected class members into docsets in their own right.
[ "Turns", "auto", "-", "detected", "class", "members", "into", "docsets", "in", "their", "own", "right", "." ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/doc_expander.js#L103-L114
30,582
artifishional/air-m2
src/loader/loader.js
vertextes
function vertextes(parent, exist = [], item, _path) { return [...parent.children].reduce( (acc, node, index) => { if(node.tagName === "IMG") { //const [ name, props = {} ] = JSON.parse(node.getAttribute("m2") || "[]"); node.setAttribute("m2", JSON.stringify([ `*${imgc...
javascript
function vertextes(parent, exist = [], item, _path) { return [...parent.children].reduce( (acc, node, index) => { if(node.tagName === "IMG") { //const [ name, props = {} ] = JSON.parse(node.getAttribute("m2") || "[]"); node.setAttribute("m2", JSON.stringify([ `*${imgc...
[ "function", "vertextes", "(", "parent", ",", "exist", "=", "[", "]", ",", "item", ",", "_path", ")", "{", "return", "[", "...", "parent", ".", "children", "]", ".", "reduce", "(", "(", "acc", ",", "node", ",", "index", ")", "=>", "{", "if", "(", ...
todo need refactor
[ "todo", "need", "refactor" ]
554203dcc835e4877481f53efc92e04aff79ce4c
https://github.com/artifishional/air-m2/blob/554203dcc835e4877481f53efc92e04aff79ce4c/src/loader/loader.js#L42-L73
30,583
shapesecurity/shift-scope-js
examples/const.js
declarationImpliesInitialisation
function declarationImpliesInitialisation(variable, scope) { return variable.name === "arguments" && scope.type === ScopeType.FUNCTION || variable.declarations.some(decl => decl.type === DeclarationType.PARAMETER || decl.type === DeclarationType.FUNCTION_NAME || decl.type === DeclarationType.CAT...
javascript
function declarationImpliesInitialisation(variable, scope) { return variable.name === "arguments" && scope.type === ScopeType.FUNCTION || variable.declarations.some(decl => decl.type === DeclarationType.PARAMETER || decl.type === DeclarationType.FUNCTION_NAME || decl.type === DeclarationType.CAT...
[ "function", "declarationImpliesInitialisation", "(", "variable", ",", "scope", ")", "{", "return", "variable", ".", "name", "===", "\"arguments\"", "&&", "scope", ".", "type", "===", "ScopeType", ".", "FUNCTION", "||", "variable", ".", "declarations", ".", "some...
determine if a variable has an implicit initial value
[ "determine", "if", "a", "variable", "has", "an", "implicit", "initial", "value" ]
2a467754fec0e8f0149a08d0a366c2663f0670fd
https://github.com/shapesecurity/shift-scope-js/blob/2a467754fec0e8f0149a08d0a366c2663f0670fd/examples/const.js#L55-L62
30,584
weepower/wee-core
scripts/core/types.js
_arrEquals
function _arrEquals(a, b) { return a.length == b.length && a.every((el, i) => _equals(el, b[i])); }
javascript
function _arrEquals(a, b) { return a.length == b.length && a.every((el, i) => _equals(el, b[i])); }
[ "function", "_arrEquals", "(", "a", ",", "b", ")", "{", "return", "a", ".", "length", "==", "b", ".", "length", "&&", "a", ".", "every", "(", "(", "el", ",", "i", ")", "=>", "_equals", "(", "el", ",", "b", "[", "i", "]", ")", ")", ";", "}" ...
Compare two arrays for equality @private @param {Array} a @param {Array} b @returns {boolean}
[ "Compare", "two", "arrays", "for", "equality" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/core/types.js#L11-L14
30,585
weepower/wee-core
scripts/core/types.js
_copy
function _copy(val) { const type = $type(val); if (type == 'object') { val = _extend({}, val, true); } else if (type == 'array') { val = val.slice(0); } return val; }
javascript
function _copy(val) { const type = $type(val); if (type == 'object') { val = _extend({}, val, true); } else if (type == 'array') { val = val.slice(0); } return val; }
[ "function", "_copy", "(", "val", ")", "{", "const", "type", "=", "$type", "(", "val", ")", ";", "if", "(", "type", "==", "'object'", ")", "{", "val", "=", "_extend", "(", "{", "}", ",", "val", ",", "true", ")", ";", "}", "else", "if", "(", "t...
Clone value to a new instance @private @param {*} val @returns {*}
[ "Clone", "value", "to", "a", "new", "instance" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/core/types.js#L44-L54
30,586
weepower/wee-core
scripts/core/types.js
_equals
function _equals(a, b) { if (a === b) { return true; } const aType = $type(a); if (aType != $type(b)) { return false; } if (aType == 'array') { return _arrEquals(a, b); } if (aType == 'object') { return _objEquals(a, b); } if (aType == 'date')...
javascript
function _equals(a, b) { if (a === b) { return true; } const aType = $type(a); if (aType != $type(b)) { return false; } if (aType == 'array') { return _arrEquals(a, b); } if (aType == 'object') { return _objEquals(a, b); } if (aType == 'date')...
[ "function", "_equals", "(", "a", ",", "b", ")", "{", "if", "(", "a", "===", "b", ")", "{", "return", "true", ";", "}", "const", "aType", "=", "$type", "(", "a", ")", ";", "if", "(", "aType", "!=", "$type", "(", "b", ")", ")", "{", "return", ...
Compare two values for equality @private @param {*} a @param {*} b @returns {boolean}
[ "Compare", "two", "values", "for", "equality" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/core/types.js#L64-L88
30,587
weepower/wee-core
scripts/core/types.js
_objEquals
function _objEquals(a, b) { const aKeys = Object.keys(a); return _arrEquals(aKeys.sort(), Object.keys(b).sort()) && aKeys.every(i => _equals(a[i], b[i])); }
javascript
function _objEquals(a, b) { const aKeys = Object.keys(a); return _arrEquals(aKeys.sort(), Object.keys(b).sort()) && aKeys.every(i => _equals(a[i], b[i])); }
[ "function", "_objEquals", "(", "a", ",", "b", ")", "{", "const", "aKeys", "=", "Object", ".", "keys", "(", "a", ")", ";", "return", "_arrEquals", "(", "aKeys", ".", "sort", "(", ")", ",", "Object", ".", "keys", "(", "b", ")", ".", "sort", "(", ...
Compare two objects for equality @private @param {Object} a @param {Object} b @returns {boolean}
[ "Compare", "two", "objects", "for", "equality" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/core/types.js#L143-L148
30,588
kaelzhang/neuron.js
lib/util.js
format_parsed
function format_parsed (parsed) { var pkg = (parsed.s && '@' + parsed.s + '/') + parsed.n + '@' + parsed.v; parsed.id = pkg + parsed.p; parsed.k = pkg; return parsed; }
javascript
function format_parsed (parsed) { var pkg = (parsed.s && '@' + parsed.s + '/') + parsed.n + '@' + parsed.v; parsed.id = pkg + parsed.p; parsed.k = pkg; return parsed; }
[ "function", "format_parsed", "(", "parsed", ")", "{", "var", "pkg", "=", "(", "parsed", ".", "s", "&&", "'@'", "+", "parsed", ".", "s", "+", "'/'", ")", "+", "parsed", ".", "n", "+", "'@'", "+", "parsed", ".", "v", ";", "parsed", ".", "id", "="...
Format package id and pkg `parsed` -> 'a@1.1.0'
[ "Format", "package", "id", "and", "pkg", "parsed", "-", ">", "a" ]
3e1eed28f08ab14f289f476f886ac7f095036e66
https://github.com/kaelzhang/neuron.js/blob/3e1eed28f08ab14f289f476f886ac7f095036e66/lib/util.js#L43-L50
30,589
kaelzhang/neuron.js
lib/util.js
mix
function mix (receiver, supplier) { for (var key in supplier) { receiver[key] = supplier[key]; } return receiver; }
javascript
function mix (receiver, supplier) { for (var key in supplier) { receiver[key] = supplier[key]; } return receiver; }
[ "function", "mix", "(", "receiver", ",", "supplier", ")", "{", "for", "(", "var", "key", "in", "supplier", ")", "{", "receiver", "[", "key", "]", "=", "supplier", "[", "key", "]", ";", "}", "return", "receiver", ";", "}" ]
A very simple `mix` method copy all properties in the supplier to the receiver @param {Object} receiver @param {Object} supplier @returns {mixed} receiver
[ "A", "very", "simple", "mix", "method", "copy", "all", "properties", "in", "the", "supplier", "to", "the", "receiver" ]
3e1eed28f08ab14f289f476f886ac7f095036e66
https://github.com/kaelzhang/neuron.js/blob/3e1eed28f08ab14f289f476f886ac7f095036e66/lib/util.js#L58-L63
30,590
weepower/wee-core
scripts/routes/transitions.js
_whichTransitionEvent
function _whichTransitionEvent() { const el = document.createElement('meta'); const animations = { transition: 'transitionend', OTransition: 'oTransitionEnd', MozTransition: 'transitionend', WebkitTransition: 'webkitTransitionEnd', }; for (const t in animations) { ...
javascript
function _whichTransitionEvent() { const el = document.createElement('meta'); const animations = { transition: 'transitionend', OTransition: 'oTransitionEnd', MozTransition: 'transitionend', WebkitTransition: 'webkitTransitionEnd', }; for (const t in animations) { ...
[ "function", "_whichTransitionEvent", "(", ")", "{", "const", "el", "=", "document", ".", "createElement", "(", "'meta'", ")", ";", "const", "animations", "=", "{", "transition", ":", "'transitionend'", ",", "OTransition", ":", "'oTransitionEnd'", ",", "MozTransi...
Detect what transition property to listen for @returns {*} @private
[ "Detect", "what", "transition", "property", "to", "listen", "for" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/routes/transitions.js#L13-L27
30,591
weepower/wee-core
scripts/wee-screen.js
_addRule
function _addRule(conf) { // Attach unique identifier conf.i = id++; // Only setup watching when enabled if (conf.watch !== false) { events.push(conf); // Only attach event once if (! bound) { const run = _run.bind(this, false, 0, null); bound = 1; ...
javascript
function _addRule(conf) { // Attach unique identifier conf.i = id++; // Only setup watching when enabled if (conf.watch !== false) { events.push(conf); // Only attach event once if (! bound) { const run = _run.bind(this, false, 0, null); bound = 1; ...
[ "function", "_addRule", "(", "conf", ")", "{", "// Attach unique identifier", "conf", ".", "i", "=", "id", "++", ";", "// Only setup watching when enabled", "if", "(", "conf", ".", "watch", "!==", "false", ")", "{", "events", ".", "push", "(", "conf", ")", ...
Bind individual rule @private @param {Object} conf - breakpoint rules @param {Array} [conf.args] - callback arguments @param {Function} conf.callback @param {boolean} [conf.each=false] - execute for each matching breakpoint @param {boolean} [conf.init=true] - check event on load @param {number} [conf.max] - maximum br...
[ "Bind", "individual", "rule" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/wee-screen.js#L27-L50
30,592
weepower/wee-core
scripts/wee-screen.js
_eq
function _eq(evt, size, init) { const sz = evt.size; const mn = evt.min; const mx = evt.max; const ex = evt.each || init; // Check match against rules return (! sz && ! mn && ! mx) || (sz && sz === size) || (mn && size >= mn && (ex || current < mn) && (! mx || size <= mx)) || ...
javascript
function _eq(evt, size, init) { const sz = evt.size; const mn = evt.min; const mx = evt.max; const ex = evt.each || init; // Check match against rules return (! sz && ! mn && ! mx) || (sz && sz === size) || (mn && size >= mn && (ex || current < mn) && (! mx || size <= mx)) || ...
[ "function", "_eq", "(", "evt", ",", "size", ",", "init", ")", "{", "const", "sz", "=", "evt", ".", "size", ";", "const", "mn", "=", "evt", ".", "min", ";", "const", "mx", "=", "evt", ".", "max", ";", "const", "ex", "=", "evt", ".", "each", "|...
Compare event rules against current size @private @param {Object} evt @param {number} size @param {boolean} init @returns {boolean}
[ "Compare", "event", "rules", "against", "current", "size" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/wee-screen.js#L61-L72
30,593
weepower/wee-core
scripts/wee-screen.js
_run
function _run(init, rules, namespace) { const size = _size(); let evts = rules || events; let i; // If breakpoint has been hit or resize logic initialized if (size && (init || size !== current)) { if (namespace) { evts = evts.filter(obj => obj.namespace === namespace); }...
javascript
function _run(init, rules, namespace) { const size = _size(); let evts = rules || events; let i; // If breakpoint has been hit or resize logic initialized if (size && (init || size !== current)) { if (namespace) { evts = evts.filter(obj => obj.namespace === namespace); }...
[ "function", "_run", "(", "init", ",", "rules", ",", "namespace", ")", "{", "const", "size", "=", "_size", "(", ")", ";", "let", "evts", "=", "rules", "||", "events", ";", "let", "i", ";", "// If breakpoint has been hit or resize logic initialized", "if", "("...
Check mapped rules for matching conditions @private @param {boolean} [init=false] - initial page load @param {Array} [rules] - breakpoint rules @param {string} [namespace] - namespace for map object
[ "Check", "mapped", "rules", "for", "matching", "conditions" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/wee-screen.js#L82-L122
30,594
weepower/wee-core
scripts/wee-routes.js
router
function router(config = {}) { $extend(settings, config); // Update scrollBehavior property in case that was changed history.scrollBehavior = settings.scrollBehavior; history.transition = settings.transition; return router; }
javascript
function router(config = {}) { $extend(settings, config); // Update scrollBehavior property in case that was changed history.scrollBehavior = settings.scrollBehavior; history.transition = settings.transition; return router; }
[ "function", "router", "(", "config", "=", "{", "}", ")", "{", "$extend", "(", "settings", ",", "config", ")", ";", "// Update scrollBehavior property in case that was changed", "history", ".", "scrollBehavior", "=", "settings", ".", "scrollBehavior", ";", "history",...
Set base configurations for router @param {Object} config @returns {router}
[ "Set", "base", "configurations", "for", "router" ]
3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4
https://github.com/weepower/wee-core/blob/3ffbb38ce0c9d21b0c5f4aad6b31295d7a2750f4/scripts/wee-routes.js#L32-L40
30,595
kaelzhang/neuron.js
lib/define.js
run_callbacks
function run_callbacks (object, key) { var callbacks = object[key]; var callback; // Mark the module is ready // `delete module.c` is not safe // #135 // Android 2.2 might treat `null` as [object Global] and equal it to true, // So, never confuse `null` and `false` object[key] = FALSE; while(callback ...
javascript
function run_callbacks (object, key) { var callbacks = object[key]; var callback; // Mark the module is ready // `delete module.c` is not safe // #135 // Android 2.2 might treat `null` as [object Global] and equal it to true, // So, never confuse `null` and `false` object[key] = FALSE; while(callback ...
[ "function", "run_callbacks", "(", "object", ",", "key", ")", "{", "var", "callbacks", "=", "object", "[", "key", "]", ";", "var", "callback", ";", "// Mark the module is ready", "// `delete module.c` is not safe", "// #135", "// Android 2.2 might treat `null` as [object G...
Run the callbacks
[ "Run", "the", "callbacks" ]
3e1eed28f08ab14f289f476f886ac7f095036e66
https://github.com/kaelzhang/neuron.js/blob/3e1eed28f08ab14f289f476f886ac7f095036e66/lib/define.js#L85-L97
30,596
shadowgov/envc
lib/parser.js
Parser
function Parser(options) { options = options || {}; // env storage this._env = Object.create(null); // current env this._currEnv = options.currEnv || process.env; // enable/disable booleans this._allowBool = has.call(options, 'booleans') ? options.booleans : false; // enable/disable numbers ...
javascript
function Parser(options) { options = options || {}; // env storage this._env = Object.create(null); // current env this._currEnv = options.currEnv || process.env; // enable/disable booleans this._allowBool = has.call(options, 'booleans') ? options.booleans : false; // enable/disable numbers ...
[ "function", "Parser", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "// env storage", "this", ".", "_env", "=", "Object", ".", "create", "(", "null", ")", ";", "// current env", "this", ".", "_currEnv", "=", "options", ".", ...
.env file parser. @constructor
[ ".", "env", "file", "parser", "." ]
a5e998c465197dbd748a5bf58fb4a0896b6fabff
https://github.com/shadowgov/envc/blob/a5e998c465197dbd748a5bf58fb4a0896b6fabff/lib/parser.js#L19-L37
30,597
shadowgov/envc
lib/parser.js
scan
function scan(str, re) { var match = null; var ret = []; while (match = re.exec(str)) { ret.push(match); } return ret; }
javascript
function scan(str, re) { var match = null; var ret = []; while (match = re.exec(str)) { ret.push(match); } return ret; }
[ "function", "scan", "(", "str", ",", "re", ")", "{", "var", "match", "=", "null", ";", "var", "ret", "=", "[", "]", ";", "while", "(", "match", "=", "re", ".", "exec", "(", "str", ")", ")", "{", "ret", ".", "push", "(", "match", ")", ";", "...
Scan `str` with `re`. @param {String} str @param {RegExp} re @returns {Array} @private
[ "Scan", "str", "with", "re", "." ]
a5e998c465197dbd748a5bf58fb4a0896b6fabff
https://github.com/shadowgov/envc/blob/a5e998c465197dbd748a5bf58fb4a0896b6fabff/lib/parser.js#L254-L263
30,598
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/ast_esprima.js
function() { // First deal only with doc-comments doc_comments = _.filter(docs, function(d) { return d["type"] == "doc_comment"; }); // Detect code in each docset. Sometimes a docset has already // been detected as part of detecting some previous docset (like // Class detecting all of it...
javascript
function() { // First deal only with doc-comments doc_comments = _.filter(docs, function(d) { return d["type"] == "doc_comment"; }); // Detect code in each docset. Sometimes a docset has already // been detected as part of detecting some previous docset (like // Class detecting all of it...
[ "function", "(", ")", "{", "// First deal only with doc-comments", "doc_comments", "=", "_", ".", "filter", "(", "docs", ",", "function", "(", "d", ")", "{", "return", "d", "[", "\"type\"", "]", "==", "\"doc_comment\"", ";", "}", ")", ";", "// Detect code in...
Performs the detection of code in all docsets. @returns the processed array of docsets. (But it does it destructively by modifying the passed-in docsets.)
[ "Performs", "the", "detection", "of", "code", "in", "all", "docsets", "." ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/ast_esprima.js#L40-L63
30,599
gjtorikian/panino-docs
lib/panino/plugins/parsers/javascript/jsd/ast_esprima.js
detect_class_members_from_object
function detect_class_members_from_object(cls, ast) { cls["members"] = [] return each_pair_in_object_expression(ast, function(key, value, pair) { detect_method_or_property(cls, key, value, pair); }); }
javascript
function detect_class_members_from_object(cls, ast) { cls["members"] = [] return each_pair_in_object_expression(ast, function(key, value, pair) { detect_method_or_property(cls, key, value, pair); }); }
[ "function", "detect_class_members_from_object", "(", "cls", ",", "ast", ")", "{", "cls", "[", "\"members\"", "]", "=", "[", "]", "return", "each_pair_in_object_expression", "(", "ast", ",", "function", "(", "key", ",", "value", ",", "pair", ")", "{", "detect...
Detects class members from object literal
[ "Detects", "class", "members", "from", "object", "literal" ]
23ea0355d42875a59f14a065ac3c06d096112ced
https://github.com/gjtorikian/panino-docs/blob/23ea0355d42875a59f14a065ac3c06d096112ced/lib/panino/plugins/parsers/javascript/jsd/ast_esprima.js#L303-L308