зеркало из https://github.com/Azure/ms-rest-js.git
Avoid split for undefined objects
This commit is contained in:
Родитель
c8ed5b1c42
Коммит
0de30867dd
|
@ -241,6 +241,7 @@ function base64UrlToByteArray(str: string): Uint8Array | undefined {
|
||||||
function splitSerializeName(prop: string): Array<string> {
|
function splitSerializeName(prop: string): Array<string> {
|
||||||
const classes: Array<string> = [];
|
const classes: Array<string> = [];
|
||||||
let partialclass = "";
|
let partialclass = "";
|
||||||
|
if (prop) {
|
||||||
const subwords = prop.split(".");
|
const subwords = prop.split(".");
|
||||||
|
|
||||||
for (const item of subwords) {
|
for (const item of subwords) {
|
||||||
|
@ -252,6 +253,7 @@ function splitSerializeName(prop: string): Array<string> {
|
||||||
partialclass = "";
|
partialclass = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
@ -533,7 +535,7 @@ function deserializeCompositeType(serializer: Serializer, mapper: CompositeMappe
|
||||||
const propertyMapper = modelProps[key];
|
const propertyMapper = modelProps[key];
|
||||||
const { serializedName, xmlName, xmlElementName } = propertyMapper;
|
const { serializedName, xmlName, xmlElementName } = propertyMapper;
|
||||||
let propertyObjectName = objectName;
|
let propertyObjectName = objectName;
|
||||||
if (serializedName !== "") {
|
if (serializedName !== "" && serializedName !== undefined) {
|
||||||
propertyObjectName = objectName + "." + serializedName;
|
propertyObjectName = objectName + "." + serializedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче