Revert "Protect local storage calls (#3043)" (#3063)

This reverts commit 2f28d7c6f8.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
alex 2024-03-04 15:48:31 +00:00 committed by GitHub
parent 15c760f7ea
commit 8adaaf8e22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 52 additions and 625 deletions

View file

@ -172,62 +172,6 @@
"name": "",
"preserveMemberOrder": false,
"members": [
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!clearLocalStorage:function(1)",
"docComment": "/**\n * Clear all values from local storage. Will not throw an error if localStorage is not available.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function clearLocalStorage(): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/local-storage.ts",
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [],
"name": "clearLocalStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!clearSessionStorage:function(1)",
"docComment": "/**\n * Clear all values from session storage. Will not throw an error if sessionStorage is not available.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function clearSessionStorage(): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/session-storage.ts",
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [],
"name": "clearSessionStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!debounce:function(1)",
@ -479,96 +423,6 @@
],
"name": "deepCopy"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!deleteFromLocalStorage:function(1)",
"docComment": "/**\n * Remove a value from local storage. Will not throw an error if localStorage is not available.\n *\n * @param key - The key to set.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function deleteFromLocalStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/local-storage.ts",
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
}
],
"name": "deleteFromLocalStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!deleteFromSessionStorage:function(1)",
"docComment": "/**\n * Remove a value from session storage. Will not throw an error if sessionStorage is not available.\n *\n * @param key - The key to set.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function deleteFromSessionStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/session-storage.ts",
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
}
],
"name": "deleteFromSessionStorage"
},
{
"kind": "TypeAlias",
"canonicalReference": "@tldraw/utils!ErrorResult:type",
@ -800,128 +654,6 @@
],
"name": "getFirstFromIterable"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!getFromLocalStorage:function(1)",
"docComment": "/**\n * Get a value from local storage.\n *\n * @param key - The key to get.\n *\n * @param defaultValue - The default value to return if the key is not found or if local storage is not available.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function getFromLocalStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ", defaultValue?: "
},
{
"kind": "Content",
"text": "null"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "any"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/local-storage.ts",
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
},
{
"parameterName": "defaultValue",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"isOptional": true
}
],
"name": "getFromLocalStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!getFromSessionStorage:function(1)",
"docComment": "/**\n * Get a value from session storage.\n *\n * @param key - The key to get.\n *\n * @param defaultValue - The default value to return if the key is not found or if session storage is not available.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function getFromSessionStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ", defaultValue?: "
},
{
"kind": "Content",
"text": "null"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "any"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/session-storage.ts",
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
},
{
"parameterName": "defaultValue",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"isOptional": true
}
],
"name": "getFromSessionStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!getHashForBuffer:function(1)",
@ -3329,128 +3061,6 @@
],
"name": "rotateArray"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!setInLocalStorage:function(1)",
"docComment": "/**\n * Set a value in local storage. Will not throw an error if localStorage is not available.\n *\n * @param key - The key to set.\n *\n * @param value - The value to set.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function setInLocalStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ", value: "
},
{
"kind": "Content",
"text": "any"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/local-storage.ts",
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
},
{
"parameterName": "value",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"isOptional": false
}
],
"name": "setInLocalStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!setInSessionStorage:function(1)",
"docComment": "/**\n * Set a value in session storage. Will not throw an error if sessionStorage is not available.\n *\n * @param key - The key to set.\n *\n * @param value - The value to set.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function setInSessionStorage(key: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ", value: "
},
{
"kind": "Content",
"text": "any"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"fileUrlPath": "packages/utils/src/lib/session-storage.ts",
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "key",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
},
{
"parameterName": "value",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"isOptional": false
}
],
"name": "setInSessionStorage"
},
{
"kind": "Function",
"canonicalReference": "@tldraw/utils!sortById:function(1)",