lib/model.js
function metaData() {
            const meta = {};

            Object.keys(schema.paths).forEach((k) => {
                switch (schema.paths[k].type) {
                    case 'geoPoint':
                        // This allows us to automatically convert valid lng/lat objects
                        // to Datastore.geoPoints
                        meta.geoPointsProps = meta.geoPointsProps || [];
                        meta.geoPointsProps.push(k);
                        break;
                    case 'entityKey':
                        meta.refProps = meta.refProps || {};
                        meta.refProps[k] = true;
                        break;
                    default:
                }
            });

            return meta;
        }
function metaData() {
            const meta = {};

            Object.keys(schema.paths).forEach((k) => {
                switch (schema.paths[k].type) {
                    case 'geoPoint':
                        // This allows us to automatically convert valid lng/lat objects
                        // to Datastore.geoPoints
                        meta.geoPointsProps = meta.geoPointsProps || [];
                        meta.geoPointsProps.push(k);
                        break;
                    case 'entityKey':
                        meta.refProps = meta.refProps || {};
                        meta.refProps[k] = true;
                        break;
                    default:
                }
            });

            return meta;
        }
function metaData ( ) { const meta = { } ; Object . keys ( schema . paths ) . forEach ( ( k ) => { switch ( schema . paths [ k ] . type ) { case 'geoPoint' : // This allows us to automatically convert valid lng/lat objects // to Datastore.geoPoints meta . geoPointsProps = meta . geoPointsProps || [ ] ; meta . geoPointsProps . push ( k ) ; break ; case 'entityKey' : meta . refProps = meta . refProps || { } ; meta . refProps [ k ] = true ; break ; default : } } ) ; return meta ; }
To improve performance and avoid looping over and over the entityData or Schema we keep here some meta data to be used later in models and entities methods
To improve performance and avoid looping over and over the entityData or Schema we keep here some meta data to be used later in models and entities methods