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
2,600
summernote/summernote
src/js/base/core/dom.js
isSamePoint
function isSamePoint(pointA, pointB) { return pointA.node === pointB.node && pointA.offset === pointB.offset; }
javascript
function isSamePoint(pointA, pointB) { return pointA.node === pointB.node && pointA.offset === pointB.offset; }
[ "function", "isSamePoint", "(", "pointA", ",", "pointB", ")", "{", "return", "pointA", ".", "node", "===", "pointB", ".", "node", "&&", "pointA", ".", "offset", "===", "pointB", ".", "offset", ";", "}" ]
returns whether pointA and pointB is same or not. @param {BoundaryPoint} pointA @param {BoundaryPoint} pointB @return {Boolean}
[ "returns", "whether", "pointA", "and", "pointB", "is", "same", "or", "not", "." ]
8dcafb8107453006b905ef697a529c42e76beb3f
https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L592-L594
2,601
summernote/summernote
src/js/base/core/range.js
textRangeToPoint
function textRangeToPoint(textRange, isStart) { let container = textRange.parentElement(); let offset; const tester = document.body.createTextRange(); let prevContainer; const childNodes = lists.from(container.childNodes); for (offset = 0; offset < childNodes.length; offset++) { if (dom.isText(childNod...
javascript
function textRangeToPoint(textRange, isStart) { let container = textRange.parentElement(); let offset; const tester = document.body.createTextRange(); let prevContainer; const childNodes = lists.from(container.childNodes); for (offset = 0; offset < childNodes.length; offset++) { if (dom.isText(childNod...
[ "function", "textRangeToPoint", "(", "textRange", ",", "isStart", ")", "{", "let", "container", "=", "textRange", ".", "parentElement", "(", ")", ";", "let", "offset", ";", "const", "tester", "=", "document", ".", "body", ".", "createTextRange", "(", ")", ...
return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js @param {TextRange} textRange @param {Boolean} isStart @return {BoundaryPoint} @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx
[ "return", "boundaryPoint", "from", "TextRange", "inspired", "by", "Andy", "Na", "s", "HuskyRange", ".", "js" ]
8dcafb8107453006b905ef697a529c42e76beb3f
https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/range.js#L16-L67
2,602
summernote/summernote
src/js/base/core/env.js
isFontInstalled
function isFontInstalled(fontName) { const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS'; const testText = 'mmmmmmmmmmwwwww'; const testSize = '200px'; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); context.font = testSize + " '" + tes...
javascript
function isFontInstalled(fontName) { const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS'; const testText = 'mmmmmmmmmmwwwww'; const testSize = '200px'; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); context.font = testSize + " '" + tes...
[ "function", "isFontInstalled", "(", "fontName", ")", "{", "const", "testFontName", "=", "fontName", "===", "'Comic Sans MS'", "?", "'Courier New'", ":", "'Comic Sans MS'", ";", "const", "testText", "=", "'mmmmmmmmmmwwwww'", ";", "const", "testSize", "=", "'200px'", ...
eslint-disable-line returns whether font is installed or not. @param {String} fontName @return {Boolean}
[ "eslint", "-", "disable", "-", "line", "returns", "whether", "font", "is", "installed", "or", "not", "." ]
8dcafb8107453006b905ef697a529c42e76beb3f
https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/env.js#L10-L25
2,603
ramda/ramda
source/applySpec.js
mapValues
function mapValues(fn, obj) { return keys(obj).reduce(function(acc, key) { acc[key] = fn(obj[key]); return acc; }, {}); }
javascript
function mapValues(fn, obj) { return keys(obj).reduce(function(acc, key) { acc[key] = fn(obj[key]); return acc; }, {}); }
[ "function", "mapValues", "(", "fn", ",", "obj", ")", "{", "return", "keys", "(", "obj", ")", ".", "reduce", "(", "function", "(", "acc", ",", "key", ")", "{", "acc", "[", "key", "]", "=", "fn", "(", "obj", "[", "key", "]", ")", ";", "return", ...
Use custom mapValues function to avoid issues with specs that include a "map" key and R.map delegating calls to .map
[ "Use", "custom", "mapValues", "function", "to", "avoid", "issues", "with", "specs", "that", "include", "a", "map", "key", "and", "R", ".", "map", "delegating", "calls", "to", ".", "map" ]
072d417a345e7087a95466a9825d43b6ca3a4941
https://github.com/ramda/ramda/blob/072d417a345e7087a95466a9825d43b6ca3a4941/source/applySpec.js#L12-L17
2,604
uikit/uikit
src/js/components/parallax.js
getOffsetElement
function getOffsetElement(el) { return el ? 'offsetTop' in el ? el : getOffsetElement(el.parentNode) : document.body; }
javascript
function getOffsetElement(el) { return el ? 'offsetTop' in el ? el : getOffsetElement(el.parentNode) : document.body; }
[ "function", "getOffsetElement", "(", "el", ")", "{", "return", "el", "?", "'offsetTop'", "in", "el", "?", "el", ":", "getOffsetElement", "(", "el", ".", "parentNode", ")", ":", "document", ".", "body", ";", "}" ]
SVG elements do not inherit from HTMLElement
[ "SVG", "elements", "do", "not", "inherit", "from", "HTMLElement" ]
b7760008135313b6a81f645c750db6f285a89488
https://github.com/uikit/uikit/blob/b7760008135313b6a81f645c750db6f285a89488/src/js/components/parallax.js#L70-L76
2,605
pagekit/vue-resource
dist/vue-resource.esm.js
root
function root (options$$1, next) { var url = next(options$$1); if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) { url = trimEnd(options$$1.root, '/') + '/' + url; } return url; }
javascript
function root (options$$1, next) { var url = next(options$$1); if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) { url = trimEnd(options$$1.root, '/') + '/' + url; } return url; }
[ "function", "root", "(", "options$$1", ",", "next", ")", "{", "var", "url", "=", "next", "(", "options$$1", ")", ";", "if", "(", "isString", "(", "options$$1", ".", "root", ")", "&&", "!", "/", "^(https?:)?\\/", "/", ".", "test", "(", "url", ")", "...
Root Prefix Transform.
[ "Root", "Prefix", "Transform", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L448-L457
2,606
pagekit/vue-resource
dist/vue-resource.esm.js
query
function query (options$$1, next) { var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); each(options$$1.params, function (value, key) { if (urlParams.indexOf(key) === -1) { query[key] = value; } }); query = Url.params(query); if (query...
javascript
function query (options$$1, next) { var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); each(options$$1.params, function (value, key) { if (urlParams.indexOf(key) === -1) { query[key] = value; } }); query = Url.params(query); if (query...
[ "function", "query", "(", "options$$1", ",", "next", ")", "{", "var", "urlParams", "=", "Object", ".", "keys", "(", "Url", ".", "options", ".", "params", ")", ",", "query", "=", "{", "}", ",", "url", "=", "next", "(", "options$$1", ")", ";", "each"...
Query Parameter Transform.
[ "Query", "Parameter", "Transform", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L463-L480
2,607
pagekit/vue-resource
dist/vue-resource.esm.js
form
function form (request) { if (isFormData(request.body)) { request.headers.delete('Content-Type'); } else if (isObject(request.body) && request.emulateJSON) { request.body = Url.params(request.body); request.headers.set('Content-Type', 'application/x-www-form-urlencoded'); } }
javascript
function form (request) { if (isFormData(request.body)) { request.headers.delete('Content-Type'); } else if (isObject(request.body) && request.emulateJSON) { request.body = Url.params(request.body); request.headers.set('Content-Type', 'application/x-www-form-urlencoded'); } }
[ "function", "form", "(", "request", ")", "{", "if", "(", "isFormData", "(", "request", ".", "body", ")", ")", "{", "request", ".", "headers", ".", "delete", "(", "'Content-Type'", ")", ";", "}", "else", "if", "(", "isObject", "(", "request", ".", "bo...
Form data Interceptor.
[ "Form", "data", "Interceptor", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L848-L857
2,608
pagekit/vue-resource
dist/vue-resource.esm.js
json
function json (request) { var type = request.headers.get('Content-Type') || ''; if (isObject(request.body) && type.indexOf('application/json') === 0) { request.body = JSON.stringify(request.body); } return function (response) { return response.bodyText ? when(response.text(), functio...
javascript
function json (request) { var type = request.headers.get('Content-Type') || ''; if (isObject(request.body) && type.indexOf('application/json') === 0) { request.body = JSON.stringify(request.body); } return function (response) { return response.bodyText ? when(response.text(), functio...
[ "function", "json", "(", "request", ")", "{", "var", "type", "=", "request", ".", "headers", ".", "get", "(", "'Content-Type'", ")", "||", "''", ";", "if", "(", "isObject", "(", "request", ".", "body", ")", "&&", "type", ".", "indexOf", "(", "'applic...
JSON Interceptor.
[ "JSON", "Interceptor", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L863-L894
2,609
pagekit/vue-resource
dist/vue-resource.esm.js
method
function method (request) { if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { request.headers.set('X-HTTP-Method-Override', request.method); request.method = 'POST'; } }
javascript
function method (request) { if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { request.headers.set('X-HTTP-Method-Override', request.method); request.method = 'POST'; } }
[ "function", "method", "(", "request", ")", "{", "if", "(", "request", ".", "emulateHTTP", "&&", "/", "^(PUT|PATCH|DELETE)$", "/", "i", ".", "test", "(", "request", ".", "method", ")", ")", "{", "request", ".", "headers", ".", "set", "(", "'X-HTTP-Method-...
HTTP method override Interceptor.
[ "HTTP", "method", "override", "Interceptor", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L986-L993
2,610
pagekit/vue-resource
dist/vue-resource.esm.js
header
function header (request) { var headers = assign({}, Http.headers.common, !request.crossOrigin ? Http.headers.custom : {}, Http.headers[toLower(request.method)] ); each(headers, function (value, name) { if (!request.headers.has(name)) { request.headers.set(name, value);...
javascript
function header (request) { var headers = assign({}, Http.headers.common, !request.crossOrigin ? Http.headers.custom : {}, Http.headers[toLower(request.method)] ); each(headers, function (value, name) { if (!request.headers.has(name)) { request.headers.set(name, value);...
[ "function", "header", "(", "request", ")", "{", "var", "headers", "=", "assign", "(", "{", "}", ",", "Http", ".", "headers", ".", "common", ",", "!", "request", ".", "crossOrigin", "?", "Http", ".", "headers", ".", "custom", ":", "{", "}", ",", "Ht...
Header Interceptor.
[ "Header", "Interceptor", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L999-L1012
2,611
pagekit/vue-resource
dist/vue-resource.esm.js
Client
function Client (context) { var reqHandlers = [sendRequest], resHandlers = []; if (!isObject(context)) { context = null; } function Client(request) { while (reqHandlers.length) { var handler = reqHandlers.pop(); if (isFunction(handler)) { var...
javascript
function Client (context) { var reqHandlers = [sendRequest], resHandlers = []; if (!isObject(context)) { context = null; } function Client(request) { while (reqHandlers.length) { var handler = reqHandlers.pop(); if (isFunction(handler)) { var...
[ "function", "Client", "(", "context", ")", "{", "var", "reqHandlers", "=", "[", "sendRequest", "]", ",", "resHandlers", "=", "[", "]", ";", "if", "(", "!", "isObject", "(", "context", ")", ")", "{", "context", "=", "null", ";", "}", "function", "Clie...
Base client.
[ "Base", "client", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1126-L1174
2,612
pagekit/vue-resource
dist/vue-resource.esm.js
Headers
function Headers(headers) { var this$1 = this; this.map = {}; each(headers, function (value, name) { return this$1.append(name, value); }); }
javascript
function Headers(headers) { var this$1 = this; this.map = {}; each(headers, function (value, name) { return this$1.append(name, value); }); }
[ "function", "Headers", "(", "headers", ")", "{", "var", "this$1", "=", "this", ";", "this", ".", "map", "=", "{", "}", ";", "each", "(", "headers", ",", "function", "(", "value", ",", "name", ")", "{", "return", "this$1", ".", "append", "(", "name"...
HTTP Headers.
[ "HTTP", "Headers", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1187-L1194
2,613
pagekit/vue-resource
dist/vue-resource.esm.js
Response
function Response(body, ref) { var url = ref.url; var headers = ref.headers; var status = ref.status; var statusText = ref.statusText; this.url = url; this.ok = status >= 200 && status < 300; this.status = status || 0; this.statusText = statusText || ''; this.headers = new Headers(...
javascript
function Response(body, ref) { var url = ref.url; var headers = ref.headers; var status = ref.status; var statusText = ref.statusText; this.url = url; this.ok = status >= 200 && status < 300; this.status = status || 0; this.statusText = statusText || ''; this.headers = new Headers(...
[ "function", "Response", "(", "body", ",", "ref", ")", "{", "var", "url", "=", "ref", ".", "url", ";", "var", "headers", "=", "ref", ".", "headers", ";", "var", "status", "=", "ref", ".", "status", ";", "var", "statusText", "=", "ref", ".", "statusT...
HTTP Response.
[ "HTTP", "Response", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1261-L1287
2,614
pagekit/vue-resource
dist/vue-resource.esm.js
Request
function Request(options$$1) { this.body = null; this.params = {}; assign(this, options$$1, { method: toUpper(options$$1.method || 'GET') }); if (!(this.headers instanceof Headers)) { this.headers = new Headers(this.headers); } }
javascript
function Request(options$$1) { this.body = null; this.params = {}; assign(this, options$$1, { method: toUpper(options$$1.method || 'GET') }); if (!(this.headers instanceof Headers)) { this.headers = new Headers(this.headers); } }
[ "function", "Request", "(", "options$$1", ")", "{", "this", ".", "body", "=", "null", ";", "this", ".", "params", "=", "{", "}", ";", "assign", "(", "this", ",", "options$$1", ",", "{", "method", ":", "toUpper", "(", "options$$1", ".", "method", "||"...
HTTP Request.
[ "HTTP", "Request", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1334-L1346
2,615
pagekit/vue-resource
dist/vue-resource.esm.js
Resource
function Resource(url, params, actions, options$$1) { var self = this || {}, resource = {}; actions = assign({}, Resource.actions, actions ); each(actions, function (action, name) { action = merge({url: url, params: assign({}, params)}, options$$1, action); resource[...
javascript
function Resource(url, params, actions, options$$1) { var self = this || {}, resource = {}; actions = assign({}, Resource.actions, actions ); each(actions, function (action, name) { action = merge({url: url, params: assign({}, params)}, options$$1, action); resource[...
[ "function", "Resource", "(", "url", ",", "params", ",", "actions", ",", "options$$1", ")", "{", "var", "self", "=", "this", "||", "{", "}", ",", "resource", "=", "{", "}", ";", "actions", "=", "assign", "(", "{", "}", ",", "Resource", ".", "actions...
Service for interacting with RESTful services.
[ "Service", "for", "interacting", "with", "RESTful", "services", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1433-L1452
2,616
pagekit/vue-resource
dist/vue-resource.esm.js
plugin
function plugin(Vue) { if (plugin.installed) { return; } Util(Vue); Vue.url = Url; Vue.http = Http; Vue.resource = Resource; Vue.Promise = PromiseObj; Object.defineProperties(Vue.prototype, { $url: { get: function get() { return options(Vu...
javascript
function plugin(Vue) { if (plugin.installed) { return; } Util(Vue); Vue.url = Url; Vue.http = Http; Vue.resource = Resource; Vue.Promise = PromiseObj; Object.defineProperties(Vue.prototype, { $url: { get: function get() { return options(Vu...
[ "function", "plugin", "(", "Vue", ")", "{", "if", "(", "plugin", ".", "installed", ")", "{", "return", ";", "}", "Util", "(", "Vue", ")", ";", "Vue", ".", "url", "=", "Url", ";", "Vue", ".", "http", "=", "Http", ";", "Vue", ".", "resource", "="...
Install plugin.
[ "Install", "plugin", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1507-L1549
2,617
kriasoft/react-starter-kit
src/client.js
onLocationChange
async function onLocationChange(location, action) { // Remember the latest scroll position for the previous location scrollPositionsHistory[currentLocation.key] = { scrollX: window.pageXOffset, scrollY: window.pageYOffset, }; // Delete stored scroll position for next page if any if (action === 'PUSH')...
javascript
async function onLocationChange(location, action) { // Remember the latest scroll position for the previous location scrollPositionsHistory[currentLocation.key] = { scrollX: window.pageXOffset, scrollY: window.pageYOffset, }; // Delete stored scroll position for next page if any if (action === 'PUSH')...
[ "async", "function", "onLocationChange", "(", "location", ",", "action", ")", "{", "// Remember the latest scroll position for the previous location", "scrollPositionsHistory", "[", "currentLocation", ".", "key", "]", "=", "{", "scrollX", ":", "window", ".", "pageXOffset"...
Re-render the app when window.location changes
[ "Re", "-", "render", "the", "app", "when", "window", ".", "location", "changes" ]
8d6c018f3198dec2a580ecafb011a32f06e38dbf
https://github.com/kriasoft/react-starter-kit/blob/8d6c018f3198dec2a580ecafb011a32f06e38dbf/src/client.js#L47-L147
2,618
bokeh/bokeh
examples/custom/gears/gear_utils.js
involuteXbez
function involuteXbez(t) { // map t (0 <= t <= 1) onto x (where -1 <= x <= 1) var x = t*2-1; //map theta (where ts <= theta <= te) from x (-1 <=x <= 1) var theta = x*(te-ts)/2 + (ts + te)/2; return Rb*(Math.cos(theta)+theta*Math.sin(theta)); }
javascript
function involuteXbez(t) { // map t (0 <= t <= 1) onto x (where -1 <= x <= 1) var x = t*2-1; //map theta (where ts <= theta <= te) from x (-1 <=x <= 1) var theta = x*(te-ts)/2 + (ts + te)/2; return Rb*(Math.cos(theta)+theta*Math.sin(theta)); }
[ "function", "involuteXbez", "(", "t", ")", "{", "// map t (0 <= t <= 1) onto x (where -1 <= x <= 1)", "var", "x", "=", "t", "*", "2", "-", "1", ";", "//map theta (where ts <= theta <= te) from x (-1 <=x <= 1)", "var", "theta", "=", "x", "*", "(", "te", "-", "ts", ...
Equation of involute using the Bezier parameter t as variable
[ "Equation", "of", "involute", "using", "the", "Bezier", "parameter", "t", "as", "variable" ]
c3a9d4d5ab5662ea34813fd72de50e1bdaae714d
https://github.com/bokeh/bokeh/blob/c3a9d4d5ab5662ea34813fd72de50e1bdaae714d/examples/custom/gears/gear_utils.js#L128-L135
2,619
rollup/rollup
rollup.config.js
fixAcornEsmImport
function fixAcornEsmImport() { return { name: 'fix-acorn-esm-import', renderChunk(code, chunk, options) { if (/esm?/.test(options.format)) { let found = false; const fixedCode = code.replace(expectedAcornImport, () => { found = true; return newAcornImport; }); if (!found) { this.e...
javascript
function fixAcornEsmImport() { return { name: 'fix-acorn-esm-import', renderChunk(code, chunk, options) { if (/esm?/.test(options.format)) { let found = false; const fixedCode = code.replace(expectedAcornImport, () => { found = true; return newAcornImport; }); if (!found) { this.e...
[ "function", "fixAcornEsmImport", "(", ")", "{", "return", "{", "name", ":", "'fix-acorn-esm-import'", ",", "renderChunk", "(", "code", ",", "chunk", ",", "options", ")", "{", "if", "(", "/", "esm?", "/", ".", "test", "(", "options", ".", "format", ")", ...
by default, rollup-plugin-commonjs will translate require statements as default imports which can cause issues for secondary tools that use the ESM version of acorn
[ "by", "default", "rollup", "-", "plugin", "-", "commonjs", "will", "translate", "require", "statements", "as", "default", "imports", "which", "can", "cause", "issues", "for", "secondary", "tools", "that", "use", "the", "ESM", "version", "of", "acorn" ]
7d669ebc19b8feb6a8a61fb84b95ea8df650dde1
https://github.com/rollup/rollup/blob/7d669ebc19b8feb6a8a61fb84b95ea8df650dde1/rollup.config.js#L49-L68
2,620
ipfs/js-ipfs
src/core/utils.js
parseIpfsPath
function parseIpfsPath (ipfsPath) { const invalidPathErr = new Error('invalid ipfs ref path') ipfsPath = ipfsPath.replace(/^\/ipfs\//, '') const matched = ipfsPath.match(/([^/]+(?:\/[^/]+)*)\/?$/) if (!matched) { throw invalidPathErr } const [hash, ...links] = matched[1].split('/') // check that a C...
javascript
function parseIpfsPath (ipfsPath) { const invalidPathErr = new Error('invalid ipfs ref path') ipfsPath = ipfsPath.replace(/^\/ipfs\//, '') const matched = ipfsPath.match(/([^/]+(?:\/[^/]+)*)\/?$/) if (!matched) { throw invalidPathErr } const [hash, ...links] = matched[1].split('/') // check that a C...
[ "function", "parseIpfsPath", "(", "ipfsPath", ")", "{", "const", "invalidPathErr", "=", "new", "Error", "(", "'invalid ipfs ref path'", ")", "ipfsPath", "=", "ipfsPath", ".", "replace", "(", "/", "^\\/ipfs\\/", "/", ",", "''", ")", "const", "matched", "=", "...
Break an ipfs-path down into it's hash and an array of links. examples: b58Hash -> { hash: 'b58Hash', links: [] } b58Hash/mercury/venus -> { hash: 'b58Hash', links: ['mercury', 'venus']} /ipfs/b58Hash/links/by/name -> { hash: 'b58Hash', links: ['links', 'by', 'name'] } @param {String} ipfsPath An ipfs-path @return {...
[ "Break", "an", "ipfs", "-", "path", "down", "into", "it", "s", "hash", "and", "an", "array", "of", "links", "." ]
97e67601094acda3906549ecb0248fd09f1a8cc3
https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/utils.js#L23-L39
2,621
ipfs/js-ipfs
src/core/utils.js
follow
function follow (cid, links, err, obj) { if (err) { return cb(err) } if (!links.length) { // done tracing, obj is the target node return cb(null, cid.buffer) } const linkName = links[0] const nextObj = obj.links.find(link => link.name === linkName) if ...
javascript
function follow (cid, links, err, obj) { if (err) { return cb(err) } if (!links.length) { // done tracing, obj is the target node return cb(null, cid.buffer) } const linkName = links[0] const nextObj = obj.links.find(link => link.name === linkName) if ...
[ "function", "follow", "(", "cid", ",", "links", ",", "err", ",", "obj", ")", "{", "if", "(", "err", ")", "{", "return", "cb", "(", "err", ")", "}", "if", "(", "!", "links", ".", "length", ")", "{", "// done tracing, obj is the target node", "return", ...
recursively follow named links to the target node
[ "recursively", "follow", "named", "links", "to", "the", "target", "node" ]
97e67601094acda3906549ecb0248fd09f1a8cc3
https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/utils.js#L116-L135
2,622
ipfs/js-ipfs
src/core/components/files-regular/utils.js
parseRabinString
function parseRabinString (chunker) { const options = {} const parts = chunker.split('-') switch (parts.length) { case 1: options.avgChunkSize = 262144 break case 2: options.avgChunkSize = parseChunkSize(parts[1], 'avg') break case 4: options.minChunkSize = parseChunkSize...
javascript
function parseRabinString (chunker) { const options = {} const parts = chunker.split('-') switch (parts.length) { case 1: options.avgChunkSize = 262144 break case 2: options.avgChunkSize = parseChunkSize(parts[1], 'avg') break case 4: options.minChunkSize = parseChunkSize...
[ "function", "parseRabinString", "(", "chunker", ")", "{", "const", "options", "=", "{", "}", "const", "parts", "=", "chunker", ".", "split", "(", "'-'", ")", "switch", "(", "parts", ".", "length", ")", "{", "case", "1", ":", "options", ".", "avgChunkSi...
Parses rabin chunker string @param {String} chunker Chunker algorithm supported formats: "rabin" "rabin-{avg}" "rabin-{min}-{avg}-{max}" @return {Object} rabin chunker options
[ "Parses", "rabin", "chunker", "string" ]
97e67601094acda3906549ecb0248fd09f1a8cc3
https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/components/files-regular/utils.js#L70-L90
2,623
ipfs/js-ipfs
src/core/components/resolve.js
resolve
function resolve (cid, path, callback) { let value, remainderPath doUntil( (cb) => { self.block.get(cid, (err, block) => { if (err) return cb(err) const r = self._ipld.resolvers[cid.codec] if (!r) { return cb(new Error(`No resolver found for codec "${cid...
javascript
function resolve (cid, path, callback) { let value, remainderPath doUntil( (cb) => { self.block.get(cid, (err, block) => { if (err) return cb(err) const r = self._ipld.resolvers[cid.codec] if (!r) { return cb(new Error(`No resolver found for codec "${cid...
[ "function", "resolve", "(", "cid", ",", "path", ",", "callback", ")", "{", "let", "value", ",", "remainderPath", "doUntil", "(", "(", "cb", ")", "=>", "{", "self", ".", "block", ".", "get", "(", "cid", ",", "(", "err", ",", "block", ")", "=>", "{...
Resolve the given CID + path to a CID.
[ "Resolve", "the", "given", "CID", "+", "path", "to", "a", "CID", "." ]
97e67601094acda3906549ecb0248fd09f1a8cc3
https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/components/resolve.js#L45-L88
2,624
angular/protractor
website/docgen/processors/add-links.js
function(doc) { // Heuristic for the custom docs in the lib/selenium-webdriver/ folder. if (doc.name && doc.name.startsWith('webdriver')) { return; } var template = _.template('https://github.com/angular/protractor/blob/' + '<%= linksHash %>/lib/<%= fileName %>.ts'); doc.sourceLink = template({ ...
javascript
function(doc) { // Heuristic for the custom docs in the lib/selenium-webdriver/ folder. if (doc.name && doc.name.startsWith('webdriver')) { return; } var template = _.template('https://github.com/angular/protractor/blob/' + '<%= linksHash %>/lib/<%= fileName %>.ts'); doc.sourceLink = template({ ...
[ "function", "(", "doc", ")", "{", "// Heuristic for the custom docs in the lib/selenium-webdriver/ folder.", "if", "(", "doc", ".", "name", "&&", "doc", ".", "name", ".", "startsWith", "(", "'webdriver'", ")", ")", "{", "return", ";", "}", "var", "template", "="...
Add a link to the source code. @param {!Object} doc Current document.
[ "Add", "a", "link", "to", "the", "source", "code", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/add-links.js#L24-L36
2,625
angular/protractor
website/docgen/processors/add-links.js
function(str, doc) { var oldStr = null; while (str != oldStr) { oldStr = str; var matches = /{\s*@link[plain]*\s+([^]+?)\s*}/.exec(str); if (matches) { var str = str.replace( new RegExp('{\\s*@link[plain]*\\s+' + matches[1].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + '\\s*}...
javascript
function(str, doc) { var oldStr = null; while (str != oldStr) { oldStr = str; var matches = /{\s*@link[plain]*\s+([^]+?)\s*}/.exec(str); if (matches) { var str = str.replace( new RegExp('{\\s*@link[plain]*\\s+' + matches[1].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + '\\s*}...
[ "function", "(", "str", ",", "doc", ")", "{", "var", "oldStr", "=", "null", ";", "while", "(", "str", "!=", "oldStr", ")", "{", "oldStr", "=", "str", ";", "var", "matches", "=", "/", "{\\s*@link[plain]*\\s+([^]+?)\\s*}", "/", ".", "exec", "(", "str", ...
Add links to @link annotations. For example: `{@link foo.bar}` will be transformed into `[foo.bar](foo.bar)` and `{@link foo.bar FooBar Link}` will be transfirned into `[FooBar Link](foo.bar)` @param {string} str The string with the annotations. @param {!Object} doc Current document. @return {string} A link in markdown...
[ "Add", "links", "to" ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/add-links.js#L46-L61
2,626
angular/protractor
website/docgen/processors/add-links.js
function(param) { var str = param.typeExpression; var type = param.type; if (!type) { return escape(str); } var replaceWithLinkIfPresent = function(type) { if (type.name) { str = str.replace(type.name, toMarkdownLinkFormat(type.name)); } }; if (type.type === 'FunctionType') { _.eac...
javascript
function(param) { var str = param.typeExpression; var type = param.type; if (!type) { return escape(str); } var replaceWithLinkIfPresent = function(type) { if (type.name) { str = str.replace(type.name, toMarkdownLinkFormat(type.name)); } }; if (type.type === 'FunctionType') { _.eac...
[ "function", "(", "param", ")", "{", "var", "str", "=", "param", ".", "typeExpression", ";", "var", "type", "=", "param", ".", "type", ";", "if", "(", "!", "type", ")", "{", "return", "escape", "(", "str", ")", ";", "}", "var", "replaceWithLinkIfPrese...
Create the param or return type. @param {!Object} param Parameter. @return {string} Escaped param string with links to the types.
[ "Create", "the", "param", "or", "return", "type", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/add-links.js#L128-L155
2,627
angular/protractor
website/js/api-controller.js
function(item) { var parts = item.displayName.split('.'); for (var i = parts.length - 1; i > 0; i--) { var name = parts.slice(0, i).join('.'); if (itemsByName[name]) { return itemsByName[name]; } } }
javascript
function(item) { var parts = item.displayName.split('.'); for (var i = parts.length - 1; i > 0; i--) { var name = parts.slice(0, i).join('.'); if (itemsByName[name]) { return itemsByName[name]; } } }
[ "function", "(", "item", ")", "{", "var", "parts", "=", "item", ".", "displayName", ".", "split", "(", "'.'", ")", ";", "for", "(", "var", "i", "=", "parts", ".", "length", "-", "1", ";", "i", ">", "0", ";", "i", "--", ")", "{", "var", "name"...
Try to find a parent by matching the longest substring of the display name. @param item
[ "Try", "to", "find", "a", "parent", "by", "matching", "the", "longest", "substring", "of", "the", "display", "name", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/js/api-controller.js#L161-L169
2,628
angular/protractor
website/docgen/processors/tag-fixer.js
function(doc) { // Skip if the function has a name. if (doc.name) { return doc.name; } try { var node = doc.codeNode; // Is this a simple declaration? "var element = function() {". if (node.declarations && node.declarations.length) { return node.declarations[0].id.name; } // Is ...
javascript
function(doc) { // Skip if the function has a name. if (doc.name) { return doc.name; } try { var node = doc.codeNode; // Is this a simple declaration? "var element = function() {". if (node.declarations && node.declarations.length) { return node.declarations[0].id.name; } // Is ...
[ "function", "(", "doc", ")", "{", "// Skip if the function has a name.", "if", "(", "doc", ".", "name", ")", "{", "return", "doc", ".", "name", ";", "}", "try", "{", "var", "node", "=", "doc", ".", "codeNode", ";", "// Is this a simple declaration? \"var eleme...
Find the name of the function.
[ "Find", "the", "name", "of", "the", "function", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/tag-fixer.js#L16-L60
2,629
angular/protractor
website/docgen/processors/tag-fixer.js
buildName
function buildName(obj) { if (!obj) { return parts.join('.'); } if (obj.property && obj.property.name) { parts.unshift(obj.property.name); } if (obj.object && obj.object.name) { parts.unshift(obj.object.name); } return buildName(ob...
javascript
function buildName(obj) { if (!obj) { return parts.join('.'); } if (obj.property && obj.property.name) { parts.unshift(obj.property.name); } if (obj.object && obj.object.name) { parts.unshift(obj.object.name); } return buildName(ob...
[ "function", "buildName", "(", "obj", ")", "{", "if", "(", "!", "obj", ")", "{", "return", "parts", ".", "join", "(", "'.'", ")", ";", "}", "if", "(", "obj", ".", "property", "&&", "obj", ".", "property", ".", "name", ")", "{", "parts", ".", "un...
Recursively create the function name by examining the object property. @param obj Parsed object. @return {string} The name of the function.
[ "Recursively", "create", "the", "function", "name", "by", "examining", "the", "object", "property", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/tag-fixer.js#L39-L53
2,630
angular/protractor
website/docgen/processors/tag-fixer.js
function(doc) { if (doc.params) { _.each(doc.params, function(param) { replaceNewLines(param, 'description'); }); } // Replace new lines in the return and params descriptions. var returns = doc.returns; if (returns) { replaceNewLines(returns, 'description'); } }
javascript
function(doc) { if (doc.params) { _.each(doc.params, function(param) { replaceNewLines(param, 'description'); }); } // Replace new lines in the return and params descriptions. var returns = doc.returns; if (returns) { replaceNewLines(returns, 'description'); } }
[ "function", "(", "doc", ")", "{", "if", "(", "doc", ".", "params", ")", "{", "_", ".", "each", "(", "doc", ".", "params", ",", "function", "(", "param", ")", "{", "replaceNewLines", "(", "param", ",", "'description'", ")", ";", "}", ")", ";", "}"...
Remove the duplicate param annotations. Go through the params and the return annotations to replace the new lines and escape the types to prepare them for markdown rendering. @param {!Object} doc Document representing a function jsdoc.
[ "Remove", "the", "duplicate", "param", "annotations", ".", "Go", "through", "the", "params", "and", "the", "return", "annotations", "to", "replace", "the", "new", "lines", "and", "escape", "the", "types", "to", "prepare", "them", "for", "markdown", "rendering"...
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/website/docgen/processors/tag-fixer.js#L80-L92
2,631
angular/protractor
lib/clientsidescripts.js
function(callback) { if (window.angular) { var hooks = getNg1Hooks(rootSelector); if (!hooks){ callback(); // not an angular1 app } else{ if (hooks.$$testability) { hooks.$$testability.whenStable(callback); } else if (hooks.$injector) { ...
javascript
function(callback) { if (window.angular) { var hooks = getNg1Hooks(rootSelector); if (!hooks){ callback(); // not an angular1 app } else{ if (hooks.$$testability) { hooks.$$testability.whenStable(callback); } else if (hooks.$injector) { ...
[ "function", "(", "callback", ")", "{", "if", "(", "window", ".", "angular", ")", "{", "var", "hooks", "=", "getNg1Hooks", "(", "rootSelector", ")", ";", "if", "(", "!", "hooks", ")", "{", "callback", "(", ")", ";", "// not an angular1 app", "}", "else"...
Wait for angular1 testability first and run waitForAngular2 as a callback
[ "Wait", "for", "angular1", "testability", "first", "and", "run", "waitForAngular2", "as", "a", "callback" ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/lib/clientsidescripts.js#L143-L168
2,632
angular/protractor
lib/clientsidescripts.js
function() { if (window.getAngularTestability) { if (rootSelector) { var testability = null; var el = document.querySelector(rootSelector); try{ testability = window.getAngularTestability(el); } catch(e){} if (testability) { ...
javascript
function() { if (window.getAngularTestability) { if (rootSelector) { var testability = null; var el = document.querySelector(rootSelector); try{ testability = window.getAngularTestability(el); } catch(e){} if (testability) { ...
[ "function", "(", ")", "{", "if", "(", "window", ".", "getAngularTestability", ")", "{", "if", "(", "rootSelector", ")", "{", "var", "testability", "=", "null", ";", "var", "el", "=", "document", ".", "querySelector", "(", "rootSelector", ")", ";", "try",...
Wait for Angular2 testability and then run test callback
[ "Wait", "for", "Angular2", "testability", "and", "then", "run", "test", "callback" ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/lib/clientsidescripts.js#L171-L211
2,633
angular/protractor
lib/clientsidescripts.js
findRepeaterRows
function findRepeaterRows(repeater, exact, index, using) { using = using || document; var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:']; var rows = []; for (var p = 0; p < prefixes.length; ++p) { var attr = prefixes[p] + 'repeat'; var repeatElems = using.querySelectorAll('[' + attr + ']'); ...
javascript
function findRepeaterRows(repeater, exact, index, using) { using = using || document; var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:']; var rows = []; for (var p = 0; p < prefixes.length; ++p) { var attr = prefixes[p] + 'repeat'; var repeatElems = using.querySelectorAll('[' + attr + ']'); ...
[ "function", "findRepeaterRows", "(", "repeater", ",", "exact", ",", "index", ",", "using", ")", "{", "using", "=", "using", "||", "document", ";", "var", "prefixes", "=", "[", "'ng-'", ",", "'ng_'", ",", "'data-ng-'", ",", "'x-ng-'", ",", "'ng\\\\:'", "]...
Find an array of elements matching a row within an ng-repeat. Always returns an array of only one element for plain old ng-repeat. Returns an array of all the elements in one segment for ng-repeat-start. @param {string} repeater The text of the repeater, e.g. 'cat in cats'. @param {boolean} exact Whether the repeater ...
[ "Find", "an", "array", "of", "elements", "matching", "a", "row", "within", "an", "ng", "-", "repeat", ".", "Always", "returns", "an", "array", "of", "only", "one", "element", "for", "plain", "old", "ng", "-", "repeat", ".", "Returns", "an", "array", "o...
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/lib/clientsidescripts.js#L284-L323
2,634
angular/protractor
lib/clientsidescripts.js
findAllRepeaterRows
function findAllRepeaterRows(repeater, exact, using) { using = using || document; var rows = []; var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:']; for (var p = 0; p < prefixes.length; ++p) { var attr = prefixes[p] + 'repeat'; var repeatElems = using.querySelectorAll('[' + attr + ']'); at...
javascript
function findAllRepeaterRows(repeater, exact, using) { using = using || document; var rows = []; var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:']; for (var p = 0; p < prefixes.length; ++p) { var attr = prefixes[p] + 'repeat'; var repeatElems = using.querySelectorAll('[' + attr + ']'); at...
[ "function", "findAllRepeaterRows", "(", "repeater", ",", "exact", ",", "using", ")", "{", "using", "=", "using", "||", "document", ";", "var", "rows", "=", "[", "]", ";", "var", "prefixes", "=", "[", "'ng-'", ",", "'ng_'", ",", "'data-ng-'", ",", "'x-n...
Find all rows of an ng-repeat. @param {string} repeater The text of the repeater, e.g. 'cat in cats'. @param {boolean} exact Whether the repeater needs to be matched exactly @param {Element} using The scope of the search. @return {Array.<Element>} All rows of the repeater.
[ "Find", "all", "rows", "of", "an", "ng", "-", "repeat", "." ]
4f74a4ec753c97adfe955fe468a39286a0a55837
https://github.com/angular/protractor/blob/4f74a4ec753c97adfe955fe468a39286a0a55837/lib/clientsidescripts.js#L335-L368
2,635
getinsomnia/insomnia
packages/insomnia-prettify/src/json.js
_convertUnicode
function _convertUnicode(originalStr) { let m; let c; let cStr; let lastI = 0; // Matches \u#### but not \\u#### const unicodeRegex = /\\u[0-9a-fA-F]{4}/g; let convertedStr = ''; while ((m = unicodeRegex.exec(originalStr))) { // Don't convert if the backslash itself is escaped if (originalStr[...
javascript
function _convertUnicode(originalStr) { let m; let c; let cStr; let lastI = 0; // Matches \u#### but not \\u#### const unicodeRegex = /\\u[0-9a-fA-F]{4}/g; let convertedStr = ''; while ((m = unicodeRegex.exec(originalStr))) { // Don't convert if the backslash itself is escaped if (originalStr[...
[ "function", "_convertUnicode", "(", "originalStr", ")", "{", "let", "m", ";", "let", "c", ";", "let", "cStr", ";", "let", "lastI", "=", "0", ";", "// Matches \\u#### but not \\\\u####", "const", "unicodeRegex", "=", "/", "\\\\u[0-9a-fA-F]{4}", "/", "g", ";", ...
Convert escaped unicode characters to real characters. Any JSON parser will do this by default. This is really fast too. Around 25ms for ~2MB of data with LOTS of unicode. @param originalStr @returns {string} @private
[ "Convert", "escaped", "unicode", "characters", "to", "real", "characters", ".", "Any", "JSON", "parser", "will", "do", "this", "by", "default", ".", "This", "is", "really", "fast", "too", ".", "Around", "25ms", "for", "~2MB", "of", "data", "with", "LOTS", ...
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-prettify/src/json.js#L172-L209
2,636
getinsomnia/insomnia
packages/insomnia-importers/src/importers/openapi3.js
parseEndpoints
function parseEndpoints(document) { const defaultParent = WORKSPACE_ID; const paths = Object.keys(document.paths); const endpointsSchemas = paths .map(path => { const schemasPerMethod = document.paths[path]; const methods = Object.keys(schemasPerMethod); return methods .filter(meth...
javascript
function parseEndpoints(document) { const defaultParent = WORKSPACE_ID; const paths = Object.keys(document.paths); const endpointsSchemas = paths .map(path => { const schemasPerMethod = document.paths[path]; const methods = Object.keys(schemasPerMethod); return methods .filter(meth...
[ "function", "parseEndpoints", "(", "document", ")", "{", "const", "defaultParent", "=", "WORKSPACE_ID", ";", "const", "paths", "=", "Object", ".", "keys", "(", "document", ".", "paths", ")", ";", "const", "endpointsSchemas", "=", "paths", ".", "map", "(", ...
Create request definitions based on openapi document. @param {Object} document - OpenAPI 3 valid object (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#oasObject) @returns {Object[]} array of insomnia endpoints definitions
[ "Create", "request", "definitions", "based", "on", "openapi", "document", "." ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L98-L134
2,637
getinsomnia/insomnia
packages/insomnia-importers/src/importers/openapi3.js
importRequest
function importRequest(endpointSchema, id, parentId) { const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`; return { _type: 'request', _id: id, parentId: parentId, name, method: endpointSchema.method.toUpperCase(), url: '{{ base_url }}' + pathWithParamsAs...
javascript
function importRequest(endpointSchema, id, parentId) { const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`; return { _type: 'request', _id: id, parentId: parentId, name, method: endpointSchema.method.toUpperCase(), url: '{{ base_url }}' + pathWithParamsAs...
[ "function", "importRequest", "(", "endpointSchema", ",", "id", ",", "parentId", ")", "{", "const", "name", "=", "endpointSchema", ".", "summary", "||", "`", "${", "endpointSchema", ".", "method", "}", "${", "endpointSchema", ".", "path", "}", "`", ";", "re...
Return Insomnia request @param {Object} endpointSchema - OpenAPI 3 endpoint schema @param {string} id - id to be given to current request @param {string} parentId - id of parent category @returns {Object}
[ "Return", "Insomnia", "request" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L163-L176
2,638
getinsomnia/insomnia
packages/insomnia-importers/src/importers/openapi3.js
prepareQueryParams
function prepareQueryParams(endpointSchema) { const isSendInQuery = p => p.in === 'query'; const parameters = endpointSchema.parameters || []; const queryParameters = parameters.filter(isSendInQuery); return convertParameters(queryParameters); }
javascript
function prepareQueryParams(endpointSchema) { const isSendInQuery = p => p.in === 'query'; const parameters = endpointSchema.parameters || []; const queryParameters = parameters.filter(isSendInQuery); return convertParameters(queryParameters); }
[ "function", "prepareQueryParams", "(", "endpointSchema", ")", "{", "const", "isSendInQuery", "=", "p", "=>", "p", ".", "in", "===", "'query'", ";", "const", "parameters", "=", "endpointSchema", ".", "parameters", "||", "[", "]", ";", "const", "queryParameters"...
Imports insomnia definitions of query parameters. @param {Object} endpointSchema - OpenAPI 3 endpoint schema @returns {Object[]} array of parameters definitions
[ "Imports", "insomnia", "definitions", "of", "query", "parameters", "." ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L196-L201
2,639
getinsomnia/insomnia
packages/insomnia-importers/src/importers/openapi3.js
prepareHeaders
function prepareHeaders(endpointSchema) { const isSendInHeader = p => p.in === 'header'; const parameters = endpointSchema.parameters || []; const headerParameters = parameters.filter(isSendInHeader); return convertParameters(headerParameters); }
javascript
function prepareHeaders(endpointSchema) { const isSendInHeader = p => p.in === 'header'; const parameters = endpointSchema.parameters || []; const headerParameters = parameters.filter(isSendInHeader); return convertParameters(headerParameters); }
[ "function", "prepareHeaders", "(", "endpointSchema", ")", "{", "const", "isSendInHeader", "=", "p", "=>", "p", ".", "in", "===", "'header'", ";", "const", "parameters", "=", "endpointSchema", ".", "parameters", "||", "[", "]", ";", "const", "headerParameters",...
Imports insomnia definitions of header parameters. @param {Object} endpointSchema - OpenAPI 3 endpoint schema @returns {Object[]} array of parameters definitions
[ "Imports", "insomnia", "definitions", "of", "header", "parameters", "." ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L209-L214
2,640
getinsomnia/insomnia
packages/insomnia-importers/src/importers/swagger2.js
convertParameters
function convertParameters(parameters) { return parameters.map(parameter => { const { required, name } = parameter; return { name, disabled: required !== true, value: `${generateParameterExample(parameter)}`, }; }); }
javascript
function convertParameters(parameters) { return parameters.map(parameter => { const { required, name } = parameter; return { name, disabled: required !== true, value: `${generateParameterExample(parameter)}`, }; }); }
[ "function", "convertParameters", "(", "parameters", ")", "{", "return", "parameters", ".", "map", "(", "parameter", "=>", "{", "const", "{", "required", ",", "name", "}", "=", "parameter", ";", "return", "{", "name", ",", "disabled", ":", "required", "!=="...
Converts swagger schema of parametes into insomnia one. @param {Object[]} parameters - array of swagger schemas of parameters @returns {Object[]} array of insomnia parameters definitions
[ "Converts", "swagger", "schema", "of", "parametes", "into", "insomnia", "one", "." ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/swagger2.js#L261-L270
2,641
getinsomnia/insomnia
packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js
replaceHintMatch
function replaceHintMatch(cm, self, data) { const cur = cm.getCursor(); const from = CodeMirror.Pos(cur.line, cur.ch - data.segment.length); const to = CodeMirror.Pos(cur.line, cur.ch); const prevStart = CodeMirror.Pos(from.line, from.ch - 10); const prevChars = cm.getRange(prevStart, from); const nextEnd...
javascript
function replaceHintMatch(cm, self, data) { const cur = cm.getCursor(); const from = CodeMirror.Pos(cur.line, cur.ch - data.segment.length); const to = CodeMirror.Pos(cur.line, cur.ch); const prevStart = CodeMirror.Pos(from.line, from.ch - 10); const prevChars = cm.getRange(prevStart, from); const nextEnd...
[ "function", "replaceHintMatch", "(", "cm", ",", "self", ",", "data", ")", "{", "const", "cur", "=", "cm", ".", "getCursor", "(", ")", ";", "const", "from", "=", "CodeMirror", ".", "Pos", "(", "cur", ".", "line", ",", "cur", ".", "ch", "-", "data", ...
Replace the text in the editor when a hint is selected. This also makes sure there is whitespace surrounding it @param cm @param self @param data
[ "Replace", "the", "text", "in", "the", "editor", "when", "a", "hint", "is", "selected", ".", "This", "also", "makes", "sure", "there", "is", "whitespace", "surrounding", "it" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L298-L337
2,642
getinsomnia/insomnia
packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js
matchSegments
function matchSegments(listOfThings, segment, type, limit = -1) { if (!Array.isArray(listOfThings)) { console.warn('Autocomplete received items in non-list form', listOfThings); return []; } const matches = []; for (const t of listOfThings) { const name = typeof t === 'string' ? t : t.name; con...
javascript
function matchSegments(listOfThings, segment, type, limit = -1) { if (!Array.isArray(listOfThings)) { console.warn('Autocomplete received items in non-list form', listOfThings); return []; } const matches = []; for (const t of listOfThings) { const name = typeof t === 'string' ? t : t.name; con...
[ "function", "matchSegments", "(", "listOfThings", ",", "segment", ",", "type", ",", "limit", "=", "-", "1", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "listOfThings", ")", ")", "{", "console", ".", "warn", "(", "'Autocomplete received items in...
Match against a list of things @param listOfThings - Can be list of strings or list of {name, value} @param segment - segment to match against @param type @param limit @returns {Array}
[ "Match", "against", "a", "list", "of", "things" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L347-L389
2,643
getinsomnia/insomnia
packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js
replaceWithSurround
function replaceWithSurround(text, find, prefix, suffix) { const escapedString = escapeRegex(find); const re = new RegExp(escapedString, 'gi'); return text.replace(re, matched => prefix + matched + suffix); }
javascript
function replaceWithSurround(text, find, prefix, suffix) { const escapedString = escapeRegex(find); const re = new RegExp(escapedString, 'gi'); return text.replace(re, matched => prefix + matched + suffix); }
[ "function", "replaceWithSurround", "(", "text", ",", "find", ",", "prefix", ",", "suffix", ")", "{", "const", "escapedString", "=", "escapeRegex", "(", "find", ")", ";", "const", "re", "=", "new", "RegExp", "(", "escapedString", ",", "'gi'", ")", ";", "r...
Replace all occurrences of string @param text @param find @param prefix @param suffix @returns string
[ "Replace", "all", "occurrences", "of", "string" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L399-L403
2,644
getinsomnia/insomnia
packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js
renderHintMatch
function renderHintMatch(li, self, data) { // Bold the matched text const { displayText, segment } = data; const markedName = replaceWithSurround(displayText, segment, '<strong>', '</strong>'); const { char, title } = ICONS[data.type]; const safeValue = escapeHTML(data.displayValue); li.className += ` fan...
javascript
function renderHintMatch(li, self, data) { // Bold the matched text const { displayText, segment } = data; const markedName = replaceWithSurround(displayText, segment, '<strong>', '</strong>'); const { char, title } = ICONS[data.type]; const safeValue = escapeHTML(data.displayValue); li.className += ` fan...
[ "function", "renderHintMatch", "(", "li", ",", "self", ",", "data", ")", "{", "// Bold the matched text", "const", "{", "displayText", ",", "segment", "}", "=", "data", ";", "const", "markedName", "=", "replaceWithSurround", "(", "displayText", ",", "segment", ...
Render the autocomplete list entry @param li @param self @param data
[ "Render", "the", "autocomplete", "list", "entry" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/components/codemirror/extensions/autocomplete.js#L411-L427
2,645
getinsomnia/insomnia
packages/insomnia-app/app/sync-legacy/index.js
_getResourceGroupSymmetricKey
async function _getResourceGroupSymmetricKey(resourceGroupId) { let key = resourceGroupSymmetricKeysCache[resourceGroupId]; if (!key) { const resourceGroup = await fetchResourceGroup(resourceGroupId); const accountPrivateKey = await session.getPrivateKey(); const symmetricKeyStr = crypt.decryptRSAWith...
javascript
async function _getResourceGroupSymmetricKey(resourceGroupId) { let key = resourceGroupSymmetricKeysCache[resourceGroupId]; if (!key) { const resourceGroup = await fetchResourceGroup(resourceGroupId); const accountPrivateKey = await session.getPrivateKey(); const symmetricKeyStr = crypt.decryptRSAWith...
[ "async", "function", "_getResourceGroupSymmetricKey", "(", "resourceGroupId", ")", "{", "let", "key", "=", "resourceGroupSymmetricKeysCache", "[", "resourceGroupId", "]", ";", "if", "(", "!", "key", ")", "{", "const", "resourceGroup", "=", "await", "fetchResourceGro...
Get a ResourceGroup's symmetric encryption key @param resourceGroupId @private
[ "Get", "a", "ResourceGroup", "s", "symmetric", "encryption", "key" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/sync-legacy/index.js#L669-L688
2,646
getinsomnia/insomnia
packages/insomnia-app/app/account/crypt.js
_pbkdf2Passphrase
async function _pbkdf2Passphrase(passphrase, salt) { if (window.crypto && window.crypto.subtle) { console.log('[crypt] Using native PBKDF2'); const k = await window.crypto.subtle.importKey( 'raw', Buffer.from(passphrase, 'utf8'), { name: 'PBKDF2' }, false, ['deriveBits'], );...
javascript
async function _pbkdf2Passphrase(passphrase, salt) { if (window.crypto && window.crypto.subtle) { console.log('[crypt] Using native PBKDF2'); const k = await window.crypto.subtle.importKey( 'raw', Buffer.from(passphrase, 'utf8'), { name: 'PBKDF2' }, false, ['deriveBits'], );...
[ "async", "function", "_pbkdf2Passphrase", "(", "passphrase", ",", "salt", ")", "{", "if", "(", "window", ".", "crypto", "&&", "window", ".", "crypto", ".", "subtle", ")", "{", "console", ".", "log", "(", "'[crypt] Using native PBKDF2'", ")", ";", "const", ...
Derive key from password @param passphrase @param salt hex representation of salt
[ "Derive", "key", "from", "password" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/account/crypt.js#L346-L379
2,647
getinsomnia/insomnia
packages/insomnia-app/app/ui/redux/modules/index.js
getAllDocs
async function getAllDocs() { // Restore docs in parent->child->grandchild order const allDocs = [ ...(await models.settings.all()), ...(await models.workspace.all()), ...(await models.workspaceMeta.all()), ...(await models.environment.all()), ...(await models.cookieJar.all()), ...(await mod...
javascript
async function getAllDocs() { // Restore docs in parent->child->grandchild order const allDocs = [ ...(await models.settings.all()), ...(await models.workspace.all()), ...(await models.workspaceMeta.all()), ...(await models.environment.all()), ...(await models.cookieJar.all()), ...(await mod...
[ "async", "function", "getAllDocs", "(", ")", "{", "// Restore docs in parent->child->grandchild order", "const", "allDocs", "=", "[", "...", "(", "await", "models", ".", "settings", ".", "all", "(", ")", ")", ",", "...", "(", "await", "models", ".", "workspace...
Async function to get all docs concurrently
[ "Async", "function", "to", "get", "all", "docs", "concurrently" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-app/app/ui/redux/modules/index.js#L48-L66
2,648
baianat/vee-validate
src/utils/vnode.js
addNativeNodeListener
function addNativeNodeListener (node, eventName, handler) { if (isNullOrUndefined(node.data.on)) { node.data.on = {}; } mergeVNodeListeners(node.data.on, eventName, handler); }
javascript
function addNativeNodeListener (node, eventName, handler) { if (isNullOrUndefined(node.data.on)) { node.data.on = {}; } mergeVNodeListeners(node.data.on, eventName, handler); }
[ "function", "addNativeNodeListener", "(", "node", ",", "eventName", ",", "handler", ")", "{", "if", "(", "isNullOrUndefined", "(", "node", ".", "data", ".", "on", ")", ")", "{", "node", ".", "data", ".", "on", "=", "{", "}", ";", "}", "mergeVNodeListen...
Adds a listener to a native HTML vnode.
[ "Adds", "a", "listener", "to", "a", "native", "HTML", "vnode", "." ]
31a7022569a7ea36857016e0f6e68c6539b0c935
https://github.com/baianat/vee-validate/blob/31a7022569a7ea36857016e0f6e68c6539b0c935/src/utils/vnode.js#L79-L85
2,649
baianat/vee-validate
src/utils/vnode.js
addComponentNodeListener
function addComponentNodeListener (node, eventName, handler) { /* istanbul ignore next */ if (!node.componentOptions.listeners) { node.componentOptions.listeners = {}; } mergeVNodeListeners(node.componentOptions.listeners, eventName, handler); }
javascript
function addComponentNodeListener (node, eventName, handler) { /* istanbul ignore next */ if (!node.componentOptions.listeners) { node.componentOptions.listeners = {}; } mergeVNodeListeners(node.componentOptions.listeners, eventName, handler); }
[ "function", "addComponentNodeListener", "(", "node", ",", "eventName", ",", "handler", ")", "{", "/* istanbul ignore next */", "if", "(", "!", "node", ".", "componentOptions", ".", "listeners", ")", "{", "node", ".", "componentOptions", ".", "listeners", "=", "{...
Adds a listener to a Vue component vnode.
[ "Adds", "a", "listener", "to", "a", "Vue", "component", "vnode", "." ]
31a7022569a7ea36857016e0f6e68c6539b0c935
https://github.com/baianat/vee-validate/blob/31a7022569a7ea36857016e0f6e68c6539b0c935/src/utils/vnode.js#L88-L95
2,650
baianat/vee-validate
src/components/provider.js
shouldValidate
function shouldValidate (ctx, model) { // when an immediate/initial validation is needed and wasn't done before. if (!ctx._ignoreImmediate && ctx.immediate) { return true; } // when the value changes for whatever reason. if (ctx.value !== model.value) { return true; } // when it needs validation...
javascript
function shouldValidate (ctx, model) { // when an immediate/initial validation is needed and wasn't done before. if (!ctx._ignoreImmediate && ctx.immediate) { return true; } // when the value changes for whatever reason. if (ctx.value !== model.value) { return true; } // when it needs validation...
[ "function", "shouldValidate", "(", "ctx", ",", "model", ")", "{", "// when an immediate/initial validation is needed and wasn't done before.", "if", "(", "!", "ctx", ".", "_ignoreImmediate", "&&", "ctx", ".", "immediate", ")", "{", "return", "true", ";", "}", "// wh...
Determines if a provider needs to run validation.
[ "Determines", "if", "a", "provider", "needs", "to", "run", "validation", "." ]
31a7022569a7ea36857016e0f6e68c6539b0c935
https://github.com/baianat/vee-validate/blob/31a7022569a7ea36857016e0f6e68c6539b0c935/src/components/provider.js#L41-L63
2,651
baianat/vee-validate
src/components/provider.js
addListeners
function addListeners (node) { const model = findModel(node); // cache the input eventName. this._inputEventName = this._inputEventName || getInputEventName(node, model); onRenderUpdate.call(this, model); const { onInput, onBlur, onValidate } = createCommonHandlers(this); addVNodeListener(node, this._inpu...
javascript
function addListeners (node) { const model = findModel(node); // cache the input eventName. this._inputEventName = this._inputEventName || getInputEventName(node, model); onRenderUpdate.call(this, model); const { onInput, onBlur, onValidate } = createCommonHandlers(this); addVNodeListener(node, this._inpu...
[ "function", "addListeners", "(", "node", ")", "{", "const", "model", "=", "findModel", "(", "node", ")", ";", "// cache the input eventName.", "this", ".", "_inputEventName", "=", "this", ".", "_inputEventName", "||", "getInputEventName", "(", "node", ",", "mode...
Adds all plugin listeners to the vnode.
[ "Adds", "all", "plugin", "listeners", "to", "the", "vnode", "." ]
31a7022569a7ea36857016e0f6e68c6539b0c935
https://github.com/baianat/vee-validate/blob/31a7022569a7ea36857016e0f6e68c6539b0c935/src/components/provider.js#L136-L153
2,652
firebase/firebaseui-web
javascript/utils/googleyolo.js
function() { // UI initialized, it is OK to cancel last operation. self.initialized_ = true; // retrieve is only called if auto sign-in is enabled. Otherwise, it will // get skipped. var retrieveCredential = Promise.resolve(null); if (!autoSignInDisabled) { retrieveCredential...
javascript
function() { // UI initialized, it is OK to cancel last operation. self.initialized_ = true; // retrieve is only called if auto sign-in is enabled. Otherwise, it will // get skipped. var retrieveCredential = Promise.resolve(null); if (!autoSignInDisabled) { retrieveCredential...
[ "function", "(", ")", "{", "// UI initialized, it is OK to cancel last operation.", "self", ".", "initialized_", "=", "true", ";", "// retrieve is only called if auto sign-in is enabled. Otherwise, it will", "// get skipped.", "var", "retrieveCredential", "=", "Promise", ".", "re...
One-Tap UI renderer.
[ "One", "-", "Tap", "UI", "renderer", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/utils/googleyolo.js#L131-L182
2,653
firebase/firebaseui-web
javascript/utils/acclient.js
function(resp, opt_error) { if (resp && resp['account'] && opt_onAccountSelected) { opt_onAccountSelected( firebaseui.auth.Account.fromPlainObject(resp['account'])); } else if (opt_onAddAccount) { // Check if accountchooser.com is available and pass to add account. var isUnavailable ...
javascript
function(resp, opt_error) { if (resp && resp['account'] && opt_onAccountSelected) { opt_onAccountSelected( firebaseui.auth.Account.fromPlainObject(resp['account'])); } else if (opt_onAddAccount) { // Check if accountchooser.com is available and pass to add account. var isUnavailable ...
[ "function", "(", "resp", ",", "opt_error", ")", "{", "if", "(", "resp", "&&", "resp", "[", "'account'", "]", "&&", "opt_onAccountSelected", ")", "{", "opt_onAccountSelected", "(", "firebaseui", ".", "auth", ".", "Account", ".", "fromPlainObject", "(", "resp"...
Save the add account callback for later use.
[ "Save", "the", "add", "account", "callback", "for", "later", "use", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/utils/acclient.js#L86-L96
2,654
firebase/firebaseui-web
protractor_spec.js
function(done, fail, tries) { // The default retrial policy. if (typeof tries === 'undefined') { tries = FLAKY_TEST_RETRIAL; } // executeScript runs the passed method in the "window" context of // the current test. JSUnit exposes hooks into the test's status through // the "G_testRunner" g...
javascript
function(done, fail, tries) { // The default retrial policy. if (typeof tries === 'undefined') { tries = FLAKY_TEST_RETRIAL; } // executeScript runs the passed method in the "window" context of // the current test. JSUnit exposes hooks into the test's status through // the "G_testRunner" g...
[ "function", "(", "done", ",", "fail", ",", "tries", ")", "{", "// The default retrial policy.", "if", "(", "typeof", "tries", "===", "'undefined'", ")", "{", "tries", "=", "FLAKY_TEST_RETRIAL", ";", "}", "// executeScript runs the passed method in the \"window\" context...
Waits for current tests to be executed. @param {!Object} done The function called when the test is finished. @param {!Error} fail The function called when an unrecoverable error happened during the test. @param {?number=} tries The number of trials so far for the current test. This is used to retry flaky tests.
[ "Waits", "for", "current", "tests", "to", "be", "executed", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/protractor_spec.js#L32-L66
2,655
firebase/firebaseui-web
javascript/widgets/handler/common.js
function(isAvailable) { var app = getApp(); if (!app) { return; } firebaseui.auth.widget.handler.common.handleAcAddAccountResponse_( isAvailable, app, container, uiShownCallback); }
javascript
function(isAvailable) { var app = getApp(); if (!app) { return; } firebaseui.auth.widget.handler.common.handleAcAddAccountResponse_( isAvailable, app, container, uiShownCallback); }
[ "function", "(", "isAvailable", ")", "{", "var", "app", "=", "getApp", "(", ")", ";", "if", "(", "!", "app", ")", "{", "return", ";", "}", "firebaseui", ".", "auth", ".", "widget", ".", "handler", ".", "common", ".", "handleAcAddAccountResponse_", "(",...
Handle adding an account.
[ "Handle", "adding", "an", "account", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L390-L397
2,656
firebase/firebaseui-web
javascript/widgets/handler/common.js
function(error) { // Ignore error if cancelled by the client. if (error['name'] && error['name'] == 'cancel') { return; } // Check if the error was due to an expired credential. // This may happen in the email mismatch case where the user waits more // than an hour and then proceeds to sig...
javascript
function(error) { // Ignore error if cancelled by the client. if (error['name'] && error['name'] == 'cancel') { return; } // Check if the error was due to an expired credential. // This may happen in the email mismatch case where the user waits more // than an hour and then proceeds to sig...
[ "function", "(", "error", ")", "{", "// Ignore error if cancelled by the client.", "if", "(", "error", "[", "'name'", "]", "&&", "error", "[", "'name'", "]", "==", "'cancel'", ")", "{", "return", ";", "}", "// Check if the error was due to an expired credential.", "...
For any error, display in info bar message.
[ "For", "any", "error", "display", "in", "info", "bar", "message", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L562-L598
2,657
firebase/firebaseui-web
javascript/widgets/handler/common.js
function(error) { // Clear pending redirect status if redirect on Cordova fails. firebaseui.auth.storage.removePendingRedirectStatus(app.getAppId()); // Ignore error if cancelled by the client. if (error['name'] && error['name'] == 'cancel') { return; } switch (error['code']) { case ...
javascript
function(error) { // Clear pending redirect status if redirect on Cordova fails. firebaseui.auth.storage.removePendingRedirectStatus(app.getAppId()); // Ignore error if cancelled by the client. if (error['name'] && error['name'] == 'cancel') { return; } switch (error['code']) { case ...
[ "function", "(", "error", ")", "{", "// Clear pending redirect status if redirect on Cordova fails.", "firebaseui", ".", "auth", ".", "storage", ".", "removePendingRedirectStatus", "(", "app", ".", "getAppId", "(", ")", ")", ";", "// Ignore error if cancelled by the client....
Error handler for signInWithPopup and getRedirectResult on Cordova.
[ "Error", "handler", "for", "signInWithPopup", "and", "getRedirectResult", "on", "Cordova", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L982-L1022
2,658
firebase/firebaseui-web
javascript/widgets/handler/common.js
function() { firebaseui.auth.storage.setPendingRedirectStatus(app.getAppId()); app.registerPending(component.executePromiseRequest( /** @type {function (): !goog.Promise} */ ( goog.bind(app.startSignInWithRedirect, app)), [provider], function() { // Only run below l...
javascript
function() { firebaseui.auth.storage.setPendingRedirectStatus(app.getAppId()); app.registerPending(component.executePromiseRequest( /** @type {function (): !goog.Promise} */ ( goog.bind(app.startSignInWithRedirect, app)), [provider], function() { // Only run below l...
[ "function", "(", ")", "{", "firebaseui", ".", "auth", ".", "storage", ".", "setPendingRedirectStatus", "(", "app", ".", "getAppId", "(", ")", ")", ";", "app", ".", "registerPending", "(", "component", ".", "executePromiseRequest", "(", "/** @type {function (): !...
Redirect processor.
[ "Redirect", "processor", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L1027-L1059
2,659
firebase/firebaseui-web
javascript/widgets/handler/common.js
function(firebaseCredential) { var status = false; var p = component.executePromiseRequest( /** @type {function (): !goog.Promise} */ ( goog.bind(app.startSignInWithCredential, app)), [firebaseCredential], function(result) { var container = component.getContainer();...
javascript
function(firebaseCredential) { var status = false; var p = component.executePromiseRequest( /** @type {function (): !goog.Promise} */ ( goog.bind(app.startSignInWithCredential, app)), [firebaseCredential], function(result) { var container = component.getContainer();...
[ "function", "(", "firebaseCredential", ")", "{", "var", "status", "=", "false", ";", "var", "p", "=", "component", ".", "executePromiseRequest", "(", "/** @type {function (): !goog.Promise} */", "(", "goog", ".", "bind", "(", "app", ".", "startSignInWithCredential",...
Sign in with a Firebase Auth credential. @param {!firebase.auth.AuthCredential} firebaseCredential The Firebase Auth credential. @return {!goog.Promise<boolean>}
[ "Sign", "in", "with", "a", "Firebase", "Auth", "credential", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L1135-L1185
2,660
firebase/firebaseui-web
javascript/widgets/handler/common.js
function(providerId, opt_email) { // If popup flow enabled, this will fail and fallback to redirect. // TODO: Optimize to force redirect mode only. // For non-Google providers (not supported yet). This may end up signing the // user with a provider using different email. Even for Google, a user can ...
javascript
function(providerId, opt_email) { // If popup flow enabled, this will fail and fallback to redirect. // TODO: Optimize to force redirect mode only. // For non-Google providers (not supported yet). This may end up signing the // user with a provider using different email. Even for Google, a user can ...
[ "function", "(", "providerId", ",", "opt_email", ")", "{", "// If popup flow enabled, this will fail and fallback to redirect.", "// TODO: Optimize to force redirect mode only.", "// For non-Google providers (not supported yet). This may end up signing the", "// user with a provider using differ...
Sign in with a provider ID. @param {string} providerId The Firebase Auth provider ID to sign-in with. @param {?string=} opt_email The optional email to sign-in with. @return {!goog.Promise<boolean>}
[ "Sign", "in", "with", "a", "provider", "ID", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/common.js#L1192-L1202
2,661
firebase/firebaseui-web
gulpfile.js
compile
function compile(srcs, out, args) { // Get the compiler arguments, using the defaults if not specified. const combinedArgs = Object.assign({}, COMPILER_DEFAULT_ARGS, args); return gulp .src(srcs) .pipe(closureCompiler({ compilerPath: COMPILER_PATH, fileName: path.basename(out), ...
javascript
function compile(srcs, out, args) { // Get the compiler arguments, using the defaults if not specified. const combinedArgs = Object.assign({}, COMPILER_DEFAULT_ARGS, args); return gulp .src(srcs) .pipe(closureCompiler({ compilerPath: COMPILER_PATH, fileName: path.basename(out), ...
[ "function", "compile", "(", "srcs", ",", "out", ",", "args", ")", "{", "// Get the compiler arguments, using the defaults if not specified.", "const", "combinedArgs", "=", "Object", ".", "assign", "(", "{", "}", ",", "COMPILER_DEFAULT_ARGS", ",", "args", ")", ";", ...
Invokes Closure Compiler. @param {!Array<string>} srcs The JS sources to compile. @param {string} out The path to the output JS file. @param {!Object} args Additional arguments to Closure compiler. @return {*} A stream that finishes when compliation finishes.
[ "Invokes", "Closure", "Compiler", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L124-L135
2,662
firebase/firebaseui-web
gulpfile.js
repeatTaskForAllLocales
function repeatTaskForAllLocales(taskName, dependencies, operation) { return ALL_LOCALES.map((locale) => { // Convert build-js-$ to build-js-fr, for example. const replaceTokens = (name) => name.replace(/\$/g, locale); const localeTaskName = replaceTokens(taskName); const localeDependencies = dependen...
javascript
function repeatTaskForAllLocales(taskName, dependencies, operation) { return ALL_LOCALES.map((locale) => { // Convert build-js-$ to build-js-fr, for example. const replaceTokens = (name) => name.replace(/\$/g, locale); const localeTaskName = replaceTokens(taskName); const localeDependencies = dependen...
[ "function", "repeatTaskForAllLocales", "(", "taskName", ",", "dependencies", ",", "operation", ")", "{", "return", "ALL_LOCALES", ".", "map", "(", "(", "locale", ")", "=>", "{", "// Convert build-js-$ to build-js-fr, for example.", "const", "replaceTokens", "=", "(", ...
Repeats a gulp task for all locales. @param {string} taskName The gulp task name to generate. Any $ tokens will be replaced with the language code (e.g. build-$ becomes build-fr, build-es, etc.). @param {!Array<string>} dependencies The gulp tasks that each operation depends on. Any $ tokens will be replaced with the l...
[ "Repeats", "a", "gulp", "task", "for", "all", "locales", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L167-L179
2,663
firebase/firebaseui-web
gulpfile.js
buildFirebaseUiJs
function buildFirebaseUiJs(locale) { const flags = { closure_entry_point: 'firebaseui.auth.exports', define: `goog.LOCALE='${locale}'`, externs: [ 'node_modules/firebase/externs/firebase-app-externs.js', 'node_modules/firebase/externs/firebase-auth-externs.js', 'node_modules/firebase/ext...
javascript
function buildFirebaseUiJs(locale) { const flags = { closure_entry_point: 'firebaseui.auth.exports', define: `goog.LOCALE='${locale}'`, externs: [ 'node_modules/firebase/externs/firebase-app-externs.js', 'node_modules/firebase/externs/firebase-auth-externs.js', 'node_modules/firebase/ext...
[ "function", "buildFirebaseUiJs", "(", "locale", ")", "{", "const", "flags", "=", "{", "closure_entry_point", ":", "'firebaseui.auth.exports'", ",", "define", ":", "`", "${", "locale", "}", "`", ",", "externs", ":", "[", "'node_modules/firebase/externs/firebase-app-e...
Builds the core FirebaseUI binary in the given locale. @param {string} locale @return {*} A stream that finishes when compilation finishes.
[ "Builds", "the", "core", "FirebaseUI", "binary", "in", "the", "given", "locale", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L186-L211
2,664
firebase/firebaseui-web
gulpfile.js
concatWithDeps
function concatWithDeps(locale, outBaseName, outputWrapper) { const localeForFileName = getLocaleForFileName(locale); // Get a list of the FirebaseUI JS and its dependencies. const srcs = JS_DEPS.concat([getTmpJsPath(locale)]); const outputPath = `${DEST_DIR}/${outBaseName}__${localeForFileName}.js`; return c...
javascript
function concatWithDeps(locale, outBaseName, outputWrapper) { const localeForFileName = getLocaleForFileName(locale); // Get a list of the FirebaseUI JS and its dependencies. const srcs = JS_DEPS.concat([getTmpJsPath(locale)]); const outputPath = `${DEST_DIR}/${outBaseName}__${localeForFileName}.js`; return c...
[ "function", "concatWithDeps", "(", "locale", ",", "outBaseName", ",", "outputWrapper", ")", "{", "const", "localeForFileName", "=", "getLocaleForFileName", "(", "locale", ")", ";", "// Get a list of the FirebaseUI JS and its dependencies.", "const", "srcs", "=", "JS_DEPS"...
Concatenates the core FirebaseUI JS with its external dependencies, and cleans up comments and whitespace in the dependencies. @param {string} locale The desired FirebaseUI locale. @param {string} outBaseName The prefix of the output file name. @param {string} outputWrapper A wrapper with which to wrap the output JS. @...
[ "Concatenates", "the", "core", "FirebaseUI", "JS", "with", "its", "external", "dependencies", "and", "cleans", "up", "comments", "and", "whitespace", "in", "the", "dependencies", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L221-L230
2,665
firebase/firebaseui-web
gulpfile.js
buildCss
function buildCss(isRtl) { const mdlSrcs = gulp.src('stylesheet/mdl.scss') .pipe(sass.sync().on('error', sass.logError)) .pipe(cssInlineImages({ webRoot: 'node_modules/material-design-lite/src', })); const dialogPolyfillSrcs = gulp.src( 'node_modules/dialog-polyfill/dialog-polyfill.c...
javascript
function buildCss(isRtl) { const mdlSrcs = gulp.src('stylesheet/mdl.scss') .pipe(sass.sync().on('error', sass.logError)) .pipe(cssInlineImages({ webRoot: 'node_modules/material-design-lite/src', })); const dialogPolyfillSrcs = gulp.src( 'node_modules/dialog-polyfill/dialog-polyfill.c...
[ "function", "buildCss", "(", "isRtl", ")", "{", "const", "mdlSrcs", "=", "gulp", ".", "src", "(", "'stylesheet/mdl.scss'", ")", ".", "pipe", "(", "sass", ".", "sync", "(", ")", ".", "on", "(", "'error'", ",", "sass", ".", "logError", ")", ")", ".", ...
Builds the CSS for FirebaseUI. @param {boolean} isRtl Whether to build in right-to-left mode. @return {*} A stream that finishes when compilation finishes.
[ "Builds", "the", "CSS", "for", "FirebaseUI", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L297-L318
2,666
firebase/firebaseui-web
soy/viewhelper.js
loadRecaptcha
function loadRecaptcha(container) { var root = goog.dom.getElement(container); var recaptchaContainer = goog.dom.getElementByClass('firebaseui-recaptcha-container', root); recaptchaContainer.style.display = 'block'; var img = goog.dom.createElement('img'); img.src = '../image/test/recaptcha-widget.png';...
javascript
function loadRecaptcha(container) { var root = goog.dom.getElement(container); var recaptchaContainer = goog.dom.getElementByClass('firebaseui-recaptcha-container', root); recaptchaContainer.style.display = 'block'; var img = goog.dom.createElement('img'); img.src = '../image/test/recaptcha-widget.png';...
[ "function", "loadRecaptcha", "(", "container", ")", "{", "var", "root", "=", "goog", ".", "dom", ".", "getElement", "(", "container", ")", ";", "var", "recaptchaContainer", "=", "goog", ".", "dom", ".", "getElementByClass", "(", "'firebaseui-recaptcha-container'...
Simulates a reCAPTCHA being rendered for UI testing. This will just load a mock visible reCAPTCHA in the reCAPTCHA element. @param {Element} container The root container that holds the reCAPTCHA.
[ "Simulates", "a", "reCAPTCHA", "being", "rendered", "for", "UI", "testing", ".", "This", "will", "just", "load", "a", "mock", "visible", "reCAPTCHA", "in", "the", "reCAPTCHA", "element", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/soy/viewhelper.js#L59-L67
2,667
firebase/firebaseui-web
javascript/widgets/handler/emailnotreceived.js
function() { firebaseui.auth.widget.handler.common.sendEmailLinkForSignIn( app, component, email, onCancelClick, function(error) { // The email provided could be an invalid one or some other error // could occur. ...
javascript
function() { firebaseui.auth.widget.handler.common.sendEmailLinkForSignIn( app, component, email, onCancelClick, function(error) { // The email provided could be an invalid one or some other error // could occur. ...
[ "function", "(", ")", "{", "firebaseui", ".", "auth", ".", "widget", ".", "handler", ".", "common", ".", "sendEmailLinkForSignIn", "(", "app", ",", "component", ",", "email", ",", "onCancelClick", ",", "function", "(", "error", ")", "{", "// The email provid...
On resend link click.
[ "On", "resend", "link", "click", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/emailnotreceived.js#L44-L58
2,668
firebase/firebaseui-web
buildtools/country_data/get_directory_args.js
assertIsDirectory
function assertIsDirectory(path) { try { if (!fs.lstatSync(path).isDirectory()) { console.log('Path "' + path + '" is not a directory.'); process.exit(); } } catch (e) { console.log('Directory "' + path + '" could not be found.'); process.exit(); } }
javascript
function assertIsDirectory(path) { try { if (!fs.lstatSync(path).isDirectory()) { console.log('Path "' + path + '" is not a directory.'); process.exit(); } } catch (e) { console.log('Directory "' + path + '" could not be found.'); process.exit(); } }
[ "function", "assertIsDirectory", "(", "path", ")", "{", "try", "{", "if", "(", "!", "fs", ".", "lstatSync", "(", "path", ")", ".", "isDirectory", "(", ")", ")", "{", "console", ".", "log", "(", "'Path \"'", "+", "path", "+", "'\" is not a directory.'", ...
Asserts that the given path points to a directory and exits otherwise. @param {string} path
[ "Asserts", "that", "the", "given", "path", "points", "to", "a", "directory", "and", "exits", "otherwise", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/buildtools/country_data/get_directory_args.js#L26-L36
2,669
firebase/firebaseui-web
javascript/widgets/handler/passwordsignup.js
function() { var errorMessage = firebaseui.auth.widget.handler.common.getErrorMessage(emailExistsError); firebaseui.auth.ui.element.setValid(component.getEmailElement(), false); firebaseui.auth.ui.element.show( component.getEmailErrorElement(), errorMessage); component.getEmailElement()....
javascript
function() { var errorMessage = firebaseui.auth.widget.handler.common.getErrorMessage(emailExistsError); firebaseui.auth.ui.element.setValid(component.getEmailElement(), false); firebaseui.auth.ui.element.show( component.getEmailErrorElement(), errorMessage); component.getEmailElement()....
[ "function", "(", ")", "{", "var", "errorMessage", "=", "firebaseui", ".", "auth", ".", "widget", ".", "handler", ".", "common", ".", "getErrorMessage", "(", "emailExistsError", ")", ";", "firebaseui", ".", "auth", ".", "ui", ".", "element", ".", "setValid"...
If a provider already exists, just display the error and focus the email element.
[ "If", "a", "provider", "already", "exists", "just", "display", "the", "error", "and", "focus", "the", "email", "element", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/passwordsignup.js#L192-L199
2,670
firebase/firebaseui-web
javascript/widgets/handler/phonesigninstart.js
function(phoneAuthResult) { // Display the dialog that the code was sent. var container = component.getContainer(); component.showProgressDialog( firebaseui.auth.ui.element.progressDialog.State.DONE, firebaseui.auth.soy2.strings.dialogCodeSent().toString()); // Ke...
javascript
function(phoneAuthResult) { // Display the dialog that the code was sent. var container = component.getContainer(); component.showProgressDialog( firebaseui.auth.ui.element.progressDialog.State.DONE, firebaseui.auth.soy2.strings.dialogCodeSent().toString()); // Ke...
[ "function", "(", "phoneAuthResult", ")", "{", "// Display the dialog that the code was sent.", "var", "container", "=", "component", ".", "getContainer", "(", ")", ";", "component", ".", "showProgressDialog", "(", "firebaseui", ".", "auth", ".", "ui", ".", "element"...
On success a phone Auth result is returned.
[ "On", "success", "a", "phone", "Auth", "result", "is", "returned", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/phonesigninstart.js#L269-L297
2,671
firebase/firebaseui-web
demo/public/app.js
getUiConfig
function getUiConfig() { return { 'callbacks': { // Called when the user has been successfully signed in. 'signInSuccessWithAuthResult': function(authResult, redirectUrl) { if (authResult.user) { handleSignedInUser(authResult.user); } if (authResult.additionalUserInfo...
javascript
function getUiConfig() { return { 'callbacks': { // Called when the user has been successfully signed in. 'signInSuccessWithAuthResult': function(authResult, redirectUrl) { if (authResult.user) { handleSignedInUser(authResult.user); } if (authResult.additionalUserInfo...
[ "function", "getUiConfig", "(", ")", "{", "return", "{", "'callbacks'", ":", "{", "// Called when the user has been successfully signed in.", "'signInSuccessWithAuthResult'", ":", "function", "(", "authResult", ",", "redirectUrl", ")", "{", "if", "(", "authResult", ".",...
FirebaseUI initialization to be used in a Single Page application context. @return {!Object} The FirebaseUI config.
[ "FirebaseUI", "initialization", "to", "be", "used", "in", "a", "Single", "Page", "application", "context", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L22-L90
2,672
firebase/firebaseui-web
demo/public/app.js
function(authResult, redirectUrl) { if (authResult.user) { handleSignedInUser(authResult.user); } if (authResult.additionalUserInfo) { document.getElementById('is-new-user').textContent = authResult.additionalUserInfo.isNewUser ? 'New User' : 'Exis...
javascript
function(authResult, redirectUrl) { if (authResult.user) { handleSignedInUser(authResult.user); } if (authResult.additionalUserInfo) { document.getElementById('is-new-user').textContent = authResult.additionalUserInfo.isNewUser ? 'New User' : 'Exis...
[ "function", "(", "authResult", ",", "redirectUrl", ")", "{", "if", "(", "authResult", ".", "user", ")", "{", "handleSignedInUser", "(", "authResult", ".", "user", ")", ";", "}", "if", "(", "authResult", ".", "additionalUserInfo", ")", "{", "document", ".",...
Called when the user has been successfully signed in.
[ "Called", "when", "the", "user", "has", "been", "successfully", "signed", "in", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L26-L37
2,673
firebase/firebaseui-web
demo/public/app.js
function(user) { document.getElementById('user-signed-in').style.display = 'block'; document.getElementById('user-signed-out').style.display = 'none'; document.getElementById('name').textContent = user.displayName; document.getElementById('email').textContent = user.email; document.getElementById('phone').tex...
javascript
function(user) { document.getElementById('user-signed-in').style.display = 'block'; document.getElementById('user-signed-out').style.display = 'none'; document.getElementById('name').textContent = user.displayName; document.getElementById('email').textContent = user.email; document.getElementById('phone').tex...
[ "function", "(", "user", ")", "{", "document", ".", "getElementById", "(", "'user-signed-in'", ")", ".", "style", ".", "display", "=", "'block'", ";", "document", ".", "getElementById", "(", "'user-signed-out'", ")", ".", "style", ".", "display", "=", "'none...
Displays the UI for a signed in user. @param {!firebase.User} user
[ "Displays", "the", "UI", "for", "a", "signed", "in", "user", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L127-L148
2,674
firebase/firebaseui-web
demo/public/app.js
function() { document.getElementById('user-signed-in').style.display = 'none'; document.getElementById('user-signed-out').style.display = 'block'; ui.start('#firebaseui-container', getUiConfig()); }
javascript
function() { document.getElementById('user-signed-in').style.display = 'none'; document.getElementById('user-signed-out').style.display = 'block'; ui.start('#firebaseui-container', getUiConfig()); }
[ "function", "(", ")", "{", "document", ".", "getElementById", "(", "'user-signed-in'", ")", ".", "style", ".", "display", "=", "'none'", ";", "document", ".", "getElementById", "(", "'user-signed-out'", ")", ".", "style", ".", "display", "=", "'block'", ";",...
Displays the UI for a signed out user.
[ "Displays", "the", "UI", "for", "a", "signed", "out", "user", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L154-L158
2,675
firebase/firebaseui-web
demo/public/app.js
function() { firebase.auth().currentUser.delete().catch(function(error) { if (error.code == 'auth/requires-recent-login') { // The user's credential is too old. She needs to sign in again. firebase.auth().signOut().then(function() { // The timeout allows the message to be displayed after the U...
javascript
function() { firebase.auth().currentUser.delete().catch(function(error) { if (error.code == 'auth/requires-recent-login') { // The user's credential is too old. She needs to sign in again. firebase.auth().signOut().then(function() { // The timeout allows the message to be displayed after the U...
[ "function", "(", ")", "{", "firebase", ".", "auth", "(", ")", ".", "currentUser", ".", "delete", "(", ")", ".", "catch", "(", "function", "(", "error", ")", "{", "if", "(", "error", ".", "code", "==", "'auth/requires-recent-login'", ")", "{", "// The u...
Deletes the user's account.
[ "Deletes", "the", "user", "s", "account", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L171-L184
2,676
firebase/firebaseui-web
demo/public/app.js
handleConfigChange
function handleConfigChange() { var newRecaptchaValue = document.querySelector( 'input[name="recaptcha"]:checked').value; var newEmailSignInMethodValue = document.querySelector( 'input[name="emailSignInMethod"]:checked').value; location.replace( location.pathname + '#recaptcha=' + newRecaptchaVa...
javascript
function handleConfigChange() { var newRecaptchaValue = document.querySelector( 'input[name="recaptcha"]:checked').value; var newEmailSignInMethodValue = document.querySelector( 'input[name="emailSignInMethod"]:checked').value; location.replace( location.pathname + '#recaptcha=' + newRecaptchaVa...
[ "function", "handleConfigChange", "(", ")", "{", "var", "newRecaptchaValue", "=", "document", ".", "querySelector", "(", "'input[name=\"recaptcha\"]:checked'", ")", ".", "value", ";", "var", "newEmailSignInMethodValue", "=", "document", ".", "querySelector", "(", "'in...
Handles when the user changes the reCAPTCHA or email signInMethod config.
[ "Handles", "when", "the", "user", "changes", "the", "reCAPTCHA", "or", "email", "signInMethod", "config", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L190-L202
2,677
firebase/firebaseui-web
demo/public/app.js
function() { document.getElementById('sign-in-with-redirect').addEventListener( 'click', signInWithRedirect); document.getElementById('sign-in-with-popup').addEventListener( 'click', signInWithPopup); document.getElementById('sign-out').addEventListener('click', function() { firebase.auth().signOu...
javascript
function() { document.getElementById('sign-in-with-redirect').addEventListener( 'click', signInWithRedirect); document.getElementById('sign-in-with-popup').addEventListener( 'click', signInWithPopup); document.getElementById('sign-out').addEventListener('click', function() { firebase.auth().signOu...
[ "function", "(", ")", "{", "document", ".", "getElementById", "(", "'sign-in-with-redirect'", ")", ".", "addEventListener", "(", "'click'", ",", "signInWithRedirect", ")", ";", "document", ".", "getElementById", "(", "'sign-in-with-popup'", ")", ".", "addEventListen...
Initializes the app.
[ "Initializes", "the", "app", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L208-L238
2,678
firebase/firebaseui-web
javascript/widgets/handler/emaillinkconfirmation.js
function() { var email = component.checkAndGetEmail(); if (!email) { component.getEmailElement().focus(); return; } component.dispose(); onContinue(app, container, email, link); }
javascript
function() { var email = component.checkAndGetEmail(); if (!email) { component.getEmailElement().focus(); return; } component.dispose(); onContinue(app, container, email, link); }
[ "function", "(", ")", "{", "var", "email", "=", "component", ".", "checkAndGetEmail", "(", ")", ";", "if", "(", "!", "email", ")", "{", "component", ".", "getEmailElement", "(", ")", ".", "focus", "(", ")", ";", "return", ";", "}", "component", ".", ...
On email enter.
[ "On", "email", "enter", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/emaillinkconfirmation.js#L46-L54
2,679
firebase/firebaseui-web
javascript/widgets/handler/phonesigninfinish.js
function() { component.dispose(); // Render previous phone sign in start page. firebaseui.auth.widget.handler.handle( firebaseui.auth.widget.HandlerName.PHONE_SIGN_IN_START, app, container, phoneNumberValue); }
javascript
function() { component.dispose(); // Render previous phone sign in start page. firebaseui.auth.widget.handler.handle( firebaseui.auth.widget.HandlerName.PHONE_SIGN_IN_START, app, container, phoneNumberValue); }
[ "function", "(", ")", "{", "component", ".", "dispose", "(", ")", ";", "// Render previous phone sign in start page.", "firebaseui", ".", "auth", ".", "widget", ".", "handler", ".", "handle", "(", "firebaseui", ".", "auth", ".", "widget", ".", "HandlerName", "...
On change phone number click.
[ "On", "change", "phone", "number", "click", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/phonesigninfinish.js#L56-L62
2,680
firebase/firebaseui-web
javascript/widgets/handler/phonesigninfinish.js
function(userCredential) { component.dismissDialog(); // Show code verified dialog. component.showProgressDialog( firebaseui.auth.ui.element.progressDialog.State.DONE, firebaseui.auth.soy2.strings.dialogCodeVerified().toString()); // Keep on display for long enoug...
javascript
function(userCredential) { component.dismissDialog(); // Show code verified dialog. component.showProgressDialog( firebaseui.auth.ui.element.progressDialog.State.DONE, firebaseui.auth.soy2.strings.dialogCodeVerified().toString()); // Keep on display for long enoug...
[ "function", "(", "userCredential", ")", "{", "component", ".", "dismissDialog", "(", ")", ";", "// Show code verified dialog.", "component", ".", "showProgressDialog", "(", "firebaseui", ".", "auth", ".", "ui", ".", "element", ".", "progressDialog", ".", "State", ...
On success a user credential is returned.
[ "On", "success", "a", "user", "credential", "is", "returned", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/phonesigninfinish.js#L141-L171
2,681
firebase/firebaseui-web
javascript/widgets/handler/phonesigninfinish.js
function(error) { if (error['name'] && error['name'] == 'cancel') { // Close dialog. component.dismissDialog(); return; } // Get error message. var errorMessage = firebaseui.auth.widget.handler.common.getErrorMessage(error); // Some error...
javascript
function(error) { if (error['name'] && error['name'] == 'cancel') { // Close dialog. component.dismissDialog(); return; } // Get error message. var errorMessage = firebaseui.auth.widget.handler.common.getErrorMessage(error); // Some error...
[ "function", "(", "error", ")", "{", "if", "(", "error", "[", "'name'", "]", "&&", "error", "[", "'name'", "]", "==", "'cancel'", ")", "{", "// Close dialog.", "component", ".", "dismissDialog", "(", ")", ";", "return", ";", "}", "// Get error message.", ...
On code verification failure.
[ "On", "code", "verification", "failure", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/javascript/widgets/handler/phonesigninfinish.js#L173-L217
2,682
immerjs/immer
src/es5.js
markChangesSweep
function markChangesSweep(drafts) { // The natural order of drafts in the `scope` array is based on when they // were accessed. By processing drafts in reverse natural order, we have a // better chance of processing leaf nodes first. When a leaf node is known to // have changed, we can avoid any travers...
javascript
function markChangesSweep(drafts) { // The natural order of drafts in the `scope` array is based on when they // were accessed. By processing drafts in reverse natural order, we have a // better chance of processing leaf nodes first. When a leaf node is known to // have changed, we can avoid any travers...
[ "function", "markChangesSweep", "(", "drafts", ")", "{", "// The natural order of drafts in the `scope` array is based on when they", "// were accessed. By processing drafts in reverse natural order, we have a", "// better chance of processing leaf nodes first. When a leaf node is known to", "// h...
This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
[ "This", "looks", "expensive", "but", "only", "proxies", "are", "visited", "and", "only", "objects", "without", "known", "changes", "are", "scanned", "." ]
4443cace6c23d14536955ce5b2aec92c8c76cacc
https://github.com/immerjs/immer/blob/4443cace6c23d14536955ce5b2aec92c8c76cacc/src/es5.js#L156-L169
2,683
postcss/autoprefixer
lib/prefixer.js
clone
function clone (obj, parent) { let cloned = new obj.constructor() for (let i of Object.keys(obj || {})) { let value = obj[i] if (i === 'parent' && typeof value === 'object') { if (parent) { cloned[i] = parent } } else if (i === 'source' || i === null) { cloned[i] = value }...
javascript
function clone (obj, parent) { let cloned = new obj.constructor() for (let i of Object.keys(obj || {})) { let value = obj[i] if (i === 'parent' && typeof value === 'object') { if (parent) { cloned[i] = parent } } else if (i === 'source' || i === null) { cloned[i] = value }...
[ "function", "clone", "(", "obj", ",", "parent", ")", "{", "let", "cloned", "=", "new", "obj", ".", "constructor", "(", ")", "for", "(", "let", "i", "of", "Object", ".", "keys", "(", "obj", "||", "{", "}", ")", ")", "{", "let", "value", "=", "ob...
Recursively clone objects
[ "Recursively", "clone", "objects" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/prefixer.js#L9-L31
2,684
postcss/autoprefixer
data/prefixes.js
f
function f (data, opts, callback) { data = unpack(data) if (!callback) { [callback, opts] = [opts, {}] } let match = opts.match || /\sx($|\s)/ let need = [] for (let browser in data.stats) { let versions = data.stats[browser] for (let version in versions) { let support = versions[versio...
javascript
function f (data, opts, callback) { data = unpack(data) if (!callback) { [callback, opts] = [opts, {}] } let match = opts.match || /\sx($|\s)/ let need = [] for (let browser in data.stats) { let versions = data.stats[browser] for (let version in versions) { let support = versions[versio...
[ "function", "f", "(", "data", ",", "opts", ",", "callback", ")", "{", "data", "=", "unpack", "(", "data", ")", "if", "(", "!", "callback", ")", "{", "[", "callback", ",", "opts", "]", "=", "[", "opts", ",", "{", "}", "]", "}", "let", "match", ...
Convert Can I Use data
[ "Convert", "Can", "I", "Use", "data" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/data/prefixes.js#L18-L39
2,685
postcss/autoprefixer
lib/hacks/grid-utils.js
getMSDecls
function getMSDecls (area, addRowSpan = false, addColumnSpan = false) { return [].concat( { prop: '-ms-grid-row', value: String(area.row.start) }, (area.row.span > 1 || addRowSpan) ? { prop: '-ms-grid-row-span', value: String(area.row.span) } : [], { prop: '-ms-grid-c...
javascript
function getMSDecls (area, addRowSpan = false, addColumnSpan = false) { return [].concat( { prop: '-ms-grid-row', value: String(area.row.start) }, (area.row.span > 1 || addRowSpan) ? { prop: '-ms-grid-row-span', value: String(area.row.span) } : [], { prop: '-ms-grid-c...
[ "function", "getMSDecls", "(", "area", ",", "addRowSpan", "=", "false", ",", "addColumnSpan", "=", "false", ")", "{", "return", "[", "]", ".", "concat", "(", "{", "prop", ":", "'-ms-grid-row'", ",", "value", ":", "String", "(", "area", ".", "row", ".",...
Insert parsed grid areas Get an array of -ms- prefixed props and values @param {Object} [area] area object with column and row data @param {Boolean} [addRowSpan] should we add grid-column-row value? @param {Boolean} [addColumnSpan] should we add grid-column-span value? @return {Array<Object>}
[ "Insert", "parsed", "grid", "areas", "Get", "an", "array", "of", "-", "ms", "-", "prefixed", "props", "and", "values" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L276-L295
2,686
postcss/autoprefixer
lib/hacks/grid-utils.js
changeDuplicateAreaSelectors
function changeDuplicateAreaSelectors (ruleSelectors, templateSelectors) { ruleSelectors = ruleSelectors.map(selector => { let selectorBySpace = list.space(selector) let selectorByComma = list.comma(selector) if (selectorBySpace.length > selectorByComma.length) { selector = selectorBySpace.slice(-1...
javascript
function changeDuplicateAreaSelectors (ruleSelectors, templateSelectors) { ruleSelectors = ruleSelectors.map(selector => { let selectorBySpace = list.space(selector) let selectorByComma = list.comma(selector) if (selectorBySpace.length > selectorByComma.length) { selector = selectorBySpace.slice(-1...
[ "function", "changeDuplicateAreaSelectors", "(", "ruleSelectors", ",", "templateSelectors", ")", "{", "ruleSelectors", "=", "ruleSelectors", ".", "map", "(", "selector", "=>", "{", "let", "selectorBySpace", "=", "list", ".", "space", "(", "selector", ")", "let", ...
change selectors for rules with duplicate grid-areas. @param {Array<Rule>} rules @param {Array<String>} templateSelectors @return {Array<Rule>} rules with changed selectors
[ "change", "selectors", "for", "rules", "with", "duplicate", "grid", "-", "areas", "." ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L313-L332
2,687
postcss/autoprefixer
lib/hacks/grid-utils.js
selectorsEqual
function selectorsEqual (ruleA, ruleB) { return ruleA.selectors.some(sel => { return ruleB.selectors.some(s => s === sel) }) }
javascript
function selectorsEqual (ruleA, ruleB) { return ruleA.selectors.some(sel => { return ruleB.selectors.some(s => s === sel) }) }
[ "function", "selectorsEqual", "(", "ruleA", ",", "ruleB", ")", "{", "return", "ruleA", ".", "selectors", ".", "some", "(", "sel", "=>", "{", "return", "ruleB", ".", "selectors", ".", "some", "(", "s", "=>", "s", "===", "sel", ")", "}", ")", "}" ]
check if selector of rules are equal @param {Rule} ruleA @param {Rule} ruleB @return {Boolean}
[ "check", "if", "selector", "of", "rules", "are", "equal" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L340-L344
2,688
postcss/autoprefixer
lib/hacks/grid-utils.js
warnMissedAreas
function warnMissedAreas (areas, decl, result) { let missed = Object.keys(areas) decl.root().walkDecls('grid-area', gridArea => { missed = missed.filter(e => e !== gridArea.value) }) if (missed.length > 0) { decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')) } return undefined }
javascript
function warnMissedAreas (areas, decl, result) { let missed = Object.keys(areas) decl.root().walkDecls('grid-area', gridArea => { missed = missed.filter(e => e !== gridArea.value) }) if (missed.length > 0) { decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')) } return undefined }
[ "function", "warnMissedAreas", "(", "areas", ",", "decl", ",", "result", ")", "{", "let", "missed", "=", "Object", ".", "keys", "(", "areas", ")", "decl", ".", "root", "(", ")", ".", "walkDecls", "(", "'grid-area'", ",", "gridArea", "=>", "{", "missed"...
Warn user if grid area identifiers are not found @param {Object} areas @param {Declaration} decl @param {Result} result @return {void}
[ "Warn", "user", "if", "grid", "area", "identifiers", "are", "not", "found" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L653-L665
2,689
postcss/autoprefixer
lib/hacks/grid-utils.js
shouldInheritGap
function shouldInheritGap (selA, selB) { let result // get arrays of selector split in 3-deep array let splitSelectorArrA = splitSelector(selA) let splitSelectorArrB = splitSelector(selB) if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) { // abort if selectorA has lower descendant specific...
javascript
function shouldInheritGap (selA, selB) { let result // get arrays of selector split in 3-deep array let splitSelectorArrA = splitSelector(selA) let splitSelectorArrB = splitSelector(selB) if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) { // abort if selectorA has lower descendant specific...
[ "function", "shouldInheritGap", "(", "selA", ",", "selB", ")", "{", "let", "result", "// get arrays of selector split in 3-deep array", "let", "splitSelectorArrA", "=", "splitSelector", "(", "selA", ")", "let", "splitSelectorArrB", "=", "splitSelector", "(", "selB", "...
Compare the selectors and decide if we need to inherit gap from compared selector or not. @type {String} selA @type {String} selB @return {Boolean}
[ "Compare", "the", "selectors", "and", "decide", "if", "we", "need", "to", "inherit", "gap", "from", "compared", "selector", "or", "not", "." ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L819-L863
2,690
postcss/autoprefixer
lib/hacks/grid-utils.js
inheritGridGap
function inheritGridGap (decl, gap) { let rule = decl.parent let mediaRule = getParentMedia(rule) let root = rule.root() // get an array of selector split in 3-deep array let splitSelectorArr = splitSelector(rule.selector) // abort if the rule already has gaps if (Object.keys(gap).length > 0) { retu...
javascript
function inheritGridGap (decl, gap) { let rule = decl.parent let mediaRule = getParentMedia(rule) let root = rule.root() // get an array of selector split in 3-deep array let splitSelectorArr = splitSelector(rule.selector) // abort if the rule already has gaps if (Object.keys(gap).length > 0) { retu...
[ "function", "inheritGridGap", "(", "decl", ",", "gap", ")", "{", "let", "rule", "=", "decl", ".", "parent", "let", "mediaRule", "=", "getParentMedia", "(", "rule", ")", "let", "root", "=", "rule", ".", "root", "(", ")", "// get an array of selector split in ...
inherit grid gap values from the closest rule above with the same selector @param {Declaration} decl @param {Object} gap gap values @return {Object | Boolean} return gap values or false (if not found)
[ "inherit", "grid", "gap", "values", "from", "the", "closest", "rule", "above", "with", "the", "same", "selector" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L871-L940
2,691
postcss/autoprefixer
lib/hacks/grid-utils.js
autoplaceGridItems
function autoplaceGridItems (decl, result, gap, autoflowValue = 'row') { let { parent } = decl let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') let rows = normalizeRowColumn(rowDecl.value) let columns = normalizeRowColumn(decl.value) // Build array of area names with dummy values. If we...
javascript
function autoplaceGridItems (decl, result, gap, autoflowValue = 'row') { let { parent } = decl let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') let rows = normalizeRowColumn(rowDecl.value) let columns = normalizeRowColumn(decl.value) // Build array of area names with dummy values. If we...
[ "function", "autoplaceGridItems", "(", "decl", ",", "result", ",", "gap", ",", "autoflowValue", "=", "'row'", ")", "{", "let", "{", "parent", "}", "=", "decl", "let", "rowDecl", "=", "parent", ".", "nodes", ".", "find", "(", "i", "=>", "i", ".", "pro...
Autoplace grid items @param {Declaration} decl @param {Result} result @param {Object} gap gap values @param {String} autoflowValue grid-auto-flow value @return {void} @see https://github.com/postcss/autoprefixer/issues/1148
[ "Autoplace", "grid", "items" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L1014-L1058
2,692
showdownjs/showdown
dist/showdown.js
substitutePreCodeTags
function substitutePreCodeTags (doc) { var pres = doc.querySelectorAll('pre'), presPH = []; for (var i = 0; i < pres.length; ++i) { if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') { var content = pres[i].firstChild.innerHTML.trim(), ...
javascript
function substitutePreCodeTags (doc) { var pres = doc.querySelectorAll('pre'), presPH = []; for (var i = 0; i < pres.length; ++i) { if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') { var content = pres[i].firstChild.innerHTML.trim(), ...
[ "function", "substitutePreCodeTags", "(", "doc", ")", "{", "var", "pres", "=", "doc", ".", "querySelectorAll", "(", "'pre'", ")", ",", "presPH", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "pres", ".", "length", ";", "++", ...
find all pre tags and replace contents with placeholder we need this so that we can remove all indentation from html to ease up parsing
[ "find", "all", "pre", "tags", "and", "replace", "contents", "with", "placeholder", "we", "need", "this", "so", "that", "we", "can", "remove", "all", "indentation", "from", "html", "to", "ease", "up", "parsing" ]
33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9
https://github.com/showdownjs/showdown/blob/33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9/dist/showdown.js#L5249-L5284
2,693
firebase/firebase-js-sdk
packages/auth/demo/public/web-worker.js
function() { return new Promise(function(resolve, reject) { firebase.auth().onAuthStateChanged(function(user) { if (user) { user.getIdToken().then(function(idToken) { resolve(idToken); }, function(error) { resolve(null); }); } else { resolve(null); ...
javascript
function() { return new Promise(function(resolve, reject) { firebase.auth().onAuthStateChanged(function(user) { if (user) { user.getIdToken().then(function(idToken) { resolve(idToken); }, function(error) { resolve(null); }); } else { resolve(null); ...
[ "function", "(", ")", "{", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "firebase", ".", "auth", "(", ")", ".", "onAuthStateChanged", "(", "function", "(", "user", ")", "{", "if", "(", "user", ")", "{", "user"...
Returns a promise that resolves with an ID token if available. @return {!Promise<?string>} The promise that resolves with an ID token if available. Otherwise, the promise resolves with null.
[ "Returns", "a", "promise", "that", "resolves", "with", "an", "ID", "token", "if", "available", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/web-worker.js#L36-L52
2,694
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
runTypedoc
function runTypedoc() { const typeSource = apiType === 'node' ? tempNodeSourcePath : sourceFile; const command = `${repoPath}/node_modules/.bin/typedoc ${typeSource} \ --out ${docPath} \ --readme ${tempHomePath} \ --options ${__dirname}/typedoc.js \ --theme ${__dirname}/theme`; console.log('Running comma...
javascript
function runTypedoc() { const typeSource = apiType === 'node' ? tempNodeSourcePath : sourceFile; const command = `${repoPath}/node_modules/.bin/typedoc ${typeSource} \ --out ${docPath} \ --readme ${tempHomePath} \ --options ${__dirname}/typedoc.js \ --theme ${__dirname}/theme`; console.log('Running comma...
[ "function", "runTypedoc", "(", ")", "{", "const", "typeSource", "=", "apiType", "===", "'node'", "?", "tempNodeSourcePath", ":", "sourceFile", ";", "const", "command", "=", "`", "${", "repoPath", "}", "${", "typeSource", "}", "\\\n", "${", "docPath", "}", ...
Runs Typedoc command. Additional config options come from ./typedoc.js
[ "Runs", "Typedoc", "command", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L62-L72
2,695
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
moveFilesToRoot
function moveFilesToRoot(subdir) { return exec(`mv ${docPath}/${subdir}/* ${docPath}`) .then(() => { exec(`rmdir ${docPath}/${subdir}`); }) .catch(e => console.error(e)); }
javascript
function moveFilesToRoot(subdir) { return exec(`mv ${docPath}/${subdir}/* ${docPath}`) .then(() => { exec(`rmdir ${docPath}/${subdir}`); }) .catch(e => console.error(e)); }
[ "function", "moveFilesToRoot", "(", "subdir", ")", "{", "return", "exec", "(", "`", "${", "docPath", "}", "${", "subdir", "}", "${", "docPath", "}", "`", ")", ".", "then", "(", "(", ")", "=>", "{", "exec", "(", "`", "${", "docPath", "}", "${", "s...
Moves files from subdir to root. @param {string} subdir Subdir to move files out of.
[ "Moves", "files", "from", "subdir", "to", "root", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L78-L84
2,696
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
fixLinks
function fixLinks(file) { return fs.readFile(file, 'utf8').then(data => { const flattenedLinks = data .replace(/\.\.\//g, '') .replace(/(modules|interfaces|classes)\//g, ''); let caseFixedLinks = flattenedLinks; for (const lower in lowerToUpperLookup) { const re = new RegExp(lower, 'g');...
javascript
function fixLinks(file) { return fs.readFile(file, 'utf8').then(data => { const flattenedLinks = data .replace(/\.\.\//g, '') .replace(/(modules|interfaces|classes)\//g, ''); let caseFixedLinks = flattenedLinks; for (const lower in lowerToUpperLookup) { const re = new RegExp(lower, 'g');...
[ "function", "fixLinks", "(", "file", ")", "{", "return", "fs", ".", "readFile", "(", "file", ",", "'utf8'", ")", ".", "then", "(", "data", "=>", "{", "const", "flattenedLinks", "=", "data", ".", "replace", "(", "/", "\\.\\.\\/", "/", "g", ",", "''", ...
Reformat links to match flat structure. @param {string} file File to fix links in.
[ "Reformat", "links", "to", "match", "flat", "structure", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L90-L102
2,697
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
generateTempHomeMdFile
function generateTempHomeMdFile(tocRaw, homeRaw) { const { toc } = yaml.safeLoad(tocRaw); let tocPageLines = [homeRaw, '# API Reference']; toc.forEach(group => { tocPageLines.push(`\n## [${group.title}](${stripPath(group.path)}.html)`); group.section.forEach(item => { tocPageLines.push(`- [${item.ti...
javascript
function generateTempHomeMdFile(tocRaw, homeRaw) { const { toc } = yaml.safeLoad(tocRaw); let tocPageLines = [homeRaw, '# API Reference']; toc.forEach(group => { tocPageLines.push(`\n## [${group.title}](${stripPath(group.path)}.html)`); group.section.forEach(item => { tocPageLines.push(`- [${item.ti...
[ "function", "generateTempHomeMdFile", "(", "tocRaw", ",", "homeRaw", ")", "{", "const", "{", "toc", "}", "=", "yaml", ".", "safeLoad", "(", "tocRaw", ")", ";", "let", "tocPageLines", "=", "[", "homeRaw", ",", "'# API Reference'", "]", ";", "toc", ".", "f...
Generates temporary markdown file that will be sourced by Typedoc to create index.html. @param {string} tocRaw @param {string} homeRaw
[ "Generates", "temporary", "markdown", "file", "that", "will", "be", "sourced", "by", "Typedoc", "to", "create", "index", ".", "html", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L113-L123
2,698
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
checkForMissingFilesAndFixFilenameCase
function checkForMissingFilesAndFixFilenameCase() { // Get filenames from toc.yaml. const filenames = tocText .split('\n') .filter(line => line.includes('path:')) .map(line => line.split(devsitePath)[1]); // Logs warning to console if a file from TOC is not found. const fileCheckPromises = filenames...
javascript
function checkForMissingFilesAndFixFilenameCase() { // Get filenames from toc.yaml. const filenames = tocText .split('\n') .filter(line => line.includes('path:')) .map(line => line.split(devsitePath)[1]); // Logs warning to console if a file from TOC is not found. const fileCheckPromises = filenames...
[ "function", "checkForMissingFilesAndFixFilenameCase", "(", ")", "{", "// Get filenames from toc.yaml.", "const", "filenames", "=", "tocText", ".", "split", "(", "'\\n'", ")", ".", "filter", "(", "line", "=>", "line", ".", "includes", "(", "'path:'", ")", ")", "....
Checks to see if any files listed in toc.yaml were not generated. If files exist, fixes filename case to match toc.yaml version.
[ "Checks", "to", "see", "if", "any", "files", "listed", "in", "toc", ".", "yaml", "were", "not", "generated", ".", "If", "files", "exist", "fixes", "filename", "case", "to", "match", "toc", ".", "yaml", "version", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L135-L165
2,699
firebase/firebase-js-sdk
scripts/docgen/generate-docs.js
writeGeneratedFileList
function writeGeneratedFileList(htmlFiles) { const fileList = htmlFiles.map(filename => { return { title: filename, path: `${devsitePath}${filename}` }; }); const generatedTocYAML = yaml.safeDump({ toc: fileList }); return fs .writeFile(`${docPath}/_toc_autogenerated.yaml`, generatedTocY...
javascript
function writeGeneratedFileList(htmlFiles) { const fileList = htmlFiles.map(filename => { return { title: filename, path: `${devsitePath}${filename}` }; }); const generatedTocYAML = yaml.safeDump({ toc: fileList }); return fs .writeFile(`${docPath}/_toc_autogenerated.yaml`, generatedTocY...
[ "function", "writeGeneratedFileList", "(", "htmlFiles", ")", "{", "const", "fileList", "=", "htmlFiles", ".", "map", "(", "filename", "=>", "{", "return", "{", "title", ":", "filename", ",", "path", ":", "`", "${", "devsitePath", "}", "${", "filename", "}"...
Writes a _toc_autogenerated.yaml as a record of all files that were autogenerated. Helpful to tech writers. @param {Array} htmlFiles List of html files found in generated dir.
[ "Writes", "a", "_toc_autogenerated", ".", "yaml", "as", "a", "record", "of", "all", "files", "that", "were", "autogenerated", ".", "Helpful", "to", "tech", "writers", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L218-L229