Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

AssignDeep

  • AssignDeep(target: any, ...args: any[]): any
  • Deeply assign the values of all enumerable-own-properties and symbols f rom one or more source objects to a target object. Returns the target object.

    since

    1.1.15

    version

    2018-11-02

    see

    https://github.com/jonschlinkert/assign-deep/blob/master/index.js

    Parameters

    • target: any
    • Rest ...args: any[]

    Returns any

AssignSymbols

  • AssignSymbols(target: any, ...args: any[]): any
  • Assign the enumerable es6 Symbol properties from one or more objects to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.

    since

    1.1.15

    version

    2018-11-02

    see

    https://github.com/jonschlinkert/assign-symbols/blob/master/index.js

    Parameters

    • target: any
    • Rest ...args: any[]

    Returns any

ChangeFileExtension

  • ChangeFileExtension(fileName: string, extension: string): string
  • version

    1.0.5

    since

    2021-12-07

    Parameters

    • fileName: string
    • extension: string

    Returns string

CheckEndian

  • CheckEndian(): undefined | boolean
  • Returns undefined | boolean

    true if little endian, false if big endian

CombinePath

  • CombinePath(base: string, ...paths: string[]): string
  • since

    1.1.7

    version

    2021-12-07

    Parameters

    • base: string
    • Rest ...paths: string[]

    Returns string

Countdown

  • Countdown(action: (left?: number) => void, count: number, interval?: number, runWhenStart?: boolean, completeAction: () => void): void
  • version

    2018-08-19 15:59:52.369

    since

    1.1.5

    Parameters

    • action: (left?: number) => void
        • (left?: number): void
        • Parameters

          • Optional left: number

          Returns void

    • count: number
    • interval: number = 1000
    • runWhenStart: boolean = true
    • completeAction: () => void
        • (): void
        • Returns void

    Returns void

CreateArray

  • CreateArray(length: number, start: number, step?: number): number[]
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • length: number
    • start: number
    • Optional step: number

    Returns number[]

DecodeByRFC3986

  • DecodeByRFC3986(str: string): string
  • since

    1.1.11

    version

    2021-12-07

    Parameters

    • str: string

    Returns string

EncodeByRFC3986

  • EncodeByRFC3986(str: string): string
  • 字符AZ、az、09以及字符 -、_、.、 不编码。

    其它字符编码成%XY的格式,其中XY是字符对应ASCII码的16进制。示例:半角双引号(")对应%22。

    扩展的UTF-8字符,编码成%XY%ZA…的格式。

    空格( )编码成 %20,而不是加号(+)。

    该编码方式与application/x-www-form-urlencoded MIME格式编码算法相似,但又有所不同。

    encodeURIComponent: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent Not Escaped: A-Z a-z 0-9 - _ . ! ~ * ' ( )

    !*()' %21 %2A %28 %29 %27

    since

    1.1.6

    version

    2021-12-07

    Parameters

    • str: string

    Returns string

GenerateGuid

  • GenerateGuid(): string
  • version

    1.0.0

    since

    1.0.5

    Returns string

GenerateNumberString

  • GenerateNumberString(length: number): string
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • length: number

    Returns string

GeneratePassword

  • GeneratePassword(length: number, numbers?: boolean, lowercaseLetters?: boolean, uppercaseLetters?: boolean, specialCharacters?: boolean): string
  • since

    1.0.5

    version

    2021-12-07

    Parameters

    • length: number
    • numbers: boolean = true
    • lowercaseLetters: boolean = true
    • uppercaseLetters: boolean = true
    • specialCharacters: boolean = true

    Returns string

GenerateRandomString

  • GenerateRandomString(length: number, validCharacters?: string): string
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • length: number
    • Optional validCharacters: string

    Returns string

GetBaseDir

  • GetBaseDir(pathStr: string, trimLastSlash?: boolean): string
  • since

    1.0.5

    version

    2020-07-29

    example

    C:/a/b/c return C:/a/b/

    Parameters

    • pathStr: string
    • trimLastSlash: boolean = false

      default false

    Returns string

GetCRC32

  • since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns BitString

GetCRC64

  • Parameters

    Returns BitString

GetFileExtension

  • GetFileExtension(fileName: string): string
  • version

    1.0.0

    since

    1.0.5

    example

    "c:/a/b.xyz" => "xyz"

    Parameters

    • fileName: string

    Returns string

GetFileName

  • GetFileName(fileName: string): string
  • version

    2018-08-31

    since

    1.0.5

    example

    "c:/a/b.xyz" => "b.xyz" "b.xyz" => "b.xyz"

    Parameters

    • fileName: string

    Returns string

GetFileNameByDateTime

  • GetFileNameByDateTime(utc?: boolean): string
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • Optional utc: boolean

    Returns string

GetFileNameFromURL

  • GetFileNameFromURL(url: string): string
  • since

    1.1.7

    version

    2018-08-30

    Parameters

    • url: string

    Returns string

GetFileNameWithoutExtension

  • GetFileNameWithoutExtension(fileName: string): string
  • since

    1.1.7

    version

    2021-12-07

    example

    "c:/a/b.xyz" => "b"

    Parameters

    • fileName: string

    Returns string

GetMD5

  • GetMD5(str: string, md5?: KavenMD5): string
  • since

    1.1.13

    version

    2018-10-21

    Parameters

    Returns string

GetMIMEByContentType

  • GetMIMEByContentType(contentType: string): IMIME[]
  • since

    1.1.14

    version

    2018-10-26

    Parameters

    • contentType: string

    Returns IMIME[]

GetMIMEByExtension

  • GetMIMEByExtension(fileExtension: string): IMIME[]
  • since

    1.1.14

    version

    2018-10-26

    Parameters

    • fileExtension: string

    Returns IMIME[]

GetNextVersion

  • GetNextVersion(version: string): string
  • deprecated

    Please use IncreaseVersion instead

    since

    1.0.12

    version

    2021-12-06

    Parameters

    • version: string

    Returns string

GetQueryStringFromURL

  • GetQueryStringFromURL(url: string): undefined | string
  • since

    1.1.17

    version

    2019-02-26

    Parameters

    • url: string

    Returns undefined | string

GetRandomArbitrary

  • GetRandomArbitrary(min: number, max: number): number
  • Returns a random number between min (inclusive) and max (exclusive)

    version

    1.0.0

    since

    1.0.5

    Parameters

    • min: number
    • max: number

    Returns number

GetRandomInt

  • GetRandomInt(min: number, max: number): number
  • Returns a random integer between min (inclusive) and max (inclusive) Using Math.round() will give you a non-uniform distribution!

    version

    1.0.0

    since

    1.0.5

    Parameters

    • min: number
    • max: number

    Returns number

GetSHA1

  • GetSHA1(str: string, sha?: KavenSHA): string
  • Warning: This algorithm is now considered vulnerable and should not be used.

    since

    1.1.20

    version

    2019-03-30

    Parameters

    Returns string

GetSHA224

  • GetSHA224(str: string, sha?: KavenSHA): string
  • Parameters

    Returns string

GetSHA256

  • GetSHA256(str: string, sha?: KavenSHA): string
  • Parameters

    Returns string

GetSHA384

  • GetSHA384(str: string, sha?: KavenSHA): string
  • Parameters

    Returns string

GetSHA512

  • GetSHA512(str: string, sha?: KavenSHA): string
  • Parameters

    Returns string

GetSHA512T

  • GetSHA512T(str: string, t: number, sha?: KavenSHA): string
  • Parameters

    • str: string
    • t: number
    • Optional sha: KavenSHA

    Returns string

GetStackInfo

  • GetStackInfo(depth?: number, type?: "getFileName" | "getFunctionName" | "getLineNumber"): any

IsEmailAddressValid

  • IsEmailAddressValid(email: string, unicode?: boolean): boolean
  • since

    2.0.2

    version

    2019-12-26

    Parameters

    • email: string
    • unicode: boolean = false

    Returns boolean

NormalizePathSep

  • NormalizePathSep(pathStr: string, sep?: "/" | "\\"): string
  • Normalize path segment separator

    Parameters

    • pathStr: string
    • Optional sep: "/" | "\\"

    Returns string

Number2Hex

  • Number2Hex(number: number, trimStart: boolean): string
  • Parameters

    • number: number
    • trimStart: boolean

    Returns string

Number2Uint8Array

  • Number2Uint8Array(number: number): Uint8Array
  • Parameters

    • number: number

    Returns Uint8Array

ParseQueryParameters

RandomBoolean

  • RandomBoolean(): boolean
  • version

    1.0.0

    since

    1.0.5

    Returns boolean

RemoveEmpty

  • RemoveEmpty(obj: {}): {}
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • obj: {}

    Returns {}

RemoveHashFromURL

  • RemoveHashFromURL(url: string): string
  • static
    memberof

    KavenBasic

    since

    1.1.7

    version

    2018-08-30

    Parameters

    • url: string

    Returns string

RemoveInvalidCharactersForPath

  • RemoveInvalidCharactersForPath(pathStr: string): string
  • since

    1.0.9

    version

    2021-12-07

    Parameters

    • pathStr: string

    Returns string

RemoveQueriesFromURL

  • RemoveQueriesFromURL(url: string): string
  • since

    1.1.7

    version

    2018-08-30

    Parameters

    • url: string

    Returns string

RemoveQueryFromURL

  • RemoveQueryFromURL(url: string, ...names: string[]): string
  • since

    1.1.17

    version

    2019-02-19

    Parameters

    • url: string
    • Rest ...names: string[]

    Returns string

RunTest

  • RunTest(func: () => void, times: number): void
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • func: () => void
        • (): void
        • Returns void

    • times: number

    Returns void

SortByKey

  • SortByKey(obj: {}): {}
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • obj: {}

    Returns {}

SplitCamelCaseString

  • SplitCamelCaseString(camelCaseStr: string): string

SplitStringByNewline

  • SplitStringByNewline(str: string): undefined | string[]
  • export
    since

    1.0.8

    version

    2021-12-07

    Parameters

    • str: string

    Returns undefined | string[]

String2StringArray

  • String2StringArray(str: string): undefined | string[]
  • Parameters

    • str: string

    Returns undefined | string[]

StringArray2String

  • StringArray2String(...strArray: string[]): string
  • Parameters

    • Rest ...strArray: string[]

    Returns string

TrimPath

  • TrimPath(pathStr: string): string
  • remove trailing / and \ from path

    Parameters

    • pathStr: string

    Returns string

TryParseVersion

  • TryParseVersion(line: string): undefined | string
  • Parameters

    • line: string

    Returns undefined | string

UpdateQueryString

  • UpdateQueryString(param: string, value: string, url: string): string

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc