MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / parse

Method parse

lib/mapping/model-mapping-info.js:90–102  ·  view source on GitHub ↗

* Parses the user options into a map of model names and ModelMappingInfo. * @param {MappingOptions} options * @param {String} currentKeyspace * @returns {Map }

(options, currentKeyspace)

Source from the content-addressed store, hash-verified

88 * @returns {Map<String, ModelMappingInfo>}
89 */
90 static parse(options, currentKeyspace) {
91 const result = new Map();
92 if (!options || !options.models) {
93 return result;
94 }
95
96 Object.keys(options.models).forEach(modelName => {
97 const modelOptions = options.models[modelName];
98 result.set(modelName, ModelMappingInfo._create(modelName, currentKeyspace, modelOptions));
99 });
100
101 return result;
102 }
103
104 static _create(modelName, currentKeyspace, modelOptions) {
105 if (!currentKeyspace && (!modelOptions || !modelOptions.keyspace)) {

Callers

nothing calls this directly

Calls 4

setMethod · 0.80
_createMethod · 0.80
forEachMethod · 0.65
keysMethod · 0.65

Tested by

no test coverage detected