MCPcopy
hub / github.com/graphql/graphiql / isQuotaError

Function isQuotaError

packages/graphiql-toolkit/src/storage/base.ts:37–52  ·  view source on GitHub ↗
(storage: Storage, e: unknown)

Source from the content-addressed store, hash-verified

35};
36
37function isQuotaError(storage: Storage, e: unknown) {
38 return (
39 e instanceof DOMException &&
40 // everything except Firefox
41 (e.code === 22 ||
42 // Firefox
43 e.code === 1014 ||
44 // test name field too, because code might not be present
45 // everything except Firefox
46 e.name === 'QuotaExceededError' ||
47 // Firefox
48 e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
49 // acknowledge QuotaExceededError only if there's something already stored
50 storage.length !== 0
51 );
52}
53
54export class StorageAPI {
55 storage: Storage | null;

Callers 1

setMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected