@bbn/bbn 1.0.237 → 1.0.239
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/fn/datetime/microtimestamp.d.ts +13 -0
- package/dist/fn/datetime/microtimestamp.js +16 -0
- package/dist/fn/datetime/timestamp.d.ts +2 -2
- package/dist/fn/datetime/timestamp.js +2 -2
- package/dist/fn/object/getProperty.js +4 -1
- package/dist/fn.d.ts +2 -0
- package/dist/fn.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the timestamp of the given seconds if an argument is given, else returns the timestamp of new Date().
|
|
3
|
+
* @method microtimestamp
|
|
4
|
+
* @global
|
|
5
|
+
* @example
|
|
6
|
+
* ```javascript
|
|
7
|
+
* //1587031047918
|
|
8
|
+
* bbn.fn.timestamp();
|
|
9
|
+
* ```
|
|
10
|
+
* @memberof bbn.fn
|
|
11
|
+
* @returns {Number}
|
|
12
|
+
*/
|
|
13
|
+
export default function microtimestamp(): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the timestamp of the given seconds if an argument is given, else returns the timestamp of new Date().
|
|
3
|
+
* @method microtimestamp
|
|
4
|
+
* @global
|
|
5
|
+
* @example
|
|
6
|
+
* ```javascript
|
|
7
|
+
* //1587031047918
|
|
8
|
+
* bbn.fn.timestamp();
|
|
9
|
+
* ```
|
|
10
|
+
* @memberof bbn.fn
|
|
11
|
+
* @returns {Number}
|
|
12
|
+
*/
|
|
13
|
+
export default function microtimestamp() {
|
|
14
|
+
return window.performance.now() + performance.timeOrigin;
|
|
15
|
+
}
|
|
16
|
+
;
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* bbn.fn.timestamp();
|
|
9
9
|
* ```
|
|
10
10
|
* @memberof bbn.fn
|
|
11
|
-
* @param {
|
|
12
|
-
* @returns {
|
|
11
|
+
* @param {Boolean} seconds
|
|
12
|
+
* @returns {Number}
|
|
13
13
|
*/
|
|
14
14
|
export default function timestamp(seconds) {
|
|
15
15
|
if (seconds === void 0) { seconds = false; }
|
|
@@ -36,9 +36,12 @@ export default function getProperty(obj) {
|
|
|
36
36
|
if (props.length === 1 && typeof props[0] === 'string') {
|
|
37
37
|
arr.push.apply(arr, props[0].split('.'));
|
|
38
38
|
}
|
|
39
|
+
else {
|
|
40
|
+
arr.push.apply(arr, props);
|
|
41
|
+
}
|
|
39
42
|
return arr.reduce(function (o, i) {
|
|
40
43
|
if (o) {
|
|
41
|
-
return o[i];
|
|
44
|
+
return o[bbn.fn.isArray(o) ? parseInt(i) : i];
|
|
42
45
|
}
|
|
43
46
|
return undefined;
|
|
44
47
|
}, obj);
|
package/dist/fn.d.ts
CHANGED
|
@@ -167,6 +167,7 @@ import log from './fn/browser/log.js';
|
|
|
167
167
|
import makeReactive from './fn/html/makeReactive.js';
|
|
168
168
|
import map from './fn/object/map.js';
|
|
169
169
|
import md5 from './fn/string/md5.js';
|
|
170
|
+
import microtimestamp from './fn/datetime/microtimestamp.js';
|
|
170
171
|
import money from './fn/misc/money.js';
|
|
171
172
|
import move from './fn/object/move.js';
|
|
172
173
|
import multiorder from './fn/object/multiorder.js';
|
|
@@ -400,6 +401,7 @@ declare const _default: {
|
|
|
400
401
|
makeReactive: typeof makeReactive;
|
|
401
402
|
map: typeof map;
|
|
402
403
|
md5: typeof md5;
|
|
404
|
+
microtimestamp: typeof microtimestamp;
|
|
403
405
|
money: typeof money;
|
|
404
406
|
move: typeof move;
|
|
405
407
|
multiorder: typeof multiorder;
|
package/dist/fn.js
CHANGED
|
@@ -167,6 +167,7 @@ import log from './fn/browser/log.js';
|
|
|
167
167
|
import makeReactive from './fn/html/makeReactive.js';
|
|
168
168
|
import map from './fn/object/map.js';
|
|
169
169
|
import md5 from './fn/string/md5.js';
|
|
170
|
+
import microtimestamp from './fn/datetime/microtimestamp.js';
|
|
170
171
|
import money from './fn/misc/money.js';
|
|
171
172
|
import move from './fn/object/move.js';
|
|
172
173
|
import multiorder from './fn/object/multiorder.js';
|
|
@@ -400,6 +401,7 @@ export default {
|
|
|
400
401
|
makeReactive: makeReactive,
|
|
401
402
|
map: map,
|
|
402
403
|
md5: md5,
|
|
404
|
+
microtimestamp: microtimestamp,
|
|
403
405
|
money: money,
|
|
404
406
|
move: move,
|
|
405
407
|
multiorder: multiorder,
|