• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

victorperin / qr-scanner-cli / 3630546792

pending completion
3630546792

Pull #208

github

GitHub
Merge 4d6340e1d into 65b6913c7
Pull Request #208: chore(deps): bump qs from 6.10.1 to 6.11.0

19 of 24 branches covered (79.17%)

Branch coverage included in aggregate %.

73 of 75 relevant lines covered (97.33%)

5.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/pipelines/scanFromFile.ts
1
import errorHandlers from '../handlers/error'
6✔
2
import { getBitmap } from '../infrastructure/jimp'
6✔
3
import { outputText } from '../handlers/flags'
6✔
4
import { Flags } from '../cli/flags'
5
import { scanFromBitmap } from './scanFromBitmap'
6✔
6

7
/**
8
 * This function reads a file, get it's bitmap, searches and read a qrcode from it.
9
 * ```javascript
10
 * const value = await scanFromFile('./image.jpg')
11
 * ```
12
 *
13
 * @param filePath A file path for an image file containing a QR Code
14
 * @param flags
15
 * @returns Value read from the QR Code inside the image
16
 */
17
export const scanFromFile = (filePath: string, flags?: Flags): Promise<string> =>
6✔
18
  Promise.resolve(filePath)
5✔
19
    .then(getBitmap)
20
    .then((bitmap) => scanFromBitmap(bitmap, flags))
4✔
21
    .catch(errorHandlers.scanFromFile(filePath))
22

23
export const scanFromFileOnCli = (filePath: string, flags: Flags): Promise<void> =>
6✔
24
  scanFromFile(filePath, flags).then(outputText(flags))
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc