stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
60 lines • 1.96 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mapStorableToChannel = void 0;
var mapStorableToChannel = channelRow => {
var autoTranslationEnabled = channelRow.autoTranslationEnabled,
autoTranslationLanguage = channelRow.autoTranslationLanguage,
cid = channelRow.cid,
config = channelRow.config,
cooldown = channelRow.cooldown,
createdAt = channelRow.createdAt,
createdById = channelRow.createdById,
deletedAt = channelRow.deletedAt,
disabled = channelRow.disabled,
extraData = channelRow.extraData,
frozen = channelRow.frozen,
hidden = channelRow.hidden,
id = channelRow.id,
invites = channelRow.invites,
lastMessageAt = channelRow.lastMessageAt,
memberCount = channelRow.memberCount,
muted = channelRow.muted,
ownCapabilities = channelRow.ownCapabilities,
team = channelRow.team,
truncatedAt = channelRow.truncatedAt,
truncatedBy = channelRow.truncatedBy,
truncatedById = channelRow.truncatedById,
type = channelRow.type,
updatedAt = channelRow.updatedAt;
return {
channel: {
auto_translation_enabled: autoTranslationEnabled,
auto_translation_language: autoTranslationLanguage,
cid,
config: config && JSON.parse(config),
cooldown,
created_at: createdAt,
created_by_id: createdById,
deleted_at: deletedAt,
disabled,
frozen,
hidden,
id,
invites: invites && JSON.parse(invites),
last_message_at: lastMessageAt,
member_count: memberCount,
muted,
own_capabilities: ownCapabilities && JSON.parse(ownCapabilities),
team,
truncated_at: truncatedAt,
truncated_by: truncatedBy,
truncated_by_id: truncatedById,
type,
updated_at: updatedAt,
...(extraData ? JSON.parse(extraData) : {})
}
};
};
exports.mapStorableToChannel = mapStorableToChannel;
//# sourceMappingURL=mapStorableToChannel.js.map