@alicloud/tea-util
Advanced tools
Comparing version 1.1.0 to 1.2.1
@@ -39,5 +39,3 @@ /// <reference types="node" /> | ||
}): string; | ||
static toJSONString(val: { | ||
[key: string]: any; | ||
}): string; | ||
static toJSONString(val: any): string; | ||
static toBytes(val: string): Buffer; | ||
@@ -53,2 +51,3 @@ static empty(val: string): boolean; | ||
}; | ||
static assertAsBoolean(value: any): boolean; | ||
static assertAsMap(value: any): { | ||
@@ -55,0 +54,0 @@ [key: string]: any; |
@@ -147,2 +147,8 @@ "use strict"; | ||
} | ||
static assertAsBoolean(value) { | ||
if (typeof value === 'boolean') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a boolean`); | ||
} | ||
static assertAsMap(value) { | ||
@@ -149,0 +155,0 @@ if (value && typeof value === 'object' && !Array.isArray(value)) { |
{ | ||
"name": "@alicloud/tea-util", | ||
"version": "1.1.0", | ||
"version": "1.2.1", | ||
"description": "", | ||
@@ -9,3 +9,2 @@ "main": "dist/client.js", | ||
"test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test", | ||
"ci": "npm run test-cov && codecov", | ||
"build": "tsc", | ||
@@ -20,2 +19,4 @@ "prepublishOnly": "tsc" | ||
"mocha": "^7.0.1", | ||
"nyc": "^15.0.0", | ||
"source-map-support": "^0.5.16", | ||
"ts-node": "^8.6.2", | ||
@@ -28,3 +29,6 @@ "typescript": "^3.7.5" | ||
}, | ||
"files":["dist", "src"] | ||
"files": [ | ||
"dist", | ||
"src" | ||
] | ||
} |
@@ -133,3 +133,3 @@ import { Readable } from 'stream'; | ||
static toJSONString(val: {[key: string]: any}): string { | ||
static toJSONString(val: any): string { | ||
return JSON.stringify(val); | ||
@@ -178,2 +178,9 @@ } | ||
static assertAsBoolean(value: any): boolean { | ||
if (typeof value === 'boolean') { | ||
return value; | ||
} | ||
throw new Error(`The value is not a boolean`); | ||
} | ||
static assertAsMap(value: any): {[key: string]: any} { | ||
@@ -180,0 +187,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
16392
372
7