@bbn/bbn 1.0.429 → 1.0.430
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/db.d.ts +16 -9
- package/dist/fn/init.js +4 -6
- package/dist/fn/object/filter.js +2 -1
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/dist/db.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
add(db: string, name: string, structure: object): void;
|
|
1
|
+
interface Structure {
|
|
2
|
+
keys: {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
fields: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
9
8
|
}
|
|
10
|
-
declare const db:
|
|
9
|
+
declare const db: {
|
|
10
|
+
_structures: {};
|
|
11
|
+
_connections: {};
|
|
12
|
+
_stores: {};
|
|
13
|
+
ok: boolean;
|
|
14
|
+
updateStructure(storeName: any, structure: any, req: any): void;
|
|
15
|
+
open(name: any): Promise<unknown>;
|
|
16
|
+
add(database: string, name: string, structure: Structure): void;
|
|
17
|
+
};
|
|
11
18
|
export default db;
|
package/dist/fn/init.js
CHANGED
|
@@ -8,7 +8,6 @@ import resize from './style/resize.js';
|
|
|
8
8
|
import isMobile from './browser/isMobile.js';
|
|
9
9
|
import isTabletDevice from './browser/isTabletDevice.js';
|
|
10
10
|
import isFunction from './type/isFunction.js';
|
|
11
|
-
import isDataURL from './type/isDataURL.js';
|
|
12
11
|
import log from './browser/log.js';
|
|
13
12
|
import timestamp from './datetime/timestamp.js';
|
|
14
13
|
/**
|
|
@@ -130,11 +129,10 @@ export default function init(cfg, force) {
|
|
|
130
129
|
target = null;
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
|
-
if (target instanceof HTMLElement
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
&& !target.classList.contains("bbn-no")) {
|
|
132
|
+
if (target instanceof HTMLElement &&
|
|
133
|
+
target.hasAttribute("href") &&
|
|
134
|
+
!target.hasAttribute("target") &&
|
|
135
|
+
!target.classList.contains("bbn-no")) {
|
|
138
136
|
e.preventDefault();
|
|
139
137
|
e.stopPropagation();
|
|
140
138
|
link(target.getAttribute("href"));
|
package/dist/fn/object/filter.js
CHANGED
|
@@ -52,6 +52,7 @@ export default function filter(arr, prop, val, operator) {
|
|
|
52
52
|
if (val === void 0) { val = null; }
|
|
53
53
|
if (operator === void 0) { operator = '='; }
|
|
54
54
|
if (!isArray(arr)) {
|
|
55
|
+
bbn.fn.log("NOT ARRAY", arr);
|
|
55
56
|
throw new Error('Error in filter: The first argument must be an array');
|
|
56
57
|
}
|
|
57
58
|
var cfg = {};
|
|
@@ -60,6 +61,7 @@ export default function filter(arr, prop, val, operator) {
|
|
|
60
61
|
if (!prop || !arr.length) {
|
|
61
62
|
return arr;
|
|
62
63
|
}
|
|
64
|
+
bbn.env._enumerated.push(true);
|
|
63
65
|
if (typeof prop === 'object') {
|
|
64
66
|
operator = val;
|
|
65
67
|
cfg = prop;
|
|
@@ -70,7 +72,6 @@ export default function filter(arr, prop, val, operator) {
|
|
|
70
72
|
else if (!isFn) {
|
|
71
73
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
72
74
|
}
|
|
73
|
-
bbn.env._enumerated.push(true);
|
|
74
75
|
if (typeof (prop) === 'function') {
|
|
75
76
|
for (var i = 0; i < arr.length; i++) {
|
|
76
77
|
if (prop(arr[i], i)) {
|
package/dist/index.js
CHANGED