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
29,900
grasshopper-cms/grasshopper-core-nodejs
docs/js/vendor/flipclock/flipclock.js
function(digit) { var obj = this.createList(digit, { classes: { active: this.factory.classes.active, before: this.factory.classes.before, flip: this.factory.classes.flip } }); obj.$obj.insertBefore(this.factory.lists[0].$obj); this.factory.lists.unshift(obj); }
javascript
function(digit) { var obj = this.createList(digit, { classes: { active: this.factory.classes.active, before: this.factory.classes.before, flip: this.factory.classes.flip } }); obj.$obj.insertBefore(this.factory.lists[0].$obj); this.factory.lists.unshift(obj); }
[ "function", "(", "digit", ")", "{", "var", "obj", "=", "this", ".", "createList", "(", "digit", ",", "{", "classes", ":", "{", "active", ":", "this", ".", "factory", ".", "classes", ".", "active", ",", "before", ":", "this", ".", "factory", ".", "c...
Sets the clock time
[ "Sets", "the", "clock", "time" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/docs/js/vendor/flipclock/flipclock.js#L580-L592
29,901
grasshopper-cms/grasshopper-core-nodejs
docs/js/vendor/flipclock/flipclock.js
function() { var t = this; setTimeout(function() { t.$obj.removeClass(t.factory.classes.play); }, this.factory.timer.interval); }
javascript
function() { var t = this; setTimeout(function() { t.$obj.removeClass(t.factory.classes.play); }, this.factory.timer.interval); }
[ "function", "(", ")", "{", "var", "t", "=", "this", ";", "setTimeout", "(", "function", "(", ")", "{", "t", ".", "$obj", ".", "removeClass", "(", "t", ".", "factory", ".", "classes", ".", "play", ")", ";", "}", ",", "this", ".", "factory", ".", ...
Removes the play class to the DOM object
[ "Removes", "the", "play", "class", "to", "the", "DOM", "object" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/docs/js/vendor/flipclock/flipclock.js#L781-L787
29,902
grasshopper-cms/grasshopper-core-nodejs
lib/db/mongodb/schemas/contentType.js
validateFieldType
function validateFieldType(fieldsCollection){ var err; // ensure fieldsCollection is an array. if(!_.isArray(fieldsCollection)) { err = new Error('content type fields collection must be an array of field objects.'); } if(!err) { _.each(fieldsCollection, ...
javascript
function validateFieldType(fieldsCollection){ var err; // ensure fieldsCollection is an array. if(!_.isArray(fieldsCollection)) { err = new Error('content type fields collection must be an array of field objects.'); } if(!err) { _.each(fieldsCollection, ...
[ "function", "validateFieldType", "(", "fieldsCollection", ")", "{", "var", "err", ";", "// ensure fieldsCollection is an array.", "if", "(", "!", "_", ".", "isArray", "(", "fieldsCollection", ")", ")", "{", "err", "=", "new", "Error", "(", "'content type fields co...
In order to be valid we are checking the following rules 1) Collection must be an instance of an array 2) Does the element in the Collection array have all of the necessary properties 3) Are there any duplicate ids @param value @returns {null}
[ "In", "order", "to", "be", "valid", "we", "are", "checking", "the", "following", "rules", "1", ")", "Collection", "must", "be", "an", "instance", "of", "an", "array", "2", ")", "Does", "the", "element", "in", "the", "Collection", "array", "have", "all", ...
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/lib/db/mongodb/schemas/contentType.js#L70-L85
29,903
grasshopper-cms/grasshopper-core-nodejs
lib/security/providers/twitter.js
_setUserInfoFromSocialAccount
function _setUserInfoFromSocialAccount(){ return db.users.socialAuthentication('twitter', this.socialUserInfo.id_str) .then(function(user){ this.userInfo = user; }.bind(this)) .catch(function(err){ // If user isn't found surpress error. If found and still error th...
javascript
function _setUserInfoFromSocialAccount(){ return db.users.socialAuthentication('twitter', this.socialUserInfo.id_str) .then(function(user){ this.userInfo = user; }.bind(this)) .catch(function(err){ // If user isn't found surpress error. If found and still error th...
[ "function", "_setUserInfoFromSocialAccount", "(", ")", "{", "return", "db", ".", "users", ".", "socialAuthentication", "(", "'twitter'", ",", "this", ".", "socialUserInfo", ".", "id_str", ")", ".", "then", "(", "function", "(", "user", ")", "{", "this", ".",...
Function will look up a user by their social id and then assign it to the userInfo object
[ "Function", "will", "look", "up", "a", "user", "by", "their", "social", "id", "and", "then", "assign", "it", "to", "the", "userInfo", "object" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/lib/security/providers/twitter.js#L48-L58
29,904
grasshopper-cms/grasshopper-core-nodejs
lib/grasshopper.js
function(token){ return { users: require('./runners/users')(token), tokens: require('./runners/tokens')(token), content: require('./runners/content')(token), contentTypes: require('./runners/contentTypes')(token), nodes: require...
javascript
function(token){ return { users: require('./runners/users')(token), tokens: require('./runners/tokens')(token), content: require('./runners/content')(token), contentTypes: require('./runners/contentTypes')(token), nodes: require...
[ "function", "(", "token", ")", "{", "return", "{", "users", ":", "require", "(", "'./runners/users'", ")", "(", "token", ")", ",", "tokens", ":", "require", "(", "'./runners/tokens'", ")", "(", "token", ")", ",", "content", ":", "require", "(", "'./runne...
The grasshopper request function will return back an object that can execute calls to the system. If you are making an authenticated call then you should send in your token. If you are making a public call then don't pass in an argument. @param token @returns {{users: *, tokens: *, content: *, contentTypes: *, nodes: *...
[ "The", "grasshopper", "request", "function", "will", "return", "back", "an", "object", "that", "can", "execute", "calls", "to", "the", "system", ".", "If", "you", "are", "making", "an", "authenticated", "call", "then", "you", "should", "send", "in", "your", ...
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/lib/grasshopper.js#L57-L67
29,905
EasyGraphQL/easygraphql-parser
lib/schemaParser.js
findType
function findType (node, typeInfo, nestedCall) { typeInfo = typeInfo || { noNull: false, isArray: false, noNullArrayValues: false } if (!node) { return typeInfo } // Validate nested call, the parser will check first if the array can be null // then it will check if the values inside can be null if (!ne...
javascript
function findType (node, typeInfo, nestedCall) { typeInfo = typeInfo || { noNull: false, isArray: false, noNullArrayValues: false } if (!node) { return typeInfo } // Validate nested call, the parser will check first if the array can be null // then it will check if the values inside can be null if (!ne...
[ "function", "findType", "(", "node", ",", "typeInfo", ",", "nestedCall", ")", "{", "typeInfo", "=", "typeInfo", "||", "{", "noNull", ":", "false", ",", "isArray", ":", "false", ",", "noNullArrayValues", ":", "false", "}", "if", "(", "!", "node", ")", "...
Find the type of a field on the Schema @param node - The graph schema @param typeInfo - The object with the recursive values @returns {{type: String, noNull: Boolean, isArray: Boolean}}
[ "Find", "the", "type", "of", "a", "field", "on", "the", "Schema" ]
6425e9a68647a90602e0eda7728ae0929c4f8539
https://github.com/EasyGraphQL/easygraphql-parser/blob/6425e9a68647a90602e0eda7728ae0929c4f8539/lib/schemaParser.js#L79-L105
29,906
EasyGraphQL/easygraphql-parser
lib/schemaParser.js
findArguments
function findArguments (node) { if (!node) { return [] } return node.map(arg => { const name = arg.name.value const fieldType = findType(arg.type) const isDeprecated = validateIfDeprecated(arg.directives) return Object.assign({ name, isDeprecated }, fieldType) }) }
javascript
function findArguments (node) { if (!node) { return [] } return node.map(arg => { const name = arg.name.value const fieldType = findType(arg.type) const isDeprecated = validateIfDeprecated(arg.directives) return Object.assign({ name, isDeprecated }, fieldType) }) }
[ "function", "findArguments", "(", "node", ")", "{", "if", "(", "!", "node", ")", "{", "return", "[", "]", "}", "return", "node", ".", "map", "(", "arg", "=>", "{", "const", "name", "=", "arg", ".", "name", ".", "value", "const", "fieldType", "=", ...
Find the arguments that are used on the Schema @param node - The graph schema @returns {[{name: String, noNull: Boolean, isArray: Boolean, type: String}]}
[ "Find", "the", "arguments", "that", "are", "used", "on", "the", "Schema" ]
6425e9a68647a90602e0eda7728ae0929c4f8539
https://github.com/EasyGraphQL/easygraphql-parser/blob/6425e9a68647a90602e0eda7728ae0929c4f8539/lib/schemaParser.js#L112-L124
29,907
EasyGraphQL/easygraphql-parser
lib/schemaParser.js
validateIfDeprecated
function validateIfDeprecated (directives) { if (!directives.length) { return false } return directives.some(directive => directive.name.value === 'deprecated') }
javascript
function validateIfDeprecated (directives) { if (!directives.length) { return false } return directives.some(directive => directive.name.value === 'deprecated') }
[ "function", "validateIfDeprecated", "(", "directives", ")", "{", "if", "(", "!", "directives", ".", "length", ")", "{", "return", "false", "}", "return", "directives", ".", "some", "(", "directive", "=>", "directive", ".", "name", ".", "value", "===", "'de...
Check if a field is deprecated @param directives - Receive the directives array @returns {boolean}
[ "Check", "if", "a", "field", "is", "deprecated" ]
6425e9a68647a90602e0eda7728ae0929c4f8539
https://github.com/EasyGraphQL/easygraphql-parser/blob/6425e9a68647a90602e0eda7728ae0929c4f8539/lib/schemaParser.js#L131-L137
29,908
aureooms/js-itertools
lib/reduce/min.js
min
function min(compare, iterable, dflt = undefined) { let iterator = (0, _iter.iter)(iterable); let first = iterator.next(); if (first.done) return dflt; let smallest = first.value; for (let candidate of iterator) { if (compare(candidate, smallest) < 0) { smallest = candidate; } } retu...
javascript
function min(compare, iterable, dflt = undefined) { let iterator = (0, _iter.iter)(iterable); let first = iterator.next(); if (first.done) return dflt; let smallest = first.value; for (let candidate of iterator) { if (compare(candidate, smallest) < 0) { smallest = candidate; } } retu...
[ "function", "min", "(", "compare", ",", "iterable", ",", "dflt", "=", "undefined", ")", "{", "let", "iterator", "=", "(", "0", ",", "_iter", ".", "iter", ")", "(", "iterable", ")", ";", "let", "first", "=", "iterator", ".", "next", "(", ")", ";", ...
Returns the smallest element of the input iterable according to some comparison function. @example min( ( a , b ) => a - b , range( 10 ) ) ; // returns 0 @example min( ( a , b ) => a - b , range( 0 ) ) ; // returns undefined @param {Function} compare - The comparison function to use. This function must be 2-ary. It ...
[ "Returns", "the", "smallest", "element", "of", "the", "input", "iterable", "according", "to", "some", "comparison", "function", "." ]
72bafa5f3f957ceb37bdfa87a222364fe4974be3
https://github.com/aureooms/js-itertools/blob/72bafa5f3f957ceb37bdfa87a222364fe4974be3/lib/reduce/min.js#L30-L49
29,909
syntax-tree/mdast-util-to-nlcst
index.js
toNLCST
function toNLCST(tree, file, Parser, options) { var settings = options || {} var parser // Warn for invalid parameters. if (!tree || !tree.type) { throw new Error('mdast-util-to-nlcst expected node') } if (!file || !file.messages) { throw new Error('mdast-util-to-nlcst expected file') } // Co...
javascript
function toNLCST(tree, file, Parser, options) { var settings = options || {} var parser // Warn for invalid parameters. if (!tree || !tree.type) { throw new Error('mdast-util-to-nlcst expected node') } if (!file || !file.messages) { throw new Error('mdast-util-to-nlcst expected file') } // Co...
[ "function", "toNLCST", "(", "tree", ",", "file", ",", "Parser", ",", "options", ")", "{", "var", "settings", "=", "options", "||", "{", "}", "var", "parser", "// Warn for invalid parameters.", "if", "(", "!", "tree", "||", "!", "tree", ".", "type", ")", ...
Transform `tree` into `nlcst`.
[ "Transform", "tree", "into", "nlcst", "." ]
a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0
https://github.com/syntax-tree/mdast-util-to-nlcst/blob/a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0/index.js#L17-L60
29,910
syntax-tree/mdast-util-to-nlcst
index.js
one
function one(config, node) { var offset = config.location.toOffset var parser = config.parser var doc = config.doc var type = node.type var start = offset(position.start(node)) var end = offset(position.end(node)) if (config.ignore.indexOf(type) === -1) { if (config.source.indexOf(type) !== -1) { ...
javascript
function one(config, node) { var offset = config.location.toOffset var parser = config.parser var doc = config.doc var type = node.type var start = offset(position.start(node)) var end = offset(position.end(node)) if (config.ignore.indexOf(type) === -1) { if (config.source.indexOf(type) !== -1) { ...
[ "function", "one", "(", "config", ",", "node", ")", "{", "var", "offset", "=", "config", ".", "location", ".", "toOffset", "var", "parser", "=", "config", ".", "parser", "var", "doc", "=", "config", ".", "doc", "var", "type", "=", "node", ".", "type"...
Convert `node` into NLCST.
[ "Convert", "node", "into", "NLCST", "." ]
a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0
https://github.com/syntax-tree/mdast-util-to-nlcst/blob/a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0/index.js#L63-L98
29,911
syntax-tree/mdast-util-to-nlcst
index.js
patch
function patch(config, nodes, offset) { var position = config.location.toPosition var length = nodes.length var index = -1 var start = offset var children var node var end while (++index < length) { node = nodes[index] children = node.children if (children) { patch(config, children, ...
javascript
function patch(config, nodes, offset) { var position = config.location.toPosition var length = nodes.length var index = -1 var start = offset var children var node var end while (++index < length) { node = nodes[index] children = node.children if (children) { patch(config, children, ...
[ "function", "patch", "(", "config", ",", "nodes", ",", "offset", ")", "{", "var", "position", "=", "config", ".", "location", ".", "toPosition", "var", "length", "=", "nodes", ".", "length", "var", "index", "=", "-", "1", "var", "start", "=", "offset",...
Patch a position on each node in `nodes`. `offset` is the offset in `file` this run of content starts at.
[ "Patch", "a", "position", "on", "each", "node", "in", "nodes", ".", "offset", "is", "the", "offset", "in", "file", "this", "run", "of", "content", "starts", "at", "." ]
a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0
https://github.com/syntax-tree/mdast-util-to-nlcst/blob/a827720d2e5d4f53aa44cc3a3231e4431b4ad4e0/index.js#L147-L172
29,912
aureooms/js-itertools
lib/reduce/reduce.js
reduce
function reduce(accumulator, iterable, initializer = undefined) { if (initializer === undefined) { const iterator = (0, _iter.iter)(iterable); const first = iterator.next(); if (first.done) { return undefined; } return (0, _reduce2._reduce)(accumulator, iterator, first.value); } retu...
javascript
function reduce(accumulator, iterable, initializer = undefined) { if (initializer === undefined) { const iterator = (0, _iter.iter)(iterable); const first = iterator.next(); if (first.done) { return undefined; } return (0, _reduce2._reduce)(accumulator, iterator, first.value); } retu...
[ "function", "reduce", "(", "accumulator", ",", "iterable", ",", "initializer", "=", "undefined", ")", "{", "if", "(", "initializer", "===", "undefined", ")", "{", "const", "iterator", "=", "(", "0", ",", "_iter", ".", "iter", ")", "(", "iterable", ")", ...
Applies the accumulator function iteratively on the last return value of the accumulator and the next value in the input iterable. The initial value is the initializer parameter. If no initial value is given, the first element of the input iterable is used. @example _reduce( ( x , y ) => x + y , range( 10 ) , 0 ) ; //...
[ "Applies", "the", "accumulator", "function", "iteratively", "on", "the", "last", "return", "value", "of", "the", "accumulator", "and", "the", "next", "value", "in", "the", "input", "iterable", ".", "The", "initial", "value", "is", "the", "initializer", "parame...
72bafa5f3f957ceb37bdfa87a222364fe4974be3
https://github.com/aureooms/js-itertools/blob/72bafa5f3f957ceb37bdfa87a222364fe4974be3/lib/reduce/reduce.js#L29-L43
29,913
stealjs/steal-npm
npm-extension.js
function(loader, name){ var pkg = utils.pkg.findByName(loader, name.split("/")[0]); if(pkg) { var parsed = utils.moduleName.parse(name, pkg.name); parsed.version = pkg.version; if(!parsed.modulePath) { parsed.modulePath = utils.pkg.main(pkg); } return utils.moduleName.create(parsed); } return...
javascript
function(loader, name){ var pkg = utils.pkg.findByName(loader, name.split("/")[0]); if(pkg) { var parsed = utils.moduleName.parse(name, pkg.name); parsed.version = pkg.version; if(!parsed.modulePath) { parsed.modulePath = utils.pkg.main(pkg); } return utils.moduleName.create(parsed); } return...
[ "function", "(", "loader", ",", "name", ")", "{", "var", "pkg", "=", "utils", ".", "pkg", ".", "findByName", "(", "loader", ",", "name", ".", "split", "(", "\"/\"", ")", "[", "0", "]", ")", ";", "if", "(", "pkg", ")", "{", "var", "parsed", "=",...
Given a moduleName convert it into a npm-style moduleName if it belongs to a package.
[ "Given", "a", "moduleName", "convert", "it", "into", "a", "npm", "-", "style", "moduleName", "if", "it", "belongs", "to", "a", "package", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-extension.js#L329-L340
29,914
apostrophecms-legacy/apostrophe-pages
public/js/editor.js
function(callback) { var page = apos.data.aposPages.page; var _id = page._id; $.get('/apos-pages/info', { _id: _id }, function(data) { var newPathname = data.slug.replace(/^\/\//, '/'); apos.redirect(newPathname); }).error(function() { // If th...
javascript
function(callback) { var page = apos.data.aposPages.page; var _id = page._id; $.get('/apos-pages/info', { _id: _id }, function(data) { var newPathname = data.slug.replace(/^\/\//, '/'); apos.redirect(newPathname); }).error(function() { // If th...
[ "function", "(", "callback", ")", "{", "var", "page", "=", "apos", ".", "data", ".", "aposPages", ".", "page", ";", "var", "_id", "=", "page", ".", "_id", ";", "$", ".", "get", "(", "'/apos-pages/info'", ",", "{", "_id", ":", "_id", "}", ",", "fu...
After a reorg the page URL may have changed, be prepared to navigate there or to the home page or just refresh to reflect possible new tabs
[ "After", "a", "reorg", "the", "page", "URL", "may", "have", "changed", "be", "prepared", "to", "navigate", "there", "or", "to", "the", "home", "page", "or", "just", "refresh", "to", "reflect", "possible", "new", "tabs" ]
72eb4b1df351b1c253e9b1c2bd2fe3fff6eb71b3
https://github.com/apostrophecms-legacy/apostrophe-pages/blob/72eb4b1df351b1c253e9b1c2bd2fe3fff6eb71b3/public/js/editor.js#L546-L556
29,915
thinkjs/think-loader
loader/bootstrap.js
loadBootstrap
function loadBootstrap(appPath, modules, type = 'worker') { let bootstrapPath = ''; if (modules.length) { bootstrapPath = path.join(appPath, 'common/bootstrap'); } else { bootstrapPath = path.join(appPath, 'bootstrap'); } const filepath = path.join(bootstrapPath, `${type}.js`); if (helper.isFile(fil...
javascript
function loadBootstrap(appPath, modules, type = 'worker') { let bootstrapPath = ''; if (modules.length) { bootstrapPath = path.join(appPath, 'common/bootstrap'); } else { bootstrapPath = path.join(appPath, 'bootstrap'); } const filepath = path.join(bootstrapPath, `${type}.js`); if (helper.isFile(fil...
[ "function", "loadBootstrap", "(", "appPath", ",", "modules", ",", "type", "=", "'worker'", ")", "{", "let", "bootstrapPath", "=", "''", ";", "if", "(", "modules", ".", "length", ")", "{", "bootstrapPath", "=", "path", ".", "join", "(", "appPath", ",", ...
load bootstrap files
[ "load", "bootstrap", "files" ]
680ab3dfd38c3a926b6bd5a026b78a0095cd39f6
https://github.com/thinkjs/think-loader/blob/680ab3dfd38c3a926b6bd5a026b78a0095cd39f6/loader/bootstrap.js#L8-L20
29,916
unbalanced/grunt-simple-watch
tasks/simple_watch.js
fileChanged
function fileChanged(status, filepath) { // If file was deleted and then re-added, consider it changed. if (changedFiles[filepath] === 'deleted' && status === 'added') { status = 'changed'; } // Keep track of changed status for later. changedFiles[filepath] = status; // Emit watch events if anyone...
javascript
function fileChanged(status, filepath) { // If file was deleted and then re-added, consider it changed. if (changedFiles[filepath] === 'deleted' && status === 'added') { status = 'changed'; } // Keep track of changed status for later. changedFiles[filepath] = status; // Emit watch events if anyone...
[ "function", "fileChanged", "(", "status", ",", "filepath", ")", "{", "// If file was deleted and then re-added, consider it changed.", "if", "(", "changedFiles", "[", "filepath", "]", "===", "'deleted'", "&&", "status", "===", "'added'", ")", "{", "status", "=", "'c...
Handle file changes.
[ "Handle", "file", "changes", "." ]
893ef26b3cb4955d338723196315e6b6be55d7d1
https://github.com/unbalanced/grunt-simple-watch/blob/893ef26b3cb4955d338723196315e6b6be55d7d1/tasks/simple_watch.js#L112-L135
29,917
unbalanced/grunt-simple-watch
tasks/simple_watch.js
watchFile
function watchFile(filepath) { if (!watchedFiles[filepath]) { // add a new file to watched files var statStructure = null; try { statStructure = fs.statSync(filepath); } catch (e) { // StatSync can throw an error if the file has dissapeared in between return; } watchedFiles[filepat...
javascript
function watchFile(filepath) { if (!watchedFiles[filepath]) { // add a new file to watched files var statStructure = null; try { statStructure = fs.statSync(filepath); } catch (e) { // StatSync can throw an error if the file has dissapeared in between return; } watchedFiles[filepat...
[ "function", "watchFile", "(", "filepath", ")", "{", "if", "(", "!", "watchedFiles", "[", "filepath", "]", ")", "{", "// add a new file to watched files", "var", "statStructure", "=", "null", ";", "try", "{", "statStructure", "=", "fs", ".", "statSync", "(", ...
Watch a file.
[ "Watch", "a", "file", "." ]
893ef26b3cb4955d338723196315e6b6be55d7d1
https://github.com/unbalanced/grunt-simple-watch/blob/893ef26b3cb4955d338723196315e6b6be55d7d1/tasks/simple_watch.js#L138-L151
29,918
grasshopper-cms/grasshopper-core-nodejs
docs/js/vendor/imagesloaded.js
makeArray
function makeArray( obj ) { var ary = []; if ( isArray( obj ) ) { // use object if already an array ary = obj; } else if ( typeof obj.length === 'number' ) { // convert nodeList to array for ( var i=0, len = obj.length; i < len; i++ ) { ary.push( obj[i] ); } } else { // array of si...
javascript
function makeArray( obj ) { var ary = []; if ( isArray( obj ) ) { // use object if already an array ary = obj; } else if ( typeof obj.length === 'number' ) { // convert nodeList to array for ( var i=0, len = obj.length; i < len; i++ ) { ary.push( obj[i] ); } } else { // array of si...
[ "function", "makeArray", "(", "obj", ")", "{", "var", "ary", "=", "[", "]", ";", "if", "(", "isArray", "(", "obj", ")", ")", "{", "// use object if already an array", "ary", "=", "obj", ";", "}", "else", "if", "(", "typeof", "obj", ".", "length", "==...
turn element or nodeList into an array
[ "turn", "element", "or", "nodeList", "into", "an", "array" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/docs/js/vendor/imagesloaded.js#L589-L604
29,919
stealjs/steal-npm
npm-crawl.js
function(context, pkg, source) { source = source || "{}"; var packageJSON = JSON.parse(source); utils.extend(pkg, packageJSON); context.packages.push(pkg); return pkg; }
javascript
function(context, pkg, source) { source = source || "{}"; var packageJSON = JSON.parse(source); utils.extend(pkg, packageJSON); context.packages.push(pkg); return pkg; }
[ "function", "(", "context", ",", "pkg", ",", "source", ")", "{", "source", "=", "source", "||", "\"{}\"", ";", "var", "packageJSON", "=", "JSON", ".", "parse", "(", "source", ")", ";", "utils", ".", "extend", "(", "pkg", ",", "packageJSON", ")", ";",...
Adds the properties read from a package's source to the `pkg` object. @param {Object} context @param {NpmPackage} pkg - @param {String} source @return {NpmPackage}
[ "Adds", "the", "properties", "read", "from", "a", "package", "s", "source", "to", "the", "pkg", "object", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L17-L23
29,920
stealjs/steal-npm
npm-crawl.js
function(context, pkg){ var deps = crawl.getDependencyMap(context.loader, pkg, true); var pluginsPromise = crawl.loadPlugins(context, pkg, true, deps, true); var stealPromise = crawl.loadSteal(context, pkg, true, deps); return Promise.all([pluginsPromise, stealPromise]); }
javascript
function(context, pkg){ var deps = crawl.getDependencyMap(context.loader, pkg, true); var pluginsPromise = crawl.loadPlugins(context, pkg, true, deps, true); var stealPromise = crawl.loadSteal(context, pkg, true, deps); return Promise.all([pluginsPromise, stealPromise]); }
[ "function", "(", "context", ",", "pkg", ")", "{", "var", "deps", "=", "crawl", ".", "getDependencyMap", "(", "context", ".", "loader", ",", "pkg", ",", "true", ")", ";", "var", "pluginsPromise", "=", "crawl", ".", "loadPlugins", "(", "context", ",", "p...
Crawl from the root, only fetching Steal and its dependencies so that Node built-ins are autoconfigured.
[ "Crawl", "from", "the", "root", "only", "fetching", "Steal", "and", "its", "dependencies", "so", "that", "Node", "built", "-", "ins", "are", "autoconfigured", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L28-L35
29,921
stealjs/steal-npm
npm-crawl.js
function(context, pkg, isRoot) { var deps = crawl.getDependencies(context.loader, pkg, isRoot); return Promise.all(utils.filter(utils.map(deps, function(childPkg){ return crawl.fetchDep(context, pkg, childPkg, isRoot); }), truthy)).then(function(packages){ // at this point all dependencies of pkg have bee...
javascript
function(context, pkg, isRoot) { var deps = crawl.getDependencies(context.loader, pkg, isRoot); return Promise.all(utils.filter(utils.map(deps, function(childPkg){ return crawl.fetchDep(context, pkg, childPkg, isRoot); }), truthy)).then(function(packages){ // at this point all dependencies of pkg have bee...
[ "function", "(", "context", ",", "pkg", ",", "isRoot", ")", "{", "var", "deps", "=", "crawl", ".", "getDependencies", "(", "context", ".", "loader", ",", "pkg", ",", "isRoot", ")", ";", "return", "Promise", ".", "all", "(", "utils", ".", "filter", "(...
Crawls the packages dependencies @param {Object} context @param {NpmPackage} pkg @param {Boolean} [isRoot] If the root module's dependencies should be crawled. @return {Promise} A promise when all packages have been loaded
[ "Crawls", "the", "packages", "dependencies" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L43-L60
29,922
stealjs/steal-npm
npm-crawl.js
function(context, parentPkg, childPkg, isRoot){ var pkg = parentPkg; var isFlat = context.isFlatFileStructure; // if a peer dependency, and not isRoot if(childPkg._isPeerDependency && !isRoot ) { // check one node_module level higher childPkg.origFileUrl = nodeModuleAddress(pkg.fileUrl)+"/"+childPkg.name...
javascript
function(context, parentPkg, childPkg, isRoot){ var pkg = parentPkg; var isFlat = context.isFlatFileStructure; // if a peer dependency, and not isRoot if(childPkg._isPeerDependency && !isRoot ) { // check one node_module level higher childPkg.origFileUrl = nodeModuleAddress(pkg.fileUrl)+"/"+childPkg.name...
[ "function", "(", "context", ",", "parentPkg", ",", "childPkg", ",", "isRoot", ")", "{", "var", "pkg", "=", "parentPkg", ";", "var", "isFlat", "=", "context", ".", "isFlatFileStructure", ";", "// if a peer dependency, and not isRoot", "if", "(", "childPkg", ".", ...
Fetch a particular package.json dependency @param {Object} context @param {NpmPackage} parentPkg @param {NpmPackage} childPkg @param {Boolean} [isRoot] If the root module's dependencies shoudl be crawled. @return {Promise} A promise when the package has loaded
[ "Fetch", "a", "particular", "package", ".", "json", "dependency" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L129-L167
29,923
stealjs/steal-npm
npm-crawl.js
function(context, pkg, isRoot, deps){ var stealPkg = utils.filter(deps, function(dep){ return dep && dep.name === "steal"; })[0]; if(stealPkg) { return crawl.fetchDep(context, pkg, stealPkg, isRoot) .then(function(childPkg){ if(childPkg) { return crawl.deps(context, childPkg); } });...
javascript
function(context, pkg, isRoot, deps){ var stealPkg = utils.filter(deps, function(dep){ return dep && dep.name === "steal"; })[0]; if(stealPkg) { return crawl.fetchDep(context, pkg, stealPkg, isRoot) .then(function(childPkg){ if(childPkg) { return crawl.deps(context, childPkg); } });...
[ "function", "(", "context", ",", "pkg", ",", "isRoot", ",", "deps", ")", "{", "var", "stealPkg", "=", "utils", ".", "filter", "(", "deps", ",", "function", "(", "dep", ")", "{", "return", "dep", "&&", "dep", ".", "name", "===", "\"steal\"", ";", "}...
Load steal and its dependencies, if needed
[ "Load", "steal", "and", "its", "dependencies", "if", "needed" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L183-L198
29,924
stealjs/steal-npm
npm-crawl.js
function(loader, packageJSON, isRoot){ var deps = crawl.getDependencyMap(loader, packageJSON, isRoot); var dependencies = []; for(var name in deps) { dependencies.push(deps[name]); } return dependencies; }
javascript
function(loader, packageJSON, isRoot){ var deps = crawl.getDependencyMap(loader, packageJSON, isRoot); var dependencies = []; for(var name in deps) { dependencies.push(deps[name]); } return dependencies; }
[ "function", "(", "loader", ",", "packageJSON", ",", "isRoot", ")", "{", "var", "deps", "=", "crawl", ".", "getDependencyMap", "(", "loader", ",", "packageJSON", ",", "isRoot", ")", ";", "var", "dependencies", "=", "[", "]", ";", "for", "(", "var", "nam...
Returns an array of the dependency names that should be crawled. @param {Object} loader @param {NpmPackage} packageJSON @param {Boolean} [isRoot] @return {Array<String>}
[ "Returns", "an", "array", "of", "the", "dependency", "names", "that", "should", "be", "crawled", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L206-L215
29,925
stealjs/steal-npm
npm-crawl.js
function(loader, packageJSON, isRoot){ var config = utils.pkg.config(packageJSON); var hasConfig = !!config; // convert npmIgnore var npmIgnore = hasConfig && config.npmIgnore; function convertToMap(arr) { var npmMap = {}; for(var i = 0; i < arr.length; i++) { npmMap[arr[i]] = true; } return ...
javascript
function(loader, packageJSON, isRoot){ var config = utils.pkg.config(packageJSON); var hasConfig = !!config; // convert npmIgnore var npmIgnore = hasConfig && config.npmIgnore; function convertToMap(arr) { var npmMap = {}; for(var i = 0; i < arr.length; i++) { npmMap[arr[i]] = true; } return ...
[ "function", "(", "loader", ",", "packageJSON", ",", "isRoot", ")", "{", "var", "config", "=", "utils", ".", "pkg", ".", "config", "(", "packageJSON", ")", ";", "var", "hasConfig", "=", "!", "!", "config", ";", "// convert npmIgnore", "var", "npmIgnore", ...
Returns a map of the dependencies and their ranges. @param {Object} loader @param {Object} packageJSON @param {Boolean} isRoot @return {Object<String,Range>} A map of dependency names and requested version ranges.
[ "Returns", "a", "map", "of", "the", "dependencies", "and", "their", "ranges", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L223-L259
29,926
stealjs/steal-npm
npm-crawl.js
function(context, childPkg){ var curAddress = childPkg.origFileUrl; var parentAddress = utils.path.parentNodeModuleAddress(childPkg.origFileUrl); while(parentAddress) { var packageAddress = parentAddress+"/"+childPkg.name+"/package.json"; var parentPkg = context.paths[packageAddress]; if(parentPkg && Sem...
javascript
function(context, childPkg){ var curAddress = childPkg.origFileUrl; var parentAddress = utils.path.parentNodeModuleAddress(childPkg.origFileUrl); while(parentAddress) { var packageAddress = parentAddress+"/"+childPkg.name+"/package.json"; var parentPkg = context.paths[packageAddress]; if(parentPkg && Sem...
[ "function", "(", "context", ",", "childPkg", ")", "{", "var", "curAddress", "=", "childPkg", ".", "origFileUrl", ";", "var", "parentAddress", "=", "utils", ".", "path", ".", "parentNodeModuleAddress", "(", "childPkg", ".", "origFileUrl", ")", ";", "while", "...
Walk up the parent addresses until you run into the root or a conflicting package and return that as the address.
[ "Walk", "up", "the", "parent", "addresses", "until", "you", "run", "into", "the", "root", "or", "a", "conflicting", "package", "and", "return", "that", "as", "the", "address", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L327-L344
29,927
stealjs/steal-npm
npm-crawl.js
function(pkg){ var pkg = pkg || this.getPackage(); var requestedVersion = this.requestedVersion; return SemVer.validRange(requestedVersion) && SemVer.valid(pkg.version) ? SemVer.satisfies(pkg.version, requestedVersion) : true; }
javascript
function(pkg){ var pkg = pkg || this.getPackage(); var requestedVersion = this.requestedVersion; return SemVer.validRange(requestedVersion) && SemVer.valid(pkg.version) ? SemVer.satisfies(pkg.version, requestedVersion) : true; }
[ "function", "(", "pkg", ")", "{", "var", "pkg", "=", "pkg", "||", "this", ".", "getPackage", "(", ")", ";", "var", "requestedVersion", "=", "this", ".", "requestedVersion", ";", "return", "SemVer", ".", "validRange", "(", "requestedVersion", ")", "&&", "...
Is the package fetched from this task a compatible version?
[ "Is", "the", "package", "fetched", "from", "this", "task", "a", "compatible", "version?" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L523-L530
29,928
stealjs/steal-npm
npm-crawl.js
function(){ // If a task is currently loading this fileUrl, // wait for it to complete var loadingTask = this.context.loadingPaths[this.fileUrl]; if (!loadingTask) return; var task = this; return loadingTask.promise.then(function() { task._fetchedPackage = loadingTask.getPackage(); var firstTaskFail...
javascript
function(){ // If a task is currently loading this fileUrl, // wait for it to complete var loadingTask = this.context.loadingPaths[this.fileUrl]; if (!loadingTask) return; var task = this; return loadingTask.promise.then(function() { task._fetchedPackage = loadingTask.getPackage(); var firstTaskFail...
[ "function", "(", ")", "{", "// If a task is currently loading this fileUrl,", "// wait for it to complete", "var", "loadingTask", "=", "this", ".", "context", ".", "loadingPaths", "[", "this", ".", "fileUrl", "]", ";", "if", "(", "!", "loadingTask", ")", "return", ...
Handle the case where this fileUrl is already loading
[ "Handle", "the", "case", "where", "this", "fileUrl", "is", "already", "loading" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L555-L590
29,929
stealjs/steal-npm
npm-crawl.js
function(){ // If it is already loaded check to see if it's semver compatible // and if so use it. Otherwise reject. var loadedPkg = this.context.paths[this.fileUrl]; if(loadedPkg) { this._fetchedPackage = loadedPkg; if(!this.isCompatibleVersion()) { this.failed = true; } return Promise.resolve(...
javascript
function(){ // If it is already loaded check to see if it's semver compatible // and if so use it. Otherwise reject. var loadedPkg = this.context.paths[this.fileUrl]; if(loadedPkg) { this._fetchedPackage = loadedPkg; if(!this.isCompatibleVersion()) { this.failed = true; } return Promise.resolve(...
[ "function", "(", ")", "{", "// If it is already loaded check to see if it's semver compatible", "// and if so use it. Otherwise reject.", "var", "loadedPkg", "=", "this", ".", "context", ".", "paths", "[", "this", ".", "fileUrl", "]", ";", "if", "(", "loadedPkg", ")", ...
Handle the case where this fileUrl has already loaded.
[ "Handle", "the", "case", "where", "this", "fileUrl", "has", "already", "loaded", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L595-L606
29,930
stealjs/steal-npm
npm-crawl.js
function(){ var pkg = utils.extend({}, this.orig); var isFlat = this.context.isFlatFileStructure; var fileUrl = this.pkg.fileUrl; var context = this.context; if(isFlat && !pkg.__crawledNestedPosition) { pkg.__crawledNestedPosition = true; pkg.nextFileUrl = pkg.nestedFileUrl; } else { // make su...
javascript
function(){ var pkg = utils.extend({}, this.orig); var isFlat = this.context.isFlatFileStructure; var fileUrl = this.pkg.fileUrl; var context = this.context; if(isFlat && !pkg.__crawledNestedPosition) { pkg.__crawledNestedPosition = true; pkg.nextFileUrl = pkg.nestedFileUrl; } else { // make su...
[ "function", "(", ")", "{", "var", "pkg", "=", "utils", ".", "extend", "(", "{", "}", ",", "this", ".", "orig", ")", ";", "var", "isFlat", "=", "this", ".", "context", ".", "isFlatFileStructure", ";", "var", "fileUrl", "=", "this", ".", "pkg", ".", ...
Get the next package to look up by traversing up the node_modules. Create a new pkg by extending the existing one
[ "Get", "the", "next", "package", "to", "look", "up", "by", "traversing", "up", "the", "node_modules", ".", "Create", "a", "new", "pkg", "by", "extending", "the", "existing", "one" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L612-L636
29,931
stealjs/steal-npm
npm-crawl.js
npmLoad
function npmLoad(context, pkg){ var task = new FetchTask(context, pkg); return task.load().then(function(){ if(task.failed) { // Recurse. Calling task.next gives us a new pkg object // with the fileUrl being the parent node_modules folder. return npmLoad(context, task.next()); } return task.getPackage...
javascript
function npmLoad(context, pkg){ var task = new FetchTask(context, pkg); return task.load().then(function(){ if(task.failed) { // Recurse. Calling task.next gives us a new pkg object // with the fileUrl being the parent node_modules folder. return npmLoad(context, task.next()); } return task.getPackage...
[ "function", "npmLoad", "(", "context", ",", "pkg", ")", "{", "var", "task", "=", "new", "FetchTask", "(", "context", ",", "pkg", ")", ";", "return", "task", ".", "load", "(", ")", ".", "then", "(", "function", "(", ")", "{", "if", "(", "task", "....
Loads package.json if it finds one, it sets that package in paths so it won't be loaded twice.
[ "Loads", "package", ".", "json", "if", "it", "finds", "one", "it", "sets", "that", "package", "in", "paths", "so", "it", "won", "t", "be", "loaded", "twice", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-crawl.js#L644-L655
29,932
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svgtransformlist.js
transformToString
function transformToString(xform) { var m = xform.matrix, text = ''; switch(xform.type) { case 1: // MATRIX text = 'matrix(' + [m.a, m.b, m.c, m.d, m.e, m.f].join(',') + ')'; break; case 2: // TRANSLATE text = 'translate(' + m.e + ',' + m.f + ')'; break; case 3: // SCALE if (m.a == m.d) {text =...
javascript
function transformToString(xform) { var m = xform.matrix, text = ''; switch(xform.type) { case 1: // MATRIX text = 'matrix(' + [m.a, m.b, m.c, m.d, m.e, m.f].join(',') + ')'; break; case 2: // TRANSLATE text = 'translate(' + m.e + ',' + m.f + ')'; break; case 3: // SCALE if (m.a == m.d) {text =...
[ "function", "transformToString", "(", "xform", ")", "{", "var", "m", "=", "xform", ".", "matrix", ",", "text", "=", "''", ";", "switch", "(", "xform", ".", "type", ")", "{", "case", "1", ":", "// MATRIX", "text", "=", "'matrix('", "+", "[", "m", "....
Helper function.
[ "Helper", "function", "." ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svgtransformlist.js#L24-L50
29,933
grasshopper-cms/grasshopper-core-nodejs
lib/middleware/users/validate.js
basicIdentityIsSet
function basicIdentityIsSet(){ return _.has(user, 'identities') && _.has(user.identities, 'basic') && !_.isEmpty(user.identities.basic); }
javascript
function basicIdentityIsSet(){ return _.has(user, 'identities') && _.has(user.identities, 'basic') && !_.isEmpty(user.identities.basic); }
[ "function", "basicIdentityIsSet", "(", ")", "{", "return", "_", ".", "has", "(", "user", ",", "'identities'", ")", "&&", "_", ".", "has", "(", "user", ".", "identities", ",", "'basic'", ")", "&&", "!", "_", ".", "isEmpty", "(", "user", ".", "identiti...
Function that returns is the user.identities.basic property has been set to a value.
[ "Function", "that", "returns", "is", "the", "user", ".", "identities", ".", "basic", "property", "has", "been", "set", "to", "a", "value", "." ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/lib/middleware/users/validate.js#L80-L82
29,934
prscX/pod-installer
index.js
exists
function exists(cmd) { return run(`which ${cmd}`).then(stdout => { if (stdout.trim().length === 0) { // maybe an empty command was supplied? // are we running on Windows?? return Promise.reject(new Error("No output")); } const rNotFound = /^[\w\-]+ not found/g; if (rNotFound.test(c...
javascript
function exists(cmd) { return run(`which ${cmd}`).then(stdout => { if (stdout.trim().length === 0) { // maybe an empty command was supplied? // are we running on Windows?? return Promise.reject(new Error("No output")); } const rNotFound = /^[\w\-]+ not found/g; if (rNotFound.test(c...
[ "function", "exists", "(", "cmd", ")", "{", "return", "run", "(", "`", "${", "cmd", "}", "`", ")", ".", "then", "(", "stdout", "=>", "{", "if", "(", "stdout", ".", "trim", "(", ")", ".", "length", "===", "0", ")", "{", "// maybe an empty command wa...
returns Promise which fulfills with true if command exists
[ "returns", "Promise", "which", "fulfills", "with", "true", "if", "command", "exists" ]
dc582b349d673be79a1114a22325ba3d36131a1e
https://github.com/prscX/pod-installer/blob/dc582b349d673be79a1114a22325ba3d36131a1e/index.js#L66-L82
29,935
casetext/fireproof
index.js
Fireproof
function Fireproof(firebaseRef, promise) { if (!Fireproof.Promise) { try { Fireproof.Promise = Promise; } catch(e) { throw new Error('You must supply a Promise library to Fireproof!'); } } else if (typeof Fireproof.Promise !== 'function') { throw new Error('The supplied value of Firep...
javascript
function Fireproof(firebaseRef, promise) { if (!Fireproof.Promise) { try { Fireproof.Promise = Promise; } catch(e) { throw new Error('You must supply a Promise library to Fireproof!'); } } else if (typeof Fireproof.Promise !== 'function') { throw new Error('The supplied value of Firep...
[ "function", "Fireproof", "(", "firebaseRef", ",", "promise", ")", "{", "if", "(", "!", "Fireproof", ".", "Promise", ")", "{", "try", "{", "Fireproof", ".", "Promise", "=", "Promise", ";", "}", "catch", "(", "e", ")", "{", "throw", "new", "Error", "("...
Fireproofs an existing Firebase reference, giving it magic promise powers. @name Fireproof @constructor @global @param {Firebase} firebaseRef A Firebase reference object. @property then A promise shortcut for .once('value'), except for references created by .push(), where it resolves on success and rejects on failure o...
[ "Fireproofs", "an", "existing", "Firebase", "reference", "giving", "it", "magic", "promise", "powers", "." ]
a568157310d965d2c115e5a3c9e8287fc8fe021b
https://github.com/casetext/fireproof/blob/a568157310d965d2c115e5a3c9e8287fc8fe021b/index.js#L17-L46
29,936
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(win, elems) { var mode = svgCanvas.getMode(); if (mode === 'select') { setSelectMode(); } var is_node = (mode == "pathedit"); // if elems[1] is present, then we have more than one element selectedElement = (elems.length === 1 || elems[1] == null ? elems[0] : null); multiselecte...
javascript
function(win, elems) { var mode = svgCanvas.getMode(); if (mode === 'select') { setSelectMode(); } var is_node = (mode == "pathedit"); // if elems[1] is present, then we have more than one element selectedElement = (elems.length === 1 || elems[1] == null ? elems[0] : null); multiselecte...
[ "function", "(", "win", ",", "elems", ")", "{", "var", "mode", "=", "svgCanvas", ".", "getMode", "(", ")", ";", "if", "(", "mode", "===", "'select'", ")", "{", "setSelectMode", "(", ")", ";", "}", "var", "is_node", "=", "(", "mode", "==", "\"pathed...
called when we've selected a different element
[ "called", "when", "we", "ve", "selected", "a", "different", "element" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L1601-L1628
29,937
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(win, elems) { var mode = svgCanvas.getMode(); var elem = elems[0]; if (!elem) { return; } multiselected = (elems.length >= 2 && elems[1] != null); // Only updating fields for single elements for now if (!multiselected) { switch (mode) { case 'rotate': var an...
javascript
function(win, elems) { var mode = svgCanvas.getMode(); var elem = elems[0]; if (!elem) { return; } multiselected = (elems.length >= 2 && elems[1] != null); // Only updating fields for single elements for now if (!multiselected) { switch (mode) { case 'rotate': var an...
[ "function", "(", "win", ",", "elems", ")", "{", "var", "mode", "=", "svgCanvas", ".", "getMode", "(", ")", ";", "var", "elem", "=", "elems", "[", "0", "]", ";", "if", "(", "!", "elem", ")", "{", "return", ";", "}", "multiselected", "=", "(", "e...
Call when part of element is in process of changing, generally on mousemove actions like rotate, move, etc.
[ "Call", "when", "part", "of", "element", "is", "in", "process", "of", "changing", "generally", "on", "mousemove", "actions", "like", "rotate", "move", "etc", "." ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L1632-L1659
29,938
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(win, elems) { var i, mode = svgCanvas.getMode(); if (mode === 'select') { setSelectMode(); } for (i = 0; i < elems.length; ++i) { var elem = elems[i]; // if the element changed was the svg, then it could be a resolution change if (elem && elem.tagName === 'svg') { ...
javascript
function(win, elems) { var i, mode = svgCanvas.getMode(); if (mode === 'select') { setSelectMode(); } for (i = 0; i < elems.length; ++i) { var elem = elems[i]; // if the element changed was the svg, then it could be a resolution change if (elem && elem.tagName === 'svg') { ...
[ "function", "(", "win", ",", "elems", ")", "{", "var", "i", ",", "mode", "=", "svgCanvas", ".", "getMode", "(", ")", ";", "if", "(", "mode", "===", "'select'", ")", "{", "setSelectMode", "(", ")", ";", "}", "for", "(", "i", "=", "0", ";", "i", ...
called when any element has changed
[ "called", "when", "any", "element", "has", "changed" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L1662-L1705
29,939
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(event) { var options = opts; //find the currently selected tool if comes from keystroke if (event.type === 'keydown') { var flyoutIsSelected = $(options.parent + '_show').hasClass('tool_button_current'); var currentOperation = $(options.parent + '_show').attr('data-cur...
javascript
function(event) { var options = opts; //find the currently selected tool if comes from keystroke if (event.type === 'keydown') { var flyoutIsSelected = $(options.parent + '_show').hasClass('tool_button_current'); var currentOperation = $(options.parent + '_show').attr('data-cur...
[ "function", "(", "event", ")", "{", "var", "options", "=", "opts", ";", "//find the currently selected tool if comes from keystroke", "if", "(", "event", ".", "type", "===", "'keydown'", ")", "{", "var", "flyoutIsSelected", "=", "$", "(", "options", ".", "parent...
Clicking the icon in flyout should set this set's icon
[ "Clicking", "the", "icon", "in", "flyout", "should", "set", "this", "set", "s", "icon" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L1850-L1881
29,940
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(close) { var w = $('#sidepanels').width(); var deltaX = (w > 2 || close ? 2 : SIDEPANEL_OPENWIDTH) - w; changeSidePanelWidth(deltaX); }
javascript
function(close) { var w = $('#sidepanels').width(); var deltaX = (w > 2 || close ? 2 : SIDEPANEL_OPENWIDTH) - w; changeSidePanelWidth(deltaX); }
[ "function", "(", "close", ")", "{", "var", "w", "=", "$", "(", "'#sidepanels'", ")", ".", "width", "(", ")", ";", "var", "deltaX", "=", "(", "w", ">", "2", "||", "close", "?", "2", ":", "SIDEPANEL_OPENWIDTH", ")", "-", "w", ";", "changeSidePanelWid...
if width is non-zero, then fully close it, otherwise fully open it the optional close argument forces the side panel closed
[ "if", "width", "is", "non", "-", "zero", "then", "fully", "close", "it", "otherwise", "fully", "open", "it", "the", "optional", "close", "argument", "forces", "the", "side", "panel", "closed" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L4161-L4165
29,941
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js
function(width, height) { var newImage = svgCanvas.addSvgElementFromJson({ element: 'image', attr: { x: 0, y: 0, width: width, height: height, id: svgCanvas.getNextId(), style: 'pointer-events:inherit' } })...
javascript
function(width, height) { var newImage = svgCanvas.addSvgElementFromJson({ element: 'image', attr: { x: 0, y: 0, width: width, height: height, id: svgCanvas.getNextId(), style: 'pointer-events:inherit' } })...
[ "function", "(", "width", ",", "height", ")", "{", "var", "newImage", "=", "svgCanvas", ".", "addSvgElementFromJson", "(", "{", "element", ":", "'image'", ",", "attr", ":", "{", "x", ":", "0", ",", "y", ":", "0", ",", "width", ":", "width", ",", "h...
let's insert the new image until we know its dimensions
[ "let", "s", "insert", "the", "new", "image", "until", "we", "know", "its", "dimensions" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/svg-editor - Copy.js#L4741-L4758
29,942
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/ace/lib/ace/keyboard/vim.js
function(data, hashId, key) { if (hashId == -1) { // record key data.inputChar = key; data.lastEvent = "input"; } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) { // check for repeated keypress if (data.lastEvent ...
javascript
function(data, hashId, key) { if (hashId == -1) { // record key data.inputChar = key; data.lastEvent = "input"; } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) { // check for repeated keypress if (data.lastEvent ...
[ "function", "(", "data", ",", "hashId", ",", "key", ")", "{", "if", "(", "hashId", "==", "-", "1", ")", "{", "// record key", "data", ".", "inputChar", "=", "key", ";", "data", ".", "lastEvent", "=", "\"input\"", ";", "}", "else", "if", "(", "data"...
workaround for j not repeating with `defaults write -g ApplePressAndHoldEnabled -bool true`
[ "workaround", "for", "j", "not", "repeating", "with", "defaults", "write", "-", "g", "ApplePressAndHoldEnabled", "-", "bool", "true" ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/ace/lib/ace/keyboard/vim.js#L63-L82
29,943
stealjs/steal-npm
npm-convert.js
convertPropertyNames
function convertPropertyNames (context, pkg, map , root, waiting) { if(!map) { return map; } var clone = {}, value; for(var property in map ) { value = convertName(context, pkg, map, root, property, waiting); if(typeof value === 'string') { clone[value] = map[property]; } // do root paths b/c we don't...
javascript
function convertPropertyNames (context, pkg, map , root, waiting) { if(!map) { return map; } var clone = {}, value; for(var property in map ) { value = convertName(context, pkg, map, root, property, waiting); if(typeof value === 'string') { clone[value] = map[property]; } // do root paths b/c we don't...
[ "function", "convertPropertyNames", "(", "context", ",", "pkg", ",", "map", ",", "root", ",", "waiting", ")", "{", "if", "(", "!", "map", ")", "{", "return", "map", ";", "}", "var", "clone", "=", "{", "}", ",", "value", ";", "for", "(", "var", "p...
converts only the property name
[ "converts", "only", "the", "property", "name" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-convert.js#L88-L108
29,944
stealjs/steal-npm
npm-convert.js
convertPropertyNamesAndValues
function convertPropertyNamesAndValues (context, pkg, map, root, waiting) { if(!map) { return map; } var clone = {}, val, name; for(var property in map ) { val = map[property]; name = convertName(context, pkg, map, root, property, waiting); val = typeof val === "object" ? convertPropertyNamesAndValues(c...
javascript
function convertPropertyNamesAndValues (context, pkg, map, root, waiting) { if(!map) { return map; } var clone = {}, val, name; for(var property in map ) { val = map[property]; name = convertName(context, pkg, map, root, property, waiting); val = typeof val === "object" ? convertPropertyNamesAndValues(c...
[ "function", "convertPropertyNamesAndValues", "(", "context", ",", "pkg", ",", "map", ",", "root", ",", "waiting", ")", "{", "if", "(", "!", "map", ")", "{", "return", "map", ";", "}", "var", "clone", "=", "{", "}", ",", "val", ",", "name", ";", "fo...
converts both property name and value
[ "converts", "both", "property", "name", "and", "value" ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-convert.js#L111-L127
29,945
stealjs/steal-npm
npm-convert.js
convertBrowser
function convertBrowser(pkg, browser) { var type = typeof browser; if(type === "string" || type === "undefined") { return browser; } var map = {}; for(var fromName in browser) { convertBrowserProperty(map, pkg, fromName, browser[fromName]); } return map; }
javascript
function convertBrowser(pkg, browser) { var type = typeof browser; if(type === "string" || type === "undefined") { return browser; } var map = {}; for(var fromName in browser) { convertBrowserProperty(map, pkg, fromName, browser[fromName]); } return map; }
[ "function", "convertBrowser", "(", "pkg", ",", "browser", ")", "{", "var", "type", "=", "typeof", "browser", ";", "if", "(", "type", "===", "\"string\"", "||", "type", "===", "\"undefined\"", ")", "{", "return", "browser", ";", "}", "var", "map", "=", ...
Converts browser names into actual module names. Example: ``` { "foo": "browser-foo" "traceur#src/node/traceur": "./browser/traceur" "./foo" : "./foo-browser" } ``` converted to: ``` { // any foo ... regardless of where "foo": "browser-foo" // this module ... ideally minus version "traceur#src/node/traceur": "trans...
[ "Converts", "browser", "names", "into", "actual", "module", "names", "." ]
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-convert.js#L236-L246
29,946
stealjs/steal-npm
npm-convert.js
convertForPackage
function convertForPackage(context, pkg) { var name = pkg.name; var version = pkg.version; var conv = context.deferredConversions; var pkgConv = conv[name]; var depPkg, fns, keys = 0; if(pkgConv) { for(var range in pkgConv) { depPkg = crawl.matchedVersion(context, name, range); if(depPkg) { fns = pkg...
javascript
function convertForPackage(context, pkg) { var name = pkg.name; var version = pkg.version; var conv = context.deferredConversions; var pkgConv = conv[name]; var depPkg, fns, keys = 0; if(pkgConv) { for(var range in pkgConv) { depPkg = crawl.matchedVersion(context, name, range); if(depPkg) { fns = pkg...
[ "function", "convertForPackage", "(", "context", ",", "pkg", ")", "{", "var", "name", "=", "pkg", ".", "name", ";", "var", "version", "=", "pkg", ".", "version", ";", "var", "conv", "=", "context", ".", "deferredConversions", ";", "var", "pkgConv", "=", ...
When progressively loading package.jsons we need to convert any config that is waiting on a package.json to load. This function is called after a package is loaded and will call all of the callbacks that cause the config to be applied.
[ "When", "progressively", "loading", "package", ".", "jsons", "we", "need", "to", "convert", "any", "config", "that", "is", "waiting", "on", "a", "package", ".", "json", "to", "load", ".", "This", "function", "is", "called", "after", "a", "package", "is", ...
216463c552cabe7d9dad86d754da784b5dea3d78
https://github.com/stealjs/steal-npm/blob/216463c552cabe7d9dad86d754da784b5dea3d78/npm-convert.js#L350-L374
29,947
grasshopper-cms/grasshopper-core-nodejs
dev/server/public/admin/vendor/svg-edit-2.7/extensions/ext-server_opensave.js
rebuildInput
function rebuildInput(form) { form.empty(); var inp = $('<input type="file" name="svg_file">').appendTo(form); function submit() { // This submits the form, which returns the file data using svgEditor.processFile() form.submit(); rebuildInput(form); $.process_cancel("Uploading...",...
javascript
function rebuildInput(form) { form.empty(); var inp = $('<input type="file" name="svg_file">').appendTo(form); function submit() { // This submits the form, which returns the file data using svgEditor.processFile() form.submit(); rebuildInput(form); $.process_cancel("Uploading...",...
[ "function", "rebuildInput", "(", "form", ")", "{", "form", ".", "empty", "(", ")", ";", "var", "inp", "=", "$", "(", "'<input type=\"file\" name=\"svg_file\">'", ")", ".", "appendTo", "(", "form", ")", ";", "function", "submit", "(", ")", "{", "// This sub...
It appears necessary to rebuild this input every time a file is selected so the same file can be picked and the change event can fire.
[ "It", "appears", "necessary", "to", "rebuild", "this", "input", "every", "time", "a", "file", "is", "selected", "so", "the", "same", "file", "can", "be", "picked", "and", "the", "change", "event", "can", "fire", "." ]
8fabc3bfc5b18855ead443db0644608a277d0ea0
https://github.com/grasshopper-cms/grasshopper-core-nodejs/blob/8fabc3bfc5b18855ead443db0644608a277d0ea0/dev/server/public/admin/vendor/svg-edit-2.7/extensions/ext-server_opensave.js#L164-L197
29,948
aureooms/js-itertools
lib/reduce/max.js
max
function max(compare, iterable, dflt = undefined) { let iterator = (0, _iter.iter)(iterable); let first = iterator.next(); if (first.done) return dflt; let largest = first.value; for (let candidate of iterator) { if (compare(candidate, largest) > 0) { largest = candidate; } } return ...
javascript
function max(compare, iterable, dflt = undefined) { let iterator = (0, _iter.iter)(iterable); let first = iterator.next(); if (first.done) return dflt; let largest = first.value; for (let candidate of iterator) { if (compare(candidate, largest) > 0) { largest = candidate; } } return ...
[ "function", "max", "(", "compare", ",", "iterable", ",", "dflt", "=", "undefined", ")", "{", "let", "iterator", "=", "(", "0", ",", "_iter", ".", "iter", ")", "(", "iterable", ")", ";", "let", "first", "=", "iterator", ".", "next", "(", ")", ";", ...
Returns the largest element of the input iterable according to some comparison function. @example max( ( a , b ) => a - b , range( 10 ) ) ; // returns 9 @example max( ( a , b ) => a - b , range( 0 ) ) ; // returns undefined @param {Function} compare - The comparison function to use. This function must be 2-ary. It m...
[ "Returns", "the", "largest", "element", "of", "the", "input", "iterable", "according", "to", "some", "comparison", "function", "." ]
72bafa5f3f957ceb37bdfa87a222364fe4974be3
https://github.com/aureooms/js-itertools/blob/72bafa5f3f957ceb37bdfa87a222364fe4974be3/lib/reduce/max.js#L30-L49
29,949
w3co/jcf
js/jcf.scrollable.js
function() { self.value += stepValue; self.setValue(self.value); self.triggerScrollEvent(self.value); if (isFinishedScrolling()) { clearInterval(self.pageScrollTimer); } }
javascript
function() { self.value += stepValue; self.setValue(self.value); self.triggerScrollEvent(self.value); if (isFinishedScrolling()) { clearInterval(self.pageScrollTimer); } }
[ "function", "(", ")", "{", "self", ".", "value", "+=", "stepValue", ";", "self", ".", "setValue", "(", "self", ".", "value", ")", ";", "self", ".", "triggerScrollEvent", "(", "self", ".", "value", ")", ";", "if", "(", "isFinishedScrolling", "(", ")", ...
scroll by page when track is pressed
[ "scroll", "by", "page", "when", "track", "is", "pressed" ]
d002e9f5a10cb386089f58592abca4a01edc9518
https://github.com/w3co/jcf/blob/d002e9f5a10cb386089f58592abca4a01edc9518/js/jcf.scrollable.js#L525-L533
29,950
w3co/jcf
js/jcf.select.js
SelectList
function SelectList(options) { this.options = $.extend({ holder: null, maxVisibleItems: 10, selectOnClick: true, useHoverClass: false, useCustomScroll: false, handleResize: true, multipleSelectWithoutKey: false, alwaysPreventMouseWheel: false, indexAttribute: 'data-index', cloneClassPref...
javascript
function SelectList(options) { this.options = $.extend({ holder: null, maxVisibleItems: 10, selectOnClick: true, useHoverClass: false, useCustomScroll: false, handleResize: true, multipleSelectWithoutKey: false, alwaysPreventMouseWheel: false, indexAttribute: 'data-index', cloneClassPref...
[ "function", "SelectList", "(", "options", ")", "{", "this", ".", "options", "=", "$", ".", "extend", "(", "{", "holder", ":", "null", ",", "maxVisibleItems", ":", "10", ",", "selectOnClick", ":", "true", ",", "useHoverClass", ":", "false", ",", "useCusto...
options list module
[ "options", "list", "module" ]
d002e9f5a10cb386089f58592abca4a01edc9518
https://github.com/w3co/jcf/blob/d002e9f5a10cb386089f58592abca4a01edc9518/js/jcf.select.js#L586-L609
29,951
canjs/can-reflect
reflections/shape/shape.js
isSerializedHelper
function isSerializedHelper(obj){ if (typeReflections.isPrimitive(obj)) { return true; } if(hasUpdateSymbol(obj)) { return false; } return typeReflections.isBuiltIn(obj) && !typeReflections.isPlainObject(obj) && !Array.isArray(obj); }
javascript
function isSerializedHelper(obj){ if (typeReflections.isPrimitive(obj)) { return true; } if(hasUpdateSymbol(obj)) { return false; } return typeReflections.isBuiltIn(obj) && !typeReflections.isPlainObject(obj) && !Array.isArray(obj); }
[ "function", "isSerializedHelper", "(", "obj", ")", "{", "if", "(", "typeReflections", ".", "isPrimitive", "(", "obj", ")", ")", "{", "return", "true", ";", "}", "if", "(", "hasUpdateSymbol", "(", "obj", ")", ")", "{", "return", "false", ";", "}", "retu...
is the value itself its serialized value
[ "is", "the", "value", "itself", "its", "serialized", "value" ]
6b8c65a6fc52ee26973adbf6fb8c21fb6725b365
https://github.com/canjs/can-reflect/blob/6b8c65a6fc52ee26973adbf6fb8c21fb6725b365/reflections/shape/shape.js#L101-L109
29,952
canjs/can-reflect
reflections/shape/shape.js
function(obj){ var hasOwnKey = obj[canSymbol.for("can.hasOwnKey")]; if(hasOwnKey) { return hasOwnKey.bind(obj); } else { var map = makeMap( shapeReflections.getOwnEnumerableKeys(obj) ); return function(key) { return map.get(key); }; } }
javascript
function(obj){ var hasOwnKey = obj[canSymbol.for("can.hasOwnKey")]; if(hasOwnKey) { return hasOwnKey.bind(obj); } else { var map = makeMap( shapeReflections.getOwnEnumerableKeys(obj) ); return function(key) { return map.get(key); }; } }
[ "function", "(", "obj", ")", "{", "var", "hasOwnKey", "=", "obj", "[", "canSymbol", ".", "for", "(", "\"can.hasOwnKey\"", ")", "]", ";", "if", "(", "hasOwnKey", ")", "{", "return", "hasOwnKey", ".", "bind", "(", "obj", ")", ";", "}", "else", "{", "...
creates an optimized hasOwnKey lookup. If the object has hasOwnKey, then we just use that. Otherwise, try to put all keys in a map.
[ "creates", "an", "optimized", "hasOwnKey", "lookup", ".", "If", "the", "object", "has", "hasOwnKey", "then", "we", "just", "use", "that", ".", "Otherwise", "try", "to", "put", "all", "keys", "in", "a", "map", "." ]
6b8c65a6fc52ee26973adbf6fb8c21fb6725b365
https://github.com/canjs/can-reflect/blob/6b8c65a6fc52ee26973adbf6fb8c21fb6725b365/reflections/shape/shape.js#L278-L288
29,953
canjs/can-reflect
reflections/shape/shape.js
addPatch
function addPatch(patches, patch) { var lastPatch = patches[patches.length -1]; if(lastPatch) { // same number of deletes and counts as the index is back if(lastPatch.deleteCount === lastPatch.insert.length && (patch.index - lastPatch.index === lastPatch.deleteCount) ) { lastPatch.insert.push.apply(lastPatch.i...
javascript
function addPatch(patches, patch) { var lastPatch = patches[patches.length -1]; if(lastPatch) { // same number of deletes and counts as the index is back if(lastPatch.deleteCount === lastPatch.insert.length && (patch.index - lastPatch.index === lastPatch.deleteCount) ) { lastPatch.insert.push.apply(lastPatch.i...
[ "function", "addPatch", "(", "patches", ",", "patch", ")", "{", "var", "lastPatch", "=", "patches", "[", "patches", ".", "length", "-", "1", "]", ";", "if", "(", "lastPatch", ")", "{", "// same number of deletes and counts as the index is back", "if", "(", "la...
combines patches if it makes sense
[ "combines", "patches", "if", "it", "makes", "sense" ]
6b8c65a6fc52ee26973adbf6fb8c21fb6725b365
https://github.com/canjs/can-reflect/blob/6b8c65a6fc52ee26973adbf6fb8c21fb6725b365/reflections/shape/shape.js#L292-L303
29,954
shibukawa/i18n4v
docs/_static/websupport.js
setComparator
function setComparator() { // If the first three letters are "asc", sort in ascending order // and remove the prefix. if (by.substring(0,3) == 'asc') { var i = by.substring(3); comp = function(a, b) { return a[i] - b[i]; }; } else { // Otherwise sort in descending order. comp = f...
javascript
function setComparator() { // If the first three letters are "asc", sort in ascending order // and remove the prefix. if (by.substring(0,3) == 'asc') { var i = by.substring(3); comp = function(a, b) { return a[i] - b[i]; }; } else { // Otherwise sort in descending order. comp = f...
[ "function", "setComparator", "(", ")", "{", "// If the first three letters are \"asc\", sort in ascending order", "// and remove the prefix.", "if", "(", "by", ".", "substring", "(", "0", ",", "3", ")", "==", "'asc'", ")", "{", "var", "i", "=", "by", ".", "substri...
Set comp, which is a comparator function used for sorting and inserting comments into the list.
[ "Set", "comp", "which", "is", "a", "comparator", "function", "used", "for", "sorting", "and", "inserting", "comments", "into", "the", "list", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L107-L121
29,955
shibukawa/i18n4v
docs/_static/websupport.js
initComparator
function initComparator() { by = 'rating'; // Default to sort by rating. // If the sortBy cookie is set, use that instead. if (document.cookie.length > 0) { var start = document.cookie.indexOf('sortBy='); if (start != -1) { start = start + 7; var end = document.cookie.indexOf(";"...
javascript
function initComparator() { by = 'rating'; // Default to sort by rating. // If the sortBy cookie is set, use that instead. if (document.cookie.length > 0) { var start = document.cookie.indexOf('sortBy='); if (start != -1) { start = start + 7; var end = document.cookie.indexOf(";"...
[ "function", "initComparator", "(", ")", "{", "by", "=", "'rating'", ";", "// Default to sort by rating.", "// If the sortBy cookie is set, use that instead.", "if", "(", "document", ".", "cookie", ".", "length", ">", "0", ")", "{", "var", "start", "=", "document", ...
Create a comp function. If the user has preferences stored in the sortBy cookie, use those, otherwise use the default.
[ "Create", "a", "comp", "function", ".", "If", "the", "user", "has", "preferences", "stored", "in", "the", "sortBy", "cookie", "use", "those", "otherwise", "use", "the", "default", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L127-L142
29,956
shibukawa/i18n4v
docs/_static/websupport.js
show
function show(id) { $('#ao' + id).hide(); $('#ah' + id).show(); var context = $.extend({id: id}, opts); var popup = $(renderTemplate(popupTemplate, context)).hide(); popup.find('textarea[name="proposal"]').hide(); popup.find('a.by' + by).addClass('sel'); var form = popup.find('#cf' + id); ...
javascript
function show(id) { $('#ao' + id).hide(); $('#ah' + id).show(); var context = $.extend({id: id}, opts); var popup = $(renderTemplate(popupTemplate, context)).hide(); popup.find('textarea[name="proposal"]').hide(); popup.find('a.by' + by).addClass('sel'); var form = popup.find('#cf' + id); ...
[ "function", "show", "(", "id", ")", "{", "$", "(", "'#ao'", "+", "id", ")", ".", "hide", "(", ")", ";", "$", "(", "'#ah'", "+", "id", ")", ".", "show", "(", ")", ";", "var", "context", "=", "$", ".", "extend", "(", "{", "id", ":", "id", "...
Show a comment div.
[ "Show", "a", "comment", "div", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L147-L163
29,957
shibukawa/i18n4v
docs/_static/websupport.js
hide
function hide(id) { $('#ah' + id).hide(); $('#ao' + id).show(); var div = $('#sc' + id); div.slideUp('fast', function() { div.remove(); }); }
javascript
function hide(id) { $('#ah' + id).hide(); $('#ao' + id).show(); var div = $('#sc' + id); div.slideUp('fast', function() { div.remove(); }); }
[ "function", "hide", "(", "id", ")", "{", "$", "(", "'#ah'", "+", "id", ")", ".", "hide", "(", ")", ";", "$", "(", "'#ao'", "+", "id", ")", ".", "show", "(", ")", ";", "var", "div", "=", "$", "(", "'#sc'", "+", "id", ")", ";", "div", ".", ...
Hide a comment div.
[ "Hide", "a", "comment", "div", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L168-L175
29,958
shibukawa/i18n4v
docs/_static/websupport.js
getComments
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
javascript
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
[ "function", "getComments", "(", "id", ")", "{", "$", ".", "ajax", "(", "{", "type", ":", "'GET'", ",", "url", ":", "opts", ".", "getCommentsURL", ",", "data", ":", "{", "node", ":", "id", "}", ",", "success", ":", "function", "(", "data", ",", "t...
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
[ "Perform", "an", "ajax", "request", "to", "get", "comments", "for", "a", "node", "and", "insert", "the", "comments", "into", "the", "comments", "tree", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L181-L211
29,959
shibukawa/i18n4v
docs/_static/websupport.js
addComment
function addComment(form) { var node_id = form.find('input[name="node"]').val(); var parent_id = form.find('input[name="parent"]').val(); var text = form.find('textarea[name="comment"]').val(); var proposal = form.find('textarea[name="proposal"]').val(); if (text == '') { showError('Please en...
javascript
function addComment(form) { var node_id = form.find('input[name="node"]').val(); var parent_id = form.find('input[name="parent"]').val(); var text = form.find('textarea[name="comment"]').val(); var proposal = form.find('textarea[name="proposal"]').val(); if (text == '') { showError('Please en...
[ "function", "addComment", "(", "form", ")", "{", "var", "node_id", "=", "form", ".", "find", "(", "'input[name=\"node\"]'", ")", ".", "val", "(", ")", ";", "var", "parent_id", "=", "form", ".", "find", "(", "'input[name=\"parent\"]'", ")", ".", "val", "(...
Add a comment via ajax and insert the comment into the comment tree.
[ "Add", "a", "comment", "via", "ajax", "and", "insert", "the", "comment", "into", "the", "comment", "tree", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L216-L269
29,960
shibukawa/i18n4v
docs/_static/websupport.js
appendComments
function appendComments(comments, ul) { $.each(comments, function() { var div = createCommentDiv(this); ul.append($(document.createElement('li')).html(div)); appendComments(this.children, div.find('ul.comment-children')); // To avoid stagnating data, don't store the comments children in data...
javascript
function appendComments(comments, ul) { $.each(comments, function() { var div = createCommentDiv(this); ul.append($(document.createElement('li')).html(div)); appendComments(this.children, div.find('ul.comment-children')); // To avoid stagnating data, don't store the comments children in data...
[ "function", "appendComments", "(", "comments", ",", "ul", ")", "{", "$", ".", "each", "(", "comments", ",", "function", "(", ")", "{", "var", "div", "=", "createCommentDiv", "(", "this", ")", ";", "ul", ".", "append", "(", "$", "(", "document", ".", ...
Recursively append comments to the main comment list and children lists, creating the comment tree.
[ "Recursively", "append", "comments", "to", "the", "main", "comment", "list", "and", "children", "lists", "creating", "the", "comment", "tree", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L275-L284
29,961
shibukawa/i18n4v
docs/_static/websupport.js
insertComment
function insertComment(comment) { var div = createCommentDiv(comment); // To avoid stagnating data, don't store the comments children in data. comment.children = null; div.data('comment', comment); var ul = $('#cl' + (comment.node || comment.parent)); var siblings = getChildren(ul); var l...
javascript
function insertComment(comment) { var div = createCommentDiv(comment); // To avoid stagnating data, don't store the comments children in data. comment.children = null; div.data('comment', comment); var ul = $('#cl' + (comment.node || comment.parent)); var siblings = getChildren(ul); var l...
[ "function", "insertComment", "(", "comment", ")", "{", "var", "div", "=", "createCommentDiv", "(", "comment", ")", ";", "// To avoid stagnating data, don't store the comments children in data.", "comment", ".", "children", "=", "null", ";", "div", ".", "data", "(", ...
After adding a new comment, it must be inserted in the correct location in the comment tree.
[ "After", "adding", "a", "new", "comment", "it", "must", "be", "inserted", "in", "the", "correct", "location", "in", "the", "comment", "tree", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L290-L318
29,962
shibukawa/i18n4v
docs/_static/websupport.js
handleReSort
function handleReSort(link) { var classes = link.attr('class').split(/\s+/); for (var i=0; i<classes.length; i++) { if (classes[i] != 'sort-option') { by = classes[i].substring(2); } } setComparator(); // Save/update the sortBy cookie. var expiration = new Date(); expiration.set...
javascript
function handleReSort(link) { var classes = link.attr('class').split(/\s+/); for (var i=0; i<classes.length; i++) { if (classes[i] != 'sort-option') { by = classes[i].substring(2); } } setComparator(); // Save/update the sortBy cookie. var expiration = new Date(); expiration.set...
[ "function", "handleReSort", "(", "link", ")", "{", "var", "classes", "=", "link", ".", "attr", "(", "'class'", ")", ".", "split", "(", "/", "\\s+", "/", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "classes", ".", "length", ";", "...
Handle when the user clicks on a sort by link.
[ "Handle", "when", "the", "user", "clicks", "on", "a", "sort", "by", "link", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L403-L421
29,963
shibukawa/i18n4v
docs/_static/websupport.js
handleVote
function handleVote(link) { if (!opts.voting) { showError("You'll need to login to vote."); return; } var id = link.attr('id'); if (!id) { // Didn't click on one of the voting arrows. return; } // If it is an unvote, the new vote value is 0, // Otherwise it's 1 for a...
javascript
function handleVote(link) { if (!opts.voting) { showError("You'll need to login to vote."); return; } var id = link.attr('id'); if (!id) { // Didn't click on one of the voting arrows. return; } // If it is an unvote, the new vote value is 0, // Otherwise it's 1 for a...
[ "function", "handleVote", "(", "link", ")", "{", "if", "(", "!", "opts", ".", "voting", ")", "{", "showError", "(", "\"You'll need to login to vote.\"", ")", ";", "return", ";", "}", "var", "id", "=", "link", ".", "attr", "(", "'id'", ")", ";", "if", ...
Function to process a vote when a user clicks an arrow.
[ "Function", "to", "process", "a", "vote", "when", "a", "user", "clicks", "an", "arrow", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L426-L483
29,964
shibukawa/i18n4v
docs/_static/websupport.js
openReply
function openReply(id) { // Swap out the reply link for the hide link $('#rl' + id).hide(); $('#cr' + id).show(); // Add the reply li to the children ul. var div = $(renderTemplate(replyTemplate, {id: id})).hide(); $('#cl' + id) .prepend(div) // Setup the submit handler for the repl...
javascript
function openReply(id) { // Swap out the reply link for the hide link $('#rl' + id).hide(); $('#cr' + id).show(); // Add the reply li to the children ul. var div = $(renderTemplate(replyTemplate, {id: id})).hide(); $('#cl' + id) .prepend(div) // Setup the submit handler for the repl...
[ "function", "openReply", "(", "id", ")", "{", "// Swap out the reply link for the hide link", "$", "(", "'#rl'", "+", "id", ")", ".", "hide", "(", ")", ";", "$", "(", "'#cr'", "+", "id", ")", ".", "show", "(", ")", ";", "// Add the reply li to the children u...
Open a reply form used to reply to an existing comment.
[ "Open", "a", "reply", "form", "used", "to", "reply", "to", "an", "existing", "comment", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L488-L511
29,965
shibukawa/i18n4v
docs/_static/websupport.js
sortComments
function sortComments(comments) { comments.sort(comp); $.each(comments, function() { this.children = sortComments(this.children); }); return comments; }
javascript
function sortComments(comments) { comments.sort(comp); $.each(comments, function() { this.children = sortComments(this.children); }); return comments; }
[ "function", "sortComments", "(", "comments", ")", "{", "comments", ".", "sort", "(", "comp", ")", ";", "$", ".", "each", "(", "comments", ",", "function", "(", ")", "{", "this", ".", "children", "=", "sortComments", "(", "this", ".", "children", ")", ...
Recursively sort a tree of comments using the comp comparator.
[ "Recursively", "sort", "a", "tree", "of", "comments", "using", "the", "comp", "comparator", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L530-L536
29,966
shibukawa/i18n4v
docs/_static/websupport.js
getChildren
function getChildren(ul, recursive) { var children = []; ul.children().children("[id^='cd']") .each(function() { var comment = $(this).data('comment'); if (recursive) comment.children = getChildren($(this).find('#cl' + comment.id), true); children.push(comment); });...
javascript
function getChildren(ul, recursive) { var children = []; ul.children().children("[id^='cd']") .each(function() { var comment = $(this).data('comment'); if (recursive) comment.children = getChildren($(this).find('#cl' + comment.id), true); children.push(comment); });...
[ "function", "getChildren", "(", "ul", ",", "recursive", ")", "{", "var", "children", "=", "[", "]", ";", "ul", ".", "children", "(", ")", ".", "children", "(", "\"[id^='cd']\"", ")", ".", "each", "(", "function", "(", ")", "{", "var", "comment", "=",...
Get the children comments from a ul. If recursive is true, recursively include childrens' children.
[ "Get", "the", "children", "comments", "from", "a", "ul", ".", "If", "recursive", "is", "true", "recursively", "include", "childrens", "children", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L542-L552
29,967
shibukawa/i18n4v
docs/_static/websupport.js
createCommentDiv
function createCommentDiv(comment) { if (!comment.displayed && !opts.moderator) { return $('<div class="moderate">Thank you! Your comment will show up ' + 'once it is has been approved by a moderator.</div>'); } // Prettify the comment rating. comment.pretty_rating = comment.rating...
javascript
function createCommentDiv(comment) { if (!comment.displayed && !opts.moderator) { return $('<div class="moderate">Thank you! Your comment will show up ' + 'once it is has been approved by a moderator.</div>'); } // Prettify the comment rating. comment.pretty_rating = comment.rating...
[ "function", "createCommentDiv", "(", "comment", ")", "{", "if", "(", "!", "comment", ".", "displayed", "&&", "!", "opts", ".", "moderator", ")", "{", "return", "$", "(", "'<div class=\"moderate\">Thank you! Your comment will show up '", "+", "'once it is has been app...
Create a div to display a comment in.
[ "Create", "a", "div", "to", "display", "a", "comment", "in", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L555-L586
29,968
shibukawa/i18n4v
docs/_static/websupport.js
showError
function showError(message) { $(document.createElement('div')).attr({'class': 'popup-error'}) .append($(document.createElement('div')) .attr({'class': 'error-message'}).text(message)) .appendTo('body') .fadeIn("slow") .delay(2000) .fadeOut("slow"); }
javascript
function showError(message) { $(document.createElement('div')).attr({'class': 'popup-error'}) .append($(document.createElement('div')) .attr({'class': 'error-message'}).text(message)) .appendTo('body') .fadeIn("slow") .delay(2000) .fadeOut("slow"); }
[ "function", "showError", "(", "message", ")", "{", "$", "(", "document", ".", "createElement", "(", "'div'", ")", ")", ".", "attr", "(", "{", "'class'", ":", "'popup-error'", "}", ")", ".", "append", "(", "$", "(", "document", ".", "createElement", "("...
Flash an error message briefly.
[ "Flash", "an", "error", "message", "briefly", "." ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/websupport.js#L610-L618
29,969
shibukawa/i18n4v
docs/_static/searchtools.js
function(object, otherterms) { var filenames = this._index.filenames; var docnames = this._index.docnames; var objects = this._index.objects; var objnames = this._index.objnames; var titles = this._index.titles; var i; var results = []; for (var prefix in objects) { for (var name...
javascript
function(object, otherterms) { var filenames = this._index.filenames; var docnames = this._index.docnames; var objects = this._index.objects; var objnames = this._index.objnames; var titles = this._index.titles; var i; var results = []; for (var prefix in objects) { for (var name...
[ "function", "(", "object", ",", "otherterms", ")", "{", "var", "filenames", "=", "this", ".", "_index", ".", "filenames", ";", "var", "docnames", "=", "this", ".", "_index", ".", "docnames", ";", "var", "objects", "=", "this", ".", "_index", ".", "obje...
search for object names
[ "search", "for", "object", "names" ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/searchtools.js#L580-L642
29,970
shibukawa/i18n4v
docs/_static/searchtools.js
function(searchterms, excluded, terms, titleterms) { var docnames = this._index.docnames; var filenames = this._index.filenames; var titles = this._index.titles; var i, j, file; var fileMap = {}; var scoreMap = {}; var results = []; // perform the search on the required terms for (...
javascript
function(searchterms, excluded, terms, titleterms) { var docnames = this._index.docnames; var filenames = this._index.filenames; var titles = this._index.titles; var i, j, file; var fileMap = {}; var scoreMap = {}; var results = []; // perform the search on the required terms for (...
[ "function", "(", "searchterms", ",", "excluded", ",", "terms", ",", "titleterms", ")", "{", "var", "docnames", "=", "this", ".", "_index", ".", "docnames", ";", "var", "filenames", "=", "this", ".", "_index", ".", "filenames", ";", "var", "titles", "=", ...
search for full-text terms in the index
[ "search", "for", "full", "-", "text", "terms", "in", "the", "index" ]
0074ec080b988e78d99b6d1f6d297f07bf82efce
https://github.com/shibukawa/i18n4v/blob/0074ec080b988e78d99b6d1f6d297f07bf82efce/docs/_static/searchtools.js#L647-L727
29,971
redfin/stratocacher
packages/stratocacher/src/wrap.js
clean
function clean(args) { return Array.prototype.filter.call(args, v => v !== INVALIDATE); }
javascript
function clean(args) { return Array.prototype.filter.call(args, v => v !== INVALIDATE); }
[ "function", "clean", "(", "args", ")", "{", "return", "Array", ".", "prototype", ".", "filter", ".", "call", "(", "args", ",", "v", "=>", "v", "!==", "INVALIDATE", ")", ";", "}" ]
Return an array containing elements from supplied `arguments` object that are not control symbols.
[ "Return", "an", "array", "containing", "elements", "from", "supplied", "arguments", "object", "that", "are", "not", "control", "symbols", "." ]
43e2af5e04966a0ce73012ebba62ff6184cceba6
https://github.com/redfin/stratocacher/blob/43e2af5e04966a0ce73012ebba62ff6184cceba6/packages/stratocacher/src/wrap.js#L221-L223
29,972
bigeasy/proof
proof.js
json
function json (program, callback) { var formatterRedux = formatter(jsonRedux()) parse(program.stdin, program.stderr, printer(formatterRedux, program.stdout, program.stderr), callback) }
javascript
function json (program, callback) { var formatterRedux = formatter(jsonRedux()) parse(program.stdin, program.stderr, printer(formatterRedux, program.stdout, program.stderr), callback) }
[ "function", "json", "(", "program", ",", "callback", ")", "{", "var", "formatterRedux", "=", "formatter", "(", "jsonRedux", "(", ")", ")", "parse", "(", "program", ".", "stdin", ",", "program", ".", "stderr", ",", "printer", "(", "formatterRedux", ",", "...
Moved exports.json to its own file.
[ "Moved", "exports", ".", "json", "to", "its", "own", "file", "." ]
a59210838cc80457ae77e54a2e6d7ce955be9596
https://github.com/bigeasy/proof/blob/a59210838cc80457ae77e54a2e6d7ce955be9596/proof.js#L25-L28
29,973
thusoy/grunt-pylint
tasks/pylint.js
getPythonExecutable
function getPythonExecutable(options, platform) { if (options.virtualenv) { var isWin = /^win/.test(platform); var pythonExec = isWin ? path.join(options.virtualenv, 'Scripts', 'python.exe') : path.join(options.virtualenv, 'bin', 'python'); delete options.virtualenv; return p...
javascript
function getPythonExecutable(options, platform) { if (options.virtualenv) { var isWin = /^win/.test(platform); var pythonExec = isWin ? path.join(options.virtualenv, 'Scripts', 'python.exe') : path.join(options.virtualenv, 'bin', 'python'); delete options.virtualenv; return p...
[ "function", "getPythonExecutable", "(", "options", ",", "platform", ")", "{", "if", "(", "options", ".", "virtualenv", ")", "{", "var", "isWin", "=", "/", "^win", "/", ".", "test", "(", "platform", ")", ";", "var", "pythonExec", "=", "isWin", "?", "pat...
Get the path to the python executable, using the options.virtualenv parameter. Will remove the virtualenv parameter from the options object if present
[ "Get", "the", "path", "to", "the", "python", "executable", "using", "the", "options", ".", "virtualenv", "parameter", ".", "Will", "remove", "the", "virtualenv", "parameter", "from", "the", "options", "object", "if", "present" ]
1911144b76b144c991e721c794640c06101a8bf1
https://github.com/thusoy/grunt-pylint/blob/1911144b76b144c991e721c794640c06101a8bf1/tasks/pylint.js#L23-L34
29,974
thusoy/grunt-pylint
tasks/pylint.js
getPythonCode
function getPythonCode(options) { var pythonCode = [], internalPylint = !options.externalPylint, pylintPath = path.join(__dirname, 'lib'), initHook = options.initHook; delete options.initHook; if (initHook) { pythonCode.push(initHook); } if (internalPylint) { py...
javascript
function getPythonCode(options) { var pythonCode = [], internalPylint = !options.externalPylint, pylintPath = path.join(__dirname, 'lib'), initHook = options.initHook; delete options.initHook; if (initHook) { pythonCode.push(initHook); } if (internalPylint) { py...
[ "function", "getPythonCode", "(", "options", ")", "{", "var", "pythonCode", "=", "[", "]", ",", "internalPylint", "=", "!", "options", ".", "externalPylint", ",", "pylintPath", "=", "path", ".", "join", "(", "__dirname", ",", "'lib'", ")", ",", "initHook",...
Get the python code that will import and execute pylint Uses the options.externalPylint parameter to determine whether to use the pylint included with the plugin or an external one. externalPylint is deleted from the options object.
[ "Get", "the", "python", "code", "that", "will", "import", "and", "execute", "pylint", "Uses", "the", "options", ".", "externalPylint", "parameter", "to", "determine", "whether", "to", "use", "the", "pylint", "included", "with", "the", "plugin", "or", "an", "...
1911144b76b144c991e721c794640c06101a8bf1
https://github.com/thusoy/grunt-pylint/blob/1911144b76b144c991e721c794640c06101a8bf1/tasks/pylint.js#L39-L57
29,975
thusoy/grunt-pylint
tasks/pylint.js
function (options) { var pylintArgs = []; var enable = options.enable; delete options.enable; if (enable) { pylintArgs.push('--enable=' + enable); } var disable = options.disable; delete options.disable; if (disable) { pylintArgs.push('--disable=' + disable); } v...
javascript
function (options) { var pylintArgs = []; var enable = options.enable; delete options.enable; if (enable) { pylintArgs.push('--enable=' + enable); } var disable = options.disable; delete options.disable; if (disable) { pylintArgs.push('--disable=' + disable); } v...
[ "function", "(", "options", ")", "{", "var", "pylintArgs", "=", "[", "]", ";", "var", "enable", "=", "options", ".", "enable", ";", "delete", "options", ".", "enable", ";", "if", "(", "enable", ")", "{", "pylintArgs", ".", "push", "(", "'--enable='", ...
Build the argument list sent to pylint from the options object
[ "Build", "the", "argument", "list", "sent", "to", "pylint", "from", "the", "options", "object" ]
1911144b76b144c991e721c794640c06101a8bf1
https://github.com/thusoy/grunt-pylint/blob/1911144b76b144c991e721c794640c06101a8bf1/tasks/pylint.js#L60-L153
29,976
ctco/rosemary-ui
src/Eventplanner/Selection.js
normalizeDistance
function normalizeDistance(distance = 0) { if (typeof distance !== 'object') distance = { top: distance, left: distance, right: distance, bottom: distance }; return distance; }
javascript
function normalizeDistance(distance = 0) { if (typeof distance !== 'object') distance = { top: distance, left: distance, right: distance, bottom: distance }; return distance; }
[ "function", "normalizeDistance", "(", "distance", "=", "0", ")", "{", "if", "(", "typeof", "distance", "!==", "'object'", ")", "distance", "=", "{", "top", ":", "distance", ",", "left", ":", "distance", ",", "right", ":", "distance", ",", "bottom", ":", ...
Resolve the disance prop from either an Int or an Object @return {Object}
[ "Resolve", "the", "disance", "prop", "from", "either", "an", "Int", "or", "an", "Object" ]
b9b91f5a23bd5e832563fbca93da2d271c3720bb
https://github.com/ctco/rosemary-ui/blob/b9b91f5a23bd5e832563fbca93da2d271c3720bb/src/Eventplanner/Selection.js#L196-L200
29,977
opendigitaleducation/sijil.js
docs/libs/typescript.js
mark
function mark(markName) { if (enabled) { marks[markName] = ts.timestamp(); counts[markName] = (counts[markName] || 0) + 1; profilerEvent(markName); } }
javascript
function mark(markName) { if (enabled) { marks[markName] = ts.timestamp(); counts[markName] = (counts[markName] || 0) + 1; profilerEvent(markName); } }
[ "function", "mark", "(", "markName", ")", "{", "if", "(", "enabled", ")", "{", "marks", "[", "markName", "]", "=", "ts", ".", "timestamp", "(", ")", ";", "counts", "[", "markName", "]", "=", "(", "counts", "[", "markName", "]", "||", "0", ")", "+...
Marks a performance event. @param markName The name of the mark.
[ "Marks", "a", "performance", "event", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L935-L941
29,978
opendigitaleducation/sijil.js
docs/libs/typescript.js
measure
function measure(measureName, startMarkName, endMarkName) { if (enabled) { var end = endMarkName && marks[endMarkName] || ts.timestamp(); var start = startMarkName && marks[startMarkName] || profilerStart; measures[measureName] = (measures[measureName] || 0) +...
javascript
function measure(measureName, startMarkName, endMarkName) { if (enabled) { var end = endMarkName && marks[endMarkName] || ts.timestamp(); var start = startMarkName && marks[startMarkName] || profilerStart; measures[measureName] = (measures[measureName] || 0) +...
[ "function", "measure", "(", "measureName", ",", "startMarkName", ",", "endMarkName", ")", "{", "if", "(", "enabled", ")", "{", "var", "end", "=", "endMarkName", "&&", "marks", "[", "endMarkName", "]", "||", "ts", ".", "timestamp", "(", ")", ";", "var", ...
Adds a performance measurement with the specified name. @param measureName The name of the performance measurement. @param startMarkName The name of the starting mark. If not supplied, the point at which the profiler was enabled is used. @param endMarkName The name of the ending mark. If not supplied, the current time...
[ "Adds", "a", "performance", "measurement", "with", "the", "specified", "name", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L952-L958
29,979
opendigitaleducation/sijil.js
docs/libs/typescript.js
find
function find(array, predicate) { for (var i = 0, len = array.length; i < len; i++) { var value = array[i]; if (predicate(value, i)) { return value; } } return undefined; }
javascript
function find(array, predicate) { for (var i = 0, len = array.length; i < len; i++) { var value = array[i]; if (predicate(value, i)) { return value; } } return undefined; }
[ "function", "find", "(", "array", ",", "predicate", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "array", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "value", "=", "array", "[", "i", "]", ";", "if", ...
Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found.
[ "Works", "like", "Array", ".", "prototype", ".", "find", "returning", "undefined", "if", "no", "element", "satisfying", "the", "predicate", "is", "found", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1120-L1128
29,980
opendigitaleducation/sijil.js
docs/libs/typescript.js
findMap
function findMap(array, callback) { for (var i = 0, len = array.length; i < len; i++) { var result = callback(array[i], i); if (result) { return result; } } Debug.fail(); }
javascript
function findMap(array, callback) { for (var i = 0, len = array.length; i < len; i++) { var result = callback(array[i], i); if (result) { return result; } } Debug.fail(); }
[ "function", "findMap", "(", "array", ",", "callback", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "array", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "result", "=", "callback", "(", "array", "[", "i",...
Returns the first truthy result of `callback`, or else fails. This is like `forEach`, but never returns undefined.
[ "Returns", "the", "first", "truthy", "result", "of", "callback", "or", "else", "fails", ".", "This", "is", "like", "forEach", "but", "never", "returns", "undefined", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1134-L1142
29,981
opendigitaleducation/sijil.js
docs/libs/typescript.js
filter
function filter(array, f) { if (array) { var len = array.length; var i = 0; while (i < len && f(array[i])) i++; if (i < len) { var result = array.slice(0, i); i++; while (i < len) { ...
javascript
function filter(array, f) { if (array) { var len = array.length; var i = 0; while (i < len && f(array[i])) i++; if (i < len) { var result = array.slice(0, i); i++; while (i < len) { ...
[ "function", "filter", "(", "array", ",", "f", ")", "{", "if", "(", "array", ")", "{", "var", "len", "=", "array", ".", "length", ";", "var", "i", "=", "0", ";", "while", "(", "i", "<", "len", "&&", "f", "(", "array", "[", "i", "]", ")", ")"...
Filters an array by a predicate function. Returns the same array instance if the predicate is true for all elements, otherwise returns a new array instance containing the filtered subset.
[ "Filters", "an", "array", "by", "a", "predicate", "function", ".", "Returns", "the", "same", "array", "instance", "if", "the", "predicate", "is", "true", "for", "all", "elements", "otherwise", "returns", "a", "new", "array", "instance", "containing", "the", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1193-L1213
29,982
opendigitaleducation/sijil.js
docs/libs/typescript.js
getOwnKeys
function getOwnKeys(map) { var keys = []; for (var key in map) if (hasOwnProperty.call(map, key)) { keys.push(key); } return keys; }
javascript
function getOwnKeys(map) { var keys = []; for (var key in map) if (hasOwnProperty.call(map, key)) { keys.push(key); } return keys; }
[ "function", "getOwnKeys", "(", "map", ")", "{", "var", "keys", "=", "[", "]", ";", "for", "(", "var", "key", "in", "map", ")", "if", "(", "hasOwnProperty", ".", "call", "(", "map", ",", "key", ")", ")", "{", "keys", ".", "push", "(", "key", ")"...
Gets the owned, enumerable property keys of a map-like. NOTE: This is intended for use with MapLike<T> objects. For Map<T> objects, use Object.keys instead as it offers better performance. @param map A map-like.
[ "Gets", "the", "owned", "enumerable", "property", "keys", "of", "a", "map", "-", "like", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1432-L1439
29,983
opendigitaleducation/sijil.js
docs/libs/typescript.js
reduceProperties
function reduceProperties(map, callback, initial) { var result = initial; for (var key in map) { result = callback(result, map[key], String(key)); } return result; }
javascript
function reduceProperties(map, callback, initial) { var result = initial; for (var key in map) { result = callback(result, map[key], String(key)); } return result; }
[ "function", "reduceProperties", "(", "map", ",", "callback", ",", "initial", ")", "{", "var", "result", "=", "initial", ";", "for", "(", "var", "key", "in", "map", ")", "{", "result", "=", "callback", "(", "result", ",", "map", "[", "key", "]", ",", ...
Reduce the properties of a map. NOTE: This is intended for use with Map<T> objects. For MapLike<T> objects, use reduceOwnProperties instead as it offers better runtime safety. @param map The map to reduce @param callback An aggregation function that is called for each entry in the map @param initial The initial value...
[ "Reduce", "the", "properties", "of", "a", "map", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1492-L1498
29,984
opendigitaleducation/sijil.js
docs/libs/typescript.js
equalOwnProperties
function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; if (!left || !right) return false; for (var key in left) if (hasOwnProperty.call(left, key)) { if (!hasOwnProperty.call(right, key) === undefined) ...
javascript
function equalOwnProperties(left, right, equalityComparer) { if (left === right) return true; if (!left || !right) return false; for (var key in left) if (hasOwnProperty.call(left, key)) { if (!hasOwnProperty.call(right, key) === undefined) ...
[ "function", "equalOwnProperties", "(", "left", ",", "right", ",", "equalityComparer", ")", "{", "if", "(", "left", "===", "right", ")", "return", "true", ";", "if", "(", "!", "left", "||", "!", "right", ")", "return", "false", ";", "for", "(", "var", ...
Performs a shallow equality comparison of the contents of two map-likes. @param left A map-like whose properties should be compared. @param right A map-like whose properties should be compared.
[ "Performs", "a", "shallow", "equality", "comparison", "of", "the", "contents", "of", "two", "map", "-", "likes", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1525-L1543
29,985
opendigitaleducation/sijil.js
docs/libs/typescript.js
removeTrailingDirectorySeparator
function removeTrailingDirectorySeparator(path) { if (path.charAt(path.length - 1) === ts.directorySeparator) { return path.substr(0, path.length - 1); } return path; }
javascript
function removeTrailingDirectorySeparator(path) { if (path.charAt(path.length - 1) === ts.directorySeparator) { return path.substr(0, path.length - 1); } return path; }
[ "function", "removeTrailingDirectorySeparator", "(", "path", ")", "{", "if", "(", "path", ".", "charAt", "(", "path", ".", "length", "-", "1", ")", "===", "ts", ".", "directorySeparator", ")", "{", "return", "path", ".", "substr", "(", "0", ",", "path", ...
Removes a trailing directory separator from a path. @param path The path.
[ "Removes", "a", "trailing", "directory", "separator", "from", "a", "path", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1971-L1976
29,986
opendigitaleducation/sijil.js
docs/libs/typescript.js
ensureTrailingDirectorySeparator
function ensureTrailingDirectorySeparator(path) { if (path.charAt(path.length - 1) !== ts.directorySeparator) { return path + ts.directorySeparator; } return path; }
javascript
function ensureTrailingDirectorySeparator(path) { if (path.charAt(path.length - 1) !== ts.directorySeparator) { return path + ts.directorySeparator; } return path; }
[ "function", "ensureTrailingDirectorySeparator", "(", "path", ")", "{", "if", "(", "path", ".", "charAt", "(", "path", ".", "length", "-", "1", ")", "!==", "ts", ".", "directorySeparator", ")", "{", "return", "path", "+", "ts", ".", "directorySeparator", ";...
Adds a trailing directory separator to a path, if it does not already have one. @param path The path.
[ "Adds", "a", "trailing", "directory", "separator", "to", "a", "path", "if", "it", "does", "not", "already", "have", "one", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L1982-L1987
29,987
opendigitaleducation/sijil.js
docs/libs/typescript.js
getBasePaths
function getBasePaths(path, includes, useCaseSensitiveFileNames) { // Storage for our results in the form of literal paths (e.g. the paths as written by the user). var basePaths = [path]; if (includes) { // Storage for literal base paths amongst the include patterns. var ...
javascript
function getBasePaths(path, includes, useCaseSensitiveFileNames) { // Storage for our results in the form of literal paths (e.g. the paths as written by the user). var basePaths = [path]; if (includes) { // Storage for literal base paths amongst the include patterns. var ...
[ "function", "getBasePaths", "(", "path", ",", "includes", ",", "useCaseSensitiveFileNames", ")", "{", "// Storage for our results in the form of literal paths (e.g. the paths as written by the user).", "var", "basePaths", "=", "[", "path", "]", ";", "if", "(", "includes", "...
Computes the unique non-wildcard base paths amongst the provided include patterns.
[ "Computes", "the", "unique", "non", "-", "wildcard", "base", "paths", "amongst", "the", "provided", "include", "patterns", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L2213-L2246
29,988
opendigitaleducation/sijil.js
docs/libs/typescript.js
isWhiteSpaceSingleLine
function isWhiteSpaceSingleLine(ch) { // Note: nextLine is in the Zs space, and should be considered to be a whitespace. // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. return ch === 32 /* space */ || ch === 9 /* tab */ || ch ===...
javascript
function isWhiteSpaceSingleLine(ch) { // Note: nextLine is in the Zs space, and should be considered to be a whitespace. // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. return ch === 32 /* space */ || ch === 9 /* tab */ || ch ===...
[ "function", "isWhiteSpaceSingleLine", "(", "ch", ")", "{", "// Note: nextLine is in the Zs space, and should be considered to be a whitespace.", "// It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript.", "return", "ch", "===", "32", "/* space */", "||", ...
Does not include line breaks. For that, see isWhiteSpaceLike.
[ "Does", "not", "include", "line", "breaks", ".", "For", "that", "see", "isWhiteSpaceLike", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L4098-L4113
29,989
opendigitaleducation/sijil.js
docs/libs/typescript.js
isRequireCall
function isRequireCall(expression, checkArgumentIsStringLiteral) { // of the form 'require("name")' var isRequire = expression.kind === 174 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expres...
javascript
function isRequireCall(expression, checkArgumentIsStringLiteral) { // of the form 'require("name")' var isRequire = expression.kind === 174 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expres...
[ "function", "isRequireCall", "(", "expression", ",", "checkArgumentIsStringLiteral", ")", "{", "// of the form 'require(\"name\")'", "var", "isRequire", "=", "expression", ".", "kind", "===", "174", "/* CallExpression */", "&&", "expression", ".", "expression", ".", "ki...
Returns true if the node is a CallExpression to the identifier 'require' with exactly one argument. This function does not test if the node is in a JavaScript file or not.
[ "Returns", "true", "if", "the", "node", "is", "a", "CallExpression", "to", "the", "identifier", "require", "with", "exactly", "one", "argument", ".", "This", "function", "does", "not", "test", "if", "the", "node", "is", "in", "a", "JavaScript", "file", "or...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L6597-L6604
29,990
opendigitaleducation/sijil.js
docs/libs/typescript.js
isDeclarationOfFunctionExpression
function isDeclarationOfFunctionExpression(s) { if (s.valueDeclaration && s.valueDeclaration.kind === 218 /* VariableDeclaration */) { var declaration = s.valueDeclaration; return declaration.initializer && declaration.initializer.kind === 179 /* FunctionExpression */; } ...
javascript
function isDeclarationOfFunctionExpression(s) { if (s.valueDeclaration && s.valueDeclaration.kind === 218 /* VariableDeclaration */) { var declaration = s.valueDeclaration; return declaration.initializer && declaration.initializer.kind === 179 /* FunctionExpression */; } ...
[ "function", "isDeclarationOfFunctionExpression", "(", "s", ")", "{", "if", "(", "s", ".", "valueDeclaration", "&&", "s", ".", "valueDeclaration", ".", "kind", "===", "218", "/* VariableDeclaration */", ")", "{", "var", "declaration", "=", "s", ".", "valueDeclara...
Returns true if the node is a variable declaration whose initializer is a function expression. This function does not test if the node is in a JavaScript file or not.
[ "Returns", "true", "if", "the", "node", "is", "a", "variable", "declaration", "whose", "initializer", "is", "a", "function", "expression", ".", "This", "function", "does", "not", "test", "if", "the", "node", "is", "in", "a", "JavaScript", "file", "or", "no...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L6614-L6620
29,991
opendigitaleducation/sijil.js
docs/libs/typescript.js
cloneNode
function cloneNode(node, location, flags, parent) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared protot...
javascript
function cloneNode(node, location, flags, parent) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared protot...
[ "function", "cloneNode", "(", "node", ",", "location", ",", "flags", ",", "parent", ")", "{", "// We don't use \"clone\" from core.ts here, as we need to preserve the prototype chain of", "// the original node. We also need to exclude specific properties and only include own-", "// prope...
Creates a shallow, memberwise clone of a node. The "kind", "pos", "end", "flags", and "parent" properties are excluded by default, and can be provided via the "location", "flags", and "parent" parameters. @param node The node to clone. @param location An optional TextRange to use to supply the new position. @param flag...
[ "Creates", "a", "shallow", "memberwise", "clone", "of", "a", "node", ".", "The", "kind", "pos", "end", "flags", "and", "parent", "properties", "are", "excluded", "by", "default", "and", "can", "be", "provided", "via", "the", "location", "flags", "and", "pa...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L7231-L7251
29,992
opendigitaleducation/sijil.js
docs/libs/typescript.js
cloneEntityName
function cloneEntityName(node, parent) { var clone = cloneNode(node, node, node.flags, parent); if (isQualifiedName(clone)) { var left = clone.left, right = clone.right; clone.left = cloneEntityName(left, clone); clone.right = cloneNode(right, right, right.flags, pare...
javascript
function cloneEntityName(node, parent) { var clone = cloneNode(node, node, node.flags, parent); if (isQualifiedName(clone)) { var left = clone.left, right = clone.right; clone.left = cloneEntityName(left, clone); clone.right = cloneNode(right, right, right.flags, pare...
[ "function", "cloneEntityName", "(", "node", ",", "parent", ")", "{", "var", "clone", "=", "cloneNode", "(", "node", ",", "node", ",", "node", ".", "flags", ",", "parent", ")", ";", "if", "(", "isQualifiedName", "(", "clone", ")", ")", "{", "var", "le...
Creates a deep clone of an EntityName, with new parent pointers. @param node The EntityName to clone. @param parent The parent for the cloned node.
[ "Creates", "a", "deep", "clone", "of", "an", "EntityName", "with", "new", "parent", "pointers", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L7258-L7266
29,993
opendigitaleducation/sijil.js
docs/libs/typescript.js
getExternalModuleNameFromPath
function getExternalModuleNameFromPath(host, fileName) { var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); var filePath = ts.getNormalizedAbsolutePath(fileName,...
javascript
function getExternalModuleNameFromPath(host, fileName) { var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); var filePath = ts.getNormalizedAbsolutePath(fileName,...
[ "function", "getExternalModuleNameFromPath", "(", "host", ",", "fileName", ")", "{", "var", "getCanonicalFileName", "=", "function", "(", "f", ")", "{", "return", "host", ".", "getCanonicalFileName", "(", "f", ")", ";", "}", ";", "var", "dir", "=", "ts", "...
Resolves a local path to a path which is absolute to the base of the emit
[ "Resolves", "a", "local", "path", "to", "a", "path", "which", "is", "absolute", "to", "the", "base", "of", "the", "emit" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L7496-L7502
29,994
opendigitaleducation/sijil.js
docs/libs/typescript.js
emitDetachedComments
function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { // removeComments is true, only reserve pinned comment at the top of file // For example: ...
javascript
function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { // removeComments is true, only reserve pinned comment at the top of file // For example: ...
[ "function", "emitDetachedComments", "(", "text", ",", "lineMap", ",", "writer", ",", "writeComment", ",", "node", ",", "newLine", ",", "removeComments", ")", "{", "var", "leadingComments", ";", "var", "currentDetachedCommentInfo", ";", "if", "(", "removeComments",...
Detached comment is a comment at the top of file or function body that is separated from the next statement by space.
[ "Detached", "comment", "is", "a", "comment", "at", "the", "top", "of", "file", "or", "function", "body", "that", "is", "separated", "from", "the", "next", "statement", "by", "space", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L7708-L7762
29,995
opendigitaleducation/sijil.js
docs/libs/typescript.js
tryExtractTypeScriptExtension
function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); }
javascript
function tryExtractTypeScriptExtension(fileName) { return ts.find(ts.supportedTypescriptExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); }); }
[ "function", "tryExtractTypeScriptExtension", "(", "fileName", ")", "{", "return", "ts", ".", "find", "(", "ts", ".", "supportedTypescriptExtensionsForExtractExtension", ",", "function", "(", "extension", ")", "{", "return", "ts", ".", "fileExtensionIs", "(", "fileNa...
Return ".ts", ".d.ts", or ".tsx", if that is the extension.
[ "Return", ".", "ts", ".", "d", ".", "ts", "or", ".", "tsx", "if", "that", "is", "the", "extension", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L7937-L7939
29,996
opendigitaleducation/sijil.js
docs/libs/typescript.js
convertToBase64
function convertToBase64(input) { var result = ""; var charCodes = getExpandedCharCodes(input); var i = 0; var length = charCodes.length; var byte1, byte2, byte3, byte4; while (i < length) { // Convert every 6-bits in the input 3 character points /...
javascript
function convertToBase64(input) { var result = ""; var charCodes = getExpandedCharCodes(input); var i = 0; var length = charCodes.length; var byte1, byte2, byte3, byte4; while (i < length) { // Convert every 6-bits in the input 3 character points /...
[ "function", "convertToBase64", "(", "input", ")", "{", "var", "result", "=", "\"\"", ";", "var", "charCodes", "=", "getExpandedCharCodes", "(", "input", ")", ";", "var", "i", "=", "0", ";", "var", "length", "=", "charCodes", ".", "length", ";", "var", ...
Converts a string to a base-64 encoded ASCII string.
[ "Converts", "a", "string", "to", "a", "base", "-", "64", "encoded", "ASCII", "string", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L8020-L8046
29,997
opendigitaleducation/sijil.js
docs/libs/typescript.js
collapseTextChangeRangesAcrossMultipleVersions
function collapseTextChangeRangesAcrossMultipleVersions(changes) { if (changes.length === 0) { return ts.unchangedTextChangeRange; } if (changes.length === 1) { return changes[0]; } // We change from talking about { { oldStart, oldLength }, newLength } to ...
javascript
function collapseTextChangeRangesAcrossMultipleVersions(changes) { if (changes.length === 0) { return ts.unchangedTextChangeRange; } if (changes.length === 1) { return changes[0]; } // We change from talking about { { oldStart, oldLength }, newLength } to ...
[ "function", "collapseTextChangeRangesAcrossMultipleVersions", "(", "changes", ")", "{", "if", "(", "changes", ".", "length", "===", "0", ")", "{", "return", "ts", ".", "unchangedTextChangeRange", ";", "}", "if", "(", "changes", ".", "length", "===", "1", ")", ...
Called to merge all the changes that occurred across several versions of a script snapshot into a single change. i.e. if a user keeps making successive edits to a script we will have a text change from V1 to V2, V2 to V3, ..., Vn. This function will then merge those changes into a single change range valid between V1...
[ "Called", "to", "merge", "all", "the", "changes", "that", "occurred", "across", "several", "versions", "of", "a", "script", "snapshot", "into", "a", "single", "change", ".", "i", ".", "e", ".", "if", "a", "user", "keeps", "making", "successive", "edits", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L8179-L8284
29,998
opendigitaleducation/sijil.js
docs/libs/typescript.js
isIdentifier
function isIdentifier() { if (token() === 69 /* Identifier */) { return true; } // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. if (token() === 114 /* YieldKey...
javascript
function isIdentifier() { if (token() === 69 /* Identifier */) { return true; } // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. if (token() === 114 /* YieldKey...
[ "function", "isIdentifier", "(", ")", "{", "if", "(", "token", "(", ")", "===", "69", "/* Identifier */", ")", "{", "return", "true", ";", "}", "// If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is", "// considered a keyword and is not an identif...
Ignore strict mode flag because we will report an error in type checker instead.
[ "Ignore", "strict", "mode", "flag", "because", "we", "will", "report", "an", "error", "in", "type", "checker", "instead", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L9175-L9190
29,999
opendigitaleducation/sijil.js
docs/libs/typescript.js
isListElement
function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); if (node) { return true; } switch (parsingContext) { case 0 /* SourceElements */: case 1 /* BlockStatements */: ...
javascript
function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); if (node) { return true; } switch (parsingContext) { case 0 /* SourceElements */: case 1 /* BlockStatements */: ...
[ "function", "isListElement", "(", "parsingContext", ",", "inErrorRecovery", ")", "{", "var", "node", "=", "currentNode", "(", "parsingContext", ")", ";", "if", "(", "node", ")", "{", "return", "true", ";", "}", "switch", "(", "parsingContext", ")", "{", "c...
True if positioned at the start of a list element
[ "True", "if", "positioned", "at", "the", "start", "of", "a", "list", "element" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L9395-L9474