nl_tokens: Function : toJSON Serializes all models and collections of this DataStore into a plain JavaScript object .
pl_tokens: function toJSON ( ) { var self = this , keys = self . keys ( ) , serializedStore = { } ; _ . each ( keys , function ( key ) { var modelOrCollection = self . <mask> ( key ) , jsonRepresentation = modelOrCollection . toJSON ( ) , identifier = self . findRegisteredIdentifier . call ( self , modelOrCollection ) ; if ( identifier ) { var serializedData = { dataStoreModelIdentifier : identifier , data : jsonRepresentation } ; serializedStore [ key ] = serializedData ; } else { throw new Error ( 'Could not serialize DataStore because ' + 'a required modelOrCollection was not registered before!' ) ; } } ) ; debug ( 'to json `%j`' , serializedStore ) ; return serializedStore ; }