build/lib/magic.js
function magic(buf, cb) {
  setTimeout(() => {
    const sampleLength = 24;
    const sample = buf.slice(0, sampleLength).toString('hex'); // lookup data

    const found = Object.keys(_magicDb2.default).find(it => {
      return sample.indexOf(it) != -1;
    });

    if (found) {
      cb(null, _magicDb2.default[found]);
    } else {
      cb(new Error('Magic number not found'));
    }
  }, 0);
}
function magic(buf, cb) {
  setTimeout(() => {
    const sampleLength = 24;
    const sample = buf.slice(0, sampleLength).toString('hex'); // lookup data

    const found = Object.keys(_magicDb2.default).find(it => {
      return sample.indexOf(it) != -1;
    });

    if (found) {
      cb(null, _magicDb2.default[found]);
    } else {
      cb(new Error('Magic number not found'));
    }
  }, 0);
}
function magic ( buf , cb ) { setTimeout ( ( ) => { const sampleLength = 24 ; const sample = buf . slice ( 0 , sampleLength ) . toString ( 'hex' ) ; // lookup data const found = Object . keys ( _magicDb2 . default ) . find ( it => { return sample . indexOf ( it ) != - 1 ; } ) ; if ( found ) { cb ( null , _magicDb2 . default [ found ] ) ; } else { cb ( new Error ( 'Magic number not found' ) ) ; } } , 0 ) ; }
Lookup the magic number in magic-number DB
@param {Buffer} buf Data buffer
@param {function} cb Callback to invoke on completion
Lookup the magic number in magic - number DB