@antfu/utils
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -182,2 +182,15 @@ /** | ||
declare function invoke(fn: Fn): void; | ||
/** | ||
* Pass the value through the callback, and return the value. | ||
* | ||
* @example | ||
* ``` | ||
* function createUser(name: string): User { | ||
* return tap(new User, user => { | ||
* user.name = name | ||
* }) | ||
* } | ||
* ``` | ||
*/ | ||
declare function tap<T>(value: T, callback: (value: T) => void): T; | ||
@@ -278,2 +291,2 @@ /** | ||
export { ArgumentsType, Arrayable, Awaitable, DeepMerge, ElementOf, Fn, MergeInsertions, Nullable, SingletonPromiseReturn, UnionToIntersection, assert, at, batchInvoke, clamp, clampArrayRange, clearUndefined, createSingletonPromise, deepMerge, ensurePrefix, flattenArrayable, invoke, isBoolean, isBrowser, isDef, isFunction, isKeyOf, isNumber, isObject, isString, isTruthy, isWindow, last, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, partition, range, remove, slash, sleep, sum, timestamp, toArray, toString, uniq }; | ||
export { ArgumentsType, Arrayable, Awaitable, DeepMerge, ElementOf, Fn, MergeInsertions, Nullable, SingletonPromiseReturn, UnionToIntersection, assert, at, batchInvoke, clamp, clampArrayRange, clearUndefined, createSingletonPromise, deepMerge, ensurePrefix, flattenArrayable, invoke, isBoolean, isBrowser, isDef, isFunction, isKeyOf, isNumber, isObject, isString, isTruthy, isWindow, last, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, partition, range, remove, slash, sleep, sum, tap, timestamp, toArray, toString, uniq }; |
@@ -130,2 +130,6 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/math.ts | ||
} | ||
function tap(value, callback) { | ||
callback(value); | ||
return value; | ||
} | ||
@@ -246,2 +250,3 @@ // src/object.ts | ||
exports.assert = assert; exports.at = at; exports.batchInvoke = batchInvoke; exports.clamp = clamp; exports.clampArrayRange = clampArrayRange; exports.clearUndefined = clearUndefined; exports.createSingletonPromise = createSingletonPromise; exports.deepMerge = deepMerge; exports.ensurePrefix = ensurePrefix; exports.flattenArrayable = flattenArrayable; exports.invoke = invoke; exports.isBoolean = isBoolean; exports.isBrowser = isBrowser; exports.isDef = isDef; exports.isFunction = isFunction; exports.isKeyOf = isKeyOf; exports.isNumber = isNumber; exports.isObject = isObject; exports.isString = isString; exports.isTruthy = isTruthy; exports.isWindow = isWindow; exports.last = last; exports.mergeArrayable = mergeArrayable; exports.move = move; exports.noNull = noNull; exports.noop = noop; exports.notNullish = notNullish; exports.notUndefined = notUndefined; exports.objectEntries = objectEntries; exports.objectKeys = objectKeys; exports.objectMap = objectMap; exports.objectPick = objectPick; exports.partition = partition; exports.range = range; exports.remove = remove; exports.slash = slash; exports.sleep = sleep; exports.sum = sum; exports.timestamp = timestamp; exports.toArray = toArray; exports.toString = toString2; exports.uniq = uniq; | ||
exports.assert = assert; exports.at = at; exports.batchInvoke = batchInvoke; exports.clamp = clamp; exports.clampArrayRange = clampArrayRange; exports.clearUndefined = clearUndefined; exports.createSingletonPromise = createSingletonPromise; exports.deepMerge = deepMerge; exports.ensurePrefix = ensurePrefix; exports.flattenArrayable = flattenArrayable; exports.invoke = invoke; exports.isBoolean = isBoolean; exports.isBrowser = isBrowser; exports.isDef = isDef; exports.isFunction = isFunction; exports.isKeyOf = isKeyOf; exports.isNumber = isNumber; exports.isObject = isObject; exports.isString = isString; exports.isTruthy = isTruthy; exports.isWindow = isWindow; exports.last = last; exports.mergeArrayable = mergeArrayable; exports.move = move; exports.noNull = noNull; exports.noop = noop; exports.notNullish = notNullish; exports.notUndefined = notUndefined; exports.objectEntries = objectEntries; exports.objectKeys = objectKeys; exports.objectMap = objectMap; exports.objectPick = objectPick; exports.partition = partition; exports.range = range; exports.remove = remove; exports.slash = slash; exports.sleep = sleep; exports.sum = sum; exports.tap = tap; exports.timestamp = timestamp; exports.toArray = toArray; exports.toString = toString2; exports.uniq = uniq; |
{ | ||
"name": "@antfu/utils", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Opinionated collection of common JavaScript / TypeScript utils by @antfu", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
22569
723