mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 23:11:41 +00:00
Add isFunction and isNullable builtins (#504)
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
@builtin export declare function isReference<T>(value?: T): bool;
|
||||
@builtin export declare function isString<T>(value?: T): bool;
|
||||
@builtin export declare function isArray<T>(value?: T): bool;
|
||||
@builtin export declare function isFunction<T>(value?: T): bool;
|
||||
@builtin export declare function isNullable<T>(value?: T): bool;
|
||||
@builtin export declare function isDefined(expression: void): bool;
|
||||
@builtin export declare function isConstant(expression: void): bool;
|
||||
@builtin export declare function isManaged<T>(value?: T): bool;
|
||||
|
4
std/assembly/index.d.ts
vendored
4
std/assembly/index.d.ts
vendored
@ -128,6 +128,10 @@ declare function isReference<T>(value?: any): value is object | string;
|
||||
declare function isString<T>(value?: any): value is string | String;
|
||||
/** Tests if the specified type *or* expression can be used as an array. Compiles to a constant. */
|
||||
declare function isArray<T>(value?: any): value is Array<any>;
|
||||
/** Tests if the specified type *or* expression is of a function type. Compiles to a constant. */
|
||||
declare function isFunction<T>(value?: any): value is Array<any>;
|
||||
/** Tests if the specified type *or* expression is of a nullable reference type. Compiles to a constant. */
|
||||
declare function isNullable<T>(value?: any): value is Array<any>;
|
||||
/** Tests if the specified expression resolves to a defined element. Compiles to a constant. */
|
||||
declare function isDefined(expression: any): bool;
|
||||
/** Tests if the specified expression evaluates to a constant value. Compiles to a constant. */
|
||||
|
Reference in New Issue
Block a user