id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35,700 | bq/corbel-js | dist/corbel.with-polyfills.js | function(params) {
var that = this;
return corbel.request.send(params, that.driver).then(function(response) {
that.driver.config.set(corbel.Services._FORCE_UPDATE_STATUS, 0);
that.driver.config.set(corbel.Services._UNAUTHORIZED_NUM_RETRIES, 0);
... | javascript | function(params) {
var that = this;
return corbel.request.send(params, that.driver).then(function(response) {
that.driver.config.set(corbel.Services._FORCE_UPDATE_STATUS, 0);
that.driver.config.set(corbel.Services._UNAUTHORIZED_NUM_RETRIES, 0);
... | [
"function",
"(",
"params",
")",
"{",
"var",
"that",
"=",
"this",
";",
"return",
"corbel",
".",
"request",
".",
"send",
"(",
"params",
",",
"that",
".",
"driver",
")",
".",
"then",
"(",
"function",
"(",
"response",
")",
"{",
"that",
".",
"driver",
"... | Internal request method.
Has force update behavior
@param {object} params
@return {Promise} | [
"Internal",
"request",
"method",
".",
"Has",
"force",
"update",
"behavior"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L2918-L2948 | |
35,701 | bq/corbel-js | dist/corbel.with-polyfills.js | function(tokenObject) {
var that = this;
if (this.driver._refreshHandlerPromise) {
return this.driver._refreshHandlerPromise;
}
if (tokenObject.refreshToken) {
console.log('corbeljs:services:token:refresh');
... | javascript | function(tokenObject) {
var that = this;
if (this.driver._refreshHandlerPromise) {
return this.driver._refreshHandlerPromise;
}
if (tokenObject.refreshToken) {
console.log('corbeljs:services:token:refresh');
... | [
"function",
"(",
"tokenObject",
")",
"{",
"var",
"that",
"=",
"this",
";",
"if",
"(",
"this",
".",
"driver",
".",
"_refreshHandlerPromise",
")",
"{",
"return",
"this",
".",
"driver",
".",
"_refreshHandlerPromise",
";",
"}",
"if",
"(",
"tokenObject",
".",
... | Default token refresh handler
Only requested once at the same time
@return {Promise} | [
"Default",
"token",
"refresh",
"handler",
"Only",
"requested",
"once",
"at",
"the",
"same",
"time"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L2961-L2989 | |
35,702 | bq/corbel-js | dist/corbel.with-polyfills.js | function(params) {
var accessToken = params.accessToken ? params.accessToken : this.driver.config
.get(corbel.Iam.IAM_TOKEN, {}).accessToken;
if (accessToken && !params.headers.Authorization) {
params.headers.Authorization = 'Bearer ' + accessToke... | javascript | function(params) {
var accessToken = params.accessToken ? params.accessToken : this.driver.config
.get(corbel.Iam.IAM_TOKEN, {}).accessToken;
if (accessToken && !params.headers.Authorization) {
params.headers.Authorization = 'Bearer ' + accessToke... | [
"function",
"(",
"params",
")",
"{",
"var",
"accessToken",
"=",
"params",
".",
"accessToken",
"?",
"params",
".",
"accessToken",
":",
"this",
".",
"driver",
".",
"config",
".",
"get",
"(",
"corbel",
".",
"Iam",
".",
"IAM_TOKEN",
",",
"{",
"}",
")",
"... | Add Authorization header with default tokenObject
@param {object} params request builded params | [
"Add",
"Authorization",
"header",
"with",
"default",
"tokenObject"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L2995-L3007 | |
35,703 | bq/corbel-js | dist/corbel.with-polyfills.js | function(responseObject) {
var location = this._getLocationHeader(responseObject);
return location ? location.substr(location.lastIndexOf('/') + 1) : undefined;
} | javascript | function(responseObject) {
var location = this._getLocationHeader(responseObject);
return location ? location.substr(location.lastIndexOf('/') + 1) : undefined;
} | [
"function",
"(",
"responseObject",
")",
"{",
"var",
"location",
"=",
"this",
".",
"_getLocationHeader",
"(",
"responseObject",
")",
";",
"return",
"location",
"?",
"location",
".",
"substr",
"(",
"location",
".",
"lastIndexOf",
"(",
"'/'",
")",
"+",
"1",
"... | Extract a id from the location header of a requestXHR
@memberof corbel.Services
@param {Promise} responseObject response from a requestXHR
@return {String} id from the Location | [
"Extract",
"a",
"id",
"from",
"the",
"location",
"header",
"of",
"a",
"requestXHR"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3161-L3164 | |
35,704 | bq/corbel-js | dist/corbel.with-polyfills.js | function(responseObject) {
responseObject = responseObject || {};
if (responseObject.xhr) {
return responseObject.xhr.getResponseHeader('Location');
} else if (responseObject.response && responseObject.response.headers.location) {
... | javascript | function(responseObject) {
responseObject = responseObject || {};
if (responseObject.xhr) {
return responseObject.xhr.getResponseHeader('Location');
} else if (responseObject.response && responseObject.response.headers.location) {
... | [
"function",
"(",
"responseObject",
")",
"{",
"responseObject",
"=",
"responseObject",
"||",
"{",
"}",
";",
"if",
"(",
"responseObject",
".",
"xhr",
")",
"{",
"return",
"responseObject",
".",
"xhr",
".",
"getResponseHeader",
"(",
"'Location'",
")",
";",
"}",
... | Extracts the location header
@param {Promise} responseObject response from a requestXHR
@returns {String} location header content
@private | [
"Extracts",
"the",
"location",
"header"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3179-L3187 | |
35,705 | bq/corbel-js | dist/corbel.with-polyfills.js | function(client) {
console.log('iamInterface.client.create', client);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel.request.method.POST,
data: client
}).then(function(res) {
... | javascript | function(client) {
console.log('iamInterface.client.create', client);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel.request.method.POST,
data: client
}).then(function(res) {
... | [
"function",
"(",
"client",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.client.create'",
",",
"client",
")",
";",
"return",
"this",
".",
"request",
"(",
"{",
"url",
":",
"this",
".",
"_buildUriWithDomain",
"(",
"this",
".",
"uri",
")",
",",
"meth... | Adds a new client.
@method
@memberOf corbel.Iam.ClientBuilder
@param {Object} client The client data.
@param {String} client.id Client id.
@param {String} client.name Client domain (obligatory).
@param {String} client.key Client k... | [
"Adds",
"a",
"new",
"client",
"."
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3448-L3457 | |
35,706 | bq/corbel-js | dist/corbel.with-polyfills.js | function(client) {
console.log('iamInterface.client.update', client);
corbel.validate.value('clientId', this.clientId);
return this.request({
url: this._buildUriWithDomain(this.uri + '/' + this.clientId),
method: corbel.request.meth... | javascript | function(client) {
console.log('iamInterface.client.update', client);
corbel.validate.value('clientId', this.clientId);
return this.request({
url: this._buildUriWithDomain(this.uri + '/' + this.clientId),
method: corbel.request.meth... | [
"function",
"(",
"client",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.client.update'",
",",
"client",
")",
";",
"corbel",
".",
"validate",
".",
"value",
"(",
"'clientId'",
",",
"this",
".",
"clientId",
")",
";",
"return",
"this",
".",
"request",
... | Updates a client.
@method
@memberOf corbel.Iam.ClientBuilder
@param {Object} client The client data.
@param {String} client.name Client domain (obligatory).
@param {String} client.key Client key (obligatory).
@param {String} client.version ... | [
"Updates",
"a",
"client",
"."
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3515-L3523 | |
35,707 | bq/corbel-js | dist/corbel.with-polyfills.js | function(domain) {
console.log('iamInterface.domain.update', domain);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel.request.method.PUT,
data: domain
});
} | javascript | function(domain) {
console.log('iamInterface.domain.update', domain);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel.request.method.PUT,
data: domain
});
} | [
"function",
"(",
"domain",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.domain.update'",
",",
"domain",
")",
";",
"return",
"this",
".",
"request",
"(",
"{",
"url",
":",
"this",
".",
"_buildUriWithDomain",
"(",
"this",
".",
"uri",
")",
",",
"meth... | Updates a domain.
@method
@memberOf corbel.Iam.DomainBuilder
@param {Object} domain The domain data.
@param {String} domain.description Description of the domain.
@param {String} domain.authUrl Authentication url.
@param {String} domain.allowedDomains Allowed domains.
@param {... | [
"Updates",
"a",
"domain",
"."
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3657-L3664 | |
35,708 | bq/corbel-js | dist/corbel.with-polyfills.js | function(scope) {
corbel.validate.failIfIsDefined(this.id, 'This function not allowed scope identifier');
console.log('iamInterface.scope.create', scope);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel... | javascript | function(scope) {
corbel.validate.failIfIsDefined(this.id, 'This function not allowed scope identifier');
console.log('iamInterface.scope.create', scope);
return this.request({
url: this._buildUriWithDomain(this.uri),
method: corbel... | [
"function",
"(",
"scope",
")",
"{",
"corbel",
".",
"validate",
".",
"failIfIsDefined",
"(",
"this",
".",
"id",
",",
"'This function not allowed scope identifier'",
")",
";",
"console",
".",
"log",
"(",
"'iamInterface.scope.create'",
",",
"scope",
")",
";",
"retu... | Creates a new scope.
@method
@memberOf corbel.Iam.ScopeBuilder
@param {Object} scope The scope.
@param {Object} scope.rules Scope rules.
@param {String} scope.type Scope type.
@param {Object} scope.scopes Scopes for a composite scope.
@return {Promise} A promise with the id of the created scope or fails
wi... | [
"Creates",
"a",
"new",
"scope",
"."
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3732-L3742 | |
35,709 | bq/corbel-js | dist/corbel.with-polyfills.js | function(params) {
params = params || {};
params.claims = params.claims || {};
if (params.jwt) {
return params.jwt;
}
var secret = params.secret || this.driver.config.get('clientSecret');
params.claims.... | javascript | function(params) {
params = params || {};
params.claims = params.claims || {};
if (params.jwt) {
return params.jwt;
}
var secret = params.secret || this.driver.config.get('clientSecret');
params.claims.... | [
"function",
"(",
"params",
")",
"{",
"params",
"=",
"params",
"||",
"{",
"}",
";",
"params",
".",
"claims",
"=",
"params",
".",
"claims",
"||",
"{",
"}",
";",
"if",
"(",
"params",
".",
"jwt",
")",
"{",
"return",
"params",
".",
"jwt",
";",
"}",
... | Build a JWT with default driver config
@param {Object} params
@param {String} [params.secret]
@param {Object} [params.claims]
@param {String} [params.claims.iss]
@param {String} [params.claims.aud]
@param {String} [params.claims.scope]
@return {String} JWT assertion | [
"Build",
"a",
"JWT",
"with",
"default",
"driver",
"config"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3818-L3831 | |
35,710 | bq/corbel-js | dist/corbel.with-polyfills.js | function(refreshToken, scopes) {
// console.log('iamInterface.token.refresh', refreshToken);
// we need refresh token to refresh access token
corbel.validate.isValue(refreshToken, 'Refresh access token request must contains refresh token');
// we need crea... | javascript | function(refreshToken, scopes) {
// console.log('iamInterface.token.refresh', refreshToken);
// we need refresh token to refresh access token
corbel.validate.isValue(refreshToken, 'Refresh access token request must contains refresh token');
// we need crea... | [
"function",
"(",
"refreshToken",
",",
"scopes",
")",
"{",
"// console.log('iamInterface.token.refresh', refreshToken);",
"// we need refresh token to refresh access token",
"corbel",
".",
"validate",
".",
"isValue",
"(",
"refreshToken",
",",
"'Refresh access token request must cont... | Refresh a token to connect with iam
@method
@memberOf corbel.Iam.TokenBuilder
@param {String} [refresh_token] Token to refresh an AccessToken
@param {String} [scopes] Scopes to the AccessToken
@return {Promise} Q promise that resolves to an AccesToken {Object} or rejects with a {@link corbelE... | [
"Refresh",
"a",
"token",
"to",
"connect",
"with",
"iam"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L3934-L3957 | |
35,711 | bq/corbel-js | dist/corbel.with-polyfills.js | function() {
console.log('iamInterface.user.get');
corbel.validate.value('id', this.id);
return this._getUser(corbel.request.method.GET, this.uri, this.id);
} | javascript | function() {
console.log('iamInterface.user.get');
corbel.validate.value('id', this.id);
return this._getUser(corbel.request.method.GET, this.uri, this.id);
} | [
"function",
"(",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.user.get'",
")",
";",
"corbel",
".",
"validate",
".",
"value",
"(",
"'id'",
",",
"this",
".",
"id",
")",
";",
"return",
"this",
".",
"_getUser",
"(",
"corbel",
".",
"request",
".",
... | Gets the user
@method
@memberOf corbel.Iam.UserBuilder
@return {Promise} Q promise that resolves to a User {Object} or rejects with a {@link corbelError} | [
"Gets",
"the",
"user"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4102-L4106 | |
35,712 | bq/corbel-js | dist/corbel.with-polyfills.js | function(data, options) {
console.log('iamInterface.user.update', data);
corbel.validate.value('id', this.id);
var args = corbel.utils.extend(options || {}, {
url: this._buildUriWithDomain(this.uri, this.id),
method: corbel.request.... | javascript | function(data, options) {
console.log('iamInterface.user.update', data);
corbel.validate.value('id', this.id);
var args = corbel.utils.extend(options || {}, {
url: this._buildUriWithDomain(this.uri, this.id),
method: corbel.request.... | [
"function",
"(",
"data",
",",
"options",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.user.update'",
",",
"data",
")",
";",
"corbel",
".",
"validate",
".",
"value",
"(",
"'id'",
",",
"this",
".",
"id",
")",
";",
"var",
"args",
"=",
"corbel",
... | Updates the user
@method
@memberOf corbel.Iam.UserBuilder
@param {Object} options Request options (e.g accessToken) - Optional
@return {Promise} Q promise that resolves to undefined (void) or rejects with a {@link corbelError} | [
"Updates",
"the",
"user"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4115-L4124 | |
35,713 | bq/corbel-js | dist/corbel.with-polyfills.js | function(options) {
var queryParams = '';
if (options && options.avoidNotification) {
queryParams = '?avoidnotification=true';
}
console.log('iamInterface.user.delete');
corbel.validate.value('id', this.id);
... | javascript | function(options) {
var queryParams = '';
if (options && options.avoidNotification) {
queryParams = '?avoidnotification=true';
}
console.log('iamInterface.user.delete');
corbel.validate.value('id', this.id);
... | [
"function",
"(",
"options",
")",
"{",
"var",
"queryParams",
"=",
"''",
";",
"if",
"(",
"options",
"&&",
"options",
".",
"avoidNotification",
")",
"{",
"queryParams",
"=",
"'?avoidnotification=true'",
";",
"}",
"console",
".",
"log",
"(",
"'iamInterface.user.de... | Deletes the user
@method
@memberOf corbel.Iam.UserBuilder
@return {Promise} Q promise that resolves to undefined (void) or rejects with a {@link corbelError} | [
"Deletes",
"the",
"user"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4132-L4143 | |
35,714 | bq/corbel-js | dist/corbel.with-polyfills.js | function(deviceId, data) {
console.log('iamInterface.user.registerDevice');
corbel.validate.values(['id', 'deviceId'], {
'id': this.id,
'deviceId': deviceId
});
return this.request({
url: this._bu... | javascript | function(deviceId, data) {
console.log('iamInterface.user.registerDevice');
corbel.validate.values(['id', 'deviceId'], {
'id': this.id,
'deviceId': deviceId
});
return this.request({
url: this._bu... | [
"function",
"(",
"deviceId",
",",
"data",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.user.registerDevice'",
")",
";",
"corbel",
".",
"validate",
".",
"values",
"(",
"[",
"'id'",
",",
"'deviceId'",
"]",
",",
"{",
"'id'",
":",
"this",
".",
"id",
... | User device register
@method
@memberOf corbel.Iam.UserBuilder
@param {string} deviceId The device id
@param {Object} data The device data
@param {Object} data.URI The device token
@param {Object} data.name The device name
@param {Object} data.type The device type (ANDROID, APPLE, WEB)
@return {Promise} Q pr... | [
"User",
"device",
"register"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4254-L4267 | |
35,715 | bq/corbel-js | dist/corbel.with-polyfills.js | function(group) {
console.log('iamInterface.user.deleteGroup');
corbel.validate.values(['id', 'group'], {
'id': this.id,
'group': group
});
return this.request({
url: this._buildUriWithDomain(this... | javascript | function(group) {
console.log('iamInterface.user.deleteGroup');
corbel.validate.values(['id', 'group'], {
'id': this.id,
'group': group
});
return this.request({
url: this._buildUriWithDomain(this... | [
"function",
"(",
"group",
")",
"{",
"console",
".",
"log",
"(",
"'iamInterface.user.deleteGroup'",
")",
";",
"corbel",
".",
"validate",
".",
"values",
"(",
"[",
"'id'",
",",
"'group'",
"]",
",",
"{",
"'id'",
":",
"this",
".",
"id",
",",
"'group'",
":",... | Delete group to user
@method
@memberOf iam.UserBuilder
@param {Object} groups The data of the groups
@return {Promise} Q promise that resolves to undefined (void) or rejects with a {@link SilkRoadError} | [
"Delete",
"group",
"to",
"user"
] | 00074882676b592d2ac16868279c58b0c4faf1e2 | https://github.com/bq/corbel-js/blob/00074882676b592d2ac16868279c58b0c4faf1e2/dist/corbel.with-polyfills.js#L4362-L4372 | |
35,716 | 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 | |
35,717 | 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 | |
35,718 | 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 | |
35,719 | 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 | |
35,720 | 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 | |
35,721 | 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 | |
35,722 | 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 | |
35,723 | 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 | |
35,724 | 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 | |
35,725 | 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 | |
35,726 | 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 | |
35,727 | 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 | |
35,728 | 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 | |
35,729 | 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 | |
35,730 | 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 | |
35,731 | 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 | |
35,732 | 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 | |
35,733 | 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 | |
35,734 | 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 | |
35,735 | 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 | |
35,736 | 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 | |
35,737 | 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 | |
35,738 | 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 | |
35,739 | 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 | |
35,740 | 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 | |
35,741 | 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 | |
35,742 | 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 | |
35,743 | 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 | |
35,744 | 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 |
35,745 | 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 | |
35,746 | 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 |
35,747 | 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 |
35,748 | 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 |
35,749 | 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 |
35,750 | 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 |
35,751 | 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 |
35,752 | 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 |
35,753 | 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 |
35,754 | 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 |
35,755 | 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 |
35,756 | 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 | |
35,757 | 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 |
35,758 | 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 |
35,759 | 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 |
35,760 | 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 | |
35,761 | 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 |
35,762 | 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 | |
35,763 | 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 | |
35,764 | 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 |
35,765 | 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 |
35,766 | 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 | |
35,767 | 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 | |
35,768 | 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 | |
35,769 | 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 |
35,770 | 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 | |
35,771 | 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 |
35,772 | 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 |
35,773 | 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 | |
35,774 | 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 |
35,775 | 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 |
35,776 | 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 |
35,777 | 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 |
35,778 | 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 |
35,779 | 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 |
35,780 | 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 |
35,781 | 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 |
35,782 | 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 | |
35,783 | 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 |
35,784 | 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 |
35,785 | 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 | |
35,786 | 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 | |
35,787 | 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 | |
35,788 | 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 |
35,789 | 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 | |
35,790 | 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 | |
35,791 | 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 |
35,792 | 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 |
35,793 | 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 | |
35,794 | 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 | |
35,795 | 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 |
35,796 | 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 |
35,797 | 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 | |
35,798 | 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 | |
35,799 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.