@alicloud/tea-util
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -47,2 +47,10 @@ /// <reference types="node" /> | ||
static isUnset(value: any): boolean; | ||
static stringifyMapValue(m: { | ||
[key: string]: any; | ||
}): { | ||
[key: string]: string; | ||
}; | ||
static assertAsMap(value: any): { | ||
[key: string]: any; | ||
}; | ||
} |
@@ -137,4 +137,20 @@ "use strict"; | ||
} | ||
static stringifyMapValue(m) { | ||
if (!m) { | ||
return m; | ||
} | ||
const result = {}; | ||
for (const [key, value] of Object.entries(m)) { | ||
result[key] = String(value); | ||
} | ||
return result; | ||
} | ||
static assertAsMap(value) { | ||
if (value && typeof value === 'object' && !Array.isArray(value)) { | ||
return value; | ||
} | ||
throw new Error(`The value is not a object`); | ||
} | ||
} | ||
exports.default = Client; | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "@alicloud/tea-util", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/client.js", |
@@ -164,2 +164,21 @@ import { Readable } from 'stream'; | ||
} | ||
static stringifyMapValue(m: {[key: string]: any} ): {[key: string]: string} { | ||
if (!m) { | ||
return m; | ||
} | ||
const result: {[key: string]: string} = {}; | ||
for (const [key, value] of Object.entries(m)) { | ||
result[key] = String(value); | ||
} | ||
return result; | ||
} | ||
static assertAsMap(value: any): {[key: string]: any} { | ||
if (value && typeof value === 'object' && !Array.isArray(value)) { | ||
return value as {[key: string]: any}; | ||
} | ||
throw new Error(`The value is not a object`); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
15874
7
361
0
29