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

victorperin / qr-scanner-cli / 7492198815

11 Jan 2024 05:14PM UTC coverage: 92.929%. First build
7492198815

Pull #217

github

web-flow
Merge fd721e8fd into 17c8abc20
Pull Request #217: Bugfix: updates

19 of 24 branches covered (0.0%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

73 of 75 relevant lines covered (97.33%)

19.47 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'
24✔
2
import { getBitmap } from '../infrastructure/jimp'
24✔
3
import { outputText } from '../handlers/flags'
24✔
4
import { Flags } from '../cli/flags'
5
import { scanFromBitmap } from './scanFromBitmap'
24✔
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> =>
24✔
18
  Promise.resolve(filePath)
20✔
19
    .then(getBitmap)
20
    .then((bitmap) => scanFromBitmap(bitmap, flags))
16✔
21
    .catch(errorHandlers.scanFromFile(filePath))
22

23
export const scanFromFileOnCli = (filePath: string, flags: Flags): Promise<void> =>
24✔
24
  scanFromFile(filePath, flags).then(outputText(flags))
20✔
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

© 2026 Coveralls, Inc