index.js
function unboxStrict(box, ifFrom) { // eslint-disable-line no-shadow
    const result = unbox(box, ifFrom, neverBoxed);
    if (result === neverBoxed) {
      throw new Error('Could not unbox');
    }
    return result;
  }
function unboxStrict(box, ifFrom) { // eslint-disable-line no-shadow
    const result = unbox(box, ifFrom, neverBoxed);
    if (result === neverBoxed) {
      throw new Error('Could not unbox');
    }
    return result;
  }
function unboxStrict ( box , ifFrom ) { // eslint-disable-line no-shadow const result = unbox ( box , ifFrom , neverBoxed ) ; if ( result === neverBoxed ) { throw new Error ( 'Could not unbox' ) ; } return result ; }
Like unbox but raises an exception if unboxing fails.
@param {*} box the box to unbox.
@param {?function(function():boolean):boolean} ifFrom
if the box may be opened by this unboxer's owner,
then ifFrom receives the publicKey of the box creator.
It should return true to allow unboxing to proceed.
@return {*} the value if unboxing is allowed or fallback otherwise.
Like unbox but raises an exception if unboxing fails .