@vnejs/helpers.create-promise-resolve 0.1.1 → 0.1.2

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,5 @@
1
+ export type PromiseResolve<T = void> = {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ };
5
+ export declare const createPromiseResolve: <T = void>() => PromiseResolve<T>;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export const createPromiseResolve = () => {
2
+ const obj = {};
3
+ obj.promise = new Promise((resolve) => {
4
+ obj.resolve = resolve;
5
+ });
6
+ return obj;
7
+ };
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "@vnejs/helpers.create-promise-resolve",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
- "main": "index.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
6
10
  "scripts": {
7
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "rm -rf dist && tsc -p tsconfig.json",
8
13
  "publish:major:plugin": "npm run publish:major",
9
14
  "publish:minor:plugin": "npm run publish:minor",
10
15
  "publish:patch:plugin": "npm run publish:patch",
11
- "publish:major": "npm version major && npm publish --access public",
12
- "publish:minor": "npm version minor && npm publish --access public",
13
- "publish:patch": "npm version patch && npm publish --access public"
16
+ "publish:major": "npm run build && npm version major && npm publish --access public",
17
+ "publish:minor": "npm run build && npm version minor && npm publish --access public",
18
+ "publish:patch": "npm run build && npm version patch && npm publish --access public"
14
19
  },
15
20
  "author": "",
16
- "license": "ISC"
21
+ "license": "ISC",
22
+ "devDependencies": {
23
+ "typescript": "^6.0.3"
24
+ }
17
25
  }
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- export const createPromiseResolve = () => {
2
- const obj = {};
3
- obj.promise = new Promise((resolve) => {
4
- obj.resolve = resolve;
5
- });
6
-
7
- return obj;
8
- };