BucketModel

BucketModel

Provides bucket data representation.

Constructor

new BucketModel(name)

Source:
Parameters:
Name Type Description
name String

Model name.

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

Methods

_init()

Set defaults.

Source:

(static) isValidFields(arr) → {Boolean}

Verify the Modal field format.

Source:
Parameters:
Name Type Description
arr Array.<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.

Source:
Parameters:
Name Type Description
value String

Name value to validate.

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

(static) isValidParent(value) → {Boolean}

Verify the Modal parent type.

Source:
Parameters:
Name Type Description
value String

Parent value to validate.

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

(static) isValidType(value) → {Boolean}

Verify the Modal output type.

Source:
Parameters:
Name Type Description
value String

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

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