function hsCompile(pattern, flags, mode) {
  const dbPtrPtr = ref.alloc(r(hsDatabase));
  const errPtrPtr = ref.alloc(r(hsCompileError));
  const res = hyperscan.hs_compile(pattern, flags || (HS_FLAG_CASELESS | HS_FLAG_SOM_LEFTMOST), mode || (HS_MODE_BLOCK), ref.NULL, dbPtrPtr, errPtrPtr);
  if (res !== 0) {
    const err = errPtrPtr.deref().deref();
    throw new Error(`Pattern compilation error: ${err.message} for pattern '${pattern}' with the ID ${err.expression}`);
  } else {
    return dbPtrPtr.deref();
  }
}
/**
 * Compiles a single pattern into a database
 * @param {String} pattern A pattern to compile
 * @param {int} flags Matching flags (see HS_FLAG_...)
 * @param {int} mode Match modes (see HS_MODE_...)
 * @return {hsDatabase} The newly generated database
 */
Compiles a single pattern into a database
@param {String} pattern A pattern to compile
@param {int} flags Matching flags
@param {int} mode Match modes
@return {hsDatabase} The newly generated database
Compiles a single pattern into a database @param { String } pattern A pattern to compile @param { int } flags Matching flags @param { int } mode Match modes @return { hsDatabase } The newly generated database
function hsCompile(pattern, flags, mode) {
  const dbPtrPtr = ref.alloc(r(hsDatabase));
  const errPtrPtr = ref.alloc(r(hsCompileError));
  const res = hyperscan.hs_compile(pattern, flags || (HS_FLAG_CASELESS | HS_FLAG_SOM_LEFTMOST), mode || (HS_MODE_BLOCK), ref.NULL, dbPtrPtr, errPtrPtr);
  if (res !== 0) {
    const err = errPtrPtr.deref().deref();
    throw new Error(`Pattern compilation error: ${err.message} for pattern '${pattern}' with the ID ${err.expression}`);
  } else {
    return dbPtrPtr.deref();
  }
}
function hsCompile ( pattern , flags , mode ) { const dbPtrPtr = ref . alloc ( r ( hsDatabase ) ) ; const errPtrPtr = ref . alloc ( r ( hsCompileError ) ) ; const res = hyperscan . hs_compile ( pattern , flags || ( HS_FLAG_CASELESS | HS_FLAG_SOM_LEFTMOST ) , mode || ( HS_MODE_BLOCK ) , ref . NULL , dbPtrPtr , errPtrPtr ) ; if ( res !== 0 ) { const err = errPtrPtr . deref ( ) . deref ( ) ; throw new Error ( ` ${ err . message } ${ pattern } ${ err . expression } ` ) ; } else { return dbPtrPtr . deref ( ) ; } }
Compiles a single pattern into a database
 @param {String} pattern A pattern to compile
 @param {int} flags Matching flags (see HS_FLAG_...)
 @param {int} mode Match modes (see HS_MODE_...)
 @return {hsDatabase} The newly generated database
Compiles a single pattern into a database @param { String } pattern A pattern to compile @param { int } flags Matching flags ( see HS_FLAG_ ... ) @param { int } mode Match modes ( see HS_MODE_ ... ) @return { hsDatabase } The newly generated database