MCPcopy Create free account
hub / github.com/Tencent/CodeAnalysis / getLocalStorage

Function getLocalStorage

web/packages/framework/src/utils/index.ts:66–74  ·  view source on GitHub ↗
(name: string, defaultValue = '')

Source from the content-addressed store, hash-verified

64 * @param defaultValue 默认🈯️
65 */
66export function getLocalStorage(name: string, defaultValue = ''): string {
67 if (window.localStorage) {
68 const value = window.localStorage.getItem(name);
69 if (value) {
70 return value;
71 }
72 }
73 return defaultValue;
74}
75
76/**
77 * 设置LocalStorage name对应值

Callers 1

DevModalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected