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
partition
stringclasses
1 value
bq/corbel-js
dist/corbel.with-polyfills.js
function(scopes) { console.log('iamInterface.group.addScopes', scopes); corbel.validate.value('id', this.id); return this.request({ url: this._buildUriWithDomain(this.uri, this.id) + '/scope', method: corbel.request.method.PUT, ...
javascript
function(scopes) { console.log('iamInterface.group.addScopes', scopes); corbel.validate.value('id', this.id); return this.request({ url: this._buildUriWithDomain(this.uri, this.id) + '/scope', method: corbel.request.method.PUT, ...
[ "function", "(", "scopes", ")", "{", "console", ".", "log", "(", "'iamInterface.group.addScopes'", ",", "scopes", ")", ";", "corbel", ".", "validate", ".", "value", "(", "'id'", ",", "this", ".", "id", ")", ";", "return", "this", ".", "request", "(", "...
Add scopes to a group. @method @memberOf corbel.Iam.GroupBuilder @param {Array} scopes Group scopes to add. @return {Promise} A promise which resolves to undefined(void) or fails with a {@link SilkRoadError}.
[ "Add", "scopes", "to", "a", "group", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4658-L4667
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(email) { console.log('iamInterface.email.availability', email); corbel.validate.value('email', email); return this.request({ url: this._buildUriWithDomain(this.uri, email), method: corbel.request.method.HEAD ...
javascript
function(email) { console.log('iamInterface.email.availability', email); corbel.validate.value('email', email); return this.request({ url: this._buildUriWithDomain(this.uri, email), method: corbel.request.method.HEAD ...
[ "function", "(", "email", ")", "{", "console", ".", "log", "(", "'iamInterface.email.availability'", ",", "email", ")", ";", "corbel", ".", "validate", ".", "value", "(", "'email'", ",", "email", ")", ";", "return", "this", ".", "request", "(", "{", "url...
Return availability endpoint. @method @memberOf corbel.Iam.EmailBuilder @param {String} email The email. @return {Promise} A promise which resolves into email availability boolean state.
[ "Return", "availability", "endpoint", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4763-L4782
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(srcType, srcId, destType, destId) { var urlBase = this.driver.config.getCurrentEndpoint(corbel.Resources.moduleName, this._buildPort(this.driver.config)); var domain = this.driver.config.get(corbel.Iam.IAM_DOMAIN, 'unauthenticated'); var customDomain = this.dri...
javascript
function(srcType, srcId, destType, destId) { var urlBase = this.driver.config.getCurrentEndpoint(corbel.Resources.moduleName, this._buildPort(this.driver.config)); var domain = this.driver.config.get(corbel.Iam.IAM_DOMAIN, 'unauthenticated'); var customDomain = this.dri...
[ "function", "(", "srcType", ",", "srcId", ",", "destType", ",", "destId", ")", "{", "var", "urlBase", "=", "this", ".", "driver", ".", "config", ".", "getCurrentEndpoint", "(", "corbel", ".", "Resources", ".", "moduleName", ",", "this", ".", "_buildPort", ...
Helper function to build the request uri @param {String} srcType Type of the resource @param {String} srcId Id of the resource @param {String} relType Type of the relationed resource @param {String} destId Information of the relationed resource @return {String} Uri to perform the requ...
[ "Helper", "function", "to", "build", "the", "request", "uri" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5457-L5479
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(destId, relationData, options) { options = this.getDefaultOptions(options); corbel.validate.value('destId', destId); var args = corbel.utils.extend(options, { url: this.buildUri(this.type, this.srcId, this.destType, destId), ...
javascript
function(destId, relationData, options) { options = this.getDefaultOptions(options); corbel.validate.value('destId', destId); var args = corbel.utils.extend(options, { url: this.buildUri(this.type, this.srcId, this.destType, destId), ...
[ "function", "(", "destId", ",", "relationData", ",", "options", ")", "{", "options", "=", "this", ".", "getDefaultOptions", "(", "options", ")", ";", "corbel", ".", "validate", ".", "value", "(", "'destId'", ",", "destId", ")", ";", "var", "args", "=", ...
Adds a new relation between Resources @method @memberOf Resources.Relation @param {String} destId Relationed resource @param {Object} relationData Additional data to be added to the relation (in json) @return {Promise} ES6 promise that resolves to undefined (void) or rejects with a {@link CorbelE...
[ "Adds", "a", "new", "relation", "between", "Resources" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5566-L5579
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(relationData, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type, this.srcId, this.destType), data: relationData, method: corbel.request.method....
javascript
function(relationData, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type, this.srcId, this.destType), data: relationData, method: corbel.request.method....
[ "function", "(", "relationData", ",", "options", ")", "{", "options", "=", "this", ".", "getDefaultOptions", "(", "options", ")", ";", "var", "args", "=", "corbel", ".", "utils", ".", "extend", "(", "options", ",", "{", "url", ":", "this", ".", "buildU...
Adds a new anonymous relation @method @memberOf Resources.Relation @param {Object} relationData Additional data to be added to the relation (in json) @return {Promise} ES6 promise that resolves to undefined (void) or rejects with a {@link CorbelError} @example uri = '555'
[ "Adds", "a", "new", "anonymous", "relation" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5589-L5601
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(destId, pos, options) { corbel.validate.value('destId', destId); var positionStartId = destId.indexOf('/'); if (positionStartId !== -1) { destId = destId.substring(positionStartId + 1); } options = this.getDefa...
javascript
function(destId, pos, options) { corbel.validate.value('destId', destId); var positionStartId = destId.indexOf('/'); if (positionStartId !== -1) { destId = destId.substring(positionStartId + 1); } options = this.getDefa...
[ "function", "(", "destId", ",", "pos", ",", "options", ")", "{", "corbel", ".", "validate", ".", "value", "(", "'destId'", ",", "destId", ")", ";", "var", "positionStartId", "=", "destId", ".", "indexOf", "(", "'/'", ")", ";", "if", "(", "positionStart...
Move a relation @method @memberOf Resources.Relation @param {Integer} pos The new position @return {Promise} ES6 promise that resolves to undefined (void) or rejects with a {@link CorbelError}
[ "Move", "a", "relation" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5610-L5629
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(data, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type), method: corbel.request.method.POST, contentType: options.dataType, ...
javascript
function(data, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type), method: corbel.request.method.POST, contentType: options.dataType, ...
[ "function", "(", "data", ",", "options", ")", "{", "options", "=", "this", ".", "getDefaultOptions", "(", "options", ")", ";", "var", "args", "=", "corbel", ".", "utils", ".", "extend", "(", "options", ",", "{", "url", ":", "this", ".", "buildUri", "...
Adds a new element to a collection @method @memberOf Resources.CollectionBuilder @param {object} data Data array added to the collection @param {object} options Options object with dataType request option @return {Promise} ES6 promise that resolves to the new resource id or rejects with a {@link C...
[ "Adds", "a", "new", "element", "to", "a", "collection" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5704-L5718
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(data, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type), method: corbel.request.method.PUT, contentType: options.dataType, ...
javascript
function(data, options) { options = this.getDefaultOptions(options); var args = corbel.utils.extend(options, { url: this.buildUri(this.type), method: corbel.request.method.PUT, contentType: options.dataType, ...
[ "function", "(", "data", ",", "options", ")", "{", "options", "=", "this", ".", "getDefaultOptions", "(", "options", ")", ";", "var", "args", "=", "corbel", ".", "utils", ".", "extend", "(", "options", ",", "{", "url", ":", "this", ".", "buildUri", "...
Update every element in a collection, accepts query params @method @memberOf resources.CollectionBuilder @param {Object} data The element to be updated @param {Object} options/query Options object with dataType request option @return {Promise} ES6 promise that resolves to an {Array} of ...
[ "Update", "every", "element", "in", "a", "collection", "accepts", "query", "params" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5728-L5740
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(acl) { var args = { url: this.buildUri(this.type, this.id), method: corbel.request.method.PUT, data: acl, Accept: 'application/corbel.acl+json' }; return this.request(args); ...
javascript
function(acl) { var args = { url: this.buildUri(this.type, this.id), method: corbel.request.method.PUT, data: acl, Accept: 'application/corbel.acl+json' }; return this.request(args); ...
[ "function", "(", "acl", ")", "{", "var", "args", "=", "{", "url", ":", "this", ".", "buildUri", "(", "this", ".", "type", ",", "this", ".", "id", ")", ",", "method", ":", "corbel", ".", "request", ".", "method", ".", "PUT", ",", "data", ":", "a...
Updates the ACL of a resource @method @memberOf resources.Resource @param {Object} acl Acl to be updated @return {Promise} ES6 promise that resolves to undefined (void) or rejects with a {@link CorbelError}
[ "Updates", "the", "ACL", "of", "a", "resource" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L5846-L5855
train
bq/corbel-js
dist/corbel.with-polyfills.js
function() { console.log('oauthInterface.authorization.dialog'); var that = this; return this.request({ url: this._buildUri(this.uri + '/authorize'), method: corbel.request.method.GET, dataType: 'tex...
javascript
function() { console.log('oauthInterface.authorization.dialog'); var that = this; return this.request({ url: this._buildUri(this.uri + '/authorize'), method: corbel.request.method.GET, dataType: 'tex...
[ "function", "(", ")", "{", "console", ".", "log", "(", "'oauthInterface.authorization.dialog'", ")", ";", "var", "that", "=", "this", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", ".", "uri", "+", "...
Does a login with stored cookie in oauth server @method @memberOf corbel.Oauth.AuthorizationBuilder @return {Promise} Q promise that resolves to a redirection to redirectUri or rejects with a 404 {@link CorbelError}
[ "Does", "a", "login", "with", "stored", "cookie", "in", "oauth", "server" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6021-L6041
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(username, password, setCookie, redirect) { console.log('oauthInterface.authorization.login', username + ':' + password); if (username) { this.params.data.username = username; } if (password) { this.params....
javascript
function(username, password, setCookie, redirect) { console.log('oauthInterface.authorization.login', username + ':' + password); if (username) { this.params.data.username = username; } if (password) { this.params....
[ "function", "(", "username", ",", "password", ",", "setCookie", ",", "redirect", ")", "{", "console", ".", "log", "(", "'oauthInterface.authorization.login'", ",", "username", "+", "':'", "+", "password", ")", ";", "if", "(", "username", ")", "{", "this", ...
Does a login in oauth server @method @memberOf corbel.Oauth.AuthorizationBuilder @param {String} username The username of the user to log in @param {String} password The password of the user @param {Boolean} setCookie Sends 'RequestCookie' to the server @param {Boolean} redirect The user when he does the login @ret...
[ "Does", "a", "login", "in", "oauth", "server" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6052-L6108
train
bq/corbel-js
dist/corbel.with-polyfills.js
function() { console.log('oauthInterface.authorization.signOut'); delete this.params.data; return this.request({ url: this._buildUri(this.uri + '/signout'), method: corbel.request.method.GET, withCredentials: tru...
javascript
function() { console.log('oauthInterface.authorization.signOut'); delete this.params.data; return this.request({ url: this._buildUri(this.uri + '/signout'), method: corbel.request.method.GET, withCredentials: tru...
[ "function", "(", ")", "{", "console", ".", "log", "(", "'oauthInterface.authorization.signOut'", ")", ";", "delete", "this", ".", "params", ".", "data", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", "...
Sign out from oauth server @method @memberOf corbel.Oauth.SignOutBuilder @return {Promise} promise that resolves empty when the sign out process completes or rejects with a {@link CorbelError}
[ "Sign", "out", "from", "oauth", "server" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6116-L6126
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(user) { console.log('oauthInterface.user.create', user); return this.request({ url: this._buildUri(this.uri), method: corbel.request.method.POST, headers: { Authorization: 'Basic...
javascript
function(user) { console.log('oauthInterface.user.create', user); return this.request({ url: this._buildUri(this.uri), method: corbel.request.method.POST, headers: { Authorization: 'Basic...
[ "function", "(", "user", ")", "{", "console", ".", "log", "(", "'oauthInterface.user.create'", ",", "user", ")", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", ".", "uri", ")", ",", "method", ":", ...
Adds a new user to the oauth server. @method @memberOf corbel.Oauth.UserBuilder @param {Object} user The user to be created @return {Promise} A promise with the id of the created user or fails with a {@link corbelError}.
[ "Adds", "a", "new", "user", "to", "the", "oauth", "server", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6266-L6281
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(notification) { console.log('notificationsInterface.notification.sendNotification', notification); this.uri += '/send'; return this.request({ url: this.buildUri(this.uri), method: corbel.request.method.POST, ...
javascript
function(notification) { console.log('notificationsInterface.notification.sendNotification', notification); this.uri += '/send'; return this.request({ url: this.buildUri(this.uri), method: corbel.request.method.POST, ...
[ "function", "(", "notification", ")", "{", "console", ".", "log", "(", "'notificationsInterface.notification.sendNotification'", ",", "notification", ")", ";", "this", ".", "uri", "+=", "'/send'", ";", "return", "this", ".", "request", "(", "{", "url", ":", "t...
Send a notification @method @memberOf Corbel.Notifications.NotificationsBuilder @param {Object} notification Notification @param {String} notification.notificationId Notification id (mail, sms...) @param {String} notification.recipient Notification recipient @param {Object} notification.propierties No...
[ "Send", "a", "notification" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6551-L6559
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(couponIds) { console.log('ecInterface.order.prepare'); corbel.validate.value('id', this.id); return this.request({ url: this._buildUri(this.uri, this.id, '/prepare'), method: corbel.request.method.POST, ...
javascript
function(couponIds) { console.log('ecInterface.order.prepare'); corbel.validate.value('id', this.id); return this.request({ url: this._buildUri(this.uri, this.id, '/prepare'), method: corbel.request.method.POST, ...
[ "function", "(", "couponIds", ")", "{", "console", ".", "log", "(", "'ecInterface.order.prepare'", ")", ";", "corbel", ".", "validate", ".", "value", "(", "'id'", ",", "this", ".", "id", ")", ";", "return", "this", ".", "request", "(", "{", "url", ":",...
Prepares the order, required to checkout @method @memberOf corbel.Ec.OrderBuilder @param {string[]} couponIds Array of String with the coupons ids to prepare the order @return {Promise} Q promise that resolves to undefined (void) or rejects with a {@link SilkRoadError}
[ "Prepares", "the", "order", "required", "to", "checkout" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6975-L6984
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(data) { console.log('ecInterface.order.checkout'); if (!data.paymentMethodIds) { return Promise.reject(new Error('paymentMethodIds lists needed')); } if (!data.paymentMethodIds.length) { return Promise.reje...
javascript
function(data) { console.log('ecInterface.order.checkout'); if (!data.paymentMethodIds) { return Promise.reject(new Error('paymentMethodIds lists needed')); } if (!data.paymentMethodIds.length) { return Promise.reje...
[ "function", "(", "data", ")", "{", "console", ".", "log", "(", "'ecInterface.order.checkout'", ")", ";", "if", "(", "!", "data", ".", "paymentMethodIds", ")", "{", "return", "Promise", ".", "reject", "(", "new", "Error", "(", "'paymentMethodIds lists needed'",...
Checks out the Order @method @memberOf corbel.Ec.OrderBuilder @param {Object} data Purchase information to do the checkout @param {string[]} data.paymentMethodIds Array of String with the payment methods ids to checkout the order @return {Promise} Promise that resolves in the...
[ "Checks", "out", "the", "Order" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L6995-L7012
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(product) { console.log('ecInterface.product.create', product); return this.request({ url: this._buildUri(this.uri), method: corbel.request.method.POST, data: product }).then(function(res) { ...
javascript
function(product) { console.log('ecInterface.product.create', product); return this.request({ url: this._buildUri(this.uri), method: corbel.request.method.POST, data: product }).then(function(res) { ...
[ "function", "(", "product", ")", "{", "console", ".", "log", "(", "'ecInterface.product.create'", ",", "product", ")", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", ".", "uri", ")", ",", "method", "...
Create a new product. @method @memberOf corbel.Ec.ProductBuilder @param {Object} product Contains the data of the new product @param {Object} product.name The name of the product @param {String} product.price Information about price @param {String} product.pric...
[ "Create", "a", "new", "product", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7083-L7093
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(eventData) { if (!eventData) { throw new Error('Send event require data'); } console.log('evciInterface.publish', eventData); corbel.validate.value('eventType', this.eventType); return this.request({ ...
javascript
function(eventData) { if (!eventData) { throw new Error('Send event require data'); } console.log('evciInterface.publish', eventData); corbel.validate.value('eventType', this.eventType); return this.request({ ...
[ "function", "(", "eventData", ")", "{", "if", "(", "!", "eventData", ")", "{", "throw", "new", "Error", "(", "'Send event require data'", ")", ";", "}", "console", ".", "log", "(", "'evciInterface.publish'", ",", "eventData", ")", ";", "corbel", ".", "vali...
Publish a new event. @method @memberOf corbel.Evci.EventBuilder @param {Object} eventData The data of the event. @return {Promise} A promise with the id of the created scope or fails with a {@link corbelError}.
[ "Publish", "a", "new", "event", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7271-L7284
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(id) { var resource = new corbel.Borrow.BorrowBuilder(id); resource.driver = this.driver; return resource; }
javascript
function(id) { var resource = new corbel.Borrow.BorrowBuilder(id); resource.driver = this.driver; return resource; }
[ "function", "(", "id", ")", "{", "var", "resource", "=", "new", "corbel", ".", "Borrow", ".", "BorrowBuilder", "(", "id", ")", ";", "resource", ".", "driver", "=", "this", ".", "driver", ";", "return", "resource", ";", "}" ]
Create a BorrowBuilder for resource managing requests. @param {String} id The id of the borrow. @return {corbel.Borrow.BorrowBuilder}
[ "Create", "a", "BorrowBuilder", "for", "resource", "managing", "requests", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7339-L7343
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(id) { var lender = new corbel.Borrow.LenderBuilder(id); lender.driver = this.driver; return lender; }
javascript
function(id) { var lender = new corbel.Borrow.LenderBuilder(id); lender.driver = this.driver; return lender; }
[ "function", "(", "id", ")", "{", "var", "lender", "=", "new", "corbel", ".", "Borrow", ".", "LenderBuilder", "(", "id", ")", ";", "lender", ".", "driver", "=", "this", ".", "driver", ";", "return", "lender", ";", "}" ]
Create a LenderBuilder for lender managing requests. @param {String} id The id of the lender. @return {corbel.Borrow.LenderBuilder}
[ "Create", "a", "LenderBuilder", "for", "lender", "managing", "requests", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7352-L7356
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(id) { var user = new corbel.Borrow.UserBuilder(id); user.driver = this.driver; return user; }
javascript
function(id) { var user = new corbel.Borrow.UserBuilder(id); user.driver = this.driver; return user; }
[ "function", "(", "id", ")", "{", "var", "user", "=", "new", "corbel", ".", "Borrow", ".", "UserBuilder", "(", "id", ")", ";", "user", ".", "driver", "=", "this", ".", "driver", ";", "return", "user", ";", "}" ]
Create a UserBuilder for user managing requests. @param {String} id The id of the user. @return {corbel.Borrow.UserBuilder}
[ "Create", "a", "UserBuilder", "for", "user", "managing", "requests", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7365-L7369
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(license) { console.log('borrowInterface.resource.addLicense', license); corbel.validate.value('id', this.id); return this.request({ url: this._buildUri(this.uri, this.id, 'license'), method: corbel.request.method.POST, ...
javascript
function(license) { console.log('borrowInterface.resource.addLicense', license); corbel.validate.value('id', this.id); return this.request({ url: this._buildUri(this.uri, this.id, 'license'), method: corbel.request.method.POST, ...
[ "function", "(", "license", ")", "{", "console", ".", "log", "(", "'borrowInterface.resource.addLicense'", ",", "license", ")", ";", "corbel", ".", "validate", ".", "value", "(", "'id'", ",", "this", ".", "id", ")", ";", "return", "this", ".", "request", ...
Add license to loanable resource. @method @memberOf corbel.Borrow.BorrowBuilder @param {Object} data licenses data. @param {Object} license The license data. @param {String} license.resourceId Identifier of resource @param {number} licensee.availableUses Amount of uses that the resource is ava...
[ "Add", "license", "to", "loanable", "resource", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7510-L7520
train
bq/corbel-js
dist/corbel.with-polyfills.js
function() { console.log('borrowInterface.user.getAllLoans', this.id); return this.request({ url: this._buildUri(this.uri, this.id, 'loan'), method: corbel.request.method.GET }); }
javascript
function() { console.log('borrowInterface.user.getAllLoans', this.id); return this.request({ url: this._buildUri(this.uri, this.id, 'loan'), method: corbel.request.method.GET }); }
[ "function", "(", ")", "{", "console", ".", "log", "(", "'borrowInterface.user.getAllLoans'", ",", "this", ".", "id", ")", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", ".", "uri", ",", "this", ".", ...
Get all loans of a user. @method @memberOf corbel.Borrow.UserBuilder @return {Promise} A promise with all user loans {Object} or fails with a {@link corbelError}.
[ "Get", "all", "loans", "of", "a", "user", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7836-L7842
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(lender) { console.log('borrowInterface.lender.update'); return this.request({ url: this._buildUri(this.uri, this.id), method: corbel.request.method.PUT, data: lender }); }
javascript
function(lender) { console.log('borrowInterface.lender.update'); return this.request({ url: this._buildUri(this.uri, this.id), method: corbel.request.method.PUT, data: lender }); }
[ "function", "(", "lender", ")", "{", "console", ".", "log", "(", "'borrowInterface.lender.update'", ")", ";", "return", "this", ".", "request", "(", "{", "url", ":", "this", ".", "_buildUri", "(", "this", ".", "uri", ",", "this", ".", "id", ")", ",", ...
Update a Lender. @method @memberOf corbel.Borrow.LenderBuilder @param {Object} lender The lender data. @return {Promise} A promise resolves to undefined (void) or fails with a {@link corbelError}.
[ "Update", "a", "Lender", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L7904-L7912
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(id) { var phraseBuilder = new corbel.CompoSR.PhraseBuilder(id); phraseBuilder.driver = this.driver; return phraseBuilder; }
javascript
function(id) { var phraseBuilder = new corbel.CompoSR.PhraseBuilder(id); phraseBuilder.driver = this.driver; return phraseBuilder; }
[ "function", "(", "id", ")", "{", "var", "phraseBuilder", "=", "new", "corbel", ".", "CompoSR", ".", "PhraseBuilder", "(", "id", ")", ";", "phraseBuilder", ".", "driver", "=", "this", ".", "driver", ";", "return", "phraseBuilder", ";", "}" ]
Create a PhraseBuilder for phrase managing requests. @param {String} id The id of the phrase. @return {corbel.CompoSR.PhraseBuilder}
[ "Create", "a", "PhraseBuilder", "for", "phrase", "managing", "requests", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L8005-L8009
train
bq/corbel-js
dist/corbel.with-polyfills.js
function() { var requestBuilder = new corbel.CompoSR.RequestBuilder(Array.prototype.slice.call(arguments)); requestBuilder.driver = this.driver; return requestBuilder; }
javascript
function() { var requestBuilder = new corbel.CompoSR.RequestBuilder(Array.prototype.slice.call(arguments)); requestBuilder.driver = this.driver; return requestBuilder; }
[ "function", "(", ")", "{", "var", "requestBuilder", "=", "new", "corbel", ".", "CompoSR", ".", "RequestBuilder", "(", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ")", ";", "requestBuilder", ".", "driver", "=", "this", "."...
Create a RequestBuilder for phrase requests. @param {String} id phrase id @param {String} param1 path parameter @param {String} param2 path parameter @param {String} paramN path parameter @return {corbel.CompoSR.RequestBuilder}
[ "Create", "a", "RequestBuilder", "for", "phrase", "requests", "." ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L8021-L8025
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(params) { corbel.validate.value('id', this.id); var options = params ? corbel.utils.clone(params) : {}; var args = corbel.utils.extend(options, { url: this._buildUriWithDomain(this.id), method: corbel.request.method.GET,...
javascript
function(params) { corbel.validate.value('id', this.id); var options = params ? corbel.utils.clone(params) : {}; var args = corbel.utils.extend(options, { url: this._buildUriWithDomain(this.id), method: corbel.request.method.GET,...
[ "function", "(", "params", ")", "{", "corbel", ".", "validate", ".", "value", "(", "'id'", ",", "this", ".", "id", ")", ";", "var", "options", "=", "params", "?", "corbel", ".", "utils", ".", "clone", "(", "params", ")", ":", "{", "}", ";", "var"...
Gets the content @memberof corbel.Webfs.WebfsBuilder.prototype @param {object} [params] Params of a {@link corbel.request} @return {Promise} Promise that resolves with a resource or rejects with a {@link CorbelError}
[ "Gets", "the", "content" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L8314-L8328
train
bq/corbel-js
dist/corbel.with-polyfills.js
function(driver) { this.driver = driver; return function(id) { driver.config.set(corbel.Domain.CUSTOM_DOMAIN, id); return driver; }; }
javascript
function(driver) { this.driver = driver; return function(id) { driver.config.set(corbel.Domain.CUSTOM_DOMAIN, id); return driver; }; }
[ "function", "(", "driver", ")", "{", "this", ".", "driver", "=", "driver", ";", "return", "function", "(", "id", ")", "{", "driver", ".", "config", ".", "set", "(", "corbel", ".", "Domain", ".", "CUSTOM_DOMAIN", ",", "id", ")", ";", "return", "driver...
Creates a new instance of corbelDriver with a custom domain @memberof corbel.Domain.prototype @param {string} id String with the custom domain value @return {corbelDriver}
[ "Creates", "a", "new", "instance", "of", "corbelDriver", "with", "a", "custom", "domain" ]
00074882676b592d2ac16868279c58b0c4faf1e2
https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L8414-L8422
train
cronvel/doormen
lib/assert.js
FunctionCall
function FunctionCall( fn , isAsync , thisArg , ... args ) { this.function = fn ; this.isAsync = isAsync ; this.this = thisArg ; this.args = args ; this.hasThrown = false ; this.error = undefined ; this.return = undefined ; try { this.return = this.function.call( this.this || null , ... this.args ) ; } cat...
javascript
function FunctionCall( fn , isAsync , thisArg , ... args ) { this.function = fn ; this.isAsync = isAsync ; this.this = thisArg ; this.args = args ; this.hasThrown = false ; this.error = undefined ; this.return = undefined ; try { this.return = this.function.call( this.this || null , ... this.args ) ; } cat...
[ "function", "FunctionCall", "(", "fn", ",", "isAsync", ",", "thisArg", ",", "...", "args", ")", "{", "this", ".", "function", "=", "fn", ";", "this", ".", "isAsync", "=", "isAsync", ";", "this", ".", "this", "=", "thisArg", ";", "this", ".", "args", ...
A class for actual function, arguments, return value and thrown error
[ "A", "class", "for", "actual", "function", "arguments", "return", "value", "and", "thrown", "error" ]
e17e801736be326cc57d93095a73571f4cbaf1cc
https://github.com/cronvel/doormen/blob/e17e801736be326cc57d93095a73571f4cbaf1cc/lib/assert.js#L52-L84
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.10/xtemplate/runtime.js
function (commandName, fn) { var config = this.config; config.commands = config.commands || {}; config.commands[commandName] = fn; }
javascript
function (commandName, fn) { var config = this.config; config.commands = config.commands || {}; config.commands[commandName] = fn; }
[ "function", "(", "commandName", ",", "fn", ")", "{", "var", "config", "=", "this", ".", "config", ";", "config", ".", "commands", "=", "config", ".", "commands", "||", "{", "}", ";", "config", ".", "commands", "[", "commandName", "]", "=", "fn", ";",...
add command definition to current template @param commandName @param {Function} fn command definition
[ "add", "command", "definition", "to", "current", "template" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.10/xtemplate/runtime.js#L196-L200
train
Automattic/wpcom-unpublished
index.js
WPCOMUnpublished
function WPCOMUnpublished( token, reqHandler ) { if ( ! ( this instanceof WPCOMUnpublished ) ) { return new WPCOMUnpublished( token, reqHandler ); } WPCOM.call( this, token, reqHandler ); }
javascript
function WPCOMUnpublished( token, reqHandler ) { if ( ! ( this instanceof WPCOMUnpublished ) ) { return new WPCOMUnpublished( token, reqHandler ); } WPCOM.call( this, token, reqHandler ); }
[ "function", "WPCOMUnpublished", "(", "token", ",", "reqHandler", ")", "{", "if", "(", "!", "(", "this", "instanceof", "WPCOMUnpublished", ")", ")", "{", "return", "new", "WPCOMUnpublished", "(", "token", ",", "reqHandler", ")", ";", "}", "WPCOM", ".", "cal...
Creates a `WPCOMUnpublished` instance Example // Create WPCOMUnpublished instance var WPCOMUnpublished = require( 'wpcom-unpublished' ); var wpcom = WPCOM(); Example // Create WPCOMUnpublished instance passing a token var WPCOMUnpublished = require( 'wpcom-unpublished' ); var wpcom = WPCOM( '<your-token>' ); Example...
[ "Creates", "a", "WPCOMUnpublished", "instance" ]
9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e
https://github.com/Automattic/wpcom-unpublished/blob/9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e/index.js#L35-L41
train
dumberjs/dumber-module-loader
src/index.js
toUrl
function toUrl(mId) { const parsed = parse(mId); let url = parsed.bareId; if (url[0] !== '/' && !url.match(/^https?:\/\//)) url = _baseUrl + url; if (!parsed.ext) { // no known ext, add .js url += '.js'; } return url; }
javascript
function toUrl(mId) { const parsed = parse(mId); let url = parsed.bareId; if (url[0] !== '/' && !url.match(/^https?:\/\//)) url = _baseUrl + url; if (!parsed.ext) { // no known ext, add .js url += '.js'; } return url; }
[ "function", "toUrl", "(", "mId", ")", "{", "const", "parsed", "=", "parse", "(", "mId", ")", ";", "let", "url", "=", "parsed", ".", "bareId", ";", "if", "(", "url", "[", "0", "]", "!==", "'/'", "&&", "!", "url", ".", "match", "(", "/", "^https?...
incoming id is already mapped
[ "incoming", "id", "is", "already", "mapped" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L188-L197
train
dumberjs/dumber-module-loader
src/index.js
runtimeReq
function runtimeReq(mId) { const parsed = parse(mId); return _fetch(parsed.cleanId) .then(response => { // ensure default user space define.switchToUserSpace(); for (let i = 0, len = _translators.length; i < len; i++) { const result = _translators[i](parsed, response); if (result && typeo...
javascript
function runtimeReq(mId) { const parsed = parse(mId); return _fetch(parsed.cleanId) .then(response => { // ensure default user space define.switchToUserSpace(); for (let i = 0, len = _translators.length; i < len; i++) { const result = _translators[i](parsed, response); if (result && typeo...
[ "function", "runtimeReq", "(", "mId", ")", "{", "const", "parsed", "=", "parse", "(", "mId", ")", ";", "return", "_fetch", "(", "parsed", ".", "cleanId", ")", ".", "then", "(", "response", "=>", "{", "// ensure default user space", "define", ".", "switchTo...
incoming id is already mapped return a promise
[ "incoming", "id", "is", "already", "mapped", "return", "a", "promise" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L286-L307
train
dumberjs/dumber-module-loader
src/index.js
userReqFromBundle
function userReqFromBundle(mId) { const possibleIds = nodejsIds(mId); const bundleName = Object.keys(_bundles).find(bn => { const {nameSpace, user} = _bundles[bn]; return possibleIds.some(d => { if (nameSpace) { const parsed = parse(d); if (parsed.bareId.slice(0, nameSpace.length + 1) ...
javascript
function userReqFromBundle(mId) { const possibleIds = nodejsIds(mId); const bundleName = Object.keys(_bundles).find(bn => { const {nameSpace, user} = _bundles[bn]; return possibleIds.some(d => { if (nameSpace) { const parsed = parse(d); if (parsed.bareId.slice(0, nameSpace.length + 1) ...
[ "function", "userReqFromBundle", "(", "mId", ")", "{", "const", "possibleIds", "=", "nodejsIds", "(", "mId", ")", ";", "const", "bundleName", "=", "Object", ".", "keys", "(", "_bundles", ")", ".", "find", "(", "bn", "=>", "{", "const", "{", "nameSpace", ...
incoming id is already mapped return a promise to load additional bundle or return undefined.
[ "incoming", "id", "is", "already", "mapped", "return", "a", "promise", "to", "load", "additional", "bundle", "or", "return", "undefined", "." ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L312-L344
train
dumberjs/dumber-module-loader
src/index.js
packageReqFromBundle
function packageReqFromBundle(mId) { const possibleIds = nodejsIds(mId); const bundleName = Object.keys(_bundles).find(bn => possibleIds.some(d => { const pack = _bundles[bn].package; if (pack.hasOwnProperty(d)) return true; const p = parse(d); // For module with unknown plugin prefix, t...
javascript
function packageReqFromBundle(mId) { const possibleIds = nodejsIds(mId); const bundleName = Object.keys(_bundles).find(bn => possibleIds.some(d => { const pack = _bundles[bn].package; if (pack.hasOwnProperty(d)) return true; const p = parse(d); // For module with unknown plugin prefix, t...
[ "function", "packageReqFromBundle", "(", "mId", ")", "{", "const", "possibleIds", "=", "nodejsIds", "(", "mId", ")", ";", "const", "bundleName", "=", "Object", ".", "keys", "(", "_bundles", ")", ".", "find", "(", "bn", "=>", "possibleIds", ".", "some", "...
incoming id is already mapped return a promise to load additional bundle or throw an error to help userSpaceTesseract to identify sync return.
[ "incoming", "id", "is", "already", "mapped", "return", "a", "promise", "to", "load", "additional", "bundle", "or", "throw", "an", "error", "to", "help", "userSpaceTesseract", "to", "identify", "sync", "return", "." ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L349-L376
train
dumberjs/dumber-module-loader
src/index.js
loadBundle
function loadBundle(bundleName) { if (!_bundleLoad[bundleName]) { const mappedBundleName = _paths[bundleName] || bundleName; const url = toUrl(mappedBundleName); const {nameSpace} = _bundles[bundleName] || {}; let job; // I really hate this. // Use script tag, not fetch, only to support sourc...
javascript
function loadBundle(bundleName) { if (!_bundleLoad[bundleName]) { const mappedBundleName = _paths[bundleName] || bundleName; const url = toUrl(mappedBundleName); const {nameSpace} = _bundles[bundleName] || {}; let job; // I really hate this. // Use script tag, not fetch, only to support sourc...
[ "function", "loadBundle", "(", "bundleName", ")", "{", "if", "(", "!", "_bundleLoad", "[", "bundleName", "]", ")", "{", "const", "mappedBundleName", "=", "_paths", "[", "bundleName", "]", "||", "bundleName", ";", "const", "url", "=", "toUrl", "(", "mappedB...
return a promise
[ "return", "a", "promise" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L380-L447
train
dumberjs/dumber-module-loader
src/index.js
nameSpacedDefine
function nameSpacedDefine(nameSpace, id, deps, callback) { // only add name space for modules in user space // also skip any ext: plugin (a dumber-module-loader feature) if (currentSpace === userSpace && id.slice(0, 4) !== 'ext:') { const parsed = parse(id); userSpace.define(parsed.prefix + nameSpace + '/...
javascript
function nameSpacedDefine(nameSpace, id, deps, callback) { // only add name space for modules in user space // also skip any ext: plugin (a dumber-module-loader feature) if (currentSpace === userSpace && id.slice(0, 4) !== 'ext:') { const parsed = parse(id); userSpace.define(parsed.prefix + nameSpace + '/...
[ "function", "nameSpacedDefine", "(", "nameSpace", ",", "id", ",", "deps", ",", "callback", ")", "{", "// only add name space for modules in user space", "// also skip any ext: plugin (a dumber-module-loader feature)", "if", "(", "currentSpace", "===", "userSpace", "&&", "id",...
Special named spaced define Designed to load runtime extensions
[ "Special", "named", "spaced", "define", "Designed", "to", "load", "runtime", "extensions" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L480-L489
train
dumberjs/dumber-module-loader
src/index.js
requireFunc
function requireFunc() { if (typeof arguments[0] === 'string') { const dep = arguments[0]; const got = defined(dep); if (got) return got.val; throw new Error(`commonjs dependency "${dep}" is not prepared.`); } return requirejs.apply(null, arguments); }
javascript
function requireFunc() { if (typeof arguments[0] === 'string') { const dep = arguments[0]; const got = defined(dep); if (got) return got.val; throw new Error(`commonjs dependency "${dep}" is not prepared.`); } return requirejs.apply(null, arguments); }
[ "function", "requireFunc", "(", ")", "{", "if", "(", "typeof", "arguments", "[", "0", "]", "===", "'string'", ")", "{", "const", "dep", "=", "arguments", "[", "0", "]", ";", "const", "got", "=", "defined", "(", "dep", ")", ";", "if", "(", "got", ...
return AMD require function or commonjs require function
[ "return", "AMD", "require", "function", "or", "commonjs", "require", "function" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L506-L515
train
dumberjs/dumber-module-loader
src/index.js
loadWasm
function loadWasm(name, req, load) { req(['raw!' + name], response => { response.arrayBuffer().then(buffer => WebAssembly.instantiate(buffer, /*importObject*/) ) .then( obj => { load(obj.instance.exports); }, load.error ); }); }
javascript
function loadWasm(name, req, load) { req(['raw!' + name], response => { response.arrayBuffer().then(buffer => WebAssembly.instantiate(buffer, /*importObject*/) ) .then( obj => { load(obj.instance.exports); }, load.error ); }); }
[ "function", "loadWasm", "(", "name", ",", "req", ",", "load", ")", "{", "req", "(", "[", "'raw!'", "+", "name", "]", ",", "response", "=>", "{", "response", ".", "arrayBuffer", "(", ")", ".", "then", "(", "buffer", "=>", "WebAssembly", ".", "instanti...
Only support wasm without importObject. How to know what kind of importObject the wasm file needs?
[ "Only", "support", "wasm", "without", "importObject", ".", "How", "to", "know", "what", "kind", "of", "importObject", "the", "wasm", "file", "needs?" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L566-L578
train
dumberjs/dumber-module-loader
src/index.js
config
function config(opts) { if (!opts) return; if (opts.baseUrl) _baseUrl = parse(opts.baseUrl).bareId + '/'; if (opts.paths) { Object.keys(opts.paths).forEach(path => { let alias = opts.paths[path]; _paths[cleanPath(path)] = cleanPath(alias); }); } if (opts.bundles) { Object.keys(opts.b...
javascript
function config(opts) { if (!opts) return; if (opts.baseUrl) _baseUrl = parse(opts.baseUrl).bareId + '/'; if (opts.paths) { Object.keys(opts.paths).forEach(path => { let alias = opts.paths[path]; _paths[cleanPath(path)] = cleanPath(alias); }); } if (opts.bundles) { Object.keys(opts.b...
[ "function", "config", "(", "opts", ")", "{", "if", "(", "!", "opts", ")", "return", ";", "if", "(", "opts", ".", "baseUrl", ")", "_baseUrl", "=", "parse", "(", "opts", ".", "baseUrl", ")", ".", "bareId", "+", "'/'", ";", "if", "(", "opts", ".", ...
minimum support of requirejs config baseUrl paths, relative to baseUrl bundles, for code splitting
[ "minimum", "support", "of", "requirejs", "config", "baseUrl", "paths", "relative", "to", "baseUrl", "bundles", "for", "code", "splitting" ]
e585f483624717ff64ff16dbf6eb3e2bd4d80273
https://github.com/dumberjs/dumber-module-loader/blob/e585f483624717ff64ff16dbf6eb3e2bd4d80273/src/index.js#L635-L663
train
llorsat/wonkajs
dist/templates/core/contrib/less.js
function () { var name, index = i; if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) { return new(tree.Variable)(name, index, env.currentFileInfo); } }
javascript
function () { var name, index = i; if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) { return new(tree.Variable)(name, index, env.currentFileInfo); } }
[ "function", "(", ")", "{", "var", "name", ",", "index", "=", "i", ";", "if", "(", "input", ".", "charAt", "(", "i", ")", "===", "'@'", "&&", "(", "name", "=", "$", "(", "/", "^@@?[\\w-]+", "/", ")", ")", ")", "{", "return", "new", "(", "tree"...
A Variable entity, such as `@fink`, in width: @fink + 2px We use a different parser for variable definitions, see `parsers.variable`.
[ "A", "Variable", "entity", "such", "as" ]
c45d7feaefa8dbf29b6fd1c824a1767173452611
https://github.com/llorsat/wonkajs/blob/c45d7feaefa8dbf29b6fd1c824a1767173452611/dist/templates/core/contrib/less.js#L713-L719
train
taskcluster/taskcluster-lib-loader
src/loader.js
validateComponent
function validateComponent(def, name) { let e = 'Invalid component definition: ' + name; // Check that it's an object if (typeof def !== 'object' && def !== null && def !== undefined) { throw new Error(e + ' must be an object, null or undefined'); } // Check that is object has a setup function if (!(def...
javascript
function validateComponent(def, name) { let e = 'Invalid component definition: ' + name; // Check that it's an object if (typeof def !== 'object' && def !== null && def !== undefined) { throw new Error(e + ' must be an object, null or undefined'); } // Check that is object has a setup function if (!(def...
[ "function", "validateComponent", "(", "def", ",", "name", ")", "{", "let", "e", "=", "'Invalid component definition: '", "+", "name", ";", "// Check that it's an object", "if", "(", "typeof", "def", "!==", "'object'", "&&", "def", "!==", "null", "&&", "def", "...
Validate component definition
[ "Validate", "component", "definition" ]
b68f0a8f7b495a51d51b9a438a5bb1516608b359
https://github.com/taskcluster/taskcluster-lib-loader/blob/b68f0a8f7b495a51d51b9a438a5bb1516608b359/src/loader.js#L16-L36
train
taskcluster/taskcluster-lib-loader
src/loader.js
renderGraph
function renderGraph(componentDirectory, sortedComponents) { let dot = [ '// This graph shows all dependencies for this loader.', '// You might find http://www.webgraphviz.com/ useful!', '', 'digraph G {', ]; for (let component of sortedComponents) { dot.push(util.format(' "%s"', component))...
javascript
function renderGraph(componentDirectory, sortedComponents) { let dot = [ '// This graph shows all dependencies for this loader.', '// You might find http://www.webgraphviz.com/ useful!', '', 'digraph G {', ]; for (let component of sortedComponents) { dot.push(util.format(' "%s"', component))...
[ "function", "renderGraph", "(", "componentDirectory", ",", "sortedComponents", ")", "{", "let", "dot", "=", "[", "'// This graph shows all dependencies for this loader.'", ",", "'// You might find http://www.webgraphviz.com/ useful!'", ",", "''", ",", "'digraph G {'", ",", "]...
Render componentDirectory to dot format for graphviz given a topologically sorted list of components
[ "Render", "componentDirectory", "to", "dot", "format", "for", "graphviz", "given", "a", "topologically", "sorted", "list", "of", "components" ]
b68f0a8f7b495a51d51b9a438a5bb1516608b359
https://github.com/taskcluster/taskcluster-lib-loader/blob/b68f0a8f7b495a51d51b9a438a5bb1516608b359/src/loader.js#L42-L60
train
taskcluster/taskcluster-lib-loader
src/loader.js
load
function load(target) { if (!loaded[target]) { var def = componentDirectory[target]; // Initialize component, this won't cause an infinite loop because // we've already check that the componentDirectory is a DAG let requires = def.requires || []; return loaded[target] = Pro...
javascript
function load(target) { if (!loaded[target]) { var def = componentDirectory[target]; // Initialize component, this won't cause an infinite loop because // we've already check that the componentDirectory is a DAG let requires = def.requires || []; return loaded[target] = Pro...
[ "function", "load", "(", "target", ")", "{", "if", "(", "!", "loaded", "[", "target", "]", ")", "{", "var", "def", "=", "componentDirectory", "[", "target", "]", ";", "// Initialize component, this won't cause an infinite loop because", "// we've already check that th...
Load a component
[ "Load", "a", "component" ]
b68f0a8f7b495a51d51b9a438a5bb1516608b359
https://github.com/taskcluster/taskcluster-lib-loader/blob/b68f0a8f7b495a51d51b9a438a5bb1516608b359/src/loader.js#L204-L228
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/menu-debug.js
function (element) { var self = this; var $el = self.$el; // 隐藏当然不包含了 // 隐藏当然不包含了 if (!self.get('visible') || !$el) { return false; } if ($el && ($el[0] === element || $el.contains(element))) { return true; ...
javascript
function (element) { var self = this; var $el = self.$el; // 隐藏当然不包含了 // 隐藏当然不包含了 if (!self.get('visible') || !$el) { return false; } if ($el && ($el[0] === element || $el.contains(element))) { return true; ...
[ "function", "(", "element", ")", "{", "var", "self", "=", "this", ";", "var", "$el", "=", "self", ".", "$el", ";", "// 隐藏当然不包含了", "// 隐藏当然不包含了", "if", "(", "!", "self", ".", "get", "(", "'visible'", ")", "||", "!", "$el", ")", "{", "return", "false...
Whether this menu contains specified html element. @param {KISSY.Node} element html Element to be tested. @return {Boolean} @protected
[ "Whether", "this", "menu", "contains", "specified", "html", "element", "." ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/menu-debug.js#L207-L225
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/menu-debug.js
afterHighlightedItemChange
function afterHighlightedItemChange(e) { if (e.target.isMenu) { var el = this.el, menuItem = e.newVal; el.setAttribute('aria-activedescendant', menuItem && menuItem.el.id || ''); } }
javascript
function afterHighlightedItemChange(e) { if (e.target.isMenu) { var el = this.el, menuItem = e.newVal; el.setAttribute('aria-activedescendant', menuItem && menuItem.el.id || ''); } }
[ "function", "afterHighlightedItemChange", "(", "e", ")", "{", "if", "(", "e", ".", "target", ".", "isMenu", ")", "{", "var", "el", "=", "this", ".", "el", ",", "menuItem", "=", "e", ".", "newVal", ";", "el", ".", "setAttribute", "(", "'aria-activedesce...
capture bubbling capture bubbling
[ "capture", "bubbling", "capture", "bubbling" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/menu-debug.js#L247-L252
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/menu-debug.js
function (v, e) { var self = this; self.callSuper(v, e); // sync // sync if (!e) { return; } if (e.fromMouse) { return; } if (v && !e.fromKeyboard) { showMenu.call(self); ...
javascript
function (v, e) { var self = this; self.callSuper(v, e); // sync // sync if (!e) { return; } if (e.fromMouse) { return; } if (v && !e.fromKeyboard) { showMenu.call(self); ...
[ "function", "(", "v", ",", "e", ")", "{", "var", "self", "=", "this", ";", "self", ".", "callSuper", "(", "v", ",", "e", ")", ";", "// sync", "// sync", "if", "(", "!", "e", ")", "{", "return", ";", "}", "if", "(", "e", ".", "fromMouse", ")",...
Dismisses the submenu on a delay, with the result that the user needs less accuracy when moving to sub menus. @protected
[ "Dismisses", "the", "submenu", "on", "a", "delay", "with", "the", "result", "that", "the", "user", "needs", "less", "accuracy", "when", "moving", "to", "sub", "menus", "." ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/menu-debug.js#L663-L678
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/menu-debug.js
function (e) { var self = this, menu = self.get('menu'), menuChildren, menuChild, hasKeyboardControl_ = menu.get('visible'), keyCode = e.keyCode; if (!hasKeyboardControl_) { // right if (keyCode === KeyCode.RIGHT) { showMenu.call(self); ...
javascript
function (e) { var self = this, menu = self.get('menu'), menuChildren, menuChild, hasKeyboardControl_ = menu.get('visible'), keyCode = e.keyCode; if (!hasKeyboardControl_) { // right if (keyCode === KeyCode.RIGHT) { showMenu.call(self); ...
[ "function", "(", "e", ")", "{", "var", "self", "=", "this", ",", "menu", "=", "self", ".", "get", "(", "'menu'", ")", ",", "menuChildren", ",", "menuChild", ",", "hasKeyboardControl_", "=", "menu", ".", "get", "(", "'visible'", ")", ",", "keyCode", "...
Handles a key event that is passed to the menu item from its parent because it is highlighted. If the right key is pressed the sub menu takes control and delegates further key events to its menu until it is dismissed OR the left key is pressed. Protected for subclass overridden. @param {KISSY.Event.DomEvent.Object} e ...
[ "Handles", "a", "key", "event", "that", "is", "passed", "to", "the", "menu", "item", "from", "its", "parent", "because", "it", "is", "highlighted", ".", "If", "the", "right", "key", "is", "pressed", "the", "sub", "menu", "takes", "control", "and", "deleg...
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/menu-debug.js#L695-L724
train
vsch/for-each-break
index.js
forEach
function forEach(callback, thisArg = UNDEFINED, defaultReturn = UNDEFINED) { const savedReturn = BREAK.clearDefault(defaultReturn); const iMax = this.length; let result = thisArg; for (let i = 0; i < iMax; i++) { const value = this[i]; const returned = callback.call(thisArg, value, i, th...
javascript
function forEach(callback, thisArg = UNDEFINED, defaultReturn = UNDEFINED) { const savedReturn = BREAK.clearDefault(defaultReturn); const iMax = this.length; let result = thisArg; for (let i = 0; i < iMax; i++) { const value = this[i]; const returned = callback.call(thisArg, value, i, th...
[ "function", "forEach", "(", "callback", ",", "thisArg", "=", "UNDEFINED", ",", "defaultReturn", "=", "UNDEFINED", ")", "{", "const", "savedReturn", "=", "BREAK", ".", "clearDefault", "(", "defaultReturn", ")", ";", "const", "iMax", "=", "this", ".", "length"...
Execute forEach on array like object and return value using BREAK @this array like object over which to loop @param callback callback function (value, index, array) @param thisArg optional arg to use as this for the callback @param defaultReturn optional default return value @return {*}
[ "Execute", "forEach", "on", "array", "like", "object", "and", "return", "value", "using", "BREAK" ]
6d8e0babce28f2a03d395a64bad1ca1341a4f46d
https://github.com/vsch/for-each-break/blob/6d8e0babce28f2a03d395a64bad1ca1341a4f46d/index.js#L42-L56
train
Automattic/wpcom-unpublished
lib/site.wordads.tos.js
SiteWordAdsTOS
function SiteWordAdsTOS( sid, wpcom ) { if ( ! ( this instanceof SiteWordAdsTOS ) ) { return new SiteWordAdsTOS( sid, wpcom ); } this._sid = sid; this.wpcom = wpcom; }
javascript
function SiteWordAdsTOS( sid, wpcom ) { if ( ! ( this instanceof SiteWordAdsTOS ) ) { return new SiteWordAdsTOS( sid, wpcom ); } this._sid = sid; this.wpcom = wpcom; }
[ "function", "SiteWordAdsTOS", "(", "sid", ",", "wpcom", ")", "{", "if", "(", "!", "(", "this", "instanceof", "SiteWordAdsTOS", ")", ")", "{", "return", "new", "SiteWordAdsTOS", "(", "sid", ",", "wpcom", ")", ";", "}", "this", ".", "_sid", "=", "sid", ...
`SiteWordAdsTOS` constructor. *Example:* // Require `wpcom-unpublished` library var wpcomUnpublished = require( 'wpcom-unpublished' ); // Create a `wpcomUnpublished` instance var wpcom = wpcomUnpublished(); // Create a `SiteWordAdsTOS` instance var wordAds = wpcom .site( 'my-blog.wordpress.com' ) .wordAds() .tos(); ...
[ "SiteWordAdsTOS", "constructor", "." ]
9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e
https://github.com/Automattic/wpcom-unpublished/blob/9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e/lib/site.wordads.tos.js#L23-L30
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/util-debug.js
function (a, override) { var b = a.slice(); if (override) { b.reverse(); } var i = 0, n, item; while (i < b.length) { item = b[i]; while ((n = util.lastIndexOf(item, b)) !== i) { b.splice(n, 1...
javascript
function (a, override) { var b = a.slice(); if (override) { b.reverse(); } var i = 0, n, item; while (i < b.length) { item = b[i]; while ((n = util.lastIndexOf(item, b)) !== i) { b.splice(n, 1...
[ "function", "(", "a", ",", "override", ")", "{", "var", "b", "=", "a", ".", "slice", "(", ")", ";", "if", "(", "override", ")", "{", "b", ".", "reverse", "(", ")", ";", "}", "var", "i", "=", "0", ",", "n", ",", "item", ";", "while", "(", ...
Returns a copy of the array with the duplicate entries removed @param a {Array} the array to find the subset of unique for @param [override] {Boolean} if override is TRUE, util.unique([a, b, a]) => [b, a]. if override is FALSE, util.unique([a, b, a]) => [a, b] @return {Array} a copy of the array with duplicate entries ...
[ "Returns", "a", "copy", "of", "the", "array", "with", "the", "duplicate", "entries", "removed" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/util-debug.js#L102-L119
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/util-debug.js
function (r, varArgs) { var args = util.makeArray(arguments), len = args.length - 2, i = 1, proto, arg, ov = args[len], wl = args[len + 1]; args[1] = varArgs; if (!util.isArray(wl)) { ov = wl; wl = undef; len++; } ...
javascript
function (r, varArgs) { var args = util.makeArray(arguments), len = args.length - 2, i = 1, proto, arg, ov = args[len], wl = args[len + 1]; args[1] = varArgs; if (!util.isArray(wl)) { ov = wl; wl = undef; len++; } ...
[ "function", "(", "r", ",", "varArgs", ")", "{", "var", "args", "=", "util", ".", "makeArray", "(", "arguments", ")", ",", "len", "=", "args", ".", "length", "-", "2", ",", "i", "=", "1", ",", "proto", ",", "arg", ",", "ov", "=", "args", "[", ...
Applies prototype properties from the supplier to the receiver. @param {Object} r received object @param {...Object} varArgs object need to augment {Boolean} [ov=true] whether overwrite existing property {String[]} [wl] array of white-list properties @return {Object} the augmented object @member KISSY
[ "Applies", "prototype", "properties", "from", "the", "supplier", "to", "the", "receiver", "." ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/util-debug.js#L852-L872
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/util-debug.js
function (id, fn) { id = (id + EMPTY).match(RE_ID_STR)[1]; var retryCount = 1; var timer = util.later(function () { if (++retryCount > POLL_RETIRES) { timer.cancel(); return; } ...
javascript
function (id, fn) { id = (id + EMPTY).match(RE_ID_STR)[1]; var retryCount = 1; var timer = util.later(function () { if (++retryCount > POLL_RETIRES) { timer.cancel(); return; } ...
[ "function", "(", "id", ",", "fn", ")", "{", "id", "=", "(", "id", "+", "EMPTY", ")", ".", "match", "(", "RE_ID_STR", ")", "[", "1", "]", ";", "var", "retryCount", "=", "1", ";", "var", "timer", "=", "util", ".", "later", "(", "function", "(", ...
Executes the supplied callback when the item with the supplied id is found. @param id {String} The id of the element, or an array of ids to look for. @param fn {Function} What to execute when the element is found. @member KISSY
[ "Executes", "the", "supplied", "callback", "when", "the", "item", "with", "the", "supplied", "id", "is", "found", "." ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/util-debug.js#L1490-L1504
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/router-debug.js
getUrlForRouter
function getUrlForRouter(urlStr) { urlStr = urlStr || location.href; var uri = url.parse(urlStr); if (!globalConfig.useHash && supportHistoryPushState) { return uri.pathname.substr(globalConfig.urlRoot.length) + (uri.search || ''); } else { return utils.getHash(ur...
javascript
function getUrlForRouter(urlStr) { urlStr = urlStr || location.href; var uri = url.parse(urlStr); if (!globalConfig.useHash && supportHistoryPushState) { return uri.pathname.substr(globalConfig.urlRoot.length) + (uri.search || ''); } else { return utils.getHash(ur...
[ "function", "getUrlForRouter", "(", "urlStr", ")", "{", "urlStr", "=", "urlStr", "||", "location", ".", "href", ";", "var", "uri", "=", "url", ".", "parse", "(", "urlStr", ")", ";", "if", "(", "!", "globalConfig", ".", "useHash", "&&", "supportHistoryPus...
get url path for router dispatch get url path for router dispatch
[ "get", "url", "path", "for", "router", "dispatch", "get", "url", "path", "for", "router", "dispatch" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/router-debug.js#L63-L71
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/router-debug.js
function (fragment, urlRoot) { return location.protocol + '//' + location.host + this.removeEndSlash(urlRoot) + this.addStartSlash(fragment); }
javascript
function (fragment, urlRoot) { return location.protocol + '//' + location.host + this.removeEndSlash(urlRoot) + this.addStartSlash(fragment); }
[ "function", "(", "fragment", ",", "urlRoot", ")", "{", "return", "location", ".", "protocol", "+", "'//'", "+", "location", ".", "host", "+", "this", ".", "removeEndSlash", "(", "urlRoot", ")", "+", "this", ".", "addStartSlash", "(", "fragment", ")", ";"...
get full path from fragment for html history
[ "get", "full", "path", "from", "fragment", "for", "html", "history" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/router-debug.js#L539-L541
train
vsch/boxed-state
index.js
saveBoxed
function saveBoxed(onDoneCallback = UNDEFINED) { const boxed = this.boxed; if (boxed) { const modified = boxed[boxedImmutable.BOXED_GET_THIS].valueOfModified(); if (modified !== UNDEFINED) { this.boxed = UNDEFINED; if (this.saveState) { return this.saveSta...
javascript
function saveBoxed(onDoneCallback = UNDEFINED) { const boxed = this.boxed; if (boxed) { const modified = boxed[boxedImmutable.BOXED_GET_THIS].valueOfModified(); if (modified !== UNDEFINED) { this.boxed = UNDEFINED; if (this.saveState) { return this.saveSta...
[ "function", "saveBoxed", "(", "onDoneCallback", "=", "UNDEFINED", ")", "{", "const", "boxed", "=", "this", ".", "boxed", ";", "if", "(", "boxed", ")", "{", "const", "modified", "=", "boxed", "[", "boxedImmutable", ".", "BOXED_GET_THIS", "]", ".", "valueOfM...
save modified state @param onDoneCallback function to call on save complete @return {*}
[ "save", "modified", "state" ]
b82885eb7de0aa52b4d31a54cb192c9247542c85
https://github.com/vsch/boxed-state/blob/b82885eb7de0aa52b4d31a54cb192c9247542c85/index.js#L32-L47
train
vsch/boxed-state
index.js
cancelBoxed
function cancelBoxed() { const boxed = this.boxed; this.boxed = UNDEFINED; return boxed && boxed[boxedImmutable.BOXED_GET_THIS].unboxedDelta(); }
javascript
function cancelBoxed() { const boxed = this.boxed; this.boxed = UNDEFINED; return boxed && boxed[boxedImmutable.BOXED_GET_THIS].unboxedDelta(); }
[ "function", "cancelBoxed", "(", ")", "{", "const", "boxed", "=", "this", ".", "boxed", ";", "this", ".", "boxed", "=", "UNDEFINED", ";", "return", "boxed", "&&", "boxed", "[", "boxedImmutable", ".", "BOXED_GET_THIS", "]", ".", "unboxedDelta", "(", ")", "...
Cancel changes and return modified so these could be applied later for delayed update. @return {*}
[ "Cancel", "changes", "and", "return", "modified", "so", "these", "could", "be", "applied", "later", "for", "delayed", "update", "." ]
b82885eb7de0aa52b4d31a54cb192c9247542c85
https://github.com/vsch/boxed-state/blob/b82885eb7de0aa52b4d31a54cb192c9247542c85/index.js#L55-L59
train
vsch/boxed-state
index.js
function (target, prop, receiver) { if (isBoxedState(target)) { if (prop === BOXED_GET_THIS) return target; if (prop === target.saveBoxedProp) return target.saveBoxed; if (prop === target.cancelBoxedProp) return target.cancelBoxed; if (prop === target.boxOptionsPr...
javascript
function (target, prop, receiver) { if (isBoxedState(target)) { if (prop === BOXED_GET_THIS) return target; if (prop === target.saveBoxedProp) return target.saveBoxed; if (prop === target.cancelBoxedProp) return target.cancelBoxed; if (prop === target.boxOptionsPr...
[ "function", "(", "target", ",", "prop", ",", "receiver", ")", "{", "if", "(", "isBoxedState", "(", "target", ")", ")", "{", "if", "(", "prop", "===", "BOXED_GET_THIS", ")", "return", "target", ";", "if", "(", "prop", "===", "target", ".", "saveBoxedPro...
target is the object with on demand boxed property
[ "target", "is", "the", "object", "with", "on", "demand", "boxed", "property" ]
b82885eb7de0aa52b4d31a54cb192c9247542c85
https://github.com/vsch/boxed-state/blob/b82885eb7de0aa52b4d31a54cb192c9247542c85/index.js#L134-L143
train
bigpipe/supply
index.js
Layer
function Layer(name, fn) { this.length = fn.length; this.name = name; this.fn = fn; }
javascript
function Layer(name, fn) { this.length = fn.length; this.name = name; this.fn = fn; }
[ "function", "Layer", "(", "name", ",", "fn", ")", "{", "this", ".", "length", "=", "fn", ".", "length", ";", "this", ".", "name", "=", "name", ";", "this", ".", "fn", "=", "fn", ";", "}" ]
Representation of a single middleware layer. @constructor @param {String} name Identification of the middleware. @param {Function} fn Middleware function. @param {Mixed} context Execution context of the function. @api private
[ "Representation", "of", "a", "single", "middleware", "layer", "." ]
e2d792af0c130ec937829a26b3dc58cb8a4bc534
https://github.com/bigpipe/supply/blob/e2d792af0c130ec937829a26b3dc58cb8a4bc534/index.js#L15-L19
train
bigpipe/supply
index.js
Supply
function Supply(provider, options) { if (!this) return new Supply(provider, options); options = options || {}; this.provider = provider || this; this.layers = []; this.length = 0; if ('function' === typeof this.initialize) { this.initialize(options); } }
javascript
function Supply(provider, options) { if (!this) return new Supply(provider, options); options = options || {}; this.provider = provider || this; this.layers = []; this.length = 0; if ('function' === typeof this.initialize) { this.initialize(options); } }
[ "function", "Supply", "(", "provider", ",", "options", ")", "{", "if", "(", "!", "this", ")", "return", "new", "Supply", "(", "provider", ",", "options", ")", ";", "options", "=", "options", "||", "{", "}", ";", "this", ".", "provider", "=", "provide...
A minimal middleware layer system. @constructor @param {EventEmitter} provider EventEmitter instance. @param {Object} options Optional options. @api public
[ "A", "minimal", "middleware", "layer", "system", "." ]
e2d792af0c130ec937829a26b3dc58cb8a4bc534
https://github.com/bigpipe/supply/blob/e2d792af0c130ec937829a26b3dc58cb8a4bc534/index.js#L29-L41
train
bigpipe/supply
index.js
next
function next(err, done) { var layer = supply.layers[i++]; if (err || done || !layer) { return fn(err, !!done); } if (layer.length > length) { return layer.fn.apply(supply.provider, args.concat(next)); } else { dollars.catch(function catching() { return layer.fn.apply(sup...
javascript
function next(err, done) { var layer = supply.layers[i++]; if (err || done || !layer) { return fn(err, !!done); } if (layer.length > length) { return layer.fn.apply(supply.provider, args.concat(next)); } else { dollars.catch(function catching() { return layer.fn.apply(sup...
[ "function", "next", "(", "err", ",", "done", ")", "{", "var", "layer", "=", "supply", ".", "layers", "[", "i", "++", "]", ";", "if", "(", "err", "||", "done", "||", "!", "layer", ")", "{", "return", "fn", "(", "err", ",", "!", "!", "done", ")...
Simple middleware layer iterator. @param {Error} err A failed middleware iteration. @param {Boolean} done Stop iterating the layers as we are done. @api private
[ "Simple", "middleware", "layer", "iterator", "." ]
e2d792af0c130ec937829a26b3dc58cb8a4bc534
https://github.com/bigpipe/supply/blob/e2d792af0c130ec937829a26b3dc58cb8a4bc534/index.js#L168-L182
train
craterdog-bali/js-bali-component-framework
src/elements/Angle.js
Angle
function Angle(value, parameters) { abstractions.Element.call(this, utilities.types.ANGLE, parameters); // analyze the value if (value === undefined) value = 0; // default value if (!isFinite(value)) { throw new utilities.Exception({ $module: '/bali/elements/Angle', $pr...
javascript
function Angle(value, parameters) { abstractions.Element.call(this, utilities.types.ANGLE, parameters); // analyze the value if (value === undefined) value = 0; // default value if (!isFinite(value)) { throw new utilities.Exception({ $module: '/bali/elements/Angle', $pr...
[ "function", "Angle", "(", "value", ",", "parameters", ")", "{", "abstractions", ".", "Element", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "ANGLE", ",", "parameters", ")", ";", "// analyze the value", "if", "(", "value", "===", "undefin...
PUBLIC CONSTRUCTOR This constructor creates an immutable instance of an angle using the specified value. @constructor @param {Number} value The value of the angle. @param {Parameters} parameters Optional parameters used to parameterize this element. @returns {Angle} The new angle element.
[ "PUBLIC", "CONSTRUCTOR", "This", "constructor", "creates", "an", "immutable", "instance", "of", "an", "angle", "using", "the", "specified", "value", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Angle.js#L30-L71
train
lyveminds/scamandrios
examples/bench_helenus.js
bench
function bench(callback){ conn.connect(function(err, keyspace){ if(err){ throw(err); } console.time('Helenus ' + times + ' writes'); function cb(err, results){ if(err){ console.log('Error encountered at: ' + completed); throw(err); } completed += 1; ...
javascript
function bench(callback){ conn.connect(function(err, keyspace){ if(err){ throw(err); } console.time('Helenus ' + times + ' writes'); function cb(err, results){ if(err){ console.log('Error encountered at: ' + completed); throw(err); } completed += 1; ...
[ "function", "bench", "(", "callback", ")", "{", "conn", ".", "connect", "(", "function", "(", "err", ",", "keyspace", ")", "{", "if", "(", "err", ")", "{", "throw", "(", "err", ")", ";", "}", "console", ".", "time", "(", "'Helenus '", "+", "times",...
First bench helenus
[ "First", "bench", "helenus" ]
a1b643c68d3d88e608c610d4ce5f96e7142972cd
https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/examples/bench_helenus.js#L24-L54
train
craterdog-bali/js-bali-component-framework
src/elements/Pattern.js
Pattern
function Pattern(value, parameters) { abstractions.Element.call(this, utilities.types.PATTERN, parameters); value = value || '^none$'; // the default value matches nothing if (typeof value === 'string') value = new RegExp(value); // since this element is immutable the value must be read-only this....
javascript
function Pattern(value, parameters) { abstractions.Element.call(this, utilities.types.PATTERN, parameters); value = value || '^none$'; // the default value matches nothing if (typeof value === 'string') value = new RegExp(value); // since this element is immutable the value must be read-only this....
[ "function", "Pattern", "(", "value", ",", "parameters", ")", "{", "abstractions", ".", "Element", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "PATTERN", ",", "parameters", ")", ";", "value", "=", "value", "||", "'^none$'", ";", "// the...
PUBLIC CONSTRUCTOR This constructor creates a new pattern element using the specified value. @constructor @param {String|RegExp} value A regular expression for the pattern element. @param {Parameters} parameters Optional parameters used to parameterize this element. @returns {Pattern} The new pattern element.
[ "PUBLIC", "CONSTRUCTOR", "This", "constructor", "creates", "a", "new", "pattern", "element", "using", "the", "specified", "value", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Pattern.js#L29-L38
train
unshiftio/demolish
index.js
run
function run(key, selfie) { if (!options[key]) return; if ('string' === typeof options[key]) options[key] = options[key].split(split); if ('function' === typeof options[key]) return options[key].call(selfie); for (var i = 0, type, what; i < options[key].length; i++) { what = options[key][i]; ...
javascript
function run(key, selfie) { if (!options[key]) return; if ('string' === typeof options[key]) options[key] = options[key].split(split); if ('function' === typeof options[key]) return options[key].call(selfie); for (var i = 0, type, what; i < options[key].length; i++) { what = options[key][i]; ...
[ "function", "run", "(", "key", ",", "selfie", ")", "{", "if", "(", "!", "options", "[", "key", "]", ")", "return", ";", "if", "(", "'string'", "===", "typeof", "options", "[", "key", "]", ")", "options", "[", "key", "]", "=", "options", "[", "key...
Run addition cleanup hooks. @param {String} key Name of the clean up hook to run. @param {Mixed} selfie Reference to the instance we're cleaning up. @api private
[ "Run", "addition", "cleanup", "hooks", "." ]
c438fa2c755c35c910b610c51d8c1aeba5bc5ce3
https://github.com/unshiftio/demolish/blob/c438fa2c755c35c910b610c51d8c1aeba5bc5ce3/index.js#L26-L41
train
craterdog-bali/js-bali-component-framework
src/composites/Association.js
Association
function Association(key, value) { abstractions.Composite.call(this, utilities.types.ASSOCIATION); key = this.convert(key); value = this.convert(value); // access to this component's attributes is tightly controlled this.getKey = function() { return key; }; this.getValue = function() { return v...
javascript
function Association(key, value) { abstractions.Composite.call(this, utilities.types.ASSOCIATION); key = this.convert(key); value = this.convert(value); // access to this component's attributes is tightly controlled this.getKey = function() { return key; }; this.getValue = function() { return v...
[ "function", "Association", "(", "key", ",", "value", ")", "{", "abstractions", ".", "Composite", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "ASSOCIATION", ")", ";", "key", "=", "this", ".", "convert", "(", "key", ")", ";", "value", ...
PUBLIC FUNCTIONS This constructor creates a new key-value association. @param {String|Number|Boolean|Component} key The key of the association. @param {String|Number|Boolean|Component} value The value associated with the key. @returns {Association} A new association.
[ "PUBLIC", "FUNCTIONS", "This", "constructor", "creates", "a", "new", "key", "-", "value", "association", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/composites/Association.js#L29-L45
train
taskcluster/taskcluster-lib-testing
src/pulse.js
function(credentials, mocha) { var that = this; this._connection = new taskcluster.PulseConnection(credentials); this._listeners = null; this._promisedMessages = null; // **Note**, the before(), beforeEach(9, afterEach() and after() functions // below are mocha hooks. Ie. they are called by...
javascript
function(credentials, mocha) { var that = this; this._connection = new taskcluster.PulseConnection(credentials); this._listeners = null; this._promisedMessages = null; // **Note**, the before(), beforeEach(9, afterEach() and after() functions // below are mocha hooks. Ie. they are called by...
[ "function", "(", "credentials", ",", "mocha", ")", "{", "var", "that", "=", "this", ";", "this", ".", "_connection", "=", "new", "taskcluster", ".", "PulseConnection", "(", "credentials", ")", ";", "this", ".", "_listeners", "=", "null", ";", "this", "."...
A utility for test written in mocha, that makes very easy to listen for a specific message. credentials: { username: '...', // Pulse username password: '...' // Pulse password }
[ "A", "utility", "for", "test", "written", "in", "mocha", "that", "makes", "very", "easy", "to", "listen", "for", "a", "specific", "message", "." ]
ee2a3193f98edab0b5297eb1beeeea45a9706ca1
https://github.com/taskcluster/taskcluster-lib-testing/blob/ee2a3193f98edab0b5297eb1beeeea45a9706ca1/src/pulse.js#L16-L65
train
D780/valparams
lib/validators.js
vNumber
function vNumber(func, type, str, range) { let success = true; let checkType = true; let errmsg; // 先验证类型 if (!func(str)) { errmsg = localData.em_type({ desc, str, type, }); checkType = false; success = false; } // 再验证类型范围 // if (range &&...
javascript
function vNumber(func, type, str, range) { let success = true; let checkType = true; let errmsg; // 先验证类型 if (!func(str)) { errmsg = localData.em_type({ desc, str, type, }); checkType = false; success = false; } // 再验证类型范围 // if (range &&...
[ "function", "vNumber", "(", "func", ",", "type", ",", "str", ",", "range", ")", "{", "let", "success", "=", "true", ";", "let", "checkType", "=", "true", ";", "let", "errmsg", ";", "// 先验证类型", "if", "(", "!", "func", "(", "str", ")", ")", "{", "e...
func to validator number @param {Function} func = {v.isInt,v.isFloat,v.isNumeric} @param {String} type = {int,float,number} @param {String} str @param {Object} range @returns {boolean} /* eslint-disable no-shadow
[ "func", "to", "validator", "number" ]
4877a15a41589b1023ea7dd047b27c966b6545e7
https://github.com/D780/valparams/blob/4877a15a41589b1023ea7dd047b27c966b6545e7/lib/validators.js#L357-L401
train
craterdog-bali/js-bali-component-framework
src/elements/Percent.js
Percent
function Percent(value, parameters) { abstractions.Element.call(this, utilities.types.PERCENT, parameters); value = value || 0; // the default value // since this element is immutable the value must be read-only this.getValue = function() { return value; }; return this; }
javascript
function Percent(value, parameters) { abstractions.Element.call(this, utilities.types.PERCENT, parameters); value = value || 0; // the default value // since this element is immutable the value must be read-only this.getValue = function() { return value; }; return this; }
[ "function", "Percent", "(", "value", ",", "parameters", ")", "{", "abstractions", ".", "Element", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "PERCENT", ",", "parameters", ")", ";", "value", "=", "value", "||", "0", ";", "// the defaul...
PUBLIC CONSTRUCTOR This constructor creates a new percent element using the specified value. @param {Number} value The value of the percent. @param {Parameters} parameters Optional parameters used to parameterize this element. @returns {Percent} The new percent element.
[ "PUBLIC", "CONSTRUCTOR", "This", "constructor", "creates", "a", "new", "percent", "element", "using", "the", "specified", "value", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Percent.js#L29-L37
train
lyveminds/scamandrios
lib/column.js
function(name, value, timestamp, ttl){ /** * The name of the column, can be any type, for composites use Array */ this.name = name; /** * The value of the column */ this.value = value; /** * The timestamp of the value * @default {Date} new Date(); */ this.timestamp = timestamp || new ...
javascript
function(name, value, timestamp, ttl){ /** * The name of the column, can be any type, for composites use Array */ this.name = name; /** * The value of the column */ this.value = value; /** * The timestamp of the value * @default {Date} new Date(); */ this.timestamp = timestamp || new ...
[ "function", "(", "name", ",", "value", ",", "timestamp", ",", "ttl", ")", "{", "/**\n * The name of the column, can be any type, for composites use Array\n */", "this", ".", "name", "=", "name", ";", "/**\n * The value of the column\n */", "this", ".", "value", "=...
Cassandra Column object representation @param {Object} name The name of the column, can be any type, for composites use Array @param {Object} value The value of the column @param {Date} timestamp The timestamp of the value @param {Number} ttl The ttl for the column @constructor
[ "Cassandra", "Column", "object", "representation" ]
a1b643c68d3d88e608c610d4ce5f96e7142972cd
https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column.js#L12-L33
train
Runnable/hermes
lib/assert-opts.js
function (queueDef) { if (isString(queueDef)) { return true } if (isObject(queueDef) && isString(queueDef.name)) { return true } return false }
javascript
function (queueDef) { if (isString(queueDef)) { return true } if (isObject(queueDef) && isString(queueDef.name)) { return true } return false }
[ "function", "(", "queueDef", ")", "{", "if", "(", "isString", "(", "queueDef", ")", ")", "{", "return", "true", "}", "if", "(", "isObject", "(", "queueDef", ")", "&&", "isString", "(", "queueDef", ".", "name", ")", ")", "{", "return", "true", "}", ...
Check if queueDef is string or definition object with `name` prop
[ "Check", "if", "queueDef", "is", "string", "or", "definition", "object", "with", "name", "prop" ]
af660962b3bc67ed39811e17a4362a725442ff81
https://github.com/Runnable/hermes/blob/af660962b3bc67ed39811e17a4362a725442ff81/lib/assert-opts.js#L14-L22
train
Runnable/hermes
lib/assert-opts.js
function (queues, name) { var result = queues.filter(function (queue) { return queue.name === name }) return result.length > 0 }
javascript
function (queues, name) { var result = queues.filter(function (queue) { return queue.name === name }) return result.length > 0 }
[ "function", "(", "queues", ",", "name", ")", "{", "var", "result", "=", "queues", ".", "filter", "(", "function", "(", "queue", ")", "{", "return", "queue", ".", "name", "===", "name", "}", ")", "return", "result", ".", "length", ">", "0", "}" ]
Check if queue with provided `name` exists in the array of queueDefs @param {Array} array of nromalized queueDefs @param {String} queueName to check for existence @param {Array} array of mixed queueNames or queueDefs @return {Boolean} true if queue with `name` exists in the array of queueDefs
[ "Check", "if", "queue", "with", "provided", "name", "exists", "in", "the", "array", "of", "queueDefs" ]
af660962b3bc67ed39811e17a4362a725442ff81
https://github.com/Runnable/hermes/blob/af660962b3bc67ed39811e17a4362a725442ff81/lib/assert-opts.js#L31-L36
train
craterdog-bali/js-bali-component-framework
src/utilities/Codex.js
formatLines
function formatLines(string, indentation) { indentation = indentation ? indentation : ''; var formatted = ''; const length = string.length; if (length > LINE_WIDTH) { for (var index = 0; index < length; index += LINE_WIDTH) { formatted += EOL + indentation; formatted += s...
javascript
function formatLines(string, indentation) { indentation = indentation ? indentation : ''; var formatted = ''; const length = string.length; if (length > LINE_WIDTH) { for (var index = 0; index < length; index += LINE_WIDTH) { formatted += EOL + indentation; formatted += s...
[ "function", "formatLines", "(", "string", ",", "indentation", ")", "{", "indentation", "=", "indentation", "?", "indentation", ":", "''", ";", "var", "formatted", "=", "''", ";", "const", "length", "=", "string", ".", "length", ";", "if", "(", "length", ...
This function returns a formatted version of a string with LINE_WIDTH characters per line. @param {String} string The string to be formatted. @param {String} indentation The string to be prepended to each line of the result. @returns {String} The formatted string.
[ "This", "function", "returns", "a", "formatted", "version", "of", "a", "string", "with", "LINE_WIDTH", "characters", "per", "line", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/utilities/Codex.js#L554-L568
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
function (progressListener) { var self = this, listeners = self[PROMISE_PROGRESS_LISTENERS]; if (listeners === false) { return self; } if (!listeners) { listeners = self[PROMISE_PROGRESS_LISTENERS] = []; } listeners....
javascript
function (progressListener) { var self = this, listeners = self[PROMISE_PROGRESS_LISTENERS]; if (listeners === false) { return self; } if (!listeners) { listeners = self[PROMISE_PROGRESS_LISTENERS] = []; } listeners....
[ "function", "(", "progressListener", ")", "{", "var", "self", "=", "this", ",", "listeners", "=", "self", "[", "PROMISE_PROGRESS_LISTENERS", "]", ";", "if", "(", "listeners", "===", "false", ")", "{", "return", "self", ";", "}", "if", "(", "!", "listener...
call progress listener when defer.notify is called @param {Function} [progressListener] progress listener
[ "call", "progress", "listener", "when", "defer", ".", "notify", "is", "called" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L195-L205
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
function (callback) { return when(this, function (value) { return callback(value, true); }, function (reason) { return callback(reason, false); }); }
javascript
function (callback) { return when(this, function (value) { return callback(value, true); }, function (reason) { return callback(reason, false); }); }
[ "function", "(", "callback", ")", "{", "return", "when", "(", "this", ",", "function", "(", "value", ")", "{", "return", "callback", "(", "value", ",", "true", ")", ";", "}", ",", "function", "(", "reason", ")", "{", "return", "callback", "(", "reaso...
call callback when this promise object is rejected or resolved @param {Function} callback the second parameter is true when resolved and false when rejected @@return {KISSY.Promise} a new promise object
[ "call", "callback", "when", "this", "promise", "object", "is", "rejected", "or", "resolved" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L220-L226
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
when
function when(value, fulfilled, rejected) { var defer = new Defer(), done = 0; // wrap user's callback to catch exception // wrap user's callback to catch exception function _fulfilled(value) { try { return fulfilled ? fulfilled.call(this, value) : // propagate ...
javascript
function when(value, fulfilled, rejected) { var defer = new Defer(), done = 0; // wrap user's callback to catch exception // wrap user's callback to catch exception function _fulfilled(value) { try { return fulfilled ? fulfilled.call(this, value) : // propagate ...
[ "function", "when", "(", "value", ",", "fulfilled", ",", "rejected", ")", "{", "var", "defer", "=", "new", "Defer", "(", ")", ",", "done", "=", "0", ";", "// wrap user's callback to catch exception", "// wrap user's callback to catch exception", "function", "_fulfil...
wrap for promiseWhen wrap for promiseWhen
[ "wrap", "for", "promiseWhen", "wrap", "for", "promiseWhen" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L303-L358
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
_fulfilled
function _fulfilled(value) { try { return fulfilled ? fulfilled.call(this, value) : // propagate value; } catch (e) { // can not use logger.error // must expose to user // print stack info for firefox/chrome ...
javascript
function _fulfilled(value) { try { return fulfilled ? fulfilled.call(this, value) : // propagate value; } catch (e) { // can not use logger.error // must expose to user // print stack info for firefox/chrome ...
[ "function", "_fulfilled", "(", "value", ")", "{", "try", "{", "return", "fulfilled", "?", "fulfilled", ".", "call", "(", "this", ",", "value", ")", ":", "// propagate", "value", ";", "}", "catch", "(", "e", ")", "{", "// can not use logger.error", "// must...
wrap user's callback to catch exception wrap user's callback to catch exception
[ "wrap", "user", "s", "callback", "to", "catch", "exception", "wrap", "user", "s", "callback", "to", "catch", "exception" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L306-L317
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
function (promises) { var count = promises.length; if (!count) { return null; } var defer = new Defer(); for (var i = 0; i < promises.length; i++) { /*jshint loopfunc:true*/ (function (promise, i) { ...
javascript
function (promises) { var count = promises.length; if (!count) { return null; } var defer = new Defer(); for (var i = 0; i < promises.length; i++) { /*jshint loopfunc:true*/ (function (promise, i) { ...
[ "function", "(", "promises", ")", "{", "var", "count", "=", "promises", ".", "length", ";", "if", "(", "!", "count", ")", "{", "return", "null", ";", "}", "var", "defer", "=", "new", "Defer", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";"...
return a new promise which is resolved when all promises is resolved and rejected when any one of promises is rejected @param {KISSY.Promise[]} promises list of promises @static @return {KISSY.Promise} @member KISSY.Promise
[ "return", "a", "new", "promise", "which", "is", "resolved", "when", "all", "promises", "is", "resolved", "and", "rejected", "when", "any", "one", "of", "promises", "is", "rejected" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L470-L494
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/build/promise-debug.js
function (generatorFunc) { return function () { var generator = generatorFunc.apply(this, arguments); function doAction(action, arg) { var result; // in case error on first // in case error on first try { ...
javascript
function (generatorFunc) { return function () { var generator = generatorFunc.apply(this, arguments); function doAction(action, arg) { var result; // in case error on first // in case error on first try { ...
[ "function", "(", "generatorFunc", ")", "{", "return", "function", "(", ")", "{", "var", "generator", "=", "generatorFunc", ".", "apply", "(", "this", ",", "arguments", ")", ";", "function", "doAction", "(", "action", ",", "arg", ")", "{", "var", "result"...
provide es6 generator @param generatorFunc es6 generator function which has yielded promise
[ "provide", "es6", "generator" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/build/promise-debug.js#L499-L523
train
craterdog-bali/js-bali-component-framework
src/elements/Version.js
Version
function Version(value, parameters) { abstractions.Element.call(this, utilities.types.VERSION, parameters); value = value || [1]; // the default value if (value.indexOf(0) >= 0) { throw new utilities.Exception({ $module: '/bali/elements/Version', $procedure: '$Version', ...
javascript
function Version(value, parameters) { abstractions.Element.call(this, utilities.types.VERSION, parameters); value = value || [1]; // the default value if (value.indexOf(0) >= 0) { throw new utilities.Exception({ $module: '/bali/elements/Version', $procedure: '$Version', ...
[ "function", "Version", "(", "value", ",", "parameters", ")", "{", "abstractions", ".", "Element", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "VERSION", ",", "parameters", ")", ";", "value", "=", "value", "||", "[", "1", "]", ";", ...
PUBLIC CONSTRUCTOR This constructor creates a new version element using the specified value. @param {Array} value An array containing the version levels for the version string. @param {Parameters} parameters Optional parameters used to parameterize this element. @returns {Symbol} The new version string element.
[ "PUBLIC", "CONSTRUCTOR", "This", "constructor", "creates", "a", "new", "version", "element", "using", "the", "specified", "value", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Version.js#L30-L47
train
craterdog-bali/js-bali-component-framework
src/elements/Tag.js
Tag
function Tag(value, parameters) { abstractions.Element.call(this, utilities.types.TAG, parameters); value = value || 20; // the default number of bytes var bytes, numberOfBytes, hash; switch (typeof value) { case 'number': numberOfBytes = value; bytes = utilities.random....
javascript
function Tag(value, parameters) { abstractions.Element.call(this, utilities.types.TAG, parameters); value = value || 20; // the default number of bytes var bytes, numberOfBytes, hash; switch (typeof value) { case 'number': numberOfBytes = value; bytes = utilities.random....
[ "function", "Tag", "(", "value", ",", "parameters", ")", "{", "abstractions", ".", "Element", ".", "call", "(", "this", ",", "utilities", ".", "types", ".", "TAG", ",", "parameters", ")", ";", "value", "=", "value", "||", "20", ";", "// the default numbe...
PUBLIC CONSTRUCTOR This constructor creates a new tag element using the specified value. @param {Number|String} value An optional parameter defining the size of a new random tag or the value it should represent. @param {Parameters} parameters Optional parameters used to parameterize this element. @returns {Tag} The n...
[ "PUBLIC", "CONSTRUCTOR", "This", "constructor", "creates", "a", "new", "tag", "element", "using", "the", "specified", "value", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/elements/Tag.js#L30-L53
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/lib/build/loader.js
function (msg, cat, logger) { if ('@DEBUG@') { var matched = 1; if (logger) { var list, i, l, level, minLevel, maxLevel, reg; cat = cat || 'debug'; level = loggerLevel[cat] || loggerLevel.debug; i...
javascript
function (msg, cat, logger) { if ('@DEBUG@') { var matched = 1; if (logger) { var list, i, l, level, minLevel, maxLevel, reg; cat = cat || 'debug'; level = loggerLevel[cat] || loggerLevel.debug; i...
[ "function", "(", "msg", ",", "cat", ",", "logger", ")", "{", "if", "(", "'@DEBUG@'", ")", "{", "var", "matched", "=", "1", ";", "if", "(", "logger", ")", "{", "var", "list", ",", "i", ",", "l", ",", "level", ",", "minLevel", ",", "maxLevel", ",...
Prints debug info. @param msg {String} the message to log. @param {String} [cat] the log category for the message. Default categories are 'info', 'warn', 'error', 'time' etc. @param {String} [logger] the logger of the the message (opt)
[ "Prints", "debug", "info", "." ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L235-L280
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/lib/build/loader.js
function (name, cfg) { var module = mods[name]; if (!module) { name = normalizeName(name); module = mods[name]; } if (module) { mix(module, cfg); // module definition changes requires if (cf...
javascript
function (name, cfg) { var module = mods[name]; if (!module) { name = normalizeName(name); module = mods[name]; } if (module) { mix(module, cfg); // module definition changes requires if (cf...
[ "function", "(", "name", ",", "cfg", ")", "{", "var", "module", "=", "mods", "[", "name", "]", ";", "if", "(", "!", "module", ")", "{", "name", "=", "normalizeName", "(", "name", ")", ";", "module", "=", "mods", "[", "name", "]", ";", "}", "if"...
get a module from cache or create a module instance
[ "get", "a", "module", "from", "cache", "or", "create", "a", "module", "instance" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L589-L612
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/lib/build/loader.js
function () { var self = this; if (!self.url) { self.url = Utils.normalizeSlash(S.Config.resolveModFn(self)); } return self.url; }
javascript
function () { var self = this; if (!self.url) { self.url = Utils.normalizeSlash(S.Config.resolveModFn(self)); } return self.url; }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "if", "(", "!", "self", ".", "url", ")", "{", "self", ".", "url", "=", "Utils", ".", "normalizeSlash", "(", "S", ".", "Config", ".", "resolveModFn", "(", "self", ")", ")", ";", "}", "r...
Get the path url of current module if load dynamically @return {String}
[ "Get", "the", "path", "url", "of", "current", "module", "if", "load", "dynamically" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L939-L945
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/lib/build/loader.js
cssPoll
function cssPoll() { for (var url in monitors) { var callbackObj = monitors[url], node = callbackObj.node; if (isCssLoaded(node, url)) { if (callbackObj.callback) { callbackObj.callback.call(node); } dele...
javascript
function cssPoll() { for (var url in monitors) { var callbackObj = monitors[url], node = callbackObj.node; if (isCssLoaded(node, url)) { if (callbackObj.callback) { callbackObj.callback.call(node); } dele...
[ "function", "cssPoll", "(", ")", "{", "for", "(", "var", "url", "in", "monitors", ")", "{", "var", "callbackObj", "=", "monitors", "[", "url", "]", ",", "node", "=", "callbackObj", ".", "node", ";", "if", "(", "isCssLoaded", "(", "node", ",", "url", ...
single thread is ok
[ "single", "thread", "is", "ok" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L1193-L1211
train
kissyteam/kissy-xtemplate
lib/kissy/5.0.0-alpha.3/lib/build/loader.js
function (moduleName) { var requiresModule = createModule(moduleName); var mods = requiresModule.getNormalizedModules(); Utils.each(mods, function (m) { m.undef(); }); }
javascript
function (moduleName) { var requiresModule = createModule(moduleName); var mods = requiresModule.getNormalizedModules(); Utils.each(mods, function (m) { m.undef(); }); }
[ "function", "(", "moduleName", ")", "{", "var", "requiresModule", "=", "createModule", "(", "moduleName", ")", ";", "var", "mods", "=", "requiresModule", ".", "getNormalizedModules", "(", ")", ";", "Utils", ".", "each", "(", "mods", ",", "function", "(", "...
undefine a module @param {String} moduleName module name @member KISSY
[ "undefine", "a", "module" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kissy/5.0.0-alpha.3/lib/build/loader.js#L2365-L2371
train
Automattic/wpcom-unpublished
lib/site.wordads.earnings.js
SiteWordAdsEarnings
function SiteWordAdsEarnings( sid, wpcom ) { if ( ! ( this instanceof SiteWordAdsEarnings ) ) { return new SiteWordAdsEarnings( sid, wpcom ); } this._sid = sid; this.wpcom = wpcom; }
javascript
function SiteWordAdsEarnings( sid, wpcom ) { if ( ! ( this instanceof SiteWordAdsEarnings ) ) { return new SiteWordAdsEarnings( sid, wpcom ); } this._sid = sid; this.wpcom = wpcom; }
[ "function", "SiteWordAdsEarnings", "(", "sid", ",", "wpcom", ")", "{", "if", "(", "!", "(", "this", "instanceof", "SiteWordAdsEarnings", ")", ")", "{", "return", "new", "SiteWordAdsEarnings", "(", "sid", ",", "wpcom", ")", ";", "}", "this", ".", "_sid", ...
`SiteWordAdsEarnings` constructor. *Example:* // Require `wpcom-unpublished` library var wpcomUnpublished = require( 'wpcom-unpublished' ); // Create a `wpcomUnpublished` instance var wpcom = wpcomUnpublished(); // Create a `SiteWordAdsEarnings` instance var wordAds = wpcom .site( 'my-blog.wordpress.com' ) .wordAds(...
[ "SiteWordAdsEarnings", "constructor", "." ]
9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e
https://github.com/Automattic/wpcom-unpublished/blob/9d3112f0e647cf2a9d5a9aa5fc1d7cda66ef185e/lib/site.wordads.earnings.js#L23-L30
train
cshum/raco
index.js
_raco
function _raco (iter, args, callback, opts) { var self = this var trycatch = true var isYieldable = true var yielded = false var nothrow = !!opts.nothrow /** * internal callback stepper * * @param {object} err - callback error object * @param {...*} val - callback value(s) */ function step ...
javascript
function _raco (iter, args, callback, opts) { var self = this var trycatch = true var isYieldable = true var yielded = false var nothrow = !!opts.nothrow /** * internal callback stepper * * @param {object} err - callback error object * @param {...*} val - callback value(s) */ function step ...
[ "function", "_raco", "(", "iter", ",", "args", ",", "callback", ",", "opts", ")", "{", "var", "self", "=", "this", "var", "trycatch", "=", "true", "var", "isYieldable", "=", "true", "var", "yielded", "=", "false", "var", "nothrow", "=", "!", "!", "op...
internal raco resolver @param {function} genFn - generator function @param {array} args - arguments in real array form @returns {promise} if no callback provided
[ "internal", "raco", "resolver" ]
33909b489c1696492253c90f49d24c27e18a4ed6
https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L62-L154
train
cshum/raco
index.js
step
function step (err, val) { if (iter) { // generator step yielded = false isYieldable = false var state if (trycatch) { try { if (nothrow) state = iter.next(slice.call(arguments)) else state = err ? iter.throw(err) : iter.next(val) } catch (err) { ...
javascript
function step (err, val) { if (iter) { // generator step yielded = false isYieldable = false var state if (trycatch) { try { if (nothrow) state = iter.next(slice.call(arguments)) else state = err ? iter.throw(err) : iter.next(val) } catch (err) { ...
[ "function", "step", "(", "err", ",", "val", ")", "{", "if", "(", "iter", ")", "{", "// generator step", "yielded", "=", "false", "isYieldable", "=", "false", "var", "state", "if", "(", "trycatch", ")", "{", "try", "{", "if", "(", "nothrow", ")", "sta...
internal callback stepper @param {object} err - callback error object @param {...*} val - callback value(s)
[ "internal", "callback", "stepper" ]
33909b489c1696492253c90f49d24c27e18a4ed6
https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L74-L104
train
cshum/raco
index.js
next
function next () { var args = slice.call(arguments) if (!isYieldable) { // only handle callback if not yieldable if (iter && yielded) { // no need defer when yielded step.apply(self, args) } else { // need next tick if not defered process.nextTick(function () { ...
javascript
function next () { var args = slice.call(arguments) if (!isYieldable) { // only handle callback if not yieldable if (iter && yielded) { // no need defer when yielded step.apply(self, args) } else { // need next tick if not defered process.nextTick(function () { ...
[ "function", "next", "(", ")", "{", "var", "args", "=", "slice", ".", "call", "(", "arguments", ")", "if", "(", "!", "isYieldable", ")", "{", "// only handle callback if not yieldable", "if", "(", "iter", "&&", "yielded", ")", "{", "// no need defer when yielde...
next, callback stepper with nextTick @param {object} err - callback error object @param {...*} val - callback value(s)
[ "next", "callback", "stepper", "with", "nextTick" ]
33909b489c1696492253c90f49d24c27e18a4ed6
https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L111-L127
train
cshum/raco
index.js
raco
function raco (genFn, opts) { if (!isGeneratorFunction(genFn)) { if (isFunction(genFn)) throw new Error('Generator function required') else if (!isGenerator(genFn)) return factory(genFn) } opts = Object.assign({}, _opts, opts) opts.Promise = null return _raco.call(this, genFn, null, null...
javascript
function raco (genFn, opts) { if (!isGeneratorFunction(genFn)) { if (isFunction(genFn)) throw new Error('Generator function required') else if (!isGenerator(genFn)) return factory(genFn) } opts = Object.assign({}, _opts, opts) opts.Promise = null return _raco.call(this, genFn, null, null...
[ "function", "raco", "(", "genFn", ",", "opts", ")", "{", "if", "(", "!", "isGeneratorFunction", "(", "genFn", ")", ")", "{", "if", "(", "isFunction", "(", "genFn", ")", ")", "throw", "new", "Error", "(", "'Generator function required'", ")", "else", "if"...
raco resolver returns factory if no arguments @param {function} genFn - generator function or factory options @param {object} [opts] - options object @returns {promise} if no callback provided
[ "raco", "resolver", "returns", "factory", "if", "no", "arguments" ]
33909b489c1696492253c90f49d24c27e18a4ed6
https://github.com/cshum/raco/blob/33909b489c1696492253c90f49d24c27e18a4ed6/index.js#L171-L179
train
lyveminds/scamandrios
lib/column_family.js
columnParent
function columnParent(cf, column) { var args = { column_family: cf.name }; if (cf.isSuper && column) args.super_column = cf.columnMarshaller.serialize(column); return new ttype.ColumnParent(args); }
javascript
function columnParent(cf, column) { var args = { column_family: cf.name }; if (cf.isSuper && column) args.super_column = cf.columnMarshaller.serialize(column); return new ttype.ColumnParent(args); }
[ "function", "columnParent", "(", "cf", ",", "column", ")", "{", "var", "args", "=", "{", "column_family", ":", "cf", ".", "name", "}", ";", "if", "(", "cf", ".", "isSuper", "&&", "column", ")", "args", ".", "super_column", "=", "cf", ".", "columnMars...
Returns a column parent When calculating the column parent of a standard column family, the parent is simply the column family name. When dealing with super columns on the other hand, an optional name parameter may be provided. @param {Object} cf A reference to the ColumnFamily @param {Object} name The name of the co...
[ "Returns", "a", "column", "parent", "When", "calculating", "the", "column", "parent", "of", "a", "standard", "column", "family", "the", "parent", "is", "simply", "the", "column", "family", "name", ".", "When", "dealing", "with", "super", "columns", "on", "th...
a1b643c68d3d88e608c610d4ce5f96e7142972cd
https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L28-L34
train
lyveminds/scamandrios
lib/column_family.js
columnPath
function columnPath(cf, column, subcolumn) { var args = { column_family: cf.name }; if (column) args.column = cf.columnMarshaller.serialize(column); if (cf.isSuper && subcolumn) args.subcolumn = cf.subcolumnMarshaller.serialize(subcolumn); return new ttype.ColumnPath(args); }
javascript
function columnPath(cf, column, subcolumn) { var args = { column_family: cf.name }; if (column) args.column = cf.columnMarshaller.serialize(column); if (cf.isSuper && subcolumn) args.subcolumn = cf.subcolumnMarshaller.serialize(subcolumn); return new ttype.ColumnPath(args); }
[ "function", "columnPath", "(", "cf", ",", "column", ",", "subcolumn", ")", "{", "var", "args", "=", "{", "column_family", ":", "cf", ".", "name", "}", ";", "if", "(", "column", ")", "args", ".", "column", "=", "cf", ".", "columnMarshaller", ".", "ser...
Returns a column path As with the ColumnParent, the value of the ColumnPath depends on whether this is a standard or super column family. Both must specify the column family name. A standard column family may provide an optional column name parameter. In addition to the column name, a super column family may also us...
[ "Returns", "a", "column", "path", "As", "with", "the", "ColumnParent", "the", "value", "of", "the", "ColumnPath", "depends", "on", "whether", "this", "is", "a", "standard", "or", "super", "column", "family", ".", "Both", "must", "specify", "the", "column", ...
a1b643c68d3d88e608c610d4ce5f96e7142972cd
https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L50-L61
train
lyveminds/scamandrios
lib/column_family.js
normalizeParameters
function normalizeParameters(list) { list = _.toArray(list); return _.reduce(list, function(args, value, index) { if (_.isObject(value) && !Array.isArray(value)) { var options = args.options, timestamp = value.timestamp, consistency = value.c...
javascript
function normalizeParameters(list) { list = _.toArray(list); return _.reduce(list, function(args, value, index) { if (_.isObject(value) && !Array.isArray(value)) { var options = args.options, timestamp = value.timestamp, consistency = value.c...
[ "function", "normalizeParameters", "(", "list", ")", "{", "list", "=", "_", ".", "toArray", "(", "list", ")", ";", "return", "_", ".", "reduce", "(", "list", ",", "function", "(", "args", ",", "value", ",", "index", ")", "{", "if", "(", "_", ".", ...
A convenience method to normalize the standard parameters used by a thrift operation. The parameter list must contain a `key` parameter as its first item. The `column`, `subcolumn`, `options`, and `callback` parameters are optional. @param {Array} list The list of parameters @private @memberOf ColumnFamily @returns {O...
[ "A", "convenience", "method", "to", "normalize", "the", "standard", "parameters", "used", "by", "a", "thrift", "operation", ".", "The", "parameter", "list", "must", "contain", "a", "key", "parameter", "as", "its", "first", "item", ".", "The", "column", "subc...
a1b643c68d3d88e608c610d4ce5f96e7142972cd
https://github.com/lyveminds/scamandrios/blob/a1b643c68d3d88e608c610d4ce5f96e7142972cd/lib/column_family.js#L116-L145
train
DennisSchwartz/multilayerlayout3d
lib/multilayerlayout3d.js
function() { var stable = []; for (var i=0;i<physicsSimulators.length; i++) { stable.push(physicsSimulators[i].step()); } // Check if all simulators are stable //console.log(stable); for (i=0;i<stable.length;i++) { i...
javascript
function() { var stable = []; for (var i=0;i<physicsSimulators.length; i++) { stable.push(physicsSimulators[i].step()); } // Check if all simulators are stable //console.log(stable); for (i=0;i<stable.length;i++) { i...
[ "function", "(", ")", "{", "var", "stable", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "physicsSimulators", ".", "length", ";", "i", "++", ")", "{", "stable", ".", "push", "(", "physicsSimulators", "[", "i", "]", ".", ...
Do one step of iterative layout calculation Return true is the current layout is stable
[ "Do", "one", "step", "of", "iterative", "layout", "calculation", "Return", "true", "is", "the", "current", "layout", "is", "stable" ]
772259e5cc46961df2d042c2866d52e039c91bc0
https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L69-L82
train
DennisSchwartz/multilayerlayout3d
lib/multilayerlayout3d.js
function (nodeId) { var layer = getLayer(nodeId); var body = getInitializedBody(nodeId); body.pos.z = layer * interLayerDistance; return body.pos; }
javascript
function (nodeId) { var layer = getLayer(nodeId); var body = getInitializedBody(nodeId); body.pos.z = layer * interLayerDistance; return body.pos; }
[ "function", "(", "nodeId", ")", "{", "var", "layer", "=", "getLayer", "(", "nodeId", ")", ";", "var", "body", "=", "getInitializedBody", "(", "nodeId", ")", ";", "body", ".", "pos", ".", "z", "=", "layer", "*", "interLayerDistance", ";", "return", "bod...
This will return the current position for each node @param nodeId @returns {Vector3d}
[ "This", "will", "return", "the", "current", "position", "for", "each", "node" ]
772259e5cc46961df2d042c2866d52e039c91bc0
https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L89-L94
train
DennisSchwartz/multilayerlayout3d
lib/multilayerlayout3d.js
function() { graph.off('changed', onGraphChanged); for (var i=0;i<physicsSimulators.length; i++) { physicsSimulators[i].off('stable', onStableChanged); } }
javascript
function() { graph.off('changed', onGraphChanged); for (var i=0;i<physicsSimulators.length; i++) { physicsSimulators[i].off('stable', onStableChanged); } }
[ "function", "(", ")", "{", "graph", ".", "off", "(", "'changed'", ",", "onGraphChanged", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "physicsSimulators", ".", "length", ";", "i", "++", ")", "{", "physicsSimulators", "[", "i", "]", "....
Request to release all resources
[ "Request", "to", "release", "all", "resources" ]
772259e5cc46961df2d042c2866d52e039c91bc0
https://github.com/DennisSchwartz/multilayerlayout3d/blob/772259e5cc46961df2d042c2866d52e039c91bc0/lib/multilayerlayout3d.js#L173-L178
train
kissyteam/kissy-xtemplate
lib/kg/kg-4.2.0/compiler.js
function (tplContent, name) { if (tplContent) { var ret; try { ret = parser.parse(tplContent, name); } catch (err) { var e; if (err instanceof Error) { e = err; } else { e = new Error(err); } var errorStr = 'XTemplate error '; ...
javascript
function (tplContent, name) { if (tplContent) { var ret; try { ret = parser.parse(tplContent, name); } catch (err) { var e; if (err instanceof Error) { e = err; } else { e = new Error(err); } var errorStr = 'XTemplate error '; ...
[ "function", "(", "tplContent", ",", "name", ")", "{", "if", "(", "tplContent", ")", "{", "var", "ret", ";", "try", "{", "ret", "=", "parser", ".", "parse", "(", "tplContent", ",", "name", ")", ";", "}", "catch", "(", "err", ")", "{", "var", "e", ...
get ast of template @param {String} [name] xtemplate name @param {String} tplContent @return {Object}
[ "get", "ast", "of", "template" ]
1d454ab624c867d6a862d63dba576f8d24c6dcfc
https://github.com/kissyteam/kissy-xtemplate/blob/1d454ab624c867d6a862d63dba576f8d24c6dcfc/lib/kg/kg-4.2.0/compiler.js#L635-L658
train
craterdog-bali/js-bali-component-framework
src/collections/Queue.js
Queue
function Queue(parameters) { parameters = parameters || new composites.Parameters(new Catalog()); if (!parameters.getParameter('$type')) parameters.setParameter('$type', '/bali/collections/Queue/v1'); abstractions.Collection.call(this, utilities.types.QUEUE, parameters); // the capacity and array are p...
javascript
function Queue(parameters) { parameters = parameters || new composites.Parameters(new Catalog()); if (!parameters.getParameter('$type')) parameters.setParameter('$type', '/bali/collections/Queue/v1'); abstractions.Collection.call(this, utilities.types.QUEUE, parameters); // the capacity and array are p...
[ "function", "Queue", "(", "parameters", ")", "{", "parameters", "=", "parameters", "||", "new", "composites", ".", "Parameters", "(", "new", "Catalog", "(", ")", ")", ";", "if", "(", "!", "parameters", ".", "getParameter", "(", "'$type'", ")", ")", "para...
PUBLIC CONSTRUCTORS This constructor creates a new queue component with optional parameters that are used to parameterize its type. @param {Parameters} parameters Optional parameters used to parameterize this collection. @returns {Queue} The new queue.
[ "PUBLIC", "CONSTRUCTORS", "This", "constructor", "creates", "a", "new", "queue", "component", "with", "optional", "parameters", "that", "are", "used", "to", "parameterize", "its", "type", "." ]
57279245e44d6ceef4debdb1d6132f48e464dcb8
https://github.com/craterdog-bali/js-bali-component-framework/blob/57279245e44d6ceef4debdb1d6132f48e464dcb8/src/collections/Queue.js#L40-L94
train
electric-eloquence/fepper-ui
scripts/code-viewer.js
function (type, code) { $sgCodeTitles.removeClass('sg-code-title-active'); switch (type) { case 'e': $sgCodeTitleHtml.addClass('sg-code-title-active'); break; case 'm': $sgCodeTitleMustache.addClass('sg-code-title-active'); break; } $s...
javascript
function (type, code) { $sgCodeTitles.removeClass('sg-code-title-active'); switch (type) { case 'e': $sgCodeTitleHtml.addClass('sg-code-title-active'); break; case 'm': $sgCodeTitleMustache.addClass('sg-code-title-active'); break; } $s...
[ "function", "(", "type", ",", "code", ")", "{", "$sgCodeTitles", ".", "removeClass", "(", "'sg-code-title-active'", ")", ";", "switch", "(", "type", ")", "{", "case", "'e'", ":", "$sgCodeTitleHtml", ".", "addClass", "(", "'sg-code-title-active'", ")", ";", "...
When loading the code view make sure the active tab is highlighted and filled in appropriately. @param {string} type - Single letter that refers to classes and types. @param {string} code - Code to appear in code view.
[ "When", "loading", "the", "code", "view", "make", "sure", "the", "active", "tab", "is", "highlighted", "and", "filled", "in", "appropriately", "." ]
58281efcb426c137881937956c7383cd4a30c878
https://github.com/electric-eloquence/fepper-ui/blob/58281efcb426c137881937956c7383cd4a30c878/scripts/code-viewer.js#L40-L63
train