packages/shex-webapp/test/browser-test.js
// blindly tries file extensions. should look at request headers.
blindly tries file extensions. should look at request headers.
blindly tries file extensions . should look at request headers .
function readFromFilesystem (path) {
    let filePath = Path.join(__dirname, '../../..', getRelPath(path));
    let last
    const extensions = ['', '.shex', '.ttl']
    const ret = extensions.find(
      ext => Fs.existsSync(last = filePath + ext)
    )
    if (ret !== undefined) {
      const ret = Fs.readFileSync(last, 'utf8')
      log200(path, last, ret.length)
      return ret
    } else {
      log404(path)
      throw Error(`Not Found ${path}`)
    }
  }
function readFromFilesystem ( path ) { let filePath = Path . join ( __dirname , '../../..' , getRelPath ( path ) ) ; let last const extensions = [ '' , '.shex' , '.ttl' ] const ret = extensions . find ( ext => Fs . existsSync ( last = filePath + ext ) ) if ( ret !== undefined ) { const ret = Fs . readFileSync ( last , 'utf8' ) log200 ( path , last , ret . length ) return ret } else { log404 ( path ) throw Error ( ` ${ path } ` ) } }
blindly tries file extensions.
blindly tries file extensions .