@vacantthinker/firefox-addon-framework-easy 2026.603.1748 → 2026.603.2007

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0603.1748",
3
+ "version": "2026.0603.2007",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
package/src/BaseORM.js CHANGED
@@ -1,9 +1,4 @@
1
- import {
2
- stoOpCheck,
3
- stoOpGet,
4
- stoOpRem,
5
- stoOpSet,
6
- } from './opStorage.js';
1
+ import {stoOpCheck, stoOpGet, stoOpRem, stoOpSet} from './opStorage.js';
7
2
 
8
3
  /**
9
4
  * Abstract base class BaseORM (similar to Java's Abstract Class).
@@ -23,22 +18,30 @@ export class BaseORM {
23
18
  constructor(prefix, id, defaultValue = {}) {
24
19
  // Simulating Java's abstract class behavior: prevent direct instantiation of the base class
25
20
  if (new.target === BaseORM) {
26
- throw new TypeError("Cannot construct BaseORM instances directly (Abstract Class).");
21
+ throw new TypeError(
22
+ 'Cannot construct BaseORM instances directly (Abstract Class).');
27
23
  }
28
24
  if (!prefix || !id) {
29
- throw new Error("Both prefix and id must be specified.");
25
+ throw new Error('Both prefix and id must be specified.');
30
26
  }
31
27
 
32
- // Automatically normalize the prefix format to ensure a clean trailing space
33
- const formattedPrefix = prefix.endsWith(' ') ? prefix : `${prefix} `;
34
-
35
28
  // Lock down the final storage key during instance construction
36
- this.#fullStorageKey = `${formattedPrefix}${id}`;
29
+ this.#fullStorageKey = `${prefix}${id}`;
37
30
 
38
31
  // Deep clone the default value to protect against object reference shared-state bugs
39
32
  this.#defaultValue = JSON.parse(JSON.stringify(defaultValue));
40
33
  }
41
34
 
35
+ /**
36
+ * Protected Getter for subclasses to safely access the complete key.
37
+ * Can be used in subclasses as `this.storageKey`.
38
+ * @protected
39
+ * @return {string} The full storage key
40
+ */
41
+ get storageKey() {
42
+ return this.#fullStorageKey;
43
+ }
44
+
42
45
  // Private helper method: checks if the bound key exists in the storage layer
43
46
  async #exists() {
44
47
  return await stoOpCheck(this.#fullStorageKey);
package/src/DomainORM.js CHANGED
@@ -2,7 +2,7 @@ import {BaseORM} from './BaseORM.js';
2
2
 
3
3
  export class DomainORM extends BaseORM {
4
4
  constructor(domain) {
5
- super(`domain`, domain, {
5
+ super(``, domain, {
6
6
 
7
7
  });
8
8
  }