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:
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user