Functions
getCookie
- getCookie(cname: string, source?: string): string
-
Parameters
-
cname: string
-
source: string = ...
Returns string
isIn
- isIn<T>(obj: T, ...data: unknown[]): boolean
-
Type parameters
Parameters
-
obj: T
-
Rest ...data: unknown[]
Returns boolean
map
- map<S, T>(source: S, data: { attrD?: keyof T; attrS: keyof S; mapFunction: any }[]): T
-
Type parameters
Parameters
-
source: S
-
data: { attrD?: keyof T; attrS: keyof S; mapFunction: any }[]
Returns T
mapObject
- mapObject<S, T>(source: S, data: {[ attr in keyof S]: { destVal: keyof T; mapper: any } }): T
-
Type parameters
Parameters
-
source: S
-
data: {[ attr in keyof S]: { destVal: keyof T; mapper: any } }
Returns T
objectToQueryParams
- objectToQueryParams(obj: StringMap<unknown>): string
-
Parameters
Returns string
parse
-
Type parameters
Parameters
Returns T
parseJSONWithComments
- parseJSONWithComments<T>(content: string): T
-
Type parameters
Parameters
Returns T
parseParams
- parseParams<T>(query?: string, separator?: string, delimiter?: string): T
-
Type parameters
Parameters
-
query: string = ...
-
separator: string = "&"
-
delimiter: string = "="
Returns T
serialize
- serialize(obj: any): string
-
Parameters
Returns string
setCookie
- setCookie(name: string, value: string | number | boolean, days: number): string
-
Parameters
-
name: string
-
value: string | number | boolean
-
days: number
Returns string
Method check if object is in array
isIn("a", "b", "d", "a") => true isIn("a", ["b", "d", "a"]) => true isIn("c", "b", "d", "a") => false isIn("c", ["b", "d", "a"]) => false isIn("c") => false isIn("c", []) => false