TsugiUtils
Utilities to avoid repeating ourselves.
Static Method Summary
| Static Public Methods | ||
| public static |
copy(to: *, to_key: *, from: *, from_key: *, from_key_2: *) Copy a property from one list to another |
|
| public static |
emptyPromise(val: mixed): * Generate an empty Promise NodeJS style |
|
| public static |
emptyPromiseFail(val: mixed): * Generate an empty Promise NodeJS style |
|
| public static |
Mimic the PHP isset |
|
| public static |
requestUrl(req: dsdsljk): * Get the full url for the request |
|
| public static |
toNull(v: *): * Reduce non real values to null |
|
| public static |
Reduce non real values to null for an object |
|
| public static |
trimToNull(v: *): * Reduce non real values and empty strings to null |
|
| public static |
unitTesting(): * |
|
Static Public Methods
public static copy(to: *, to_key: *, from: *, from_key: *, from_key_2: *) source
Copy a property from one list to another
Params:
| Name | Type | Attribute | Description |
| to | * | ||
| to_key | * | ||
| from | * | ||
| from_key | * |
|
|
| from_key_2 | * |
|
public static emptyPromise(val: mixed): * source
Generate an empty Promise NodeJS style
Params:
| Name | Type | Attribute | Description |
| val | mixed | The value to resolve with |
Return:
| * |
public static emptyPromiseFail(val: mixed): * source
Generate an empty Promise NodeJS style
Params:
| Name | Type | Attribute | Description |
| val | mixed | The value to reject with |
Return:
| * |
public static isset(v: *): boolean source
Mimic the PHP isset
Params:
| Name | Type | Attribute | Description |
| v | * |
public static requestUrl(req: dsdsljk): * source
Get the full url for the request
Params:
| Name | Type | Attribute | Description |
| req | dsdsljk | The http request object |
Return:
| * |
public static toNull(v: *): * source
Reduce non real values to null
Params:
| Name | Type | Attribute | Description |
| v | * |
Return:
| * |
public static toNullAll(v: object) source
Reduce non real values to null for an object
Params:
| Name | Type | Attribute | Description |
| v | object |
public static trimToNull(v: *): * source
Reduce non real values and empty strings to null
Params:
| Name | Type | Attribute | Description |
| v | * |
Return:
| * |