MCPcopy Index your code
hub / github.com/NativeScript/firebase / deserializeField

Function deserializeField

packages/firebase-firestore/index.android.ts:26–108  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

24});
25
26function deserializeField(value) {
27 if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
28 return value;
29 }
30
31 if (value instanceof java.lang.Short) {
32 return value.shortValue();
33 }
34
35 if (value instanceof java.lang.Integer) {
36 return value.intValue();
37 }
38
39 if (value instanceof java.lang.Long) {
40 return value.longValue();
41 }
42
43 if (value instanceof java.lang.Float) {
44 return value.floatValue();
45 }
46
47 if (value instanceof java.lang.Double) {
48 return value.doubleValue();
49 }
50
51 if (value instanceof java.lang.Boolean) {
52 return value.booleanValue();
53 }
54
55 if (value instanceof com.google.firebase.Timestamp) {
56 return Timestamp.fromNative(value);
57 }
58
59 if (value instanceof com.google.firebase.firestore.GeoPoint) {
60 return GeoPoint.fromNative(value);
61 }
62
63 if (value instanceof com.google.firebase.firestore.FieldPath) {
64 return FieldPath.fromNative(value);
65 }
66
67 if (value instanceof com.google.firebase.firestore.FieldValue) {
68 return FieldValue.fromNative(value);
69 }
70
71 if (value instanceof com.google.firebase.firestore.DocumentReference) {
72 return DocumentReference.fromNative(value);
73 }
74
75 if (value instanceof com.google.firebase.firestore.CollectionReference) {
76 return CollectionReference.fromNative(value);
77 }
78
79 if (value instanceof java.util.List) {
80 const array = [];
81 const size = value.size();
82 for (let i = 0, n = size; i < n; i++) {
83 array[i] = deserializeField(value.get(i));

Callers 5

dataMethod · 0.70
getMethod · 0.70
dataMethod · 0.70
getMethod · 0.70
onSuccessMethod · 0.70

Calls 3

getMethod · 0.65
fromNativeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…