Skip to content

Commit

Permalink
docs improved with some grammar corrections and more clear definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
TaTo30 committed Feb 19, 2024
2 parents 113a2e9 + b072a3f commit ae89d97
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Install packages
run: npm install

- name: Run Tests
run: npm run test
- name: Run tests and build
run: npm run build

- name: Publish packages
run: npm publish --access public
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</p>

<div align="center">
<h2><a href="https://tato30.github.io/VuePDF/">📖Documentation</a></h2>
<h2><a href="https://tato30.github.io/vue-pdf/">📖Documentation</a></h2>
</div>

## Introduction
Expand Down Expand Up @@ -122,4 +122,4 @@ npm install

# Run code with hot reload
npm run dev
```
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@tato30/vue-pdf",
"version": "1.9.2",
"version": "1.9.4",
"description": "PDF viewer for Vue 3",
"author": {
"name": "Aldo Hernandez",
"url": "https://github.com/TaTo30"
},
"license": "MIT",
"homepage": "https://github.com/TaTo30/VuePDF/",
"homepage": "https://github.com/TaTo30/vue-pdf/",
"repository": {
"type": "git",
"url": "git+https://github.com/TaTo30/VuePDF.git"
"url": "git+https://github.com/TaTo30/vue-pdf.git"
},
"bugs": {
"url": "https://github.com/TaTo30/VuePDF/issues"
"url": "https://github.com/TaTo30/vue-pdf/issues"
},
"keywords": [
"pdf",
Expand Down Expand Up @@ -41,8 +41,6 @@
"build": "npm run tests && npm run build:lib && npm run build:dts",
"build:lib": "vite build",
"build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.build.json",
"publish": "npm publish --access public",
"publish:beta": "npm publish --tag beta --access public",
"preview": "vite preview --port 5050",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
Expand Down
2 changes: 2 additions & 0 deletions src/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export type PDFSrc =
| TypedArray
| PDFDataRangeTransport
| DocumentInitParameters
| undefined
| null

export interface PDFOptions {
onProgress?: OnProgressCallback
Expand Down
8 changes: 4 additions & 4 deletions src/components/usePDF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function usePDF(src: PDFSrc | Ref<PDFSrc>,
const info = shallowRef<PDFInfo | {}>({})

function processLoadingTask(source: PDFSrc) {
const loadingTask = PDFJS.getDocument(source)
const loadingTask = PDFJS.getDocument(source!)
if (options.onProgress)
loadingTask.onProgress = options.onProgress

Expand Down Expand Up @@ -109,15 +109,15 @@ export function usePDF(src: PDFSrc | Ref<PDFSrc>,
}

if (isRef(src)) {
if (src.value !== undefined)
if (src.value)
processLoadingTask(src.value)
watch(src, () => {
if (src.value !== undefined)
if (src.value)
processLoadingTask(src.value)
})
}
else {
if (src !== undefined)
if (src)
processLoadingTask(src)
}

Expand Down

0 comments on commit ae89d97

Please sign in to comment.