src/retrieve.js
/**
 * Converts an msCrypto operation to a promise if needed.
 *
 * @param op The op (or Promise) to convert if needed.
 * @returns {{PromiseLike} A promise
 */
Converts an msCrypto operation to a promise if needed.
@param op The op (or Promise) to convert if needed.
@returns {{PromiseLike} A promise
Converts an msCrypto operation to a promise if needed . @param op The op ( or Promise ) to convert if needed . @returns {{ PromiseLike } A promise
function cryptoOperationToPromise(op) {
  if (op.then) {
    return op;
  }
  return MiniPromise.createPromise(function(resolve, reject) {
    op.oncomplete = function(evt) {
      resolve(evt.target.result);
    };
    function rejectHandler(evt) {
      reject(evt.toString());
    }
    op.onerror = rejectHandler;
    op.onabort = rejectHandler;
  });
}
function cryptoOperationToPromise ( op ) { if ( op . then ) { return op ; } return MiniPromise . createPromise ( function ( resolve , reject ) { op . oncomplete = function ( evt ) { resolve ( evt . target . result ) ; } ; function rejectHandler ( evt ) { reject ( evt . toString ( ) ) ; } op . onerror = rejectHandler ; op . onabort = rejectHandler ; } ) ; }
Converts an msCrypto operation to a promise if needed.
Converts an msCrypto operation to a promise if needed .