@brillout/docpress 0.7.1 → 0.7.2

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.
@@ -63,13 +63,14 @@ function isLocalhost() {
63
63
  function toggleDevMode() {
64
64
  if (isLocalhost())
65
65
  throw new Error('On localhost DEV MODE is always on.');
66
- if (window.localStorage[devModeKey]) {
66
+ var isEnabled = function () { return window.localStorage[devModeKey]; };
67
+ if (!isEnabled()) {
67
68
  window.localStorage[devModeKey] = 'true';
68
69
  }
69
70
  else {
70
71
  delete window.localStorage[devModeKey];
71
72
  }
72
- console.log("DEV MODE ".concat(isDevMode() ? 'enabled' : 'disabled'));
73
+ console.log("DEV MODE ".concat(isEnabled() ? 'enabled' : 'disabled'));
73
74
  }
74
75
  function assertWarning(condition, msg) {
75
76
  if (condition) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "======== Build": "",
package/utils/assert.ts CHANGED
@@ -67,12 +67,13 @@ function isLocalhost() {
67
67
  }
68
68
  function toggleDevMode() {
69
69
  if (isLocalhost()) throw new Error('On localhost DEV MODE is always on.')
70
- if (window.localStorage[devModeKey]) {
70
+ const isEnabled = () => window.localStorage[devModeKey]
71
+ if (!isEnabled()) {
71
72
  window.localStorage[devModeKey] = 'true'
72
73
  } else {
73
74
  delete window.localStorage[devModeKey]
74
75
  }
75
- console.log(`DEV MODE ${isDevMode() ? 'enabled' : 'disabled'}`)
76
+ console.log(`DEV MODE ${isEnabled() ? 'enabled' : 'disabled'}`)
76
77
  }
77
78
 
78
79
  function assertWarning(condition: unknown, msg: string): asserts condition {