Skip to content

Commit

Permalink
replace id
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Dec 2, 2024
1 parent fa6fee4 commit fa795ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/es-models/bib.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ class EsBib extends EsBase {
return this._valueToIndexFromBasicMapping('publisherLiteral')
}

recordType () {
const recordType = this.bib.ldr()?.recType
if (recordType) return recordType
recordTypeId () {
const recordTypeId = this.bib.ldr()?.recType
if (recordTypeId) return recordTypeId
else return null
}

Expand Down
6 changes: 3 additions & 3 deletions test/unit/es-bib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ describe('EsBib', function () {
})
})

describe('recordType', () => {
it('should return recordType based on ldr rectype', () => {
describe('recordTypeId', () => {
it('should return recordTypeId based on ldr rectype', () => {
const sierraBib = new SierraBib({})
sinon.stub(sierraBib, 'ldr').returns({ recType: 'h' })
const esBib = new EsBib(sierraBib)
expect(esBib.recordType()).to.deep.equal('h')
expect(esBib.recordTypeId()).to.deep.equal('h')
})
it('should return null for empty rectype', () => {
const sierraBib = new SierraBib({})
Expand Down

0 comments on commit fa795ef

Please sign in to comment.