Skip to content

Commit a8ae0d5

Browse files
Fix deprecated 'substr' method call and linting errors
1 parent 92cf721 commit a8ae0d5

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

libs/mf-tools/src/lib/web-components/router-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export function endsWith(prefix: string): UrlMatcher {
2323
export function connectRouter(router: Router, useHash = false): void {
2424
let url: string;
2525
if (!useHash) {
26-
url = `${location.pathname.substr(1)}${location.search}`;
26+
url = `${location.pathname.substring(1)}${location.search}`;
2727
router.navigateByUrl(url);
2828
window.addEventListener('popstate', () => {
2929
router.navigateByUrl(url);
3030
});
3131
}
3232
else {
33-
url = `${location.hash.substr(1)}${location.search}`;
33+
url = `${location.hash.substring(1)}${location.search}`;
3434
router.navigateByUrl(url);
3535
window.addEventListener('hashchange', () => {
3636
router.navigateByUrl(url);

libs/mf-tools/src/lib/web-components/web-component-wrapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type WebComponentWrapperOptions = LoadRemoteModuleOptions & {
77
};
88

99
@Component({
10+
// eslint-disable-next-line @angular-eslint/component-selector
1011
selector: 'mft-wc-wrapper',
1112
template: '<div #vc></div>',
1213
})

libs/mf/src/server/colors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const crypt = require("crypto");
2-
const chalk = require("chalk");
3-
const wordWrap = require("word-wrap");
1+
import crypt = require("crypto");
2+
import chalk = require("chalk");
3+
import wordWrap = require("word-wrap");
44

55
function correctColor(color: string): string {
66
let result = '';
@@ -31,12 +31,12 @@ export function print(prefix: string, prefixSize: number, message: string, error
3131
.update(prefix)
3232
.digest("hex");
3333

34-
const color = '#' + correctColor(hash.substr(6,6));
34+
const color = '#' + correctColor(hash.substring(6,6));
3535

3636
prefix = prefix.padEnd(prefixSize);
3737

3838
if (message.endsWith('\n')) {
39-
message = message.substr(0, message.length-1);
39+
message = message.substring(0, message.length-1);
4040
}
4141

4242
const coloredPrefix = chalk.hex(color)(prefix) + ' | ';

libs/mf/src/server/task-queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export type DoneFn = () => void;
22
export type Task = (done: DoneFn) => void;
33

4-
let queue: Task[] = [];
4+
const queue: Task[] = [];
55

66
// tslint:disable-next-line: no-shadowed-variable
77
function peek<T>(queue: Array<T>): T {

0 commit comments

Comments
 (0)