nl_tokens: errorIs ( 2 )
pl_tokens: function errorIs ( error , criteria ) { /* This function only deals with errors! */ if ( ! ( error instanceof Error ) ) { return <mask> ; } /* Falsy criteria matches everything (catch-all) */ if ( ! criteria ) { return true ; } /* If criteria is a constructor... */ if ( typeof criteria === 'function' ) { return error instanceof criteria ; } var name = error . name || error . constructor && error . constructor . name || '' ; /* If criteria is a string... */ if ( typeof criteria === 'string' ) { return name . toLowerCase ( ) === criteria . toLowerCase ( ) ; } /* If criteria is a regex... */ if ( criteria instanceof RegExp ) { return criteria . test ( name ) ; } /* Object: do a deep match */ if ( typeof criteria === 'object' ) { return _lodash2 [ 'default' ] . every ( Object . keys ( criteria ) , function ( key ) { return _lodash2 [ 'default' ] . matchesProperty ( key , criteria [ key ] ) ( error ) ; } ) ; } /* Have no idea what the criteria is... */ throw new Error ( 'Unexpected criteria type: ' + criteria ) ; }