@loadmill/universal v0.3.112
@loadmill/universal
Index
Modules
- "array-utils"
- "countries"
- "cron-utils"
- "enum-utils"
- "env-utils"
- "errors/client-error"
- "errors/client-errors"
- "errors/field-errors"
- "errors/index"
- "errors/presentable-error"
- "index"
- "manipulation-utils"
- "math-utils"
- "number-utils"
- "uri-utils"
Classes
@loadmill/universal › "errors/client-error" › ClientError
Class: ClientError
Represents an exception caused by a client error. The specified message will be delivered to the client in the response body with the given code as the status code.
Hierarchy
↳ ClientError
Index
Constructors
Properties
Constructors
constructor
+ new ClientError(code
: number, prettyMessage
: string, payload?
: any): ClientError
Overrides PresentableError.constructor
Defined in packages/universal/src/errors/client-error.ts:9
Parameters:
Name | Type |
---|---|
code | number |
prettyMessage | string |
payload? | any |
Returns: ClientError
Properties
Readonly
code
• code: number
Defined in packages/universal/src/errors/client-error.ts:11
message
• message: string
Inherited from PresentableError.message
Defined in node_modules/typescript/lib/lib.es5.d.ts:974
name
• name: string
Inherited from PresentableError.name
Defined in node_modules/typescript/lib/lib.es5.d.ts:973
Optional
Readonly
payload
• payload? : any
Defined in packages/universal/src/errors/client-error.ts:13
Readonly
prettyMessage
• prettyMessage: any
Inherited from PresentableError.prettyMessage
Defined in packages/universal/src/errors/presentable-error.ts:2
Optional
stack
• stack? : undefined | string
Inherited from PresentableError.stack
Defined in node_modules/typescript/lib/lib.es5.d.ts:975
@loadmill/universal › "errors/presentable-error" › PresentableError
Class: PresentableError
Hierarchy
↳ PresentableError
Index
Constructors
Properties
Constructors
constructor
+ new PresentableError(prettyMessage
: any): PresentableError
Defined in packages/universal/src/errors/presentable-error.ts:1
Parameters:
Name | Type |
---|---|
prettyMessage | any |
Returns: PresentableError
Properties
message
• message: string
Inherited from PresentableError.message
Defined in node_modules/typescript/lib/lib.es5.d.ts:974
name
• name: string
Inherited from PresentableError.name
Defined in node_modules/typescript/lib/lib.es5.d.ts:973
Readonly
prettyMessage
• prettyMessage: any
Defined in packages/universal/src/errors/presentable-error.ts:2
Optional
stack
• stack? : undefined | string
Inherited from PresentableError.stack
Defined in node_modules/typescript/lib/lib.es5.d.ts:975
Static
Error
▪ Error: ErrorConstructor
Defined in node_modules/typescript/lib/lib.es5.d.ts:984
Modules
@loadmill/universal › "array-utils"
Module: "array-utils"
Index
Functions
Functions
deleteOne
▸ deleteOne(arr
: any[], index
: number): void
Defined in packages/universal/src/array-utils.ts:1
Parameters:
Name | Type |
---|---|
arr | any[] |
index | number |
Returns: void
Const
filterFalsyElements
▸ filterFalsyElements(arr
: any[]): any[]
Defined in packages/universal/src/array-utils.ts:20
Parameters:
Name | Type | Default |
---|---|---|
arr | any[] | [] |
Returns: any[]
Const
filterFalsyElementsByProp
▸ filterFalsyElementsByProp(arr
: object[], prop
: string): any[]
Defined in packages/universal/src/array-utils.ts:23
Parameters:
Name | Type |
---|---|
arr | object[] |
prop | string |
Returns: any[]
Const
isNonEmptyArray
▸ isNonEmptyArray(arr
: any): boolean
Defined in packages/universal/src/array-utils.ts:17
Parameters:
Name | Type |
---|---|
arr | any |
Returns: boolean
swap
▸ swap(arr
: any[], oldIndex
: number, newIndex
: number): void
Defined in packages/universal/src/array-utils.ts:7
Parameters:
Name | Type |
---|---|
arr | any[] |
oldIndex | number |
newIndex | number |
Returns: void
@loadmill/universal › "countries"
Module: "countries"
Index
Variables
Functions
Object literals
Variables
Const
prettyCountryNames
• prettyCountryNames: any = getData().map( ({ name }) => uglyToPrettyname || name )
Defined in packages/universal/src/countries.ts:29
Const
prettyToUgly
• prettyToUgly: object
Defined in packages/universal/src/countries.ts:23
Type declaration:
Functions
getCode
▸ getCode(country
: any): any
Defined in packages/universal/src/countries.ts:33
Parameters:
Name | Type |
---|---|
country | any |
Returns: any
getCountry
▸ getCountry(countryCode
: string): any
Defined in packages/universal/src/countries.ts:37
Parameters:
Name | Type |
---|---|
countryCode | string |
Returns: any
isCode
▸ isCode(countryCode
: string): boolean
Defined in packages/universal/src/countries.ts:42
Parameters:
Name | Type |
---|---|
countryCode | string |
Returns: boolean
Object literals
Const
uglyToPretty
▪ uglyToPretty: object
Defined in packages/universal/src/countries.ts:3
Bolivia, Plurinational State of
• Bolivia, Plurinational State of: string = "Bolivia"
Defined in packages/universal/src/countries.ts:12
Bonaire, Sint Eustatius and Saba
• Bonaire, Sint Eustatius and Saba: string = "Bonaire"
Defined in packages/universal/src/countries.ts:13
Congo, the Democratic Republic of the
• Congo, the Democratic Republic of the: string = "Congo (Democratic Republic)"
Defined in packages/universal/src/countries.ts:20
Iran, Islamic Republic of
• Iran, Islamic Republic of: string = "Iran"
Defined in packages/universal/src/countries.ts:8
Korea, Republic of
• Korea, Republic of: string = "South Korea"
Defined in packages/universal/src/countries.ts:9
Micronesia, Federated States of
• Micronesia, Federated States of: string = "Micronesia"
Defined in packages/universal/src/countries.ts:15
Moldova, Republic of
• Moldova, Republic of: string = "Moldova"
Defined in packages/universal/src/countries.ts:6
Palestine, State of
• Palestine, State of: string = "Palestine"
Defined in packages/universal/src/countries.ts:7
Russian Federation
• Russian Federation: string = "Russia"
Defined in packages/universal/src/countries.ts:4
Saint Helena, Ascension and Tristan da Cunha
• Saint Helena, Ascension and Tristan da Cunha: string = "Saint Helena"
Defined in packages/universal/src/countries.ts:18
South Georgia and the South Sandwich Islands
• South Georgia and the South Sandwich Islands: string = "South Georgia"
Defined in packages/universal/src/countries.ts:19
Syrian Arab Republic
• Syrian Arab Republic: string = "Syria"
Defined in packages/universal/src/countries.ts:5
Taiwan, Province of China
• Taiwan, Province of China: string = "Taiwan"
Defined in packages/universal/src/countries.ts:10
Tanzania, United Republic of
• Tanzania, United Republic of: string = "Tanzania"
Defined in packages/universal/src/countries.ts:11
Venezuela, Bolivarian Republic of
• Venezuela, Bolivarian Republic of: string = "Venezuela"
Defined in packages/universal/src/countries.ts:16
Virgin Islands, British
• Virgin Islands, British: string = "British Virgin Islands"
Defined in packages/universal/src/countries.ts:17
Virgin Islands, U.S.
• Virgin Islands, U.S.: string = "U.S. Virgin Islands"
Defined in packages/universal/src/countries.ts:14
@loadmill/universal › "cron-utils"
Module: "cron-utils"
Index
Variables
Functions
Object literals
Variables
Const
TZ
• TZ: object | object = isProduction ? { utc: true } : {}
Defined in packages/universal/src/cron-utils.ts:5
Const
isProduction
• isProduction: boolean = process.env.NODE_ENV === 'production'
Defined in packages/universal/src/cron-utils.ts:4
Functions
Const
getRecurrence
▸ getRecurrence(cron
: any): string
Defined in packages/universal/src/cron-utils.ts:8
Parameters:
Name | Type |
---|---|
cron | any |
Returns: string
Const
parseCron
▸ parseCron(cron
: any): any
Defined in packages/universal/src/cron-utils.ts:16
Parameters:
Name | Type |
---|---|
cron | any |
Returns: any
Object literals
Const
VALID_EXPRESSIONS
▪ VALID_EXPRESSIONS: object
Defined in packages/universal/src/cron-utils.ts:18
Every 1 Hour
• Every 1 Hour: string = "0 /1 * *"
Defined in packages/universal/src/cron-utils.ts:21
Every 10 minutes
• Every 10 minutes: string = "/10 * * *"
Defined in packages/universal/src/cron-utils.ts:20
Every night
• Every night: string = "0 2 * * *"
Defined in packages/universal/src/cron-utils.ts:22
No scheduling
• No scheduling: string = "No scheduling"
Defined in packages/universal/src/cron-utils.ts:19
@loadmill/universal › "enum-utils"
Module: "enum-utils"
Index
Functions
Functions
names
▸ names(anEnum
: any): string[]
Defined in packages/universal/src/enum-utils.ts:4
Works only for enums without string initializers.
Parameters:
Name | Type |
---|---|
anEnum | any |
Returns: string[]
stringValues
▸ stringValues(anEnum
: any): string[]
Defined in packages/universal/src/enum-utils.ts:18
Works only for enums WITH string initializers.
Parameters:
Name | Type |
---|---|
anEnum | any |
Returns: string[]
values
▸ values(anEnum
: any): any[]
Defined in packages/universal/src/enum-utils.ts:11
Works only for enums without string initializers.
Parameters:
Name | Type |
---|---|
anEnum | any |
Returns: any[]
@loadmill/universal › "env-utils"
Module: "env-utils"
Index
Functions
Functions
isBrowser
▸ isBrowser(): boolean
Defined in packages/universal/src/env-utils.ts:1
Returns: boolean
@loadmill/universal › "errors/client-error"
Module: "errors/client-error"
Index
Classes
@loadmill/universal › "errors/client-errors"
Module: "errors/client-errors"
Index
Functions
- BadFormClientError
- CardClientError
- ConfValidationClientError
- DeprecationClientError
- EmailTakenClientError
- EntityNotFoundClientError
- ForbiddenClientError
- InsufficientCreditClientError
- IntegrationValidationClientError
- InvalidFormatClientError
- InvalidRequestClientError
- LoadTestDraftNotFoundClientError
- LoadTestNotFoundClientError
- LoadTestScheduledDraftNotFoundClientError
- MalformedHeaderClientError
- NonBetaEmailClientError
- NonDraftUpdateClientError
- NullTokenClientError
- TestSuiteScheduledNotFoundClientError
- UnauthorizedClientError
- UnknownEmailClientError
Functions
BadFormClientError
▸ BadFormClientError(fieldErrors
: FieldErrors, code
: number, message
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:8
Parameters:
Name | Type | Default |
---|---|---|
fieldErrors | FieldErrors | {} |
code | number | 400 |
message | string | "Bad Form submission failed" |
Returns: ClientError‹›
CardClientError
▸ CardClientError(message
: any): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:49
Parameters:
Name | Type |
---|---|
message | any |
Returns: ClientError‹›
ConfValidationClientError
▸ ConfValidationClientError(err
: object): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:16
Parameters:
▪ err: object
Name | Type |
---|---|
message | string |
validation | any |
Returns: ClientError‹›
DeprecationClientError
▸ DeprecationClientError(message
: any): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:67
Parameters:
Name | Type |
---|---|
message | any |
Returns: ClientError‹›
EmailTakenClientError
▸ EmailTakenClientError(): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:71
Returns: ClientError‹›
EntityNotFoundClientError
▸ EntityNotFoundClientError(name
: string, id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:92
Parameters:
Name | Type |
---|---|
name | string |
id | string |
Returns: ClientError‹›
ForbiddenClientError
▸ ForbiddenClientError(message
: any): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:63
Parameters:
Name | Type |
---|---|
message | any |
Returns: ClientError‹›
InsufficientCreditClientError
▸ InsufficientCreditClientError(message
: any): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:53
Parameters:
Name | Type |
---|---|
message | any |
Returns: ClientError‹›
IntegrationValidationClientError
▸ IntegrationValidationClientError(message
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:23
Parameters:
Name | Type |
---|---|
message | string |
Returns: ClientError‹›
InvalidFormatClientError
▸ InvalidFormatClientError(badValue
: string, type?
: undefined | string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:27
Parameters:
Name | Type |
---|---|
badValue | string |
type? | undefined | string |
Returns: ClientError‹›
InvalidRequestClientError
▸ InvalidRequestClientError(prettyMessage
: string, payload?
: any): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:34
Parameters:
Name | Type |
---|---|
prettyMessage | string |
payload? | any |
Returns: ClientError‹›
LoadTestDraftNotFoundClientError
▸ LoadTestDraftNotFoundClientError(id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:100
Parameters:
Name | Type |
---|---|
id | string |
Returns: ClientError‹›
LoadTestNotFoundClientError
▸ LoadTestNotFoundClientError(id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:96
Parameters:
Name | Type |
---|---|
id | string |
Returns: ClientError‹›
LoadTestScheduledDraftNotFoundClientError
▸ LoadTestScheduledDraftNotFoundClientError(id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:104
Parameters:
Name | Type |
---|---|
id | string |
Returns: ClientError‹›
MalformedHeaderClientError
▸ MalformedHeaderClientError(headerName
: string, value?
: undefined | string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:38
Parameters:
Name | Type |
---|---|
headerName | string |
value? | undefined | string |
Returns: ClientError‹›
NonBetaEmailClientError
▸ NonBetaEmailClientError(): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:75
Returns: ClientError‹›
NonDraftUpdateClientError
▸ NonDraftUpdateClientError(id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:57
Parameters:
Name | Type |
---|---|
id | string |
Returns: ClientError‹›
NullTokenClientError
▸ NullTokenClientError(): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:4
Returns: ClientError‹›
TestSuiteScheduledNotFoundClientError
▸ TestSuiteScheduledNotFoundClientError(id
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:108
Parameters:
Name | Type |
---|---|
id | string |
Returns: ClientError‹›
UnauthorizedClientError
▸ UnauthorizedClientError(prettyMessage
: string): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:45
Parameters:
Name | Type |
---|---|
prettyMessage | string |
Returns: ClientError‹›
UnknownEmailClientError
▸ UnknownEmailClientError(): ClientError‹›
Defined in packages/universal/src/errors/client-errors.ts:86
Returns: ClientError‹›
@loadmill/universal › "errors/field-errors"
Module: "errors/field-errors"
Index
Type aliases
Type aliases
FieldErrors
Ƭ FieldErrors: object
Defined in packages/universal/src/errors/field-errors.ts:4
A mapping from form field names to their respective errors (if any).
Type declaration:
- [ name: string]: string
@loadmill/universal › "errors/index"
Module: "errors/index"
@loadmill/universal › "errors/presentable-error"
Module: "errors/presentable-error"
Index
Classes
Module: "index"
@loadmill/universal › "manipulation-utils"
Module: "manipulation-utils"
Index
Functions
Functions
firstKey
▸ firstKey(obj
: any): string
Defined in packages/universal/src/manipulation-utils.ts:11
Parameters:
Name | Type |
---|---|
obj | any |
Returns: string
firstKeyComparator
▸ firstKeyComparator(o1
: any, o2
: any): 0 | 1 | -1
Defined in packages/universal/src/manipulation-utils.ts:25
Parameters:
Name | Type |
---|---|
o1 | any |
o2 | any |
Returns: 0 | 1 | -1
Const
isEmpty
▸ isEmpty(obj
: any): boolean
Defined in packages/universal/src/manipulation-utils.ts:1
Parameters:
Name | Type |
---|---|
obj | any |
Returns: boolean
objToSingletonArray
▸ objToSingletonArray(obj
: object, sort
: boolean): object[]
Defined in packages/universal/src/manipulation-utils.ts:15
Parameters:
Name | Type | Default |
---|---|---|
obj | object | - |
sort | boolean | true |
Returns: object[]
stripSingleton
▸ stripSingleton(singleton
: any, defaultValue
: any): any
Defined in packages/universal/src/manipulation-utils.ts:3
Parameters:
Name | Type | Default |
---|---|---|
singleton | any | - |
defaultValue | any | {} |
Returns: any
@loadmill/universal › "math-utils"
Module: "math-utils"
Index
Functions
Functions
calcAvg
▸ calcAvg(value1
: number, weight1
: number, value2
: number, weight2
: number): number
Defined in packages/universal/src/math-utils.ts:3
Parameters:
Name | Type |
---|---|
value1 | number |
weight1 | number |
value2 | number |
weight2 | number |
Returns: number
findMedian
▸ findMedian(array
: any, compare?
: any): any
Defined in packages/universal/src/math-utils.ts:21
Parameters:
Name | Type |
---|---|
array | any |
compare? | any |
Returns: any
@loadmill/universal › "number-utils"
Module: "number-utils"
Index
Functions
Functions
formatNumber
▸ formatNumber(value
: number, fractionDigits
: number): string
Defined in packages/universal/src/number-utils.ts:9
Parameters:
Name | Type |
---|---|
value | number |
fractionDigits | number |
Returns: string
numberify
▸ numberify(num?
: number | string | null, defaultValue
: number): number
Defined in packages/universal/src/number-utils.ts:1
Parameters:
Name | Type | Default |
---|---|---|
num? | number | string | null | - |
defaultValue | number | 0 |
Returns: number
@loadmill/universal › "uri-utils"
Module: "uri-utils"
Index
Functions
Functions
decodePart
▸ decodePart(urlPart
: string): string
Defined in packages/universal/src/uri-utils.ts:42
Parameters:
Name | Type |
---|---|
urlPart | string |
Returns: string
encodePart
▸ encodePart(urlPart
: string): string
Defined in packages/universal/src/uri-utils.ts:38
Parameters:
Name | Type |
---|---|
urlPart | string |
Returns: string
getDomain
▸ getDomain(url
: any): string
Defined in packages/universal/src/uri-utils.ts:14
Parameters:
Name | Type |
---|---|
url | any |
Returns: string
normalizeDomain
▸ normalizeDomain(domain?
: undefined | string): string
Defined in packages/universal/src/uri-utils.ts:19
Parameters:
Name | Type |
---|---|
domain? | undefined | string |
Returns: string
parseQuery
▸ parseQuery(query
: string): any
Defined in packages/universal/src/uri-utils.ts:10
Parameters:
Name | Type |
---|---|
query | string |
Returns: any
stripProtocol
▸ stripProtocol(urlish
: string): string
Defined in packages/universal/src/uri-utils.ts:28
Parameters:
Name | Type |
---|---|
urlish | string |
Returns: string
withProtocol
▸ withProtocol(url
: string): string
Defined in packages/universal/src/uri-utils.ts:3
Parameters:
Name | Type |
---|---|
url | string |
Returns: string
3 days ago
23 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
10 months ago
10 months ago
10 months ago
6 months ago
6 months ago
6 months ago
6 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
6 months ago
6 months ago
6 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago