node_worker.classes.build.js
function (metadata) {
        var key;
        if (metadata) {
            this.name = metadata.name;
            this.size = metadata.size || 0;
            this.mime = metadata.mime || '';
            this.isPublic = metadata.isPublic || false;
            this.tags = metadata.tags || [];
            this.content = metadata.content;
            this.contentType = metadata.contentType || BlobMetadata.CONTENT_TYPES.OBJECT;
            if (this.contentType === BlobMetadata.CONTENT_TYPES.COMPLEX) {
                for (key in this.content) {
                    if (this.content.hasOwnProperty(key)) {
                        if (BlobConfig.hashRegex.test(this.content[key].content) === false) {
                            throw new Error('BlobMetadata is malformed: hash \'' + this.content[key].content +
                                '\'is invalid');
                        }
                    }
                }
            }
        } else {
            throw new Error('metadata parameter is not defined');
        }
    }
function (metadata) {
        var key;
        if (metadata) {
            this.name = metadata.name;
            this.size = metadata.size || 0;
            this.mime = metadata.mime || '';
            this.isPublic = metadata.isPublic || false;
            this.tags = metadata.tags || [];
            this.content = metadata.content;
            this.contentType = metadata.contentType || BlobMetadata.CONTENT_TYPES.OBJECT;
            if (this.contentType === BlobMetadata.CONTENT_TYPES.COMPLEX) {
                for (key in this.content) {
                    if (this.content.hasOwnProperty(key)) {
                        if (BlobConfig.hashRegex.test(this.content[key].content) === false) {
                            throw new Error('BlobMetadata is malformed: hash \'' + this.content[key].content +
                                '\'is invalid');
                        }
                    }
                }
            }
        } else {
            throw new Error('metadata parameter is not defined');
        }
    }
function ( metadata ) { var key ; if ( metadata ) { this . name = metadata . name ; this . size = metadata . size || 0 ; this . mime = metadata . mime || '' ; this . isPublic = metadata . isPublic || false ; this . tags = metadata . tags || [ ] ; this . content = metadata . content ; this . contentType = metadata . contentType || BlobMetadata . CONTENT_TYPES . OBJECT ; if ( this . contentType === BlobMetadata . CONTENT_TYPES . COMPLEX ) { for ( key in this . content ) { if ( this . content . hasOwnProperty ( key ) ) { if ( BlobConfig . hashRegex . test ( this . content [ key ] . content ) === false ) { throw new Error ( 'BlobMetadata is malformed: hash \'' + this . content [ key ] . content + '\'is invalid' ) ; } } } } } else { throw new Error ( 'metadata parameter is not defined' ) ; } }
Initializes a new instance of BlobMetadata
@param {object} metadata - A serialized metadata object.
@param {string} metadata.name
@param {string|Object} metadata.content
@param {number} [metadata.size=0]
@param {BlobMetadata.CONTENT_TYPES} [metadata.contentType=BlobMetadata.CONTENT_TYPES.OBJECT]
@param {string} [metadata.mime='']
@param {boolean} [metadata.isPublic=false]
@param {string[]} [metadata.tags=[]]
@constructor
@alias BlobMetadata
Initializes a new instance of BlobMetadata