How to use the clay.FieldKinds function in clay

To help you get started, we’ve selected a few clay 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 Yipit / clay.js / test / unit / fields.js View on Github external
topic: function () {
            return models.FieldKinds;
        },
        'string accepts anything': function(kinds) {
github Yipit / clay.js / test / unit / models.js View on Github external
'the declared field specs are available too': function(Person) {
            should.equal(
                Person._meta.field.definitions.username,
                models.FieldKinds.alphanumeric
            );
            should.equal(
                Person._meta.field.definitions.email_address,
                models.FieldKinds.email
            );
            should.equal(
                Person._meta.field.definitions.zipcode,
                models.FieldKinds.numeric
            );
        },
        'can be created from a JSON string': function(Person) {
github Yipit / clay.js / test / unit / fields.js View on Github external
topic: function(){
                this.callback(null, models.FieldKinds.hashOf(["name", "id"]));
            },
            'get the values from a given object for the given keys': function(hasher) {
github Yipit / clay.js / test / unit / models.js View on Github external
'the declared field specs are available too': function(Person) {
            should.equal(
                Person._meta.field.definitions.username,
                models.FieldKinds.alphanumeric
            );
            should.equal(
                Person._meta.field.definitions.email_address,
                models.FieldKinds.email
            );
            should.equal(
                Person._meta.field.definitions.zipcode,
                models.FieldKinds.numeric
            );
        },
        'can be created from a JSON string': function(Person) {