@shwfed/nuxt 0.1.62 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -114,6 +114,15 @@ export function createEnvironment() {
|
|
|
114
114
|
} catch {
|
|
115
115
|
return Optional.none();
|
|
116
116
|
}
|
|
117
|
+
}).registerFunction("local(string): optional<string>", (key) => {
|
|
118
|
+
if (typeof window === "undefined") return Optional.none();
|
|
119
|
+
try {
|
|
120
|
+
const value = window.localStorage.getItem(key);
|
|
121
|
+
if (value === null) return Optional.none();
|
|
122
|
+
return Optional.of(value);
|
|
123
|
+
} catch {
|
|
124
|
+
return Optional.none();
|
|
125
|
+
}
|
|
117
126
|
});
|
|
118
127
|
return env;
|
|
119
128
|
}
|