mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Update deps, fix build and toJSON methods
This commit is contained in:
parent
4ae139f40a
commit
6c8f02db9f
11 changed files with 5450 additions and 580 deletions
|
@ -2,7 +2,7 @@
|
|||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"targets": "last 2 Chrome versions, last 2 Safari versions, last 2 ChromeAndroid versions, last 2 iOS versions, last 2 Firefox versions, last 2 Edge versions",
|
||||
"corejs": 3,
|
||||
"corejs": "3.21",
|
||||
"useBuiltIns": "usage",
|
||||
"bugfixes": true,
|
||||
"modules": "auto"
|
||||
|
|
5950
package-lock.json
generated
5950
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
@ -3,34 +3,34 @@
|
|||
"version": "0.5.0",
|
||||
"description": "Parse and Render Epubs",
|
||||
"main": "src/index.js",
|
||||
"module": "src/index.js",
|
||||
"browser": "dist/epub.js",
|
||||
"exports": "./src/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"repository": "https://github.com/futurepress/epub.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "",
|
||||
"lint": "eslint -c .eslintrc.js src; exit 0",
|
||||
"start": "rollup -w -c rollup.server.config.js",
|
||||
"build": "rollup -c",
|
||||
"compile": "babel src/ -d lib/",
|
||||
"watch": "babel --watch --optional runtime -d lib/ src/",
|
||||
"prepare": "npm run compile && npm run build"
|
||||
"watch": "rollup -w -c rollup.config.js",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"author": "fchasen@gmail.com",
|
||||
"license": "BSD-2-Clause",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.7",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@babel/core": "^7.17.9",
|
||||
"@rollup/plugin-babel": "^5.3.1",
|
||||
"@rollup/plugin-commonjs": "^21.0.3",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"rollup": "^2.63.0",
|
||||
"rollup": "^2.70.1",
|
||||
"rollup-plugin-license": "^2.6.1",
|
||||
"rollup-plugin-serve": "^1.1.0",
|
||||
"serve": "^13.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xmldom/xmldom": "^0.8.0",
|
||||
"jszip": "^3.7.1",
|
||||
"@xmldom/xmldom": "^0.8.2",
|
||||
"jszip": "^3.9.1",
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ class Epub extends Publication {
|
|||
}
|
||||
|
||||
toJSON() {
|
||||
|
||||
return super.toJSON();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -269,7 +269,7 @@ class PageList {
|
|||
* @return {json}
|
||||
*/
|
||||
toJSON() {
|
||||
return JSON.stringify(this.locations);
|
||||
return this.locations;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ class Locator {
|
|||
name: item.name,
|
||||
parent: undefined,
|
||||
children: new ResourceList()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
get url() {
|
||||
|
@ -89,7 +89,7 @@ class Locator {
|
|||
|
||||
|
||||
toJSON() {
|
||||
return JSON.stringify(this);
|
||||
return this.data;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
|
@ -412,7 +412,7 @@ class Publication {
|
|||
* Generates a JSON output of the publication structure
|
||||
*/
|
||||
toJSON() {
|
||||
return JSON.stringify(this.data);
|
||||
return this.data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -124,7 +124,7 @@ class Resource {
|
|||
|
||||
|
||||
toJSON() {
|
||||
|
||||
return this.data;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
|
@ -188,7 +188,7 @@ class ResourceList extends Map {
|
|||
}
|
||||
|
||||
toJSON() {
|
||||
return JSON.stringify(this.toArray());
|
||||
return this.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
* @param {string} _query The query string to find
|
||||
* @return {object[]} A list of matches, with form {cfi, excerpt}
|
||||
*/
|
||||
find(_query){
|
||||
/*
|
||||
find(_query) {
|
||||
var section = this;
|
||||
var matches = [];
|
||||
var query = _query.toLowerCase();
|
||||
|
@ -54,3 +55,4 @@ find(_query){
|
|||
|
||||
return matches;
|
||||
}
|
||||
*/
|
|
@ -203,10 +203,10 @@ class Sections {
|
|||
}
|
||||
|
||||
toJSON() {
|
||||
return JSON.stringify({
|
||||
return {
|
||||
readingOrder: this.toOrderedArray(),
|
||||
unordered: this.toUnorderedArray()
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue