Skip to content

Commit

Permalink
refactor(sfp): remove usage of var
Browse files Browse the repository at this point in the history
[CodeFactor] Apply fixes

Co-authored-by: codefactor-io <[email protected]>
  • Loading branch information
azlam-abdulsalam and code-factor authored Mar 2, 2024
1 parent 3a3ec4b commit 0238431
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions packages/sfp-cli/src/core/artifacts/ArtifactFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ export default class ArtifactFetcher {
}

private static makefolderid(length): string {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
let result = '';
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion packages/sfp-cli/src/core/metadata/MetadataFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class MetadataFiles {
}

public loadComponents(srcFolder: string, checkIgnore = true): void {
var metadataFiles: string[] = FileUtils.getAllFilesSync(srcFolder);
let metadataFiles: string[] = FileUtils.getAllFilesSync(srcFolder);
let keys = Object.keys(METADATA_INFO);
if (Array.isArray(metadataFiles) && metadataFiles.length > 0) {
metadataFiles.forEach((metadataFile) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ export default class SfpPackageContentGenerator {
}

private static makefolderid(length): string {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
let result = '';
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export default class SourceToMDAPIConvertor {
}

private makefolderid(length): string {
var result = '';
var characters =
let result = '';
let characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ export default class PackageMergeManager {
}

private makefolderid(length): string {
var result = '';
var characters =
let result = '';
let characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
Expand Down
8 changes: 4 additions & 4 deletions packages/sfp-cli/src/core/utils/Fileutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ export default class FileUtils {
}
}
public static makefolderid(length): string {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
let result = '';
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import OrgsUpdater from './OrgsUpdater';
import ReadPackageChangelog from './ReadPackageChangelog';
import * as fs from 'fs-extra';
import SfpPackage from '../../core/package/SfpPackage';
var hash = require('object-hash');
let hash = require('object-hash');

export default class ReleaseChangelogUpdater {
constructor(
Expand Down

0 comments on commit 0238431

Please sign in to comment.