nl_tokens: Extracts all records from the provided object store and preprocess them using the provided preprocessor .
pl_tokens: function fetchRecords ( objectStore , preprocessor ) { return new PromiseSync ( ( resolve , reject ) => { let records = [ ] objectStore . openCursor ( null , CursorDirection . NEXT , ( cursor ) => { let primaryKey = cursor . primaryKey if ( primaryKey instanceof Object ) { Object . freeze ( primaryKey ) } let preprocessedRecord = preprocessor ( cursor . record , primaryKey ) if ( preprocessedRecord === UpgradedDatabaseSchema . DELETE_RECORD ) { cursor . <mask> ( ) cursor . continue ( ) return } else if ( preprocessedRecord !== UpgradedDatabaseSchema . SKIP_RECORD ) { records . push ( { key : primaryKey , record : preprocessedRecord } ) } else { // SKIP_RECORD returned, do nothing } cursor . continue ( ) } ) . then ( ( ) => resolve ( records ) ) . catch ( error => reject ( error ) ) } ) }