namirasoft-core 1.4.63 → 1.4.64

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.
@@ -1,8 +1,12 @@
1
1
  import { IStorage } from "./IStorage";
2
2
  export declare class IStorageMemory extends IStorage {
3
3
  static data: {
4
- [name: string]: string;
4
+ [id: string]: {
5
+ [name: string]: string;
6
+ };
5
7
  };
8
+ private id;
9
+ constructor();
6
10
  get(name: string, defaultValue: string): string;
7
11
  set(name: string, value: string): void;
8
12
  del(name: string): void;
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IStorageMemory = void 0;
4
+ const BaseUUID_1 = require("./BaseUUID");
4
5
  const IStorage_1 = require("./IStorage");
5
6
  class IStorageMemory extends IStorage_1.IStorage {
7
+ constructor() {
8
+ super();
9
+ this.id = new BaseUUID_1.BaseUUID("").new();
10
+ }
6
11
  get(name, defaultValue) {
7
12
  var _a;
8
- return (_a = IStorageMemory.data[name]) !== null && _a !== void 0 ? _a : defaultValue;
13
+ return (_a = IStorageMemory.data[this.id][name]) !== null && _a !== void 0 ? _a : defaultValue;
9
14
  }
10
15
  set(name, value) {
11
- IStorageMemory.data[name] = value;
16
+ IStorageMemory.data[this.id][name] = value;
12
17
  }
13
18
  del(name) {
14
- delete IStorageMemory.data[name];
19
+ delete IStorageMemory.data[this.id][name];
15
20
  }
16
21
  }
17
22
  exports.IStorageMemory = IStorageMemory;
@@ -1 +1 @@
1
- {"version":3,"file":"IStorageMemory.js","sourceRoot":"","sources":["../src/IStorageMemory.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,MAAa,cAAe,SAAQ,mBAAQ;IAG/B,GAAG,CAAC,IAAY,EAAE,YAAoB;;QAE3C,OAAO,MAAA,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAI,YAAY,CAAC;IACrD,CAAC;IACQ,GAAG,CAAC,IAAY,EAAE,KAAa;QAEpC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACtC,CAAC;IACQ,GAAG,CAAC,IAAY;QAErB,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;;AAdL,wCAeC;AAbU,mBAAI,GAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"IStorageMemory.js","sourceRoot":"","sources":["../src/IStorageMemory.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,yCAAsC;AAEtC,MAAa,cAAe,SAAQ,mBAAQ;IAIxC;QAEI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,GAAG,IAAI,mBAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IACrC,CAAC;IACQ,GAAG,CAAC,IAAY,EAAE,YAAoB;;QAE3C,OAAO,MAAA,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,mCAAI,YAAY,CAAC;IAC9D,CAAC;IACQ,GAAG,CAAC,IAAY,EAAE,KAAa;QAEpC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC/C,CAAC;IACQ,GAAG,CAAC,IAAY;QAErB,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;;AApBL,wCAqBC;AAnBU,mBAAI,GAAiD,EAAE,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.63",
11
+ "version": "1.4.64",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -1,18 +1,25 @@
1
+ import { BaseUUID } from "./BaseUUID";
1
2
  import { IStorage } from "./IStorage";
2
3
 
3
4
  export class IStorageMemory extends IStorage
4
5
  {
5
- static data: { [name: string]: string } = {};
6
+ static data: { [id: string]: { [name: string]: string } } = {};
7
+ private id: string;
8
+ constructor()
9
+ {
10
+ super();
11
+ this.id = new BaseUUID("").new();
12
+ }
6
13
  override get(name: string, defaultValue: string)
7
14
  {
8
- return IStorageMemory.data[name] ?? defaultValue;
15
+ return IStorageMemory.data[this.id][name] ?? defaultValue;
9
16
  }
10
17
  override set(name: string, value: string)
11
18
  {
12
- IStorageMemory.data[name] = value;
19
+ IStorageMemory.data[this.id][name] = value;
13
20
  }
14
21
  override del(name: string)
15
22
  {
16
- delete IStorageMemory.data[name];
23
+ delete IStorageMemory.data[this.id][name];
17
24
  }
18
25
  }