Options
All
  • Public
  • Public/Protected
  • All
Menu

kaven-basic

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

BooleanMethod<T>: (input: T) => boolean

Type parameters

  • T

Type declaration

    • (input: T): boolean
    • Parameters

      • input: T

      Returns boolean

ByteArray: number[]

Represents an array of 8-bit unsigned integers.

Handler<TData, TSender>: (data: TData, s: TSender) => boolean

Type parameters

  • TData

  • TSender

Type declaration

    • (data: TData, s: TSender): boolean
    • Parameters

      • data: TData
      • s: TSender

      Returns boolean

StringMethod<T>: (input: T) => string

Type parameters

  • T = string

Type declaration

    • (input: T): string
    • Parameters

      • input: T

      Returns string

TBaseTimeUnit: Exclude<TimeUnit, months | years>
TConsole: "log" | "info" | "warn" | "error"
TDataAcquisition<T>: (offset: number, length: number) => Promise<T>

Type parameters

  • T = Uint8Array

Type declaration

    • (offset: number, length: number): Promise<T>
    • Parameters

      • offset: number
      • length: number

      Returns Promise<T>

TDataOfKavenBrowserRSA: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer
TEqualityComparer<T>: (a: T, b: T) => boolean

Type parameters

  • T

Type declaration

    • (a: T, b: T): boolean
    • Parameters

      • a: T
      • b: T

      Returns boolean

THashInput: string | ByteArray | Uint8Array | IDataAcquisition
TMethod<T>: () => T

Type parameters

  • T = void

Type declaration

    • (): T
    • Returns T

TMethod1<T1, TResult>: (p1: T1) => TResult

Type parameters

  • T1

  • TResult

Type declaration

    • (p1: T1): TResult
    • Parameters

      • p1: T1

      Returns TResult

TMethod2<T1, T2, TResult>: (p1: T1, p2: T2) => TResult

Type parameters

  • T1

  • T2

  • TResult

Type declaration

    • (p1: T1, p2: T2): TResult
    • Parameters

      • p1: T1
      • p2: T2

      Returns TResult

TStringObject<T>: {}

Type parameters

  • T

Type declaration

  • [name: string]: T
TStringOrUndefined: string | undefined
TStringSignatureMethod: (str: string, secret: string) => Promise<string>

Type declaration

    • (str: string, secret: string): Promise<string>
    • Parameters

      • str: string
      • secret: string

      Returns Promise<string>

Variables

