From acb284eac775fa038f0febca374bfb3ef31a8885 Mon Sep 17 00:00:00 2001 From: sunilyadav840 <79906609+sunilyadav840@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:16:33 +0530 Subject: [PATCH] Eslint/fix lint headers utility (#470) --- .eslintignore | 2 -- src/Common/HeadersUtility.ts | 23 ----------------------- 2 files changed, 25 deletions(-) diff --git a/.eslintignore b/.eslintignore index 9caea52ea..8711bfaa6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -16,8 +16,6 @@ src/Common/DocumentClientUtilityBase.ts src/Common/EditableUtility.ts src/Common/HashMap.test.ts src/Common/HashMap.ts -src/Common/HeadersUtility.test.ts -src/Common/HeadersUtility.ts src/Common/IteratorUtilities.test.ts src/Common/IteratorUtilities.ts src/Common/Logger.test.ts diff --git a/src/Common/HeadersUtility.ts b/src/Common/HeadersUtility.ts index 0579c1776..7fd7238a8 100644 --- a/src/Common/HeadersUtility.ts +++ b/src/Common/HeadersUtility.ts @@ -1,28 +1,5 @@ -import * as Constants from "./Constants"; - import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility"; -// x-ms-resource-quota: databases = 100; collections = 5000; users = 500000; permissions = 2000000; -export function getQuota(responseHeaders: any): any { - return responseHeaders && responseHeaders[Constants.HttpHeaders.resourceQuota] - ? parseStringIntoObject(responseHeaders[Constants.HttpHeaders.resourceQuota]) - : null; -} - export function shouldEnableCrossPartitionKey(): boolean { return LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true"; } - -function parseStringIntoObject(resourceString: string) { - var entityObject: any = {}; - - if (resourceString) { - var entitiesArray: string[] = resourceString.split(";"); - for (var i: any = 0; i < entitiesArray.length; i++) { - var entity: string[] = entitiesArray[i].split("="); - entityObject[entity[0]] = entity[1]; - } - } - - return entityObject; -}