@alicloud/tea-util
Advanced tools
Comparing version 1.4.6 to 1.4.7
@@ -0,1 +1,4 @@ | ||
2023-06-28 Version: 1.4.7 | ||
1. Support static method `assertAsReadable()` | ||
2023-06-26 Version: 1.4.6 | ||
@@ -2,0 +5,0 @@ 1. Support static method `assertAsInteger()` |
@@ -85,2 +85,7 @@ /// <reference types="node" /> | ||
}[]; | ||
/** | ||
* Assert a value, if it is a readable, return it, otherwise throws | ||
* @return the readable value | ||
*/ | ||
static assertAsReadable(value: any): Readable; | ||
} |
@@ -26,2 +26,3 @@ "use strict"; | ||
exports.RuntimeOptions = void 0; | ||
const stream_1 = require("stream"); | ||
const $tea = __importStar(require("@alicloud/tea-typescript")); | ||
@@ -269,4 +270,14 @@ const kitx = __importStar(require("kitx")); | ||
} | ||
/** | ||
* Assert a value, if it is a readable, return it, otherwise throws | ||
* @return the readable value | ||
*/ | ||
static assertAsReadable(value) { | ||
if (value instanceof stream_1.Readable) { | ||
return value; | ||
} | ||
throw new Error(`The value is not a readable`); | ||
} | ||
} | ||
exports.default = Client; | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "@alicloud/tea-util", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/client.js", |
@@ -305,4 +305,15 @@ import { Readable } from 'stream'; | ||
} | ||
/** | ||
* Assert a value, if it is a readable, return it, otherwise throws | ||
* @return the readable value | ||
*/ | ||
static assertAsReadable(value: any): Readable { | ||
if (value instanceof Readable) { | ||
return value; | ||
} | ||
throw new Error(`The value is not a readable`); | ||
} | ||
} | ||
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
27023
638