"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var arrayType = require("./array");
var booleanType = require("./boolean");
var dateTimeType = require("./date-time");
var enumType = require("./enum");
var numberType = require("./number");
var objectType = require("./object");
var stringType = require("./string");
exports.getDataModel = function (schema) {
    if (!schema) {
        return null;
    }
    var format = schema.format, type = schema.type;
    if (schema.enum) {
        return enumType;
    }
    if (type === 'array') {
        return arrayType;
    }
    if (type === 'string') {
        if (format === 'date-time') {
            return dateTimeType;
        }
        return stringType;
    }
    if (type === 'object') {
        return objectType;
    }
    if (type === 'boolean') {
        return booleanType;
    }
    if (type === 'number') {
        return numberType;
    }
    return null;
};
