@softsky/utils 1.0.0 → 1.0.3

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/README.md CHANGED
@@ -117,6 +117,8 @@ Find next cron tick after passed date
117
117
  Damn, I **love** TypeScript.
118
118
  ### type Optional
119
119
  Make keys in object optional
120
+ ### type Constructor
121
+ Get contructor type of an instance
120
122
  ### type AwaitedObject
121
123
  Recursively resolves promises in objects and arrays
122
124
  ### type JSONSerializable
package/dist/types.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  */
4
4
  /** Make keys in object optional */
5
5
  export type Optional<T, K extends keyof any> = Omit<T, K & keyof T> & Partial<Pick<T, K & keyof T>>;
6
+ /** Get contructor type of an instance */
7
+ export type Constructor<T> = abstract new (..._arguments: never[]) => T;
6
8
  /** Recursively resolves promises in objects and arrays */
7
9
  export type AwaitedObject<T> = {
8
10
  [K in keyof T]: T[K] extends Promise<infer U> ? U : T[K] extends object ? AwaitedObject<T[K]> : T[K];
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@softsky/utils",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "JavaScript/TypeScript utilities",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "lint": "eslint \"./src/**/*.ts\" --fix && tsc",
8
- "gen-readme": "bun ./generate-readme.ts"
8
+ "gen-readme": "bun ./generate-readme.ts",
9
+ "prepare": "bun run lint && bun run gen-readme"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
@@ -18,8 +19,8 @@
18
19
  },
19
20
  "homepage": "https://github.com/SoundOfTheSky/utils#readme",
20
21
  "devDependencies": {
21
- "@softsky/configs": "^1.0.4",
22
- "@types/bun": "^1.1.12"
22
+ "@softsky/configs": "^1.0.6",
23
+ "@types/bun": "^1.1.13"
23
24
  },
24
25
  "files": ["dist/**/*"]
25
26
  }