We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19c6744 commit d5286aeCopy full SHA for d5286ae
1 file changed
epub.js
@@ -681,7 +681,10 @@ class Resources {
681
this.cfis = CFI.fromElements($$itemref)
682
}
683
getItemByID(id) {
684
- return this.manifest.find(item => item.id === id)
+ if (!this.manifestById) {
685
+ this.manifestById = new Map(this.manifest.map(item => [item.id, item]))
686
+ }
687
+ return this.manifestById.get(id)
688
689
getItemByHref(href) {
690
return this.manifest.find(item => item.href === href)
0 commit comments