@alicloud/tea-util
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -51,2 +51,4 @@ /// <reference types="node" /> | ||
static assertAsBoolean(value: any): boolean; | ||
static assertAsString(value: any): string; | ||
static assertAsNumber(value: any): number; | ||
static assertAsMap(value: any): { | ||
@@ -53,0 +55,0 @@ [key: string]: any; |
@@ -153,2 +153,14 @@ "use strict"; | ||
} | ||
static assertAsString(value) { | ||
if (typeof value === 'string') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a string`); | ||
} | ||
static assertAsNumber(value) { | ||
if (typeof value === 'number') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a number`); | ||
} | ||
static assertAsMap(value) { | ||
@@ -155,0 +167,0 @@ if (value && typeof value === 'object' && !Array.isArray(value)) { |
{ | ||
"name": "@alicloud/tea-util", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/client.js", |
@@ -184,2 +184,16 @@ import { Readable } from 'stream'; | ||
static assertAsString(value: any): string { | ||
if (typeof value === 'string') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a string`); | ||
} | ||
static assertAsNumber(value: any): number { | ||
if (typeof value === 'number') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a number`); | ||
} | ||
static assertAsMap(value: any): {[key: string]: any} { | ||
@@ -186,0 +200,0 @@ if (value && typeof value === 'object' && !Array.isArray(value)) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17448
398