code
stringlengths 10
343k
| docstring
stringlengths 36
21.9k
| func_name
stringlengths 1
3.35k
| language
stringclasses 1
value | repo
stringlengths 7
58
| path
stringlengths 4
131
| url
stringlengths 44
195
| license
stringclasses 5
values |
---|---|---|---|---|---|---|---|
routes.teamPropertiesTemplateGet = function (arg) {
return this.request('team/properties/template/get', arg, 'team', 'api', 'rpc', 'files.team_metadata.write');
}; | Permission : Team member file access. The scope for the route is
files.team_metadata.write.
Route attributes:
scope: files.team_metadata.write
@function Dropbox#teamPropertiesTemplateGet
@deprecated
@arg {FilePropertiesGetTemplateArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<FilePropertiesGetTemplateResult>, DropboxResponseError.<FilePropertiesTemplateError>>} | routes.teamPropertiesTemplateGet ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamPropertiesTemplateList = function () {
return this.request('team/properties/template/list', null, 'team', 'api', 'rpc', 'files.team_metadata.write');
}; | Permission : Team member file access. The scope for the route is
files.team_metadata.write.
Route attributes:
scope: files.team_metadata.write
@function Dropbox#teamPropertiesTemplateList
@deprecated
@returns {Promise.<DropboxResponse<FilePropertiesListTemplateResult>, DropboxResponseError.<FilePropertiesTemplateError>>} | routes.teamPropertiesTemplateList ( ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamPropertiesTemplateUpdate = function (arg) {
return this.request('team/properties/template/update', arg, 'team', 'api', 'rpc', 'files.team_metadata.write');
}; | Permission : Team member file access.
Route attributes:
scope: files.team_metadata.write
@function Dropbox#teamPropertiesTemplateUpdate
@deprecated
@arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<FilePropertiesUpdateTemplateResult>, DropboxResponseError.<FilePropertiesModifyTemplateError>>} | routes.teamPropertiesTemplateUpdate ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamReportsGetActivity = function (arg) {
return this.request('team/reports/get_activity', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Retrieves reporting data about a team's user activity. Deprecated: Will be
removed on July 1st 2021.
Route attributes:
scope: team_info.read
@function Dropbox#teamReportsGetActivity
@deprecated
@arg {TeamDateRange} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamGetActivityReport>, DropboxResponseError.<TeamDateRangeError>>} | routes.teamReportsGetActivity ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamReportsGetDevices = function (arg) {
return this.request('team/reports/get_devices', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Retrieves reporting data about a team's linked devices. Deprecated: Will be
removed on July 1st 2021.
Route attributes:
scope: team_info.read
@function Dropbox#teamReportsGetDevices
@deprecated
@arg {TeamDateRange} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamGetDevicesReport>, DropboxResponseError.<TeamDateRangeError>>} | routes.teamReportsGetDevices ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamReportsGetMembership = function (arg) {
return this.request('team/reports/get_membership', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Retrieves reporting data about a team's membership. Deprecated: Will be
removed on July 1st 2021.
Route attributes:
scope: team_info.read
@function Dropbox#teamReportsGetMembership
@deprecated
@arg {TeamDateRange} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamGetMembershipReport>, DropboxResponseError.<TeamDateRangeError>>} | routes.teamReportsGetMembership ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamReportsGetStorage = function (arg) {
return this.request('team/reports/get_storage', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Retrieves reporting data about a team's storage usage. Deprecated: Will be
removed on July 1st 2021.
Route attributes:
scope: team_info.read
@function Dropbox#teamReportsGetStorage
@deprecated
@arg {TeamDateRange} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamGetStorageReport>, DropboxResponseError.<TeamDateRangeError>>} | routes.teamReportsGetStorage ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamSharingAllowlistAdd = function (arg) {
return this.request('team/sharing_allowlist/add', arg, 'team', 'api', 'rpc', 'team_info.write');
}; | Endpoint adds Approve List entries. Changes are effective immediately.
Changes are committed in transaction. In case of single validation error -
all entries are rejected. Valid domains (RFC-1034/5) and emails
(RFC-5322/822) are accepted. Added entries cannot overflow limit of 10000
entries per team. Maximum 100 entries per call is allowed.
Route attributes:
scope: team_info.write
@function Dropbox#teamSharingAllowlistAdd
@arg {TeamSharingAllowlistAddArgs} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamSharingAllowlistAddResponse>, DropboxResponseError.<TeamSharingAllowlistAddError>>} | routes.teamSharingAllowlistAdd ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamSharingAllowlistList = function (arg) {
return this.request('team/sharing_allowlist/list', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Lists Approve List entries for given team, from newest to oldest, returning
up to `limit` entries at a time. If there are more than `limit` entries
associated with the current team, more can be fetched by passing the returned
`cursor` to sharing_allowlist/list/continue.
Route attributes:
scope: team_info.read
@function Dropbox#teamSharingAllowlistList
@arg {TeamSharingAllowlistListArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamSharingAllowlistListResponse>, DropboxResponseError.<TeamSharingAllowlistListError>>} | routes.teamSharingAllowlistList ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamSharingAllowlistListContinue = function (arg) {
return this.request('team/sharing_allowlist/list/continue', arg, 'team', 'api', 'rpc', 'team_info.read');
}; | Lists entries associated with given team, starting from a the cursor. See
sharing_allowlist/list.
Route attributes:
scope: team_info.read
@function Dropbox#teamSharingAllowlistListContinue
@arg {TeamSharingAllowlistListContinueArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamSharingAllowlistListResponse>, DropboxResponseError.<TeamSharingAllowlistListContinueError>>} | routes.teamSharingAllowlistListContinue ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamSharingAllowlistRemove = function (arg) {
return this.request('team/sharing_allowlist/remove', arg, 'team', 'api', 'rpc', 'team_info.write');
}; | Endpoint removes Approve List entries. Changes are effective immediately.
Changes are committed in transaction. In case of single validation error -
all entries are rejected. Valid domains (RFC-1034/5) and emails
(RFC-5322/822) are accepted. Entries being removed have to be present on the
list. Maximum 1000 entries per call is allowed.
Route attributes:
scope: team_info.write
@function Dropbox#teamSharingAllowlistRemove
@arg {TeamSharingAllowlistRemoveArgs} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamSharingAllowlistRemoveResponse>, DropboxResponseError.<TeamSharingAllowlistRemoveError>>} | routes.teamSharingAllowlistRemove ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderActivate = function (arg) {
return this.request('team/team_folder/activate', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Sets an archived team folder's status to active. Permission : Team member
file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderActivate
@arg {TeamTeamFolderIdArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderMetadata>, DropboxResponseError.<TeamTeamFolderActivateError>>} | routes.teamTeamFolderActivate ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderArchive = function (arg) {
return this.request('team/team_folder/archive', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Sets an active team folder's status to archived and removes all folder and
file members. This endpoint cannot be used for teams that have a shared team
space. Permission : Team member file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderArchive
@arg {TeamTeamFolderArchiveArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderArchiveLaunch>, DropboxResponseError.<TeamTeamFolderArchiveError>>} | routes.teamTeamFolderArchive ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderArchiveCheck = function (arg) {
return this.request('team/team_folder/archive/check', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Returns the status of an asynchronous job for archiving a team folder.
Permission : Team member file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderArchiveCheck
@arg {AsyncPollArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderArchiveJobStatus>, DropboxResponseError.<AsyncPollError>>} | routes.teamTeamFolderArchiveCheck ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderCreate = function (arg) {
return this.request('team/team_folder/create', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Creates a new, active, team folder with no members. This endpoint can only be
used for teams that do not already have a shared team space. Permission :
Team member file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderCreate
@arg {TeamTeamFolderCreateArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderMetadata>, DropboxResponseError.<TeamTeamFolderCreateError>>} | routes.teamTeamFolderCreate ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderGetInfo = function (arg) {
return this.request('team/team_folder/get_info', arg, 'team', 'api', 'rpc', 'team_data.content.read');
}; | Retrieves metadata for team folders. Permission : Team member file access.
Route attributes:
scope: team_data.content.read
@function Dropbox#teamTeamFolderGetInfo
@arg {TeamTeamFolderIdListArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<Array.<TeamTeamFolderGetInfoItem>>, DropboxResponseError.<void>>} | routes.teamTeamFolderGetInfo ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderList = function (arg) {
return this.request('team/team_folder/list', arg, 'team', 'api', 'rpc', 'team_data.content.read');
}; | Lists all team folders. Permission : Team member file access.
Route attributes:
scope: team_data.content.read
@function Dropbox#teamTeamFolderList
@arg {TeamTeamFolderListArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderListResult>, DropboxResponseError.<TeamTeamFolderListError>>} | routes.teamTeamFolderList ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderListContinue = function (arg) {
return this.request('team/team_folder/list/continue', arg, 'team', 'api', 'rpc', 'team_data.content.read');
}; | Once a cursor has been retrieved from team_folder/list, use this to paginate
through all team folders. Permission : Team member file access.
Route attributes:
scope: team_data.content.read
@function Dropbox#teamTeamFolderListContinue
@arg {TeamTeamFolderListContinueArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderListResult>, DropboxResponseError.<TeamTeamFolderListContinueError>>} | routes.teamTeamFolderListContinue ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderPermanentlyDelete = function (arg) {
return this.request('team/team_folder/permanently_delete', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Permanently deletes an archived team folder. This endpoint cannot be used for
teams that have a shared team space. Permission : Team member file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderPermanentlyDelete
@arg {TeamTeamFolderIdArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<void>, DropboxResponseError.<TeamTeamFolderPermanentlyDeleteError>>} | routes.teamTeamFolderPermanentlyDelete ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderRename = function (arg) {
return this.request('team/team_folder/rename', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Changes an active team folder's name. Permission : Team member file access.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderRename
@arg {TeamTeamFolderRenameArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderMetadata>, DropboxResponseError.<TeamTeamFolderRenameError>>} | routes.teamTeamFolderRename ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTeamFolderUpdateSyncSettings = function (arg) {
return this.request('team/team_folder/update_sync_settings', arg, 'team', 'api', 'rpc', 'team_data.content.write');
}; | Updates the sync settings on a team folder or its contents. Use of this
endpoint requires that the team has team selective sync enabled.
Route attributes:
scope: team_data.content.write
@function Dropbox#teamTeamFolderUpdateSyncSettings
@arg {TeamTeamFolderUpdateSyncSettingsArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamTeamFolderMetadata>, DropboxResponseError.<TeamTeamFolderUpdateSyncSettingsError>>} | routes.teamTeamFolderUpdateSyncSettings ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamTokenGetAuthenticatedAdmin = function () {
return this.request('team/token/get_authenticated_admin', null, 'team', 'api', 'rpc', 'team_info.read');
}; | Returns the member profile of the admin who generated the team access token
used to make the call.
Route attributes:
scope: team_info.read
@function Dropbox#teamTokenGetAuthenticatedAdmin
@returns {Promise.<DropboxResponse<TeamTokenGetAuthenticatedAdminResult>, DropboxResponseError.<TeamTokenGetAuthenticatedAdminError>>} | routes.teamTokenGetAuthenticatedAdmin ( ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamLogGetEvents = function (arg) {
return this.request('team_log/get_events', arg, 'team', 'api', 'rpc', 'events.read');
}; | Retrieves team events. If the result's GetTeamEventsResult.has_more field is
true, call get_events/continue with the returned cursor to retrieve more
entries. If end_time is not specified in your request, you may use the
returned cursor to poll get_events/continue for new events. Many attributes
note 'may be missing due to historical data gap'. Note that the
file_operations category and & analogous paper events are not available on
all Dropbox Business plans /business/plans-comparison. Use
features/get_values
/developers/documentation/http/teams#team-features-get_values to check for
this feature. Permission : Team Auditing.
Route attributes:
scope: events.read
@function Dropbox#teamLogGetEvents
@arg {TeamLogGetTeamEventsArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamLogGetTeamEventsResult>, DropboxResponseError.<TeamLogGetTeamEventsError>>} | routes.teamLogGetEvents ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.teamLogGetEventsContinue = function (arg) {
return this.request('team_log/get_events/continue', arg, 'team', 'api', 'rpc', 'events.read');
}; | Once a cursor has been retrieved from get_events, use this to paginate
through all events. Permission : Team Auditing.
Route attributes:
scope: events.read
@function Dropbox#teamLogGetEventsContinue
@arg {TeamLogGetTeamEventsContinueArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<TeamLogGetTeamEventsResult>, DropboxResponseError.<TeamLogGetTeamEventsContinueError>>} | routes.teamLogGetEventsContinue ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.usersFeaturesGetValues = function (arg) {
return this.request('users/features/get_values', arg, 'user', 'api', 'rpc', 'account_info.read');
}; | Get a list of feature values that may be configured for the current account.
Route attributes:
scope: account_info.read
@function Dropbox#usersFeaturesGetValues
@arg {UsersUserFeaturesGetValuesBatchArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<UsersUserFeaturesGetValuesBatchResult>, DropboxResponseError.<UsersUserFeaturesGetValuesBatchError>>} | routes.usersFeaturesGetValues ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.usersGetAccount = function (arg) {
return this.request('users/get_account', arg, 'user', 'api', 'rpc', 'sharing.read');
}; | Get information about a user's account.
Route attributes:
scope: sharing.read
@function Dropbox#usersGetAccount
@arg {UsersGetAccountArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<UsersBasicAccount>, DropboxResponseError.<UsersGetAccountError>>} | routes.usersGetAccount ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.usersGetAccountBatch = function (arg) {
return this.request('users/get_account_batch', arg, 'user', 'api', 'rpc', 'sharing.read');
}; | Get information about multiple user accounts. At most 300 accounts may be
queried per request.
Route attributes:
scope: sharing.read
@function Dropbox#usersGetAccountBatch
@arg {UsersGetAccountBatchArg} arg - The request parameters.
@returns {Promise.<DropboxResponse<Object>, DropboxResponseError.<UsersGetAccountBatchError>>} | routes.usersGetAccountBatch ( arg ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.usersGetCurrentAccount = function () {
return this.request('users/get_current_account', null, 'user', 'api', 'rpc', 'account_info.read');
}; | Get information about the current user's account.
Route attributes:
scope: account_info.read
@function Dropbox#usersGetCurrentAccount
@returns {Promise.<DropboxResponse<UsersFullAccount>, DropboxResponseError.<void>>} | routes.usersGetCurrentAccount ( ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
routes.usersGetSpaceUsage = function () {
return this.request('users/get_space_usage', null, 'user', 'api', 'rpc', 'account_info.read');
}; | Get the space usage information for the current user's account.
Route attributes:
scope: account_info.read
@function Dropbox#usersGetSpaceUsage
@returns {Promise.<DropboxResponse<UsersSpaceUsage>, DropboxResponseError.<void>>} | routes.usersGetSpaceUsage ( ) | javascript | dropbox/dropbox-sdk-js | lib/routes.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/lib/routes.js | MIT |
setAccessToken(accessToken) {
this.accessToken = accessToken;
} | Set the access token used to authenticate requests to the API.
@arg {String} accessToken - An access token
@returns {undefined} | setAccessToken ( accessToken ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getAccessToken() {
return this.accessToken;
} | Get the access token
@returns {String} Access token | getAccessToken ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
setClientId(clientId) {
this.clientId = clientId;
} | Set the client id, which is used to help gain an access token.
@arg {String} clientId - Your apps client id
@returns {undefined} | setClientId ( clientId ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getClientId() {
return this.clientId;
} | Get the client id
@returns {String} Client id | getClientId ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
setClientSecret(clientSecret) {
this.clientSecret = clientSecret;
} | Set the client secret
@arg {String} clientSecret - Your app's client secret
@returns {undefined} | setClientSecret ( clientSecret ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getClientSecret() {
return this.clientSecret;
} | Get the client secret
@returns {String} Client secret | getClientSecret ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getRefreshToken() {
return this.refreshToken;
} | Gets the refresh token
@returns {String} Refresh token | getRefreshToken ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
setRefreshToken(refreshToken) {
this.refreshToken = refreshToken;
} | Sets the refresh token
@param refreshToken - A refresh token | setRefreshToken ( refreshToken ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getAccessTokenExpiresAt() {
return this.accessTokenExpiresAt;
} | Gets the access token's expiration date
@returns {Date} date of token expiration | getAccessTokenExpiresAt ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
setAccessTokenExpiresAt(accessTokenExpiresAt) {
this.accessTokenExpiresAt = accessTokenExpiresAt;
} | Sets the access token's expiration date
@param accessTokenExpiresAt - new expiration date | setAccessTokenExpiresAt ( accessTokenExpiresAt ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
setCodeVerifier(codeVerifier) {
this.codeVerifier = codeVerifier;
} | Sets the code verifier for PKCE flow
@param {String} codeVerifier - new code verifier | setCodeVerifier ( codeVerifier ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getCodeVerifier() {
return this.codeVerifier;
} | Gets the code verifier for PKCE flow
@returns {String} - code verifier for PKCE | getCodeVerifier ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getAuthenticationUrl(redirectUri, state, authType = 'token', tokenAccessType = null, scope = null, includeGrantedScopes = 'none', usePKCE = false) {
const clientId = this.getClientId();
const baseUrl = OAuth2AuthorizationUrl(this.domain);
if (!clientId) {
throw new Error('A client id is required. You can set the client id using .setClientId().');
}
if (authType !== 'code' && !redirectUri) {
throw new Error('A redirect uri is required.');
}
if (!GrantTypes.includes(authType)) {
throw new Error('Authorization type must be code or token');
}
if (tokenAccessType && !TokenAccessTypes.includes(tokenAccessType)) {
throw new Error('Token Access Type must be legacy, offline, or online');
}
if (scope && !(scope instanceof Array)) {
throw new Error('Scope must be an array of strings');
}
if (!IncludeGrantedScopes.includes(includeGrantedScopes)) {
throw new Error('includeGrantedScopes must be none, user, or team');
}
let authUrl;
if (authType === 'code') {
authUrl = `${baseUrl}?response_type=code&client_id=${clientId}`;
} else {
authUrl = `${baseUrl}?response_type=token&client_id=${clientId}`;
}
if (redirectUri) {
authUrl += `&redirect_uri=${redirectUri}`;
}
if (state) {
authUrl += `&state=${state}`;
}
if (tokenAccessType) {
authUrl += `&token_access_type=${tokenAccessType}`;
}
if (scope) {
authUrl += `&scope=${scope.join(' ')}`;
}
if (includeGrantedScopes !== 'none') {
authUrl += `&include_granted_scopes=${includeGrantedScopes}`;
}
if (usePKCE) {
return this.generatePKCECodes()
.then(() => {
authUrl += '&code_challenge_method=S256';
authUrl += `&code_challenge=${this.codeChallenge}`;
return authUrl;
});
}
return Promise.resolve(authUrl);
} | Get a URL that can be used to authenticate users for the Dropbox API.
@arg {String} redirectUri - A URL to redirect the user to after
authenticating. This must be added to your app through the admin interface.
@arg {String} [state] - State that will be returned in the redirect URL to help
prevent cross site scripting attacks.
@arg {String} [authType] - auth type, defaults to 'token', other option is 'code'
@arg {String} [tokenAccessType] - type of token to request. From the following:
null - creates a token with the app default (either legacy or online)
legacy - creates one long-lived token with no expiration
online - create one short-lived token with an expiration
offline - create one short-lived token with an expiration with a refresh token
@arg {Array<String>} [scope] - scopes to request for the grant
@arg {String} [includeGrantedScopes] - whether or not to include previously granted scopes.
From the following:
user - include user scopes in the grant
team - include team scopes in the grant
Note: if this user has never linked the app, include_granted_scopes must be None
@arg {boolean} [usePKCE] - Whether or not to use Sha256 based PKCE. PKCE should be only use
on client apps which doesn't call your server. It is less secure than non-PKCE flow but
can be used if you are unable to safely retrieve your app secret
@returns {Promise<String>} - Url to send user to for Dropbox API authentication
returned in a promise | getAuthenticationUrl ( redirectUri , state , authType = 'token' , tokenAccessType = null , scope = null , includeGrantedScopes = 'none' , usePKCE = false ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
getAccessTokenFromCode(redirectUri, code) {
const clientId = this.getClientId();
const clientSecret = this.getClientSecret();
if (!clientId) {
throw new Error('A client id is required. You can set the client id using .setClientId().');
}
let path = OAuth2TokenUrl(this.domain, this.domainDelimiter);
path += '?grant_type=authorization_code';
path += `&code=${code}`;
path += `&client_id=${clientId}`;
if (clientSecret) {
path += `&client_secret=${clientSecret}`;
} else {
if (!this.codeVerifier) {
throw new Error('You must use PKCE when generating the authorization URL to not include a client secret');
}
path += `&code_verifier=${this.codeVerifier}`;
}
if (redirectUri) {
path += `&redirect_uri=${redirectUri}`;
}
const fetchOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
};
return this.fetch(path, fetchOptions)
.then((res) => parseResponse(res));
} | Get an OAuth2 access token from an OAuth2 Code.
@arg {String} redirectUri - A URL to redirect the user to after
authenticating. This must be added to your app through the admin interface.
@arg {String} code - An OAuth2 code.
@returns {Object} An object containing the token and related info (if applicable) | getAccessTokenFromCode ( redirectUri , code ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
checkAndRefreshAccessToken() {
const canRefresh = this.getRefreshToken() && this.getClientId();
const needsRefresh = !this.getAccessTokenExpiresAt()
|| (new Date(Date.now() + TokenExpirationBuffer)) >= this.getAccessTokenExpiresAt();
const needsToken = !this.getAccessToken();
if ((needsRefresh || needsToken) && canRefresh) {
return this.refreshAccessToken();
}
return Promise.resolve();
} | Checks if a token is needed, can be refreshed and if the token is expired.
If so, attempts to refresh access token
@returns {Promise<*>} | checkAndRefreshAccessToken ( ) | javascript | dropbox/dropbox-sdk-js | src/auth.js | https://github.com/dropbox/dropbox-sdk-js/blob/master/src/auth.js | MIT |
export async function link(name, internalName, destination, unlinks = []) {
const modulePath = join(destination, "node_modules", name);
const internalPath = resolve(process.env.CLIOPATH, "packages", internalName);
rmdir(modulePath);
await copyDir(internalPath, modulePath);
unlinkNodeModules(modulePath, ...unlinks);
} | Link local internals package as a dependency
@param {string} destination Full path to destination directory | link ( name , internalName , destination , unlinks = [ ] ) | javascript | clio-lang/clio | packages/cli/commands/build.js | https://github.com/clio-lang/clio/blob/master/packages/cli/commands/build.js | Apache-2.0 |
export function installExternal(name, destination) {
return npmCommand("install", destination, [name], { stdio: "ignore" });
} | Install external package into destination
@param {string} destination Full path to destination directory | installExternal ( name , destination ) | javascript | clio-lang/clio | packages/cli/commands/build.js | https://github.com/clio-lang/clio/blob/master/packages/cli/commands/build.js | Apache-2.0 |
export function unlinkNodeModules(destination, ...names) {
for (const name of names) {
rmSync(join(destination, "node_modules", name), {
recursive: true,
});
}
} | Unlink local internals package as a dependency
@param {string} destination Full path to destination directory | unlinkNodeModules ( destination , ... names ) | javascript | clio-lang/clio | packages/cli/commands/build.js | https://github.com/clio-lang/clio/blob/master/packages/cli/commands/build.js | Apache-2.0 |
export function getPackageConfig(filepath) {
const file = readFileSync(filepath);
const config = parse(file);
const npmOverride = { ...config.npm };
delete npmOverride.dependencies;
delete npmOverride.devDependencies;
const parsedConfig = {
title: config.title,
description: config.description,
version: config.version,
license: config.license,
main: config.main,
authors: config.authors,
keywords: config.keywords,
build: config.build,
target: config.target,
// eslint-disable-next-line camelcase
git_repository: config.git_repository,
documentation: config.documentation,
scripts: config.scripts,
servers: config.servers,
workers: config.workers,
executor: config.executor,
dependencies: [],
npm: { dependencies: [], devDependencies: [] },
npmOverride,
};
if (config.dependencies)
parsedConfig.dependencies = parseDependencies(config.dependencies);
if (config.npm?.dependencies)
parsedConfig.npm.dependencies = parseDependencies(config.npm.dependencies);
if (config.npm?.devDependencies)
parsedConfig.npm.devDependencies = parseDependencies(
config.npm.devDependencies
);
return parsedConfig;
} | @param {string} filepath Optional name of file containing the configurations for the clio package in format `foo.toml`. | getPackageConfig ( filepath ) | javascript | clio-lang/clio | packages/manifest/packageConfig.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/packageConfig.js | Apache-2.0 |
export function addDependency(configPath, dependency) {
const config = getPackageConfig(configPath);
const [name, version] = dependency;
config.dependencies = config.dependencies || [];
config.dependencies.push({ name, version });
writePackageConfig(configPath, config);
console.log(
`Added ${name}@${version} to the dependencies list in ${configPath}`
);
} | Add a dependency to the package config
@param {string[]} dep - [ name, version ] | addDependency ( configPath , dependency ) | javascript | clio-lang/clio | packages/manifest/packageConfig.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/packageConfig.js | Apache-2.0 |
export function addNpmDependency(configPath, dependency, flags) {
const config = getPackageConfig(configPath);
const [name, version] = dependency;
if (flags.dev) {
config.npm.devDependencies = config.npm.devDependencies || [];
config.npm.devDependencies.push({ name, version });
} else {
config.npm.dependencies = config.npm.dependencies || [];
config.npm.dependencies.push({ name, version });
}
writePackageConfig(configPath, config);
console.log(
`Added ${name}@${version} to the dependencies list in ${configPath}`
);
} | Add a npm dependency to the package config
@param {string[]} dep - [ name, version ]
@param {Object} flags - { dev } | addNpmDependency ( configPath , dependency , flags ) | javascript | clio-lang/clio | packages/manifest/packageConfig.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/packageConfig.js | Apache-2.0 |
export function hasClioDependencies(configPath) {
const dependencies = getPackageDependencies(configPath);
return !!dependencies && !!Object.keys(dependencies).length;
} | Returns true if the project has at least one dependency listed in the package
config file.
@returns {bool} | hasClioDependencies ( configPath ) | javascript | clio-lang/clio | packages/manifest/dependencies.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/dependencies.js | Apache-2.0 |
export function fetchDependencies(configPath) {
if (!hasClioDependencies(configPath)) {
logNoClioDeps(configPath);
return;
}
return Promise.all(
getPackageDependencies(configPath).map((dep) =>
installDependency(configPath, `${dep.name}@${dep.version}`)
)
);
} | Installs every dependency listed in project manifest
@returns {void|promise} | fetchDependencies ( configPath ) | javascript | clio-lang/clio | packages/manifest/dependencies.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/dependencies.js | Apache-2.0 |
export const parsePackageId = (input) => {
const match = input.match(GIT_URL_RE);
if (!match) {
throw "Failed to parse the package id";
}
const [url, tag] = match.slice(1);
return { url, tag };
}; | Returns an object whose properties represent significant elements
of the provided string.
@param {string} id
@returns {object}
@example (see tests) | parsePackageId | javascript | clio-lang/clio | packages/manifest/utils/parse.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/utils/parse.js | Apache-2.0 |
export async function fetchPackageFromGit(configPath, { url, tag }, force) {
const cfg = getPackageConfig(configPath);
const source = resolve(cfg.build.source, MODULES_PATH);
const packageName = basename(url).replace(/\.git$/, "") + `@${tag}`;
const packagePath = join(source, packageName);
if (existsSync(packagePath)) {
if (force) {
rmSync(packagePath, { recursive: true });
} else {
return getPackageConfig(join(packagePath, "clio.toml"));
}
}
try {
console.log(`Cloning into ${packageName}...`);
execSync(`git clone ${url} ${packagePath}`, { stdio: "ignore" });
} catch (error) {
throw `Failed to clone ${url}@${tag}!`;
}
try {
execSync(`git checkout ${tag}`, { cwd: packagePath, stdio: "ignore" });
rmSync(join(packagePath, ".git"), { recursive: true });
} catch (error) {
rmSync(packagePath, { recursive: true });
throw `Failed to checkout ${tag}`;
}
return getPackageConfig(join(packagePath, "clio.toml"));
} | Fetches a library zip archive from GitHub and saves its reference
into the package config file.
@param {string} pkg - github uri of the package to be fetched
@returns {Promise} | fetchPackageFromGit ( configPath , { url , tag } , force ) | javascript | clio-lang/clio | packages/manifest/utils/fetch.js | https://github.com/clio-lang/clio/blob/master/packages/manifest/utils/fetch.js | Apache-2.0 |
export const isSupportedNodeVersion = (versionStr) => {
const nodeFullVersion = versionStr.replace("v", "").split(".");
const nodeMajorVersion = Number(nodeFullVersion[0]);
const nodeMinorVersion = Number(nodeFullVersion[1]);
return (
nodeMajorVersion > 14 || (nodeMajorVersion === 14 && nodeMinorVersion >= 0)
);
}; | Checks, if a given node version is officially supported by Clio.
Note that that version is subject to change. In this case, tests may have to be adjusted
@argument {string} versionStr in format "major.minor.patch". E.g.: "12.6.1"
@returns {boolean} true, if node version is officially supported by Clio | isSupportedNodeVersion | javascript | clio-lang/clio | packages/utils/versionUtils.js | https://github.com/clio-lang/clio/blob/master/packages/utils/versionUtils.js | Apache-2.0 |
const errorHandler = r => {
notify.onError('\n\n❌ ===> ERROR: <%= error.message %>\n')(r);
beep();
// this.emit('end');
}; | Custom Error Handler.
@param Mixed err | errorHandler | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
const browsersync = done => {
browserSync.init({
proxy: config.projectURL,
open: config.browserAutoOpen,
injectChanges: config.injectChanges,
watchEvents: ['change', 'add', 'unlink', 'addDir', 'unlinkDir']
});
done();
}; | Task: `browser-sync`.
Live Reloads, CSS injections, Localhost tunneling.
@link http://www.browsersync.io/docs/options/
@param {Mixed} done Done. | browsersync | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('styles', () => {
return gulp
.src(config.styleSRC, {allowEmpty: true})
.pipe(plumber(errorHandler))
.pipe(sourcemaps.init())
.pipe(
sass({
errLogToConsole: config.errLogToConsole,
outputStyle: config.outputStyle,
precision: config.precision
})
)
.on('error', sass.logError)
.pipe(sourcemaps.write({includeContent: false}))
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(autoprefixer(config.BROWSERS_LIST))
.pipe(sourcemaps.write('./'))
.pipe(lineec()) // Consistent Line Endings for non UNIX systems.
.pipe(gulp.dest(config.styleDestination))
.pipe(filter('**/*.css')) // Filtering stream to only css files.
.pipe(mmq({log: true})) // Merge Media Queries only for .min.css version.
.pipe(browserSync.stream()) // Reloads style.css if that is enqueued.
.pipe(rename({suffix: '.min'}))
.pipe(minifycss({maxLineLen: 10}))
.pipe(lineec()) // Consistent Line Endings for non UNIX systems.
.pipe(gulp.dest(config.styleDestination))
.pipe(filter('**/*.css')) // Filtering stream to only css files.
.pipe(browserSync.stream()) // Reloads style.min.css if that is enqueued.
.pipe(
notify({
message: '\n\n✅ ===> STYLES — completed!\n',
onLast: true
})
);
}); | Task: `styles`.
Compiles Sass, Autoprefixes it and Minifies CSS.
This task does the following:
1. Gets the source scss file
2. Compiles Sass to CSS
3. Writes Sourcemaps for it
4. Autoprefixes it and generates style.css
5. Renames the CSS file with suffix .min.css
6. Minifies the CSS file and generates style.min.css
7. Injects CSS or reloads the browser via browserSync | (anonymous) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('stylesRTL', () => {
return gulp
.src(config.styleSRC, {allowEmpty: true})
.pipe(plumber(errorHandler))
.pipe(sourcemaps.init())
.pipe(
sass({
errLogToConsole: config.errLogToConsole,
outputStyle: config.outputStyle,
precision: config.precision
})
)
.on('error', sass.logError)
.pipe(sourcemaps.write({includeContent: false}))
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(autoprefixer(config.BROWSERS_LIST))
.pipe(lineec()) // Consistent Line Endings for non UNIX systems.
.pipe(rename({suffix: '-rtl'})) // Append "-rtl" to the filename.
.pipe(rtlcss()) // Convert to RTL.
.pipe(sourcemaps.write('./')) // Output sourcemap for style-rtl.css.
.pipe(gulp.dest(config.styleDestination))
.pipe(filter('**/*.css')) // Filtering stream to only css files.
.pipe(browserSync.stream()) // Reloads style.css or style-rtl.css, if that is enqueued.
.pipe(mmq({log: true})) // Merge Media Queries only for .min.css version.
.pipe(rename({suffix: '.min'}))
.pipe(minifycss({maxLineLen: 10}))
.pipe(lineec()) // Consistent Line Endings for non UNIX systems.
.pipe(gulp.dest(config.styleDestination))
.pipe(filter('**/*.css')) // Filtering stream to only css files.
.pipe(browserSync.stream()) // Reloads style.css or style-rtl.css, if that is enqueued.
.pipe(
notify({
message: '\n\n✅ ===> STYLES RTL — completed!\n',
onLast: true
})
);
}); | Task: `stylesRTL`.
Compiles Sass, Autoprefixes it, Generates RTL stylesheet, and Minifies CSS.
This task does the following:
1. Gets the source scss file
2. Compiles Sass to CSS
4. Autoprefixes it and generates style.css
5. Renames the CSS file with suffix -rtl and generates style-rtl.css
6. Writes Sourcemaps for style-rtl.css
7. Renames the CSS files with suffix .min.css
8. Minifies the CSS file and generates style-rtl.min.css
9. Injects CSS or reloads the browser via browserSync | (anonymous) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('images', () => {
return gulp
.src(config.imgSRC)
.pipe(
cache(
imagemin([
imagemin.gifsicle({interlaced: true}),
imagemin.mozjpeg({quality: 90, progressive: true}),
imagemin.optipng({optimizationLevel: 3}), // 0-7 low-high.
imagemin.svgo({
plugins: [{removeViewBox: true}, {cleanupIDs: false}]
})
])
)
)
.pipe(gulp.dest(config.imgDST))
.pipe(
notify({
message: '\n\n✅ ===> IMAGES — completed!\n',
onLast: true
})
);
}); | Task: `images`.
Minifies PNG, JPEG, GIF and SVG images.
This task does the following:
1. Gets the source of images raw folder
2. Minifies PNG, JPEG, GIF and SVG images
3. Generates and saves the optimized images
This task will run only once, if you want to run it
again, do it with the command `gulp images`.
Read the following to change these options.
@link https://github.com/sindresorhus/gulp-imagemin | (anonymous) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('clearCache', function (done) {
return cache.clearAll(done);
}); | Task: `clear-images-cache`.
Deletes the images cache. By running the next "images" task,
each image will be regenerated. | (anonymous) ( done ) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('translate', () => {
return gulp
.src(config.watchPhp)
.pipe(sort())
.pipe(
wpPot({
domain: config.textDomain,
package: config.packageName,
bugReport: config.bugReport,
lastTranslator: config.lastTranslator,
team: config.team
})
)
.pipe(gulp.dest(config.translationDestination + '/' + config.translationFile))
.pipe(
notify({
message: '\n\n✅ ===> TRANSLATE — completed!\n',
onLast: true
})
);
}); | WP POT Translation File Generator.
This task does the following:
1. Gets the source of all the PHP files
2. Sort files in stream by path or any custom sort comparator
3. Applies wpPot with the variable set at the top of this file
4. Generate a .pot file of i18n that can be used for l10n to build .mo file | (anonymous) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
gulp.task('zip', () => {
const src = [...config.zipIncludeGlob, ...config.zipIgnoreGlob];
return gulp.src(src).pipe(zip(config.zipName)).pipe(gulp.dest(config.zipDestination));
}); | Zips theme or plugin and places in the parent directory
zipIncludeGlob: Files to be included in the zip file
zipIgnoreGlob: Files to be ignored from the zip file
zipDestination: Must be a folder outside of the zip folder.
zipName: theme.zip or plugin.zip | (anonymous) | javascript | ahmadawais/WPGulp | WPGulp/gulpfile.babel.js | https://github.com/ahmadawais/WPGulp/blob/master/WPGulp/gulpfile.babel.js | MIT |
select = Sizzle.select = function( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( (selector = compiled.selector || selector) );
results = results || [];
// Try to minimize operations if there is no seed and only one group
if ( match.length === 1 ) {
// Take a shortcut and set the context if the root selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
if ( !context ) {
return results;
// Precompiled matchers will still verify ancestry, so step up a level
} else if ( compiled ) {
context = context.parentNode;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && toSelector( tokens );
if ( !selector ) {
push.apply( results, seed );
return results;
}
break;
}
}
}
}
// Compile and execute a filtering function if one is not provided
// Provide `match` to avoid retokenization if we modified the selector above
( compiled || compile( selector, match ) )(
seed,
context,
!documentIsHTML,
results,
rsibling.test( selector ) && testContext( context.parentNode ) || context
);
return results;
}; | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | Sizzle.select ( selector , context , results , seed ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Identity/wwwroot/lib/jquery/jquery.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Identity/wwwroot/lib/jquery/jquery.js | Apache-2.0 |
function isObject (obj) {
return obj !== null && typeof obj === 'object'
} | Quick object check - this is primarily used to tell
Objects from primitive values when we know the value
is a JSON-compliant type. | isObject ( obj ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function isPlainObject (obj) {
return _toString.call(obj) === '[object Object]'
} | Strict object type check. Only returns true
for plain JavaScript objects. | isPlainObject ( obj ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function isValidArrayIndex (val) {
var n = parseFloat(String(val));
return n >= 0 && Math.floor(n) === n && isFinite(val)
} | Check if val is a valid array index. | isValidArrayIndex ( val ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function toString (val) {
return val == null
? ''
: Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
? JSON.stringify(val, null, 2)
: String(val)
} | Convert a value to a string that is actually rendered. | toString ( val ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function cached (fn) {
var cache = Object.create(null);
return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
})
} | Create a cached version of a pure function. | cached ( fn ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function toArray (list, start) {
start = start || 0;
var i = list.length - start;
var ret = new Array(i);
while (i--) {
ret[i] = list[i + start];
}
return ret
} | Convert an Array-like object to a real Array. | toArray ( list , start ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function toObject (arr) {
var res = {};
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res
} | Merge an Array of Objects into a single Object. | toObject ( arr ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function noop (a, b, c) {} | Perform no operation.
Stubbing args to make Flow happy without leaving useless transpiled code
with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). | noop ( a , b , c ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function genStaticKeys (modules) {
return modules.reduce(function (keys, m) {
return keys.concat(m.staticKeys || [])
}, []).join(',')
} | Generate a string containing static keys from compiler modules. | genStaticKeys ( modules ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function looseEqual (a, b) {
if (a === b) { return true }
var isObjectA = isObject(a);
var isObjectB = isObject(b);
if (isObjectA && isObjectB) {
try {
var isArrayA = Array.isArray(a);
var isArrayB = Array.isArray(b);
if (isArrayA && isArrayB) {
return a.length === b.length && a.every(function (e, i) {
return looseEqual(e, b[i])
})
} else if (a instanceof Date && b instanceof Date) {
return a.getTime() === b.getTime()
} else if (!isArrayA && !isArrayB) {
var keysA = Object.keys(a);
var keysB = Object.keys(b);
return keysA.length === keysB.length && keysA.every(function (key) {
return looseEqual(a[key], b[key])
})
} else {
/* istanbul ignore next */
return false
}
} catch (e) {
/* istanbul ignore next */
return false
}
} else if (!isObjectA && !isObjectB) {
return String(a) === String(b)
} else {
return false
}
} | Check if two values are loosely equal - that is,
if they are plain objects, do they have the same shape? | looseEqual ( a , b ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function looseIndexOf (arr, val) {
for (var i = 0; i < arr.length; i++) {
if (looseEqual(arr[i], val)) { return i }
}
return -1
} | Return the first index at which a loosely equal value can be
found in the array (if value is a plain object, the array must
contain an object of the same shape), or -1 if it is not present. | looseIndexOf ( arr , val ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function once (fn) {
var called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
} | Ensure a function is called only once. | once ( fn ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function isReserved (str) {
var c = (str + '').charCodeAt(0);
return c === 0x24 || c === 0x5F
} | Check if a string starts with $ or _ | isReserved ( str ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
var Dep = function Dep () {
this.id = uid++;
this.subs = [];
}; | A dep is an observable that can have multiple
directives subscribing to it. | Dep ( ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
methodsToPatch.forEach(function (method) {
// cache original method
var original = arrayProto[method];
def(arrayMethods, method, function mutator () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
var result = original.apply(this, args);
var ob = this.__ob__;
var inserted;
switch (method) {
case 'push':
case 'unshift':
inserted = args;
break
case 'splice':
inserted = args.slice(2);
break
}
if (inserted) { ob.observeArray(inserted); }
// notify change
ob.dep.notify();
return result
});
}); | Intercept mutating methods and emit events | (anonymous) ( method ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
var Observer = function Observer (value) {
this.value = value;
this.dep = new Dep();
this.vmCount = 0;
def(value, '__ob__', this);
if (Array.isArray(value)) {
if (hasProto) {
protoAugment(value, arrayMethods);
} else {
copyAugment(value, arrayMethods, arrayKeys);
}
this.observeArray(value);
} else {
this.walk(value);
}
}; | Observer class that is attached to each observed
object. Once attached, the observer converts the target
object's property keys into getter/setters that
collect dependencies and dispatch updates. | Observer ( value ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
Observer.prototype.walk = function walk (obj) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length; i++) {
defineReactive$$1(obj, keys[i]);
}
}; | Walk through all properties and convert them into
getter/setters. This method should only be called when
value type is Object. | walk ( obj ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function protoAugment (target, src) {
/* eslint-disable no-proto */
target.__proto__ = src;
/* eslint-enable no-proto */
} | Augment a target Object or Array by intercepting
the prototype chain using __proto__ | protoAugment ( target , src ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function copyAugment (target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
def(target, key, src[key]);
}
} | Augment a target Object or Array by defining
hidden properties.
/* istanbul ignore next | copyAugment ( target , src , keys ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function observe (value, asRootData) {
if (!isObject(value) || value instanceof VNode) {
return
}
var ob;
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
ob = value.__ob__;
} else if (
shouldObserve &&
!isServerRendering() &&
(Array.isArray(value) || isPlainObject(value)) &&
Object.isExtensible(value) &&
!value._isVue
) {
ob = new Observer(value);
}
if (asRootData && ob) {
ob.vmCount++;
}
return ob
} | Attempt to create an observer instance for a value,
returns the new observer if successfully observed,
or the existing observer if the value already has one. | observe ( value , asRootData ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function defineReactive$$1 (
obj,
key,
val,
customSetter,
shallow
) {
var dep = new Dep();
var property = Object.getOwnPropertyDescriptor(obj, key);
if (property && property.configurable === false) {
return
}
// cater for pre-defined getter/setters
var getter = property && property.get;
var setter = property && property.set;
if ((!getter || setter) && arguments.length === 2) {
val = obj[key];
}
var childOb = !shallow && observe(val);
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val;
if (Dep.target) {
dep.depend();
if (childOb) {
childOb.dep.depend();
if (Array.isArray(value)) {
dependArray(value);
}
}
}
return value
},
set: function reactiveSetter (newVal) {
var value = getter ? getter.call(obj) : val;
/* eslint-disable no-self-compare */
if (newVal === value || (newVal !== newVal && value !== value)) {
return
}
/* eslint-enable no-self-compare */
if (customSetter) {
customSetter();
}
// #7981: for accessor properties without setter
if (getter && !setter) { return }
if (setter) {
setter.call(obj, newVal);
} else {
val = newVal;
}
childOb = !shallow && observe(newVal);
dep.notify();
}
});
} | Define a reactive property on an Object. | $1 ( obj , key , val , customSetter , shallow ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function set (target, key, val) {
if (isUndef(target) || isPrimitive(target)
) {
warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val
}
if (key in target && !(key in Object.prototype)) {
target[key] = val;
return val
}
var ob = (target).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
warn(
'Avoid adding reactive properties to a Vue instance or its root $data ' +
'at runtime - declare it upfront in the data option.'
);
return val
}
if (!ob) {
target[key] = val;
return val
}
defineReactive$$1(ob.value, key, val);
ob.dep.notify();
return val
} | Set a property on an object. Adds the new property and
triggers change notification if the property doesn't
already exist. | set ( target , key , val ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function del (target, key) {
if (isUndef(target) || isPrimitive(target)
) {
warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.splice(key, 1);
return
}
var ob = (target).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
warn(
'Avoid deleting properties on a Vue instance or its root $data ' +
'- just set it to null.'
);
return
}
if (!hasOwn(target, key)) {
return
}
delete target[key];
if (!ob) {
return
}
ob.dep.notify();
} | Delete a property and trigger change if necessary. | del ( target , key ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function dependArray (value) {
for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
e = value[i];
e && e.__ob__ && e.__ob__.dep.depend();
if (Array.isArray(e)) {
dependArray(e);
}
}
} | Collect dependencies on array elements when the array is touched, since
we cannot intercept array element access like property getters. | dependArray ( value ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function mergeData (to, from) {
if (!from) { return to }
var key, toVal, fromVal;
var keys = hasSymbol
? Reflect.ownKeys(from)
: Object.keys(from);
for (var i = 0; i < keys.length; i++) {
key = keys[i];
// in case the object is already observed...
if (key === '__ob__') { continue }
toVal = to[key];
fromVal = from[key];
if (!hasOwn(to, key)) {
set(to, key, fromVal);
} else if (
toVal !== fromVal &&
isPlainObject(toVal) &&
isPlainObject(fromVal)
) {
mergeData(toVal, fromVal);
}
}
return to
} | Helper that recursively merges two data objects together. | mergeData ( to , from ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function mergeAssets (
parentVal,
childVal,
vm,
key
) {
var res = Object.create(parentVal || null);
if (childVal) {
assertObjectType(key, childVal, vm);
return extend(res, childVal)
} else {
return res
}
} | Assets
When a vm is present (instance creation), we need to do
a three-way merge between constructor options, instance
options and parent options. | mergeAssets ( parentVal , childVal , vm , key ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function normalizeProps (options, vm) {
var props = options.props;
if (!props) { return }
var res = {};
var i, val, name;
if (Array.isArray(props)) {
i = props.length;
while (i--) {
val = props[i];
if (typeof val === 'string') {
name = camelize(val);
res[name] = { type: null };
} else {
warn('props must be strings when using array syntax.');
}
}
} else if (isPlainObject(props)) {
for (var key in props) {
val = props[key];
name = camelize(key);
res[name] = isPlainObject(val)
? val
: { type: val };
}
} else {
warn(
"Invalid value for option \"props\": expected an Array or an Object, " +
"but got " + (toRawType(props)) + ".",
vm
);
}
options.props = res;
} | Ensure all props option syntax are normalized into the
Object-based format. | normalizeProps ( options , vm ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function normalizeInject (options, vm) {
var inject = options.inject;
if (!inject) { return }
var normalized = options.inject = {};
if (Array.isArray(inject)) {
for (var i = 0; i < inject.length; i++) {
normalized[inject[i]] = { from: inject[i] };
}
} else if (isPlainObject(inject)) {
for (var key in inject) {
var val = inject[key];
normalized[key] = isPlainObject(val)
? extend({ from: key }, val)
: { from: val };
}
} else {
warn(
"Invalid value for option \"inject\": expected an Array or an Object, " +
"but got " + (toRawType(inject)) + ".",
vm
);
}
} | Normalize all injections into Object-based format | normalizeInject ( options , vm ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function normalizeDirectives (options) {
var dirs = options.directives;
if (dirs) {
for (var key in dirs) {
var def$$1 = dirs[key];
if (typeof def$$1 === 'function') {
dirs[key] = { bind: def$$1, update: def$$1 };
}
}
}
} | Normalize raw function directives into object format. | normalizeDirectives ( options ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function resolveAsset (
options,
type,
id,
warnMissing
) {
/* istanbul ignore if */
if (typeof id !== 'string') {
return
}
var assets = options[type];
// check local registration variations first
if (hasOwn(assets, id)) { return assets[id] }
var camelizedId = camelize(id);
if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
var PascalCaseId = capitalize(camelizedId);
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
// fallback to prototype chain
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
if (warnMissing && !res) {
warn(
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
options
);
}
return res
} | Resolve an asset.
This function is used because child instances need access
to assets defined in its ancestor chain. | resolveAsset ( options , type , id , warnMissing ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function traverse (val) {
_traverse(val, seenObjects);
seenObjects.clear();
} | Recursively traverse an object to evoke all converted
getters, so that every nested property inside the object
is collected as a "deep" dependency. | traverse ( val ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function resolveSlots (
children,
context
) {
if (!children || !children.length) {
return {}
}
var slots = {};
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i];
var data = child.data;
// remove slot attribute if the node is resolved as a Vue slot node
if (data && data.attrs && data.attrs.slot) {
delete data.attrs.slot;
}
// named slots should only be respected if the vnode was rendered in the
// same context.
if ((child.context === context || child.fnContext === context) &&
data && data.slot != null
) {
var name = data.slot;
var slot = (slots[name] || (slots[name] = []));
if (child.tag === 'template') {
slot.push.apply(slot, child.children || []);
} else {
slot.push(child);
}
} else {
(slots.default || (slots.default = [])).push(child);
}
}
// ignore slots that contains only whitespace
for (var name$1 in slots) {
if (slots[name$1].every(isWhitespace)) {
delete slots[name$1];
}
}
return slots
} | Runtime helper for resolving raw children VNodes into a slot object. | resolveSlots ( children , context ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function renderList (
val,
render
) {
var ret, i, l, keys, key;
if (Array.isArray(val) || typeof val === 'string') {
ret = new Array(val.length);
for (i = 0, l = val.length; i < l; i++) {
ret[i] = render(val[i], i);
}
} else if (typeof val === 'number') {
ret = new Array(val);
for (i = 0; i < val; i++) {
ret[i] = render(i + 1, i);
}
} else if (isObject(val)) {
if (hasSymbol && val[Symbol.iterator]) {
ret = [];
var iterator = val[Symbol.iterator]();
var result = iterator.next();
while (!result.done) {
ret.push(render(result.value, ret.length));
result = iterator.next();
}
} else {
keys = Object.keys(val);
ret = new Array(keys.length);
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i];
ret[i] = render(val[key], key, i);
}
}
}
if (!isDef(ret)) {
ret = [];
}
(ret)._isVList = true;
return ret
} | Runtime helper for rendering v-for lists. | renderList ( val , render ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function resolveFilter (id) {
return resolveAsset(this.$options, 'filters', id, true) || identity
} | Runtime helper for resolving filters | resolveFilter ( id ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function checkKeyCodes (
eventKeyCode,
key,
builtInKeyCode,
eventKeyName,
builtInKeyName
) {
var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
return isKeyNotMatch(builtInKeyName, eventKeyName)
} else if (mappedKeyCode) {
return isKeyNotMatch(mappedKeyCode, eventKeyCode)
} else if (eventKeyName) {
return hyphenate(eventKeyName) !== key
}
} | Runtime helper for checking keyCodes from config.
exposed as Vue.prototype._k
passing in eventKeyName as last argument separately for backwards compat | checkKeyCodes ( eventKeyCode , key , builtInKeyCode , eventKeyName , builtInKeyName ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
function bindObjectProps (
data,
tag,
value,
asProp,
isSync
) {
if (value) {
if (!isObject(value)) {
warn(
'v-bind without argument expects an Object or Array value',
this
);
} else {
if (Array.isArray(value)) {
value = toObject(value);
}
var hash;
var loop = function ( key ) {
if (
key === 'class' ||
key === 'style' ||
isReservedAttribute(key)
) {
hash = data;
} else {
var type = data.attrs && data.attrs.type;
hash = asProp || config.mustUseProp(tag, type, key)
? data.domProps || (data.domProps = {})
: data.attrs || (data.attrs = {});
}
var camelizedKey = camelize(key);
var hyphenatedKey = hyphenate(key);
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
hash[key] = value[key];
if (isSync) {
var on = data.on || (data.on = {});
on[("update:" + key)] = function ($event) {
value[key] = $event;
};
}
}
};
for (var key in value) loop( key );
}
}
return data
} | Runtime helper for merging v-bind="object" into a VNode's data. | bindObjectProps ( data , tag , value , asProp , isSync ) | javascript | yubaolee/OpenAuth.Core | OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | https://github.com/yubaolee/OpenAuth.Core/blob/master/OpenAuth.Mvc/wwwroot/js/vue2.6.10.js | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.