summaryrefslogtreecommitdiff
path: root/src/main/resources/META-INF/resources/types.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/META-INF/resources/types.js')
-rw-r--r--src/main/resources/META-INF/resources/types.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/resources/META-INF/resources/types.js b/src/main/resources/META-INF/resources/types.js
new file mode 100644
index 0000000..3ea0797
--- /dev/null
+++ b/src/main/resources/META-INF/resources/types.js
@@ -0,0 +1,10 @@
+// @flow
+
+export function cast/*:: <T>*/(x /*: ?Object*/) /*: T*/ {
+ if (x === null || x === undefined) {
+ throw "unexpected null or undefined";
+ } else {
+ /*:: (x: T); */
+ return x;
+ }
+}