@antfu/utils
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -343,2 +343,24 @@ /** | ||
}; | ||
/** | ||
* Promise with `resolve` and `reject` methods of itself | ||
*/ | ||
interface ControlledPromise<T = void> extends Promise<T> { | ||
resolve(value: T | PromiseLike<T>): void; | ||
reject(reason?: any): void; | ||
} | ||
/** | ||
* Return a Promise with `resolve` and `reject` methods | ||
* | ||
* @category Promise | ||
* @example | ||
* ``` | ||
* const promise = createControlledPromise() | ||
* | ||
* await promise | ||
* | ||
* // in anther context: | ||
* promise.resolve(data) | ||
* ``` | ||
*/ | ||
declare function createControlledPromise<T>(): ControlledPromise<T>; | ||
@@ -508,2 +530,2 @@ // Type definitions for throttle-debounce 2.1 | ||
export { ArgumentsType, Arrayable, Awaitable, Constructor, DeepMerge, ElementOf, Fn, MergeInsertions, Nullable, PartitionFilter, SingletonPromiseReturn, UnionToIntersection, assert, at, batchInvoke, clamp, clampArrayRange, clearUndefined, createPromiseLock, createSingletonPromise, debounce, deepMerge, ensurePrefix, ensureSuffix, flattenArrayable, hasOwnProperty, invoke, isBoolean, isBrowser, isDef, isFunction, isKeyOf, isNumber, isObject, isString, isTruthy, isWindow, last, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, range, remove, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, uniq }; | ||
export { ArgumentsType, Arrayable, Awaitable, Constructor, ControlledPromise, DeepMerge, ElementOf, Fn, MergeInsertions, Nullable, PartitionFilter, SingletonPromiseReturn, UnionToIntersection, assert, at, batchInvoke, clamp, clampArrayRange, clearUndefined, createControlledPromise, createPromiseLock, createSingletonPromise, debounce, deepMerge, ensurePrefix, ensureSuffix, flattenArrayable, hasOwnProperty, invoke, isBoolean, isBrowser, isDef, isFunction, isKeyOf, isNumber, isObject, isString, isTruthy, isWindow, last, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, range, remove, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, uniq }; |
{ | ||
"name": "@antfu/utils", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Opinionated collection of common JavaScript / TypeScript utils by @antfu", | ||
@@ -45,22 +45,22 @@ "keywords": [ | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.16.0", | ||
"@antfu/ni": "^0.12.0", | ||
"@antfu/eslint-config": "^0.20.2", | ||
"@antfu/ni": "^0.14.0", | ||
"@rollup/plugin-alias": "^3.1.9", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-commonjs": "^21.0.3", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@types/node": "^17.0.12", | ||
"@types/node": "^17.0.23", | ||
"@types/throttle-debounce": "^2.1.0", | ||
"bumpp": "^7.1.1", | ||
"eslint": "^8.7.0", | ||
"esno": "^0.14.0", | ||
"eslint": "^8.13.0", | ||
"esno": "^0.14.1", | ||
"p-limit": "^4.0.0", | ||
"rollup": "^2.66.1", | ||
"rollup-plugin-dts": "^4.1.0", | ||
"rollup-plugin-esbuild": "^4.8.2", | ||
"rollup": "^2.70.1", | ||
"rollup-plugin-dts": "^4.2.1", | ||
"rollup-plugin-esbuild": "^4.9.1", | ||
"throttle-debounce": "^3.0.1", | ||
"typescript": "^4.5.5", | ||
"vite": "^2.7.13", | ||
"vitest": "^0.2.4" | ||
"typescript": "^4.6.3", | ||
"vite": "^2.9.1", | ||
"vitest": "^0.9.3" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73793
2391