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