BucketModel

Provides bucket data representation.

Constructor

new BucketModel(name)

Parameters:
NameTypeDescription
nameString

Model name.

Example
const modelFoo  = new BucketModel('foo');
modelFoo.parent = null;
modelFoo.fields = ['foo', 'bar', 'baz'];

Methods

(static) isValidFields(arr) → {Boolean}

Verify the Modal field format.

Parameters:
NameTypeDescription
arrArray.<String>

Fields names to validate.

Returns:
Type: 
Boolean
Example
const result = BucketModel.isValidFields(['foo', 'bar', biz', 'baz');

(static) isValidName(value) → {Boolean}

Verify the Modal name format.

Parameters:
NameTypeDescription
valueString

Name value to validate.

Returns:
Type: 
Boolean
Example
const result = BucketModel.isValidName('foo');

(static) isValidParent(value) → {Boolean}

Verify the Modal parent type.

Parameters:
NameTypeDescription
valueString

Parent value to validate.

Returns:
Type: 
Boolean
Example
const result = BucketModel.isValidParent(BucketModel);

(static) isValidType(value) → {Boolean}

Verify the Modal output type.

Parameters:
NameTypeDescription
valueString

Check type value (options: base64|blob|json|text)

Returns:
Type: 
Boolean
Example
const result = BucketModel.isValidType('json');