AnsiColors_Background_Black: "\u001b[40m" = "\u001b[40m"
AnsiColors_Background_Blue: "\u001b[44m" = "\u001b[44m"
AnsiColors_Background_BrightBlack: "\u001b[40;1m" = "\u001b[40;1m"
AnsiColors_Background_BrightBlue: "\u001b[44;1m" = "\u001b[44;1m"
AnsiColors_Background_BrightCyan: "\u001b[46;1m" = "\u001b[46;1m"
AnsiColors_Background_BrightGreen: "\u001b[42;1m" = "\u001b[42;1m"
AnsiColors_Background_BrightMagenta: "\u001b[45;1m" = "\u001b[45;1m"
AnsiColors_Background_BrightRed: "\u001b[41;1m" = "\u001b[41;1m"
AnsiColors_Background_BrightWhite: "\u001b[47;1m" = "\u001b[47;1m"
AnsiColors_Background_BrightYellow: "\u001b[43;1m" = "\u001b[43;1m"
AnsiColors_Background_Cyan: "\u001b[46m" = "\u001b[46m"
AnsiColors_Background_Green: "\u001b[42m" = "\u001b[42m"
AnsiColors_Background_Magenta: "\u001b[45m" = "\u001b[45m"
AnsiColors_Background_Red: "\u001b[41m" = "\u001b[41m"
AnsiColors_Background_White: "\u001b[47m" = "\u001b[47m"
AnsiColors_Background_Yellow: "\u001b[43m" = "\u001b[43m"
AnsiColors_Black: "\u001b[30m" = "\u001b[30m"
AnsiColors_Blue: "\u001b[34m" = "\u001b[34m"
AnsiColors_BrightBlack: "\u001b[30;1m" = "\u001b[30;1m"
AnsiColors_BrightBlue: "\u001b[34;1m" = "\u001b[34;1m"
AnsiColors_BrightCyan: "\u001b[36;1m" = "\u001b[36;1m"
AnsiColors_BrightGreen: "\u001b[32;1m" = "\u001b[32;1m"
AnsiColors_BrightMagenta: "\u001b[35;1m" = "\u001b[35;1m"
AnsiColors_BrightRed: "\u001b[31;1m" = "\u001b[31;1m"
AnsiColors_BrightWhite: "\u001b[37;1m" = "\u001b[37;1m"
AnsiColors_BrightYellow: "\u001b[33;1m" = "\u001b[33;1m"
AnsiColors_Cyan: "\u001b[36m" = "\u001b[36m"
AnsiColors_Green: "\u001b[32m" = "\u001b[32m"
AnsiColors_Magenta: "\u001b[35m" = "\u001b[35m"
AnsiColors_Red: "\u001b[31m" = "\u001b[31m"
AnsiColors_Reset: "\u001b[0m" = "\u001b[0m"
AnsiColors_White: "\u001b[37m" = "\u001b[37m"
AnsiColors_Yellow: "\u001b[33m" = "\u001b[33m"
CRC32: KavenCRC = ...
CRC64: KavenCRC = ...
HttpRequestHeader_Dnt: "DNT" = "DNT"
HttpRequestHeader_FrontEndHttps: "Front-End-Https" = "Front-End-Https"
HttpRequestHeader_ProxyConnection: "Proxy-Connection" = "Proxy-Connection"
HttpRequestHeader_SaveData: "Save-Data" = "Save-Data"
HttpRequestHeader_UpgradeInsecureRequests: "Upgrade-Insecure-Requests" = "Upgrade-Insecure-Requests"
HttpRequestHeader_XAttDeviceId: "X-ATT-DeviceId" = "X-ATT-DeviceId"
HttpRequestHeader_XCorrelationId: "X-Correlation-ID" = "X-Correlation-ID"
HttpRequestHeader_XCsrfToken: "X-Csrf-Token" = "X-Csrf-Token"
HttpRequestHeader_XForwardedFor: "X-Forwarded-For" = "X-Forwarded-For"
HttpRequestHeader_XForwardedHost: "X-Forwarded-Host" = "X-Forwarded-Host"
HttpRequestHeader_XForwardedProto: "X-Forwarded-Proto" = "X-Forwarded-Proto"
HttpRequestHeader_XHttpMethodOverride: "X-Http-Method-Override" = "X-Http-Method-Override"
HttpRequestHeader_XRequestId: "X-Request-ID" = "X-Request-ID"
HttpRequestHeader_XRequestedWith: "X-Requested-With" = "X-Requested-With"
HttpRequestHeader_XUidh: "X-UIDH" = "X-UIDH"
HttpRequestHeader_XWapProfile: "X-Wap-Profile" = "X-Wap-Profile"
HttpResponseHeader_ContentSecurityPolicy: "Content-Security-Policy" = "Content-Security-Policy"
HttpResponseHeader_ExpectCt: "Expect-CT" = "Expect-CT"
HttpResponseHeader_Nel: "NEL" = "NEL"
HttpResponseHeader_PermissionsPolicy: "Permissions-Policy" = "Permissions-Policy"
HttpResponseHeader_Refresh: "Refresh" = "Refresh"
HttpResponseHeader_ReportTo: "Report-To" = "Report-To"
HttpResponseHeader_Status: "Status" = "Status"
HttpResponseHeader_TimingAllowOrigin: "Timing-Allow-Origin" = "Timing-Allow-Origin"
HttpResponseHeader_XContentDuration: "X-Content-Duration" = "X-Content-Duration"
HttpResponseHeader_XContentSecurityPolicy: "X-Content-Security-Policy" = "X-Content-Security-Policy"
HttpResponseHeader_XContentTypeOptions: "X-Content-Type-Options" = "X-Content-Type-Options"
HttpResponseHeader_XCorrelationId: "X-Correlation-ID" = "X-Correlation-ID"
HttpResponseHeader_XPoweredBy: "X-Powered-By" = "X-Powered-By"
HttpResponseHeader_XRedirectBy: "X-Redirect-By" = "X-Redirect-By"
HttpResponseHeader_XRequestId: "X-Request-ID" = "X-Request-ID"
HttpResponseHeader_XUaCompatible: "X-UA-Compatible" = "X-UA-Compatible"
HttpResponseHeader_XWebKitCsp: "X-WebKit-CSP" = "X-WebKit-CSP"
HttpResponseHeader_XXssProtection: "X-XSS-Protection" = "X-XSS-Protection"
HttpStandardRequestHeader_AIm: "A-IM" = "A-IM"
author:

Kaven

email:

kaven@wuwenkai.com

website:

http://blog.kaven.xyz

file:

[Kaven-Basic] /src/libs/Strings.HttpHeader.ts

create:

2022-04-19 13:30:53.811

modify:

2022-04-22 15:24:24.220

version:

4.0.1

times:

13

lines:

150

copyright:

Copyright © 2022 Kaven. All Rights Reserved.

description:

[description]

license:

[license]

see:

https://en.wikipedia.org/wiki/List_of_HTTP_header_fields

HttpStandardRequestHeader_Accept: "Accept" = "Accept"
HttpStandardRequestHeader_AcceptCharset: "Accept-Charset" = "Accept-Charset"
HttpStandardRequestHeader_AcceptDatetime: "Accept-Datetime" = "Accept-Datetime"
HttpStandardRequestHeader_AcceptEncoding: "Accept-Encoding" = "Accept-Encoding"
HttpStandardRequestHeader_AcceptLanguage: "Accept-Language" = "Accept-Language"
HttpStandardRequestHeader_AccessControlRequestHeaders: "Access-Control-Request-Headers" = "Access-Control-Request-Headers"
HttpStandardRequestHeader_AccessControlRequestMethod: "Access-Control-Request-Method" = "Access-Control-Request-Method"
HttpStandardRequestHeader_Authorization: "Authorization" = "Authorization"
HttpStandardRequestHeader_CacheControl: "Cache-Control" = "Cache-Control"
HttpStandardRequestHeader_Connection: "Connection" = "Connection"
HttpStandardRequestHeader_ContentEncoding: "Content-Encoding" = "Content-Encoding"
HttpStandardRequestHeader_ContentLength: "Content-Length" = "Content-Length"
HttpStandardRequestHeader_ContentMd5: "Content-MD5" = "Content-MD5"
HttpStandardRequestHeader_ContentType: "Content-Type" = "Content-Type"
HttpStandardRequestHeader_Cookie: "Cookie" = "Cookie"
HttpStandardRequestHeader_Date: "Date" = "Date"
HttpStandardRequestHeader_Expect: "Expect" = "Expect"
HttpStandardRequestHeader_Forwarded: "Forwarded" = "Forwarded"
HttpStandardRequestHeader_From: "From" = "From"
HttpStandardRequestHeader_Host: "Host" = "Host"
HttpStandardRequestHeader_Http2Settings: "HTTP2-Settings" = "HTTP2-Settings"
HttpStandardRequestHeader_IfMatch: "If-Match" = "If-Match"
HttpStandardRequestHeader_IfModifiedSince: "If-Modified-Since" = "If-Modified-Since"
HttpStandardRequestHeader_IfNoneMatch: "If-None-Match" = "If-None-Match"
HttpStandardRequestHeader_IfRange: "If-Range" = "If-Range"
HttpStandardRequestHeader_IfUnmodifiedSince: "If-Unmodified-Since" = "If-Unmodified-Since"
HttpStandardRequestHeader_MaxForwards: "Max-Forwards" = "Max-Forwards"
HttpStandardRequestHeader_Origin: "Origin" = "Origin"
HttpStandardRequestHeader_Pragma: "Pragma" = "Pragma"
HttpStandardRequestHeader_Prefer: "Prefer" = "Prefer"
HttpStandardRequestHeader_ProxyAuthorization: "Proxy-Authorization" = "Proxy-Authorization"
HttpStandardRequestHeader_Range: "Range" = "Range"
HttpStandardRequestHeader_Referer: "Referer" = "Referer"
HttpStandardRequestHeader_Te: "TE" = "TE"
HttpStandardRequestHeader_Trailer: "Trailer" = "Trailer"
HttpStandardRequestHeader_TransferEncoding: "Transfer-Encoding" = "Transfer-Encoding"
HttpStandardRequestHeader_Upgrade: "Upgrade" = "Upgrade"
HttpStandardRequestHeader_UserAgent: "User-Agent" = "User-Agent"
HttpStandardRequestHeader_Via: "Via" = "Via"
HttpStandardRequestHeader_Warning: "Warning" = "Warning"
HttpStandardResponseHeader_AcceptCh: "Accept-CH" = "Accept-CH"
HttpStandardResponseHeader_AcceptPatch: "Accept-Patch" = "Accept-Patch"
HttpStandardResponseHeader_AcceptRanges: "Accept-Ranges" = "Accept-Ranges"
HttpStandardResponseHeader_AccessControlAllowCredentials: "Access-Control-Allow-Credentials" = "Access-Control-Allow-Credentials"
HttpStandardResponseHeader_AccessControlAllowHeaders: "Access-Control-Allow-Headers" = "Access-Control-Allow-Headers"
HttpStandardResponseHeader_AccessControlAllowMethods: "Access-Control-Allow-Methods" = "Access-Control-Allow-Methods"
HttpStandardResponseHeader_AccessControlAllowOrigin: "Access-Control-Allow-Origin" = "Access-Control-Allow-Origin"
HttpStandardResponseHeader_AccessControlExposeHeaders: "Access-Control-Expose-Headers" = "Access-Control-Expose-Headers"
HttpStandardResponseHeader_AccessControlMaxAge: "Access-Control-Max-Age" = "Access-Control-Max-Age"
HttpStandardResponseHeader_Age: "Age" = "Age"
HttpStandardResponseHeader_Allow: "Allow" = "Allow"
HttpStandardResponseHeader_AltSvc: "Alt-Svc" = "Alt-Svc"
HttpStandardResponseHeader_CacheControl: "Cache-Control" = "Cache-Control"
HttpStandardResponseHeader_Connection: "Connection" = "Connection"
HttpStandardResponseHeader_ContentDisposition: "Content-Disposition" = "Content-Disposition"
HttpStandardResponseHeader_ContentEncoding: "Content-Encoding" = "Content-Encoding"
HttpStandardResponseHeader_ContentLanguage: "Content-Language" = "Content-Language"
HttpStandardResponseHeader_ContentLength: "Content-Length" = "Content-Length"
HttpStandardResponseHeader_ContentLocation: "Content-Location" = "Content-Location"
HttpStandardResponseHeader_ContentMd5: "Content-MD5" = "Content-MD5"
HttpStandardResponseHeader_ContentRange: "Content-Range" = "Content-Range"
HttpStandardResponseHeader_ContentType: "Content-Type" = "Content-Type"
HttpStandardResponseHeader_Date: "Date" = "Date"
HttpStandardResponseHeader_DeltaBase: "Delta-Base" = "Delta-Base"
HttpStandardResponseHeader_ETag: "ETag" = "ETag"
HttpStandardResponseHeader_Expires: "Expires" = "Expires"
HttpStandardResponseHeader_Im: "IM" = "IM"
HttpStandardResponseHeader_LastModified: "Last-Modified" = "Last-Modified"
HttpStandardResponseHeader_Link: "Link" = "Link"
HttpStandardResponseHeader_Location: "Location" = "Location"
HttpStandardResponseHeader_P3P: "P3P" = "P3P"
HttpStandardResponseHeader_Pragma: "Pragma" = "Pragma"
HttpStandardResponseHeader_PreferenceApplied: "Preference-Applied" = "Preference-Applied"
HttpStandardResponseHeader_ProxyAuthenticate: "Proxy-Authenticate" = "Proxy-Authenticate"
HttpStandardResponseHeader_PublicKeyPins: "Public-Key-Pins" = "Public-Key-Pins"
HttpStandardResponseHeader_RetryAfter: "Retry-After" = "Retry-After"
HttpStandardResponseHeader_Server: "Server" = "Server"
HttpStandardResponseHeader_SetCookie: "Set-Cookie" = "Set-Cookie"
HttpStandardResponseHeader_StrictTransportSecurity: "Strict-Transport-Security" = "Strict-Transport-Security"
HttpStandardResponseHeader_Tk: "Tk" = "Tk"
HttpStandardResponseHeader_Trailer: "Trailer" = "Trailer"
HttpStandardResponseHeader_TransferEncoding: "Transfer-Encoding" = "Transfer-Encoding"
HttpStandardResponseHeader_Upgrade: "Upgrade" = "Upgrade"
HttpStandardResponseHeader_Vary: "Vary" = "Vary"
HttpStandardResponseHeader_Via: "Via" = "Via"
HttpStandardResponseHeader_Warning: "Warning" = "Warning"
HttpStandardResponseHeader_WwwAuthenticate: "WWW-Authenticate" = "WWW-Authenticate"
HttpStandardResponseHeader_XFrameOptions: "X-Frame-Options" = "X-Frame-Options"
KavenCache: MemoryCache = ...
MD5: KavenMD5 = ...
MsPerDay: number = ...
MsPerHour: number = ...
MsPerMinute: number = ...
MsPerSecond: 1000 = 1000

Number of milliseconds per second

MsPerWeek: number = ...
SHA: KavenSHA = ...
SHA3: KavenSHA3 = ...
Strings_BEGIN_PRIVATE_KEY: "-----BEGIN PRIVATE KEY-----" = "-----BEGIN PRIVATE KEY-----"
Strings_BEGIN_PUBLIC_KEY: "-----BEGIN PUBLIC KEY-----" = "-----BEGIN PUBLIC KEY-----"
Strings_BREAK_LINE_REGEXP: RegExp = ...
version

2019-03-21

since

1.1.19

Strings_BackSlash: "\\" = "\\"
version

1.0.0

since

1.0.5

Strings_CR: "\r" = "\r"

\r, (Carriage Return) Used as a new line character in Mac OS before X

version

1.0.0

since

1.0.5

Strings_CR_LF: "\r\n" = "\r\n"

\r\n, Used as a new line character in Windows

version

1.0.0

since

1.0.5

Strings_Development: "development" = "development"
version

1.0.0

since

1.0.9

Strings_Dot: "." = "."
static
memberof

Strings

version

1.0.0

since

1.0.12

Strings_DoubleQuotes: "\"" = "\""
static
memberof

Strings

version

1.0.0

since

1.0.6

Strings_END_PRIVATE_KEY: "-----END PRIVATE KEY-----" = "-----END PRIVATE KEY-----"
Strings_END_PUBLIC_KEY: "-----END PUBLIC KEY-----" = "-----END PUBLIC KEY-----"
Strings_Empty: "" = ""
version

1.0.0

since

1.0.5

Strings_Failure: "Failure" = "Failure"
static
memberof

Strings

version

1.0.0

since

1.1.1

Strings_HTML_BR: "<br>" = "<br>"
version

1.0.0

since

1.0.5

Strings_HTML_NBSP: "&nbsp;" = "&nbsp;"

non-breaking space

version

1.0.0

since

1.0.5

Strings_LF: "\n" = "\n"

\n, (Line Feed) Used as a new line character in Unix/Mac OS X

version

1.0.0

since

1.0.5

Strings_LowercaseLetters: "abcdefghijklmnopqrstuvwxyz" = "abcdefghijklmnopqrstuvwxyz"
version

1.0.0

since

1.0.5

Strings_Numbers: "0123456789" = "0123456789"
version

1.0.0

since

1.0.5

Strings_PasswordSpecialCharacters: " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~" = " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~"
Strings_Production: "production" = "production"
version

1.0.0

since

1.0.9

Strings_RunningMode: "RunningMode" = "RunningMode"
version

1.0.0

since

1.0.9

Strings_Slash: "/" = "/"
version

1.0.0

since

1.0.5

Strings_Success: "Success" = "Success"
static
memberof

Strings

version

1.0.0

since

1.1.1

Strings_Tab: "\t" = "\t"
static
memberof

Strings

version

1.0.0

since

1.0.10

Strings_Unknown: "Unknown" = "Unknown"
static
memberof

Strings

version

1.0.0

since

1.1.1

Strings_UppercaseLetters: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
version

1.0.0

since

1.0.5

Strings_WhiteSpace: " " = " "
static
memberof

Strings

version

1.0.0

since

1.0.10

Strings_false: "false" = "false"
static
memberof

Strings

version

1.0.0

since

1.1.3

Strings_true: "true" = "true"
static
memberof

Strings

version

1.0.0

since

1.1.3

Functions

  • AddDate(date: Date, value: number, unit?: TimeUnit): Date
  • Parameters

    • date: Date
    • value: number
    • unit: TimeUnit = TimeUnit.milliseconds

    Returns Date

  • AddQueryParameterToURL(url: string, name: string, value: string, noReplace?: boolean): string
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • url: string
    • name: string
    • value: string
    • noReplace: boolean = false

    Returns string

  • Type parameters

    • T

    Parameters

    Returns boolean

  • AnsiColor256(id: number): string
  • Parameters

    • id: number

    Returns string

  • AnsiColorBackground256(id: number): string
  • Parameters

    • id: number

    Returns string

  • AnsiTextBackgroundBlack(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBlue(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightBlack(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightBlue(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightCyan(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightGreen(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightMagenta(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightRed(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightWhite(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundBrightYellow(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundCyan(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundGreen(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundMagenta(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundRed(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundWhite(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBackgroundYellow(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBlack(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBlue(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightBlack(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightBlue(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightCyan(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightGreen(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightMagenta(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightRed(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightWhite(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextBrightYellow(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextColor(text: string, ansiColor: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • ansiColor: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextCyan(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextGreen(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextMagenta(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextRed(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextWhite(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • AnsiTextYellow(text: string, resetRight?: boolean): string
  • Parameters

    • text: string
    • resetRight: boolean = true

    Returns string

  • Type parameters

    • T

    Parameters

    Returns boolean

  • ArrayBuffer2String(buf: ArrayBuffer): string
  • Parameters

    • buf: ArrayBuffer

    Returns string

  • CalculateMaxSaltLength(keySizeInBits: number, digestSizeInBytes: number): number
  • RFC 3447 says that "Typical salt lengths" are either 0 or the length of the output of the digest algorithm that was selected when this key was generated. For example, if you use SHA-256 as the digest algorithm, this could be 32.

    url

    https://developer.mozilla.org/en-US/docs/Web/API/RsaPssParams

    Parameters

    • keySizeInBits: number
    • digestSizeInBytes: number

    Returns number

  • CapitalizeSentences(sentences: string): string
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • sentences: string

    Returns string

  • CapitalizeWords(str: string): string
  • Parameters

    • str: string

    Returns string

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

    1.0.5

    since

    2021-12-07

    Parameters

    • fileName: string
    • extension: string

    Returns string

  • CharactersCount(str: string, ...characters: string[]): number
  • Parameters

    • str: string
    • Rest ...characters: string[]

    Returns number

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

    true if little endian, false if big endian

  • CloneArray<T>(array: T[]): T[]
  • Simple clone array

    since

    2.0.2

    version

    2020-01-11

    Type parameters

    • T

    Parameters

    • array: T[]

    Returns T[]

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

    1.1.7

    version

    2021-12-07

    Parameters

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

    Returns string

  • ContainsSubstringOnlyOnce(str: string, ...substrings: string[]): boolean
  • Parameters

    • str: string
    • Rest ...substrings: string[]

    Returns boolean

  • ConvertTo<T>(val: unknown): T
  • since

    2.0.11

    version

    2021-02-01

    Type parameters

    • T

    Parameters

    • val: unknown

    Returns T

  • Countdown(count: number, interval?: number, intervalAction?: (left: number) => boolean): Promise<number>
  • since

    1.1.5

    version

    2021-12-14

    Parameters

    • count: number
    • interval: number = 1000
    • Optional intervalAction: (left: number) => boolean
        • (left: number): boolean
        • Parameters

          • left: number

          Returns boolean

    Returns Promise<number>

  • CreateArray<T>(length: number, value: T): T[]
  • CreateArray<T>(length: number, initialValue: T, func: TMethod2<number, T, T>): T[]
  • since

    1.0.5

    version

    2021-12-13

    Type parameters

    • T

    Parameters

    • length: number
    • value: T

    Returns T[]

  • Type parameters

    • T

    Parameters

    • length: number
    • initialValue: T
    • func: TMethod2<number, T, T>

    Returns T[]

  • DecodeByRFC3986(str: string): string
  • since

    1.1.11

    version

    2021-12-07

    Parameters

    • str: string

    Returns string

  • DefaultErrorHandler(err: unknown): void
  • since

    1.1.21

    version

    2021-12-31

    Parameters

    • err: unknown

    Returns void

  • DiffDate(date: Date, anotherDate: Date, unit?: TBaseTimeUnit): number
  • Parameters

    • date: Date
    • anotherDate: Date
    • unit: TBaseTimeUnit = TimeUnit.milliseconds

    Returns number

  • Distinct<T>(val: string | T[]): string | T[]
  • Type parameters

    • T

    Parameters

    • val: string | T[]

    Returns string | T[]

  • DoUntilSuccess(action: () => Promise<boolean>, retryDelayInMillionSeconds?: number, retryCount?: number, startImmediately?: boolean): Promise<boolean>
  • since

    1.1.5

    version

    2020-01-06

    Parameters

    • action: () => Promise<boolean>
        • (): Promise<boolean>
        • Returns Promise<boolean>

    • retryDelayInMillionSeconds: number = 500
    • retryCount: number = 5
    • startImmediately: boolean = false

    Returns Promise<boolean>

  • 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

  • ExportCryptoPrivateKey(key: CryptoKey, header?: string, footer?: string): Promise<string>
  • Parameters

    • key: CryptoKey
    • header: string = ...
    • footer: string = ...

    Returns Promise<string>

  • ExportCryptoPublicKey(key: CryptoKey, header?: string, footer?: string): Promise<string>
  • Parameters

    • key: CryptoKey
    • header: string = ...
    • footer: string = ...

    Returns Promise<string>

  • FileSize(bytes: number, baseOn1024?: boolean): string
  • Humanize bytes

    since

    3.0.0

    version

    2021-08-07

    Parameters

    • bytes: number
    • baseOn1024: boolean = false

      default false

    Returns string

  • First<T>(array: T[]): undefined | T
  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns undefined | T

  • FormatCurrentDate(format?: string, timezoneOffset?: number): string
  • Parameters

    • Optional format: string
    • Optional timezoneOffset: number

    Returns string

  • FormatDate(dt: Date): string
  • FormatDate(dt: Date, format?: string, timezoneOffset?: number): string
  • since

    1.0.5

    version

    2021-08-06

    Parameters

    • dt: Date

      default new Date()

    Returns string

  • Parameters

    • dt: Date
    • Optional format: string
    • Optional timezoneOffset: number

    Returns string

  • FormatString(format: string, ...args: (string | number)[]): string
  • Parameters

    • format: string
    • Rest ...args: (string | number)[]

    Returns string

  • GenerateFileNameByCurrentDate(timezoneOffset?: number): string
  • since

    4.0.0

    version

    2021-12-14

    Parameters

    • Optional timezoneOffset: number

    Returns string

  • GenerateGuid(): string
  • version

    1.0.0

    since

    1.0.5

    Returns string

  • GenerateNumberString(length: number): string
  • version

    1.0.0

    since

    1.0.5

    Parameters

    • length: number

    Returns string

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

    1.0.5

    version

    2021-12-11

    Parameters

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

    Returns string

  • GenerateRandomArbitrary(min: number, max: number): number
  • Getting a random number between two values

    since

    4.0.0

    version

    2021-12-12

    Parameters

    • min: number

      inclusive

    • max: number

      exclusive

    Returns number

    The returned value is no lower than (and may possibly equal) min, and is less than (and not equal) max.

  • GenerateRandomBoolean(): boolean
  • since

    4.0.0

    version

    2021-12-13

    Returns boolean

  • GenerateRandomInt(min: number, max: number, maxExclusive?: boolean): number
  • Getting a random number between two values

    since

    4.0.0

    version

    2021-12-12

    Parameters

    • min: number

      inclusive

    • max: number

      inclusive or exclusive, depends on: maxExclusive

    • maxExclusive: boolean = false

      Default: false

    Returns number

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

    1.0.0

    since

    1.0.5

    Parameters

    • length: number
    • Optional validCharacters: string

    Returns string

  • GenerateYearMonthId(randomLength?: number, validFunc?: (id: string) => Promise<boolean>): Promise<string>
  • YYYYMM + Random

    since

    4.0.0

    version

    2021-12-11

    Parameters

    • randomLength: number = 4
    • Optional validFunc: (id: string) => Promise<boolean>
        • (id: string): Promise<boolean>
        • Parameters

          • id: string

          Returns Promise<boolean>

    Returns Promise<string>

  • 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

  • GetBaseLog(num: number, baseNumber: number): number
  • Parameters

    • num: number
    • baseNumber: number

    Returns number

  • since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<BitString>

  • since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<BitString>

  • GetDayOfWeekTdd(): string[]
  • Su Mo ... Fr Sa

    since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetDayOfWeekTddd(): string[]
  • Sun Mon ... Fri Sat

    since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetDayOfWeekTdddd(): string[]
  • Sunday Monday ... Friday Saturday

    since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetEmailAddressWithName(name: string, address: string): string
  • since

    4.0.0

    version

    2021-12-08

    Parameters

    • name: string
    • address: string

    Returns string

  • GetFileExtension(fileName: string): string
  • version

    1.0.0

    since

    1.0.5

    example

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

    Parameters

    • fileName: string

    Returns string

  • 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

  • GetFileNameFromURL(url: string): string
  • since

    1.1.7

    version

    2018-08-30

    Parameters

    • url: string

    Returns string

  • GetFileNameWithoutExtension(fileName: string): string
  • since

    1.1.7

    version

    2021-12-07

    example

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

    Parameters

    • fileName: string

    Returns string

  • GetIndent(str: string): string
  • Parameters

    • str: string

    Returns string

  • GetInvalidFileNameChars(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetInvalidFileNameCharsUnix(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetInvalidFileNameCharsWindows(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetInvalidPathChars(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetInvalidPathCharsUnix(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetInvalidPathCharsWindows(): string[]
  • since

    4.0.0

    version

    2021-12-09

    Returns string[]

  • GetLeadingNumber(str: string, float?: boolean): string
  • since

    3.0.0

    version

    2021-12-11

    Parameters

    • str: string
    • float: boolean = false

    Returns string

  • since

    1.1.13

    version

    2018-10-21

    Parameters

    Returns Promise<string>

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

    1.1.14

    version

    2018-10-26

    Parameters

    • contentType: string

    Returns IMIME[]

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

    1.1.14

    version

    2018-10-26

    Parameters

    • fileExtension: string

    Returns IMIME[]

  • GetNextVersion(version: string): string
  • deprecated

    Please use IncreaseVersion instead

    since

    1.0.12

    version

    2021-12-06

    Parameters

    • version: string

    Returns string

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

    1.1.17

    version

    2019-02-26

    Parameters

    • url: string

    Returns undefined | string

  • Warning: This algorithm is now considered vulnerable and should not be used.

    since

    1.1.20

    version

    2019-03-30

    Parameters

    Returns Promise<string>

  • SHA-224

    since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<string>

  • SHA-256

    since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<string>

  • SHA-384

    since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<string>

  • SHA3-224

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • SHA3-256

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • SHA3-384

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • SHA3-512

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • SHA-512

    since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<string>

  • GetSHA512T(input: THashInput, t: number): Promise<string>
  • since

    1.1.20

    version

    2019-03-29

    Parameters

    Returns Promise<string>

  • SHA-512/224

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • SHA-512/256

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • GetSHAKE128(input: THashInput, outputBits: number): Promise<string>
  • SHAKE128

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • GetSHAKE256(input: THashInput, outputBits: number): Promise<string>
  • SHAKE256

    since

    4.0.0

    version

    2021-12-17

    Parameters

    Returns Promise<string>

  • GetStringBetween(str: string, strStart: string, strEnd: string, max?: number): string[]
  • export
    version

    2018-09-01

    since

    1.0.6

    Parameters

    • str: string
    • strStart: string
    • strEnd: string
    • max: number = -1

    Returns string[]

  • GetStringPositionBetween(str: string, strStart: string, strEnd: string, max?: number, startIndex?: number): StringPosition[]
  • since

    1.1.7

    version

    2021-12-07

    Parameters

    • str: string
    • strStart: string
    • strEnd: string
    • max: number = -1
    • startIndex: number = 0

    Returns StringPosition[]

  • Parameters

    Returns string

  • GetWeekOfYear(date: Date, iso?: boolean): number
  • since

    2.0.14

    version

    2021-08-06

    Parameters

    • date: Date
    • Optional iso: boolean

    Returns number

  • ImportCryptoPrivateKey(pem: string, isForSign?: boolean): Promise<CryptoKey>
  • Parameters

    • pem: string
    • isForSign: boolean = true

    Returns Promise<CryptoKey>

  • ImportCryptoPublicKey(pem: string, isForEncrypt?: boolean): Promise<CryptoKey>
  • Parameters

    • pem: string
    • isForEncrypt: boolean = true

    Returns Promise<CryptoKey>

  • IncreaseVersion(version: string): string
  • IncreaseVersion(version: string, index: number, increment: number): string
  • since

    3.0.3

    version

    2021-12-06

    Parameters

    • version: string

    Returns string

  • Parameters

    • version: string
    • index: number
    • increment: number

    Returns string

  • InitializeKavenExtension(): void
  • Returns void

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

    2.0.2

    version

    2019-12-26

    Parameters

    • email: string
    • unicode: boolean = false

    Returns boolean

  • IsEmpty<T>(val: undefined | string | T[]): boolean
  • since

    3.0.4

    version

    2021-12-07

    Type parameters

    • T

    Parameters

    • val: undefined | string | T[]

    Returns boolean

  • IsEqual(a?: string, b?: string, ignoreCase?: boolean): boolean
  • since

    2.0.13

    version

    2021-03-18

    Parameters

    • Optional a: string
    • Optional b: string
    • ignoreCase: boolean = true

    Returns boolean

  • IsHttpsUrl(url: string): undefined | boolean
  • since

    2.0.6

    version

    2021-12-11

    Parameters

    • url: string

    Returns undefined | boolean

  • IsNotEmpty<T>(val: undefined | string | T[]): boolean
  • since

    3.0.4

    version

    2021-12-07

    Type parameters

    • T

    Parameters

    • val: undefined | string | T[]

    Returns boolean

  • IsStartsWithNumber(str: string): boolean
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • str: string

    Returns boolean

  • IsString(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

  • Last<T>(array: T[]): undefined | T
  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns undefined | T

  • LeftRotate(num: number, n: number, bits?: number): number
  • Parameters

    • num: number
    • n: number
    • Optional bits: number

    Returns number

  • Mod(num: number, n: number): number
  • Parameters

    • num: number
    • n: number

    Returns number

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

    Parameters

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

    Returns string

  • NumberToHex(number: number, len?: number): string
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • number: number
    • Optional len: number

    Returns string

  • NumberToUint8Array(number: number): Uint8Array
  • Parameters

    • number: number

    Returns Uint8Array

  • OnlyContains(str: string, ...characters: string[]): boolean
  • Parameters

    • str: string
    • Rest ...characters: string[]

    Returns boolean

  • ParseFileSize(fileSize: string): number | undefined
  • since

    3.0.0

    version

    2021-08-07

    Parameters

    • fileSize: string

    Returns number | undefined

  • RejectAfter(timeout: number): Promise<never>
  • version

    2020-06-02

    since

    2.0.6

    Parameters

    • timeout: number

      in million seconds

    Returns Promise<never>

  • Remove<T>(array: T[], index: number): T | undefined
  • since

    4.0.0

    version

    2021-12-14

    Type parameters

    • T

    Parameters

    • array: T[]
    • index: number

    Returns T | undefined

  • RemoveAllSubStrings(str: string, ...subStrings: string[]): string
  • since

    4.0.0

    version

    2021-12-09

    Parameters

    • str: string
    • Rest ...subStrings: string[]

    Returns string

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

    KavenBasic

    since

    1.1.7

    version

    2018-08-30

    Parameters

    • url: string

    Returns string

  • RemoveInvalidCharactersFromFileName(filename: string): string
  • since

    4.0.0

    version

    2021-12-09

    Parameters

    • filename: string

    Returns string

  • RemoveInvalidCharactersFromPath(pathStr: string): string
  • since

    4.0.0

    version

    2021-12-09

    Parameters

    • pathStr: string

    Returns string

  • RemoveQueryFromURL(url: string, keepHash?: boolean): string
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • url: string
    • keepHash: boolean = false

    Returns string

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

    4.0.0

    version

    2021-12-11

    Parameters

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

    Returns string

  • ReplaceAll(str: string, old: string, rep: string): string
  • Parameters

    • str: string
    • old: string
    • rep: string

    Returns string

  • ReplaceAllStringBetween(replaceMethod: (val: string) => string, str: string, strStart: string, strEnd: string): string
  • since

    1.1.7

    version

    2021-12-07

    Parameters

    • replaceMethod: (val: string) => string
        • (val: string): string
        • Parameters

          • val: string

          Returns string

    • str: string
    • strStart: string
    • strEnd: string

    Returns string

  • ReplaceAt(str: string, index: number, rep: string, length?: number): string
  • Parameters

    • str: string
    • index: number
    • rep: string
    • length: number = 1

    Returns string

  • Parameters

    Returns string

  • ResolveAfter<T>(data: T, timeout: number): Promise<T>
  • version

    2020-06-02

    since

    2.0.6

    Type parameters

    • T

    Parameters

    • data: T
    • timeout: number

      in million seconds

    Returns Promise<T>

  • Reverse(str: string): string
  • Parameters

    • str: string

    Returns string

  • RightRotate(num: number, n: number, bits?: number): number
  • Parameters

    • num: number
    • n: number
    • Optional bits: number

    Returns number

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

    1.0.0

    since

    1.0.5

    Parameters

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

    • times: number

    Returns void

  • SequenceEqual<T>(array: T[], second: T[]): boolean
  • Type parameters

    • T

    Parameters

    • array: T[]
    • second: T[]

    Returns boolean

  • Sleep(time: number): Promise<void>
  • since

    1.1.7

    version

    2021-12-11

    Parameters

    • time: number

    Returns Promise<void>

  • Split<T>(array: T[], size: number, fromLeft?: boolean): T[][]
  • Type parameters

    • T

    Parameters

    • array: T[]
    • size: number
    • Optional fromLeft: boolean

    Returns T[][]

  • SplitByN(str: string, n: number, fromLeft?: boolean): string[]
  • Parameters

    • str: string
    • n: number
    • Optional fromLeft: boolean

    Returns string[]

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

    1.0.8

    version

    2021-12-07

    Parameters

    • Optional str: string

    Returns undefined | string[]

  • String2ArrayBuffer(str: string): ArrayBuffer
  • Parameters

    • str: string

    Returns ArrayBuffer

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

    4.0.0

    version

    2021-12-11

    Parameters

    • str: string

    Returns undefined | string[]

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

    4.0.0

    version

    2021-12-11

    Parameters

    • Rest ...strArray: string[]

    Returns string

  • StringToArray(str: string): string[]
  • since

    4.0.0

    version

    2021-12-11

    Parameters

    • str: string

    Returns string[]

  • StringToUTF8ByteArray(str: string): number[]
  • Converts a JS string to a UTF-8 "byte" array.

    since

    4.0.0

    version

    2021-12-11

    Parameters

    • str: string

    Returns number[]

  • SubtractDate(date: Date, value: number, unit?: TimeUnit): Date
  • Parameters

    • date: Date
    • value: number
    • unit: TimeUnit = TimeUnit.milliseconds

    Returns Date

  • SurroundBy(text: string, left: string, right?: string): string
  • since

    4.0.0

    version

    2021-12-24

    Parameters

    • text: string
    • left: string
    • Optional right: string

    Returns string

  • Swap32(n: number): number
  • Parameters

    • n: number

    Returns number

  • TimeoutAfter<T>(action: Promise<T>, timeout?: number): Promise<T>
  • since

    2.0.6

    version

    2020-06-02

    Type parameters

    • T

    Parameters

    • action: Promise<T>
    • timeout: number = 500

      in million seconds, Defaults: 500

    Returns Promise<T>

  • ToDays(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToHEX(...array: number[]): string
  • Parameters

    • Rest ...array: number[]

    Returns string

  • ToHours(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToMilliseconds(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToMinutes(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToMonths(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToSeconds(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToUInt32(n: number): number
  • Parameters

    • n: number

    Returns number

  • ToWeeks(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • ToYears(num: number, currentUnit: TimeUnit): number
  • Parameters

    Returns number

  • TrimAll(str: string, trimString: string): string
  • TrimAll(str: string, trimString: string, max: number): string
  • TrimAll(str: string, trimStrings: string[]): string
  • since

    3.0.3

    version

    2021-12-06

    Parameters

    • str: string
    • trimString: string

    Returns string

  • Parameters

    • str: string
    • trimString: string
    • max: number

    Returns string

  • Parameters

    • str: string
    • trimStrings: string[]

    Returns string

  • TrimEnd(str: string, trimString: string): string
  • TrimEnd(str: string, trimString: string, max: number): string
  • TrimEnd(str: string, trimStrings: string[]): string
  • TrimEnd(str: string, trimStrings: string[], trimAll: boolean): string
  • since

    3.0.3

    version

    2021-12-06

    Parameters

    • str: string
    • trimString: string

    Returns string

  • Parameters

    • str: string
    • trimString: string
    • max: number

    Returns string

  • Parameters

    • str: string
    • trimStrings: string[]

    Returns string

  • Parameters

    • str: string
    • trimStrings: string[]
    • trimAll: boolean

    Returns string

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

    Parameters

    • pathStr: string

    Returns string

  • TrimStart(str: string, trimString: string): string
  • TrimStart(str: string, trimString: string, max: number): string
  • TrimStart(str: string, trimStrings: string[]): string
  • TrimStart(str: string, trimStrings: string[], trimAll: boolean): string
  • since

    3.0.3

    version

    2021-12-06

    Parameters

    • str: string
    • trimString: string

    Returns string

  • Parameters

    • str: string
    • trimString: string
    • max: number

    Returns string

  • Parameters

    • str: string
    • trimStrings: string[]

    Returns string

  • Parameters

    • str: string
    • trimStrings: string[]
    • trimAll: boolean

    Returns string

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

    • line: string

    Returns undefined | string

  • UTF8ByteArrayToString(bytes: Uint8Array | number[]): string
  • Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.

    since

    4.0.0

    version

    2021-12-11

    Parameters

    • bytes: Uint8Array | number[]

    Returns string

  • UTF8Encode(str: string): string
  • Parameters

    • str: string

    Returns string

  • WriteToConsole(message: unknown, type?: TConsole): void
  • since

    4.0.0

    version

    2021-12-31

    Parameters

    Returns void

Generated using TypeDoc