@bbn/bbn 1.0.237 → 1.0.238

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.
@@ -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,7 +8,7 @@
8
8
  * bbn.fn.timestamp();
9
9
  * ```
10
10
  * @memberof bbn.fn
11
- * @param {Number} seconds
12
- * @returns {Boolean}
11
+ * @param {Boolean} seconds
12
+ * @returns {Number}
13
13
  */
14
14
  export default function timestamp(seconds?: boolean): number;
@@ -8,8 +8,8 @@
8
8
  * bbn.fn.timestamp();
9
9
  * ```
10
10
  * @memberof bbn.fn
11
- * @param {Number} seconds
12
- * @returns {Boolean}
11
+ * @param {Boolean} seconds
12
+ * @returns {Number}
13
13
  */
14
14
  export default function timestamp(seconds) {
15
15
  if (seconds === void 0) { seconds = false; }
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.237",
3
+ "version": "1.0.238",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",