Files
iNaturalistReactNative/tests/helpers/factoria.js
Ken-ichi a7a2e1c10f Show up-to-date metadata for observations immediately after upload (#1497)
This fetches a remote copy of each observation after upload to make sure the
client has the freshest copy of the data immediately.
2024-05-06 17:50:46 -07:00

16 lines
467 B
JavaScript

// Helpers for making factoria modals
// Trivial toJSON implementation. Note that it is import to use the
// `function`` keyword here so that `this` refers to the actual factoria
// object and not the global scope
// eslint-disable-next-line import/prefer-default-export
export function toJSON( ) {
const json = {};
Object.keys( this ).forEach( key => {
if ( typeof ( this[key] ) !== "function" ) {
json[key] = this[key];
}
} );
return json;
}