var StringMapper = /** @class */ (function () {
    function StringMapper() {
    }
    StringMapper.prototype.fromDb = function (attributeValue) {
        if (attributeValue.S) {
            return attributeValue.S;
        }
        else {
            throw new Error('there is no S(tring) value defiend on given attribute value');
        }
    };
    StringMapper.prototype.toDb = function (modelValue) {
        // an empty string is not a valid value for string attribute
        if (modelValue === '' || modelValue === null || modelValue === undefined) {
            return null;
        }
        else {
            return { S: modelValue };
        }
    };
    return StringMapper;
}());
export { StringMapper };
//# sourceMappingURL=string.mapper.js.map