Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public getExtensionObjectConstructorFromDataType(
dataTypeNodeId: NodeId
): AnyConstructorFunc {
const typeDictionary = this.getTypeDictionaryForNamespace(dataTypeNodeId.namespace);
// find schema corresponding to dataTypeNodeId in typeDictionary
const schema = findSchemaForDataType(typeDictionary, dataTypeNodeId);
const Constructor = createDynamicObjectConstructor(schema, typeDictionary);
return Constructor;
}
public getExtensionObjectConstructorFromBinaryEncoding(
binaryEncodingNodeId: NodeId
): AnyConstructorFunc {
const typeDictionary = this.getTypeDictionaryForNamespace(binaryEncodingNodeId.namespace);
// find schema corresponding to binaryEncodingNodeId in typeDictionary
const schema = findSchemaForBinaryEncoding(typeDictionary, binaryEncodingNodeId);
const Constructor = createDynamicObjectConstructor(schema, typeDictionary);
return Constructor;
}