@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.62",
4
+ "version": "0.1.63",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",