How to use the node-opcua-extension-object.ExtensionObject.schema function in node-opcua-extension-object

To help you get started, we’ve selected a few node-opcua-extension-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-schemas / source / dynamic_extension_object.ts View on Github external
decodeArrayOrElement(typeDictionary, field, thisAny, stream);
                break;
            case FieldCategory.enumeration:
            case FieldCategory.basic:
                decodeArrayOrElement(typeDictionary, field, thisAny, stream, field.schema.decode);
                break;
            default:
                /* istanbul ignore next*/
                throw new Error("Invalid category " + field.category + " " + FieldCategory[field.category]);
        }
    }
}

class DynamicExtensionObject extends ExtensionObject {

    public static schema: StructuredTypeSchema = ExtensionObject.schema;
    public static possibleFields: string[] = [];
    private readonly _typeDictionary: TypeDictionary;
    private __schema?: StructuredTypeSchema;

    constructor(options: any, schema: StructuredTypeSchema, typeDictionary: TypeDictionary) {
        assert(schema, "expecting a schema here ");
        assert(typeDictionary, "expecting a typeDic");

        super(options);
        options = options || {};
        this.__schema = schema;

        this._typeDictionary = typeDictionary;

        check_options_correctness_against_schema(this, this.schema, options);

node-opcua-extension-object

pure nodejs OPCUA SDK - module extension-object

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis