Skip to content

Commit

Permalink
removed deprecated output getter
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswilm committed Nov 16, 2024
1 parent 9e1d585 commit 3c8db08
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 27 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,41 @@ parsing of fields that are known, but shouldn't be in the bibliography entry due

## Upgrading

- From 1.x to 2.x: Note that the APi for the asynchronousparser has changed.
- From 2.x to 3.x: Note that the `output` getter has been removed. Use `parse()` instead.

You need to change instances of this:
This applied to `BibLatexExporter`, `CSLExporter` and `BibLatexParser`. Note that the output of `BibLatexParser` is structured differently when using the `parse()` function if you previously used the `output` getter.


In the case of `BibLatexExporter` and `CSLExporter`, instead of:

```JavaScript
const output = parser.output
```

Do:

```JavaScript
const output = parser.parse()
```

In the case of `BibLatexParser`, instead of:

```JavaScript
const output = parser.output
```

Do:

```JavaScript
const parsed = parser.parse()
const output = parsed.entries
```

- From 1.x to 2.x: Note that the API for the asynchronous parser has changed.

You need to change instances of this:

```JavaScript
let parser = new BibLatexParser(input, {processUnexpected: true, processUnknown: true, async: true})
parser.parse().then((bib) => { ... })
```
Expand Down
7 changes: 0 additions & 7 deletions src/export/biblatex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ export class BibLatexExporter {
this.bibtexStr = ""
}

get output(): string {
console.warn(
"BibLatexExporter.output will be deprecated in biblatex-csl-converter 2.x. Use BibLatexExporter.parse() instead."
)
return this.parse()
}

parse(): string {
this.pks.forEach((pk) => {
let bib = this.bibDB[pk as unknown as number]
Expand Down
7 changes: 0 additions & 7 deletions src/export/csl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ export class CSLExporter {
this.errors = []
}

get output(): CSLOutput {
console.warn(
"CSLExporter.output will be deprecated in biblatex-csl-converter 2.x. Use CSLExporter.parse() instead."
)
return this.parse()
}

parse(): CSLOutput {
for (let bibId in this.bibDB) {
if (this.pks.indexOf(bibId) !== -1) {
Expand Down
11 changes: 0 additions & 11 deletions src/import/biblatex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1212,17 +1212,6 @@ export class BibLatexParser {
)
}

get output(): BibDB {
console.warn(
"BibLatexParser.output will be deprecated in biblatex-csl-converter 2.x. Use BibLatexParser.parse() instead."
)
this.replaceTeXChars()
this.stepThroughBibtex()
this.createBibDB()
this.cleanDB()
return this.bibDB
}

_resolveCrossRef(key: string, parentKey: string): void {
const entry = this.entries.find((e) => e.entry_key === key)!
const parent = this.entries.find((e) => e.entry_key === parentKey)!
Expand Down

0 comments on commit 3c8db08

Please sign in to comment.