1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

Upgrade TypeScript (#148)

* Update typescript to 3.6.5 along with tslint to latest.

* Upgrade @types/node to 12.12.54 to get rid of compile errors.

* Update tslint.

* Use @types/node 10.17.28 instead
This commit is contained in:
Oscar Hinton
2020-08-12 21:42:42 +02:00
committed by GitHub
parent b32b016f82
commit e516692559
17 changed files with 62 additions and 134 deletions

View File

@@ -4,7 +4,7 @@ import {
} from '../models/domain/treeNode';
export class ServiceUtils {
static nestedTraverse(nodeTree: Array<TreeNode<ITreeNodeObject>>, partIndex: number, parts: string[],
static nestedTraverse(nodeTree: TreeNode<ITreeNodeObject>[], partIndex: number, parts: string[],
obj: ITreeNodeObject, parent: ITreeNodeObject, delimiter: string) {
if (parts.length <= partIndex) {
return;
@@ -38,7 +38,7 @@ export class ServiceUtils {
}
}
static getTreeNodeObject(nodeTree: Array<TreeNode<ITreeNodeObject>>, id: string): TreeNode<ITreeNodeObject> {
static getTreeNodeObject(nodeTree: TreeNode<ITreeNodeObject>[], id: string): TreeNode<ITreeNodeObject> {
for (let i = 0; i < nodeTree.length; i++) {
if (nodeTree[i].node.id === id) {
return nodeTree[i];

View File

@@ -8,14 +8,14 @@ export function throttle(limit: number, throttleKey: (args: any[]) => string) {
return <T>(target: any, propertyKey: string | symbol,
descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<T>>) => {
const originalMethod: () => Promise<T> = descriptor.value;
const allThrottles = new Map<any, Map<string, Array<() => void>>>();
const allThrottles = new Map<any, Map<string, (() => void)[]>>();
const getThrottles = (obj: any) => {
let throttles = allThrottles.get(obj);
if (throttles != null) {
return throttles;
}
throttles = new Map<string, Array<() => void>>();
throttles = new Map<string, (() => void)[]>();
allThrottles.set(obj, throttles);
return throttles;
};