var DateMapper = /** @class */ (function () {
    function DateMapper() {
    }
    DateMapper.prototype.fromDb = function (attributeValue) {
        if (attributeValue.N) {
            return new Date(parseInt(attributeValue.N, 10));
        }
        else {
            throw new Error('there is no N(umber) value defiend on given attribute value');
        }
    };
    DateMapper.prototype.toDb = function (modelValue) {
        if (modelValue && modelValue instanceof Date) {
            return { N: "" + modelValue.getTime() };
        }
        else {
            throw new Error('the given model value must be an instance of Date');
        }
    };
    return DateMapper;
}());
export { DateMapper };
//# sourceMappingURL=date.mapper.js.map