@bbn/bbn 1.0.196 → 1.0.198
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 +14 -6
- package/dist/bbn.js.map +1 -1
- package/dist/fn/object/getProperty.d.ts +2 -2
- package/dist/fn/object/getProperty.js +12 -4
- package/dist/fn/string/simpleHash.js +1 -1
- package/dist/fn/string/simpleHash1.d.ts +1 -1
- package/dist/fn/string/simpleHash1.js +1 -1
- package/dist/fn.d.ts +2 -2
- package/package.json +1 -1
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
* @memberof bbn.fn
|
|
25
25
|
* @param {Object} obj
|
|
26
|
-
* @param {String}
|
|
26
|
+
* @param {String} props
|
|
27
27
|
* @returns {*} The property's value or undefined
|
|
28
28
|
*/
|
|
29
|
-
declare const getProperty: (obj: any,
|
|
29
|
+
declare const getProperty: (obj: any, ...props: any[]) => any;
|
|
30
30
|
export { getProperty };
|
|
@@ -23,12 +23,20 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
* @memberof bbn.fn
|
|
25
25
|
* @param {Object} obj
|
|
26
|
-
* @param {String}
|
|
26
|
+
* @param {String} props
|
|
27
27
|
* @returns {*} The property's value or undefined
|
|
28
28
|
*/
|
|
29
|
-
var getProperty = function (obj
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
var getProperty = function (obj) {
|
|
30
|
+
var props = [];
|
|
31
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
32
|
+
props[_i - 1] = arguments[_i];
|
|
33
|
+
}
|
|
34
|
+
if (typeof obj === 'object') {
|
|
35
|
+
var arr = [];
|
|
36
|
+
if (props.length === 1 && typeof props[0] === 'string') {
|
|
37
|
+
arr.push.apply(arr, props[0].split('.'));
|
|
38
|
+
}
|
|
39
|
+
return arr.reduce(function (o, i) {
|
|
32
40
|
if (o) {
|
|
33
41
|
return o[i];
|
|
34
42
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { simpleHash1 } from './simpleHash1.js';
|
|
2
2
|
import { simpleHash2 } from './simpleHash2.js';
|
|
3
3
|
var simpleHash = function (str) {
|
|
4
|
-
var part1 = simpleHash1(str).
|
|
4
|
+
var part1 = simpleHash1(str).padStart(8, '0');
|
|
5
5
|
var part2 = simpleHash2(str).padStart(8, '0');
|
|
6
6
|
return part1 + part2;
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const simpleHash1: (str: string) =>
|
|
1
|
+
declare const simpleHash1: (str: string) => string;
|
|
2
2
|
export { simpleHash1 };
|
package/dist/fn.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ declare const fn: {
|
|
|
113
113
|
getLoader: (requestId: any) => BbnLoader;
|
|
114
114
|
getPath: (element: any) => any;
|
|
115
115
|
getProp: (obj: any, prop: any) => any;
|
|
116
|
-
getProperty: (obj: any,
|
|
116
|
+
getProperty: (obj: any, ...props: any[]) => any;
|
|
117
117
|
getRequestId: (url: any, data: any, datatype: any) => string;
|
|
118
118
|
getRow: (arr: any[], prop: string | object, val?: any, operator?: string) => any;
|
|
119
119
|
getScrollBarSize: () => number;
|
|
@@ -225,7 +225,7 @@ declare const fn: {
|
|
|
225
225
|
shortenObj: (obj: any, max?: number) => object;
|
|
226
226
|
shuffle: (array: any[]) => any[];
|
|
227
227
|
simpleHash: (str: any) => string;
|
|
228
|
-
simpleHash1: (str: string) =>
|
|
228
|
+
simpleHash1: (str: string) => string;
|
|
229
229
|
simpleHash2: (str: string) => string;
|
|
230
230
|
startChrono: (name: any) => void;
|
|
231
231
|
stopChrono: (name: any) => number;
|