Page MenuHomePhabricator

D4990.id.diff
No OneTemporary

D4990.id.diff

diff --git a/lib/utils/validation-utils.js b/lib/utils/validation-utils.js
--- a/lib/utils/validation-utils.js
+++ b/lib/utils/validation-utils.js
@@ -7,6 +7,7 @@
TRefinement,
TEnums,
TInterface,
+ TUnion,
} from 'tcomb';
import {
@@ -65,6 +66,22 @@
const tOldValidUsername: TRegex = tRegex(oldValidUsernameRegex);
const tID: TRefinement<string> = t.refinement(t.String, (id: string) => !!id);
+const tMediaMessagePhoto: TInterface = tShape({
+ type: tString('photo'),
+ uploadID: t.String,
+});
+
+const tMediaMessageVideo: TInterface = tShape({
+ type: tString('video'),
+ uploadID: t.String,
+ thumbnailUploadID: t.String,
+});
+
+const tMediaMessageMedia: TUnion<TInterface> = t.union([
+ tMediaMessagePhoto,
+ tMediaMessageVideo,
+]);
+
export {
tBool,
tString,
@@ -82,4 +99,7 @@
tEmail,
tOldValidUsername,
tID,
+ tMediaMessagePhoto,
+ tMediaMessageVideo,
+ tMediaMessageMedia,
};

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 6:12 AM (6 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2724155
Default Alt Text
D4990.id.diff (932 B)

Event Timeline