1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-17 17:10:05 +00:00

style: lint

This commit is contained in:
Mihajlo Medjedovic
2021-01-05 16:21:46 +01:00
parent acf045965e
commit 80aa848617
2 changed files with 23 additions and 5 deletions

View File

@@ -1309,7 +1309,11 @@ export class SASViyaApiClient {
* @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request. * @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request.
* @param accessToken - an access token for authorizing the request. * @param accessToken - an access token for authorizing the request.
*/ */
public async listFolder(sourceFolder: string, accessToken?: string, limit: number = 20) { public async listFolder(
sourceFolder: string,
accessToken?: string,
limit: number = 20
) {
// checks if 'sourceFolder' is already a URI // checks if 'sourceFolder' is already a URI
const sourceFolderUri = isUri(sourceFolder) const sourceFolderUri = isUri(sourceFolder)
? sourceFolder ? sourceFolder
@@ -1337,7 +1341,10 @@ export class SASViyaApiClient {
throw notFoundError throw notFoundError
} }
throw prefixMessage(err, 'There was an error while fetching folder children') throw prefixMessage(
err,
'There was an error while fetching folder children'
)
}) })
return members.items.map((item: any) => item.name) return members.items.map((item: any) => item.name)
@@ -1358,7 +1365,10 @@ export class SASViyaApiClient {
) { ) {
// If target path is existing folder, than keep source folder name, othervise rename it with given target folder name // If target path is existing folder, than keep source folder name, othervise rename it with given target folder name
const sourceFolderName = sourceFolder.split('/').pop() as string const sourceFolderName = sourceFolder.split('/').pop() as string
let targetFolderDetails = await this.getFolderDetails(targetParentFolder, accessToken) let targetFolderDetails = await this.getFolderDetails(
targetParentFolder,
accessToken
)
targetFolderName = targetFolderDetails ? sourceFolderName : targetFolderName targetFolderName = targetFolderDetails ? sourceFolderName : targetFolderName
// checks if 'sourceFolder' is already a URI // checks if 'sourceFolder' is already a URI

View File

@@ -335,10 +335,18 @@ export default class SASjs {
* @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request. * @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request.
* @param accessToken - an access token for authorizing the request. * @param accessToken - an access token for authorizing the request.
*/ */
public async listFolder(sourceFolder: string, accessToken?: string, limit?: number) { public async listFolder(
sourceFolder: string,
accessToken?: string,
limit?: number
) {
this.isMethodSupported('listFolder', ServerType.SASViya) this.isMethodSupported('listFolder', ServerType.SASViya)
return await this.sasViyaApiClient?.listFolder(sourceFolder, accessToken, limit) return await this.sasViyaApiClient?.listFolder(
sourceFolder,
accessToken,
limit
)
} }
/** /**