MCPcopy Index your code
hub / github.com/parse-community/parse-server / _pushEvent

Method _pushEvent

src/LiveQuery/Client.js:86–112  ·  view source on GitHub ↗
(type: string)

Source from the content-addressed store, hash-verified

84 }
85
86 _pushEvent(type: string): Function {
87 return function (
88 subscriptionId: number,
89 parseObjectJSON: any,
90 parseOriginalObjectJSON: any
91 ): void {
92 const response: Message = {
93 op: type,
94 clientId: this.id,
95 installationId: this.installationId,
96 };
97 if (typeof subscriptionId !== 'undefined') {
98 response['requestId'] = subscriptionId;
99 }
100 if (typeof parseObjectJSON !== 'undefined') {
101 let keys;
102 if (this.subscriptionInfos.has(subscriptionId)) {
103 keys = this.subscriptionInfos.get(subscriptionId).keys;
104 }
105 response['object'] = this._toJSONWithFields(parseObjectJSON, keys);
106 if (parseOriginalObjectJSON) {
107 response['original'] = this._toJSONWithFields(parseOriginalObjectJSON, keys);
108 }
109 }
110 Client.pushResponse(this.parseWebSocket, JSON.stringify(response));
111 };
112 }
113
114 _toJSONWithFields(parseObjectJSON: any, fields: any): FlattenedObjectData {
115 if (!fields) {

Callers 1

constructorMethod · 0.95

Calls 3

_toJSONWithFieldsMethod · 0.95
pushResponseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected