@antfu/utils
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -123,2 +123,14 @@ /** | ||
declare function clampArrayRange(n: number, arr: readonly unknown[]): number; | ||
/** | ||
* Get random items from an array | ||
* | ||
* @category Array | ||
*/ | ||
declare function sample<T>(arr: T[], count: number): T[]; | ||
/** | ||
* Shuffle an array. This function mutates the array. | ||
* | ||
* @category Array | ||
*/ | ||
declare function shuffle<T>(array: T[]): T[]; | ||
@@ -202,2 +214,7 @@ declare const assert: (condition: boolean, message: string) => asserts condition; | ||
declare function template(str: string, ...args: any[]): string; | ||
/** | ||
* Generate a random string | ||
* @category String | ||
*/ | ||
declare function randomStr(size?: number, dict?: string): string; | ||
@@ -531,2 +548,2 @@ declare const timestamp: () => number; | ||
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 }; | ||
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, randomStr, range, remove, sample, shuffle, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, uniq }; |
{ | ||
"name": "@antfu/utils", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"packageManager": "pnpm@7.0.1", | ||
"description": "Opinionated collection of common JavaScript / TypeScript utils by @antfu", | ||
@@ -12,2 +13,4 @@ "keywords": [ | ||
}, | ||
"license": "MIT", | ||
"author": "Anthony Fu <anthonyfu117@hotmail.com>", | ||
"repository": { | ||
@@ -18,5 +21,5 @@ "type": "git", | ||
"funding": "https://github.com/sponsors/antfu", | ||
"license": "MIT", | ||
"author": "Anthony Fu <anthonyfu117@hotmail.com>", | ||
"sideEffects": false, | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"types": "index.d.ts", | ||
"exports": { | ||
@@ -29,5 +32,2 @@ ".": { | ||
}, | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"types": "index.d.ts", | ||
"files": [ | ||
@@ -37,7 +37,7 @@ "dist", | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"dev": "npm run build -- --watch", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"lint:fix": "npm run lint -- --fix", | ||
"lint": "eslint .", | ||
"prepublishOnly": "npm run build", | ||
@@ -49,22 +49,22 @@ "release": "bumpp --commit --push --tag && npm publish", | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.20.2", | ||
"@antfu/ni": "^0.14.0", | ||
"@antfu/eslint-config": "^0.23.0", | ||
"@antfu/ni": "^0.16.2", | ||
"@rollup/plugin-alias": "^3.1.9", | ||
"@rollup/plugin-commonjs": "^21.0.3", | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@types/node": "^17.0.23", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@types/node": "^17.0.31", | ||
"@types/throttle-debounce": "^2.1.0", | ||
"bumpp": "^7.1.1", | ||
"eslint": "^8.13.0", | ||
"eslint": "^8.15.0", | ||
"esno": "^0.14.1", | ||
"p-limit": "^4.0.0", | ||
"rollup": "^2.70.1", | ||
"rollup": "^2.72.1", | ||
"rollup-plugin-dts": "^4.2.1", | ||
"rollup-plugin-esbuild": "^4.9.1", | ||
"throttle-debounce": "^3.0.1", | ||
"typescript": "^4.6.3", | ||
"vite": "^2.9.1", | ||
"vitest": "^0.9.3" | ||
"typescript": "^4.6.4", | ||
"vite": "^2.9.8", | ||
"vitest": "^0.12.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
75465
2450