MCPcopy Create free account
hub / github.com/DanWahlin/CustomerManagerStandard / parseTypeName

Function parseTypeName

CustomerManager/Scripts/breeze.debug.js:7266–7306  ·  view source on GitHub ↗
(entityTypeName, schema)

Source from the content-addressed store, hash-verified

7264
7265 // schema is only needed for navProperty type name
7266 function parseTypeName(entityTypeName, schema) {
7267 if (!entityTypeName) {
7268 return null;
7269 }
7270
7271 if (__stringStartsWith(entityTypeName, MetadataStore.ANONTYPE_PREFIX)) {
7272 return {
7273 shortTypeName: entityTypeName,
7274 namespace: "",
7275 typeName: entityTypeName,
7276 isAnonymous: true
7277 };
7278 }
7279 var entityTypeNameNoAssembly = entityTypeName.split(",")[0];
7280 var nameParts = entityTypeNameNoAssembly.split(".");
7281 if (nameParts.length > 1) {
7282
7283 var shortName = nameParts[nameParts.length - 1];
7284
7285 var ns = null;
7286 if (schema) {
7287 ns = getNamespaceFor(shortName, schema);
7288 }
7289
7290 if (!ns) {
7291 var namespaceParts = nameParts.slice(0, nameParts.length - 1);
7292 ns = namespaceParts.join(".");
7293 }
7294 return {
7295 shortTypeName: shortName,
7296 namespace: ns,
7297 typeName: qualifyTypeName(shortName, ns)
7298 };
7299 } else {
7300 return {
7301 shortTypeName: entityTypeName,
7302 namespace: "",
7303 typeName: entityTypeName
7304 };
7305 }
7306 }
7307
7308 function getNamespaceFor(shortName, schema) {
7309 var ns;

Callers 6

parseFunction · 0.85
parseCsdlEntityTypeFunction · 0.85
parseCsdlComplexPropertyFunction · 0.85
parseCsdlNavPropertyFunction · 0.85
getAssociationFunction · 0.85
breeze.debug.jsFile · 0.85

Calls 3

__stringStartsWithFunction · 0.85
getNamespaceForFunction · 0.85
qualifyTypeNameFunction · 0.85

Tested by

no test coverage detected