@chanyuxi/utils 0.1.2 → 0.1.4

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/index.js CHANGED
@@ -1 +1 @@
1
- class e{constructor(e,r,t){Object.defineProperty(this,"left",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"right",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:t})}}export{e as TreeNode};
1
+ class t{constructor(){Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:[]})}peek(){return this.data[0]}pop(){return 0===this.data.length?null:this.data.shift()}push(t){this.data.push(t)}size(){return this.data.length}}export{t as Queue};
@@ -0,0 +1,14 @@
1
+ interface IQueue<T> {
2
+ peek(): T | null;
3
+ pop(): T | null;
4
+ push(value: T): void;
5
+ size(): number;
6
+ }
7
+ export declare class Queue<T> implements IQueue<T> {
8
+ private data;
9
+ peek(): T;
10
+ pop(): T | null;
11
+ push(value: T): void;
12
+ size(): number;
13
+ }
14
+ export {};
@@ -1 +1 @@
1
- export * from "./data-structure/index";
1
+ export * from "./data-structure/queue";
package/package.json CHANGED
@@ -1,16 +1,21 @@
1
1
  {
2
2
  "name": "@chanyuxi/utils",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
+ "author": "Chan-Yuxi <2438149743@qq.com> (https://github.com/Chan-Yuxi)",
5
+ "license": "ISC",
4
6
  "description": "Collection of practical tools for personal use",
7
+ "keywords": [
8
+ "serialize"
9
+ ],
5
10
  "homepage": "https://github.com/Chan-Yuxi/utilsjs#readme",
6
11
  "bugs": {
7
12
  "url": "https://github.com/Chan-Yuxi/utilsjs/issues",
8
13
  "email": "2438149743@qq.com"
9
14
  },
15
+ "packageManager": "pnpm@10.4.1",
10
16
  "publishConfig": {
11
17
  "access": "public"
12
18
  },
13
- "types": "./dist/types/index.d.ts",
14
19
  "files": [
15
20
  "dist"
16
21
  ],
@@ -20,19 +25,15 @@
20
25
  ".": "./dist/index.js"
21
26
  },
22
27
  "scripts": {
23
- "build": "tsc && rollup -c",
24
- "publish": "pnpm build && pnpm publish"
28
+ "build": "rollup -c",
29
+ "test": "mocha"
25
30
  },
26
- "keywords": [
27
- "serialize"
28
- ],
29
- "author": "Chan-Yuxi <2438149743@qq.com> (https://github.com/Chan-Yuxi)",
30
- "license": "ISC",
31
- "packageManager": "pnpm@10.4.1",
32
31
  "devDependencies": {
33
32
  "@rollup/plugin-terser": "^0.4.4",
34
33
  "@rollup/plugin-typescript": "^12.1.2",
35
34
  "@tsconfig/recommended": "^1.0.8",
35
+ "mocha": "^11.1.0",
36
+ "prettier": "3.5.2",
36
37
  "rollup": "^4.34.8",
37
38
  "rollup-plugin-delete": "^3.0.0",
38
39
  "tslib": "^2.8.1"
@@ -1,7 +0,0 @@
1
- declare class TreeNode<T> {
2
- left: TreeNode<T> | null;
3
- right: TreeNode<T> | null;
4
- value: T;
5
- constructor(left: TreeNode<T> | null, right: TreeNode<T> | null, value: T);
6
- }
7
- export { TreeNode };