nuxt-hs-ui 2.0.17 → 2.0.18

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.0.17",
7
+ "version": "2.0.18",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,5 +1,4 @@
1
- import type { SelectItem as _SelectItem } from "./select-item.js";
2
- export type SelectItem = _SelectItem;
1
+ import type { SelectItem } from "./select-item.js";
3
2
  export type DisplaySelectItem = {
4
3
  id: number | null;
5
4
  } & Omit<SelectItem, "id">;
@@ -0,0 +1,7 @@
1
+ export declare class StopWatch {
2
+ private hrstart;
3
+ constructor();
4
+ GetTime: () => string;
5
+ }
6
+ export declare const SetTime: () => [number, number];
7
+ export declare const GetTime: (start: [number, number]) => string;
@@ -0,0 +1,37 @@
1
+ const convertms = (i) => {
2
+ const a = String(i).split(".");
3
+ if (a.length !== 2) {
4
+ return i + ".000";
5
+ } else {
6
+ let ret = a[0];
7
+ ret += ".";
8
+ if (a[1].length === 1) {
9
+ return ret + a[1] + "00";
10
+ } else if (a[1].length === 2) {
11
+ return ret + a[1] + "0";
12
+ } else if (a[1].length === 3) {
13
+ return ret + a[1];
14
+ } else {
15
+ return ret + a[1].slice(-3);
16
+ }
17
+ }
18
+ };
19
+ export class StopWatch {
20
+ hrstart;
21
+ constructor() {
22
+ this.hrstart = process.hrtime();
23
+ }
24
+ GetTime = () => {
25
+ const hrend = process.hrtime(this.hrstart);
26
+ const time = convertms(Math.floor(hrend[1] / 1e6 * 1e3) / 1e3);
27
+ return ("___" + hrend[0] + "s").slice(-4) + "" + ("_________" + time).slice(-8);
28
+ };
29
+ }
30
+ export const SetTime = () => {
31
+ return process.hrtime();
32
+ };
33
+ export const GetTime = (start) => {
34
+ const hrend = process.hrtime(start);
35
+ const time = convertms(Math.floor(hrend[1] / 1e6 * 1e3) / 1e3);
36
+ return ("___" + hrend[0] + "s").slice(-4) + "" + ("_________" + time).slice(-8);
37
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",
@@ -65,6 +65,11 @@
65
65
  "import": "./dist/runtime/utils/select-item.js",
66
66
  "require": "./dist/runtime/utils/select-item.js"
67
67
  },
68
+ "./utils/stop-watch": {
69
+ "types": "./dist/runtime/utils/stop-watch.d.ts",
70
+ "import": "./dist/runtime/utils/stop-watch.js",
71
+ "require": "./dist/runtime/utils/stop-watch.js"
72
+ },
68
73
  "./utils/string": {
69
74
  "types": "./dist/runtime/utils/string.d.ts",
70
75
  "import": "./dist/runtime/utils/string.js",