Float.unwrap
This commit is contained in:
parent
1743756097
commit
95c04bd5d5
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "preserves",
|
"name": "preserves",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"description": "Experimental data serialization format",
|
"description": "Experimental data serialization format",
|
||||||
"homepage": "https://gitlab.com/preserves/preserves",
|
"homepage": "https://gitlab.com/preserves/preserves",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|
|
@ -94,6 +94,10 @@ export abstract class Float {
|
||||||
|
|
||||||
static isSingle = (x: any): x is Single => Float.isFloat(x, 'Single');
|
static isSingle = (x: any): x is Single => Float.isFloat(x, 'Single');
|
||||||
static isDouble = (x: any): x is Double => Float.isFloat(x, 'Double');
|
static isDouble = (x: any): x is Double => Float.isFloat(x, 'Double');
|
||||||
|
|
||||||
|
static unwrap(f: number | Float): number {
|
||||||
|
return typeof f === 'number' ? f : f.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Single extends Float implements Preservable<never> {
|
export class Single extends Float implements Preservable<never> {
|
||||||
|
|
Loading…
Reference in New Issue