-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style: added prettier * chore: added husky and lint-staged to run prettier with pre-commit hook
- Loading branch information
Showing
18 changed files
with
410 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"printWidth": 120, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { Convert } from "./types/convert"; | ||
import { defaultOptions } from "./utils/defaultOptions"; | ||
import { pdf2picCore } from "./pdf2picCore"; | ||
import { Convert } from './types/convert'; | ||
import { defaultOptions } from './utils/defaultOptions'; | ||
import { pdf2picCore } from './pdf2picCore'; | ||
|
||
export function fromPath(filePath: string, options = defaultOptions): Convert { | ||
return pdf2picCore("path", filePath, options); | ||
return pdf2picCore('path', filePath, options); | ||
} | ||
|
||
export function fromBuffer(buffer: Buffer, options = defaultOptions): Convert { | ||
return pdf2picCore("buffer", buffer, options); | ||
return pdf2picCore('buffer', buffer, options); | ||
} | ||
|
||
export function fromBase64(b64string: string, options = defaultOptions): Convert { | ||
return pdf2picCore("base64", b64string, options); | ||
return pdf2picCore('base64', b64string, options); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ export type Options = { | |
savePath?: string; | ||
saveFilename?: string; | ||
compression?: string; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { ReadStream } from "fs"; | ||
import { bufferToStream } from "../../utils/converters/bufferToStream"; | ||
import { ReadStream } from 'fs'; | ||
import { bufferToStream } from '../../utils/converters/bufferToStream'; | ||
|
||
export function base64ToStream(base64: string): ReadStream { | ||
const buffer = Buffer.from(base64, "base64"); | ||
const buffer = Buffer.from(base64, 'base64'); | ||
|
||
return bufferToStream(buffer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.