@bbn/bbn 1.0.219 → 1.0.221

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.
@@ -3,4 +3,4 @@
3
3
  * @param {Object|Array} obj
4
4
  * @returns {String}
5
5
  */
6
- export default function hash(obj: any): string;
6
+ export default function hash(): string;
@@ -7,36 +7,34 @@ import simpleHash from './simpleHash.js';
7
7
  * @param {Object|Array} obj
8
8
  * @returns {String}
9
9
  */
10
- export default function hash(obj) {
10
+ export default function hash() {
11
11
  //log(obj);
12
- var st = "__bbn__";
12
+ var st = "";
13
13
  for (var i in arguments) {
14
- if (arguments[i]) {
15
- var value = arguments[i];
16
- if (![undefined, Object, Array, null].includes(value.constructor)) {
17
- if (isDom(value)) {
18
- if (value.bbnId) {
19
- value =
20
- "__BBN_DOM__" + value.tagName + "/" + value.bbnId + value.bbnHash;
21
- }
22
- else {
23
- value = "__BBN_DOM__" + value.tagName + "/" + value.className;
24
- }
25
- }
26
- else if (isCp(value)) {
27
- value = "__BBN_CP__" + value.$options.name + "/" + value.$cid;
14
+ var value = arguments[i];
15
+ if (value === undefined) {
16
+ value = "__BBN_UNDEFINED__";
17
+ }
18
+ else if (![undefined, Object, Array, null].includes(value.constructor)) {
19
+ if (isDom(value)) {
20
+ if (value.bbnId) {
21
+ value =
22
+ "__BBN_DOM__" + value.tagName + "/" + value.bbnId + value.bbnHash;
28
23
  }
29
24
  else {
30
- value = value.constructor.toString();
25
+ value = "__BBN_DOM__" + value.tagName + "/" + value.className;
31
26
  }
32
27
  }
33
- try {
34
- st += JSON.stringify(arguments[i], circularReplacer());
35
- }
36
- catch (e) {
37
- st += ".";
28
+ else if (isCp(value)) {
29
+ value = "__BBN_CP__" + value.$options.name + "/" + value.$cid;
38
30
  }
39
31
  }
32
+ try {
33
+ st += JSON.stringify(value, circularReplacer());
34
+ }
35
+ catch (e) {
36
+ st += ".";
37
+ }
40
38
  }
41
39
  return simpleHash(st);
42
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.219",
3
+ "version": "1.0.221",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",