@pengzhanbo/utils - v3.4.0
    Preparing search index...

    @pengzhanbo/utils - v3.4.0

    @pengzhanbo/utils

    A common JavaScript utility library, zero dependencies, any runtime.

    一个常用的工具类库, 无依赖, 任何运行时。

    import { uniq, toArray } from '@pengzhanbo/utils'

    uniq([1, 1, 2, 2, 3, 3]) // => [1, 2, 3]
    toArray(null) // => []
    toArray(2) // => [2]

    Array

    ArrayIterator
    chunk
    count
    countBy
    difference
    differenceBy
    filterAsync
    findFirstThen
    findLastThen
    groupBy
    intersection
    intersectionBy
    keyBy
    limitAsync
    mapAsync
    move
    orderBy
    partition
    range
    remove
    removeBy
    sample
    sampleSize
    shuffle
    sortBy
    toArray
    union
    unionBy
    uniq
    uniqBy
    uniqWith

    Object

    ObjectIterator
    clearUndefined
    deepEqual
    deepFreeze
    deepMerge
    deepMergeWithArray
    deleteKey
    hasOwn
    objectEntries
    objectGet
    objectKeys
    objectMap
    omit
    pick

    String

    camelCase
    capitalize
    constantCase
    ensurePrefix
    ensureSuffix
    escape
    escapeRegExp
    indent
    kebabCase
    lowerCase
    pascalCase
    slugify
    snakeCase
    titleCase
    truncate
    unescape
    upperCase
    words

    Promise

    Semaphore
    ControlledPromise
    delay
    createControlledPromise
    createPromiseLock
    createSingletonPromise
    promiseParallel
    promiseParallelSettled
    retry
    sleep
    timeout
    withTimeout

    Function

    compose
    debounce
    invoke
    noop
    once
    throttle

    Date

    isSameDay
    timestamp

    Guard

    notNullish
    notUndefined
    toError
    toFinite
    toNumber
    toString
    toTruthy

    Math

    clamp
    degToRad
    gcd
    inRange
    isPrime
    lcm
    lerp
    mapRange
    mean
    median
    radToDeg
    random
    sum

    Predicate

    isArray
    isBlob
    isBoolean
    isBrowser
    isBuffer
    isDate
    isDef
    isEmpty
    isEmptyObject
    isError
    isFinite
    isFunction
    isInteger
    isIterable
    isJSONArray
    isJSONObject
    isJSONValue
    isKeyof
    isMap
    isNil
    isNull
    isNumber
    isPlainObject
    isPrimitive
    isPromise
    isRegexp
    isSafeInteger
    isSet
    isString
    isSymbol
    isTypedArray
    isTypeof
    isUndefined
    isWindow
    typeOf

    Types

    Arrayable
    AsyncFn
    AsyncReturnType
    Awaitable
    Constructor
    ElementOf
    Finite
    Float
    Fn
    If
    IfAny
    IfNever
    IfNotAnyOrNever
    IfNull
    IfUndefined
    IfUnknown
    Integer
    IsAny
    IsAnyOrNever
    IsEqual
    IsFloat
    IsInteger
    IsNever
    IsNotFalse
    IsNull
    IsNullable
    IsPrimitive
    IsUndefined
    IsUnion
    IsUnknown
    LiteralUnion
    LooseRequired
    Negative
    NegativeFloat
    NegativeInfinity
    NegativeInteger
    Not
    Nullable
    PositiveInfinity
    Prettify
    Primitive
    UnionToIntersection
    UnionToTuple

    URL

    combineURLs
    ensureLeadingSlash
    ensureTrailingSlash
    isHttp
    isUrl
    parseProtocol
    removeLeadingSlash
    removeTrailingSlash
    slash

    Util

    assert
    attempt
    attemptAsync

    Event

    createEmitter

    Clone

    deepClone
    shallowClone
    simpleClone