@ridi/comic-parser
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -53,4 +53,2 @@ 'use strict'; | ||
var _naturalOrderby = require('natural-orderby'); | ||
var _path = require('path'); | ||
@@ -60,2 +58,6 @@ | ||
var _stringNaturalCompare = require('string-natural-compare'); | ||
var _stringNaturalCompare2 = _interopRequireDefault(_stringNaturalCompare); | ||
var _Book = require('./model/Book'); | ||
@@ -138,2 +140,3 @@ | ||
* @param {?CryptoProvider} cryptoProvider en/decrypto provider | ||
* @param {?string} logLevel logging level | ||
* @throws {Errors.ENOENT} no such file or directory | ||
@@ -146,5 +149,7 @@ * @throws {Errors.EINVAL} invalid input | ||
function ComicParser(input, cryptoProvider) { | ||
function ComicParser(input, cryptoProvider, logLevel) { | ||
(0, _classCallCheck3.default)(this, ComicParser); | ||
return (0, _possibleConstructorReturn3.default)(this, _Parser.call(this, input, cryptoProvider, 'ComicParser')); | ||
logLevel = (0, _parserCore.isString)(cryptoProvider) ? cryptoProvider : logLevel; | ||
return (0, _possibleConstructorReturn3.default)(this, _Parser.call(this, input, cryptoProvider, { namespace: ComicParser.name, logLevel: logLevel })); | ||
} | ||
@@ -216,6 +221,4 @@ | ||
entries = context.entries, rawBook = context.rawBook, options = context.options; | ||
items = (0, _naturalOrderby.orderBy)(entries.map(function (entry) { | ||
return entry; | ||
}), function (entry) { | ||
return entry.entryPath; | ||
items = entries.sort(function (e1, e2) { | ||
return (0, _stringNaturalCompare2.default)(e1.entryPath, e2.entryPath); | ||
}).filter(function (entry) { | ||
@@ -222,0 +225,0 @@ var ext = _path2.default.extname(entry.entryPath); |
{ | ||
"name": "@ridi/comic-parser", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Common comic data parser for Ridibooks services", | ||
@@ -21,7 +21,7 @@ "author": { | ||
"dependencies": { | ||
"@ridi/parser-core": "^0.4.1", | ||
"@ridi/parser-core": "^0.5.0", | ||
"fs-extra": "^7.0.1", | ||
"image-size": "^0.7.1", | ||
"natural-orderby": "1.1.1" | ||
"string-natural-compare": "^2.0.3" | ||
} | ||
} |
@@ -102,3 +102,5 @@ # @ridi/comic-parser | ||
import { LogLevel, ... } from '@ridi/comic-parser'; | ||
parser.logger.logLevel = LogLevel.VERBOSE; // SILENT, ERROR(default), WARNING, INFO, VERBOSE | ||
const parser = new ComicParser(/* path */, /* cryptoProvider */, /* logLevel */) | ||
// or const parser = new ComicParser(/* path */, /* logLevel */) | ||
parser.logger.logLevel = LogLevel.VERBOSE; // SILENT, ERROR, WARN(default), INFO, DEBUG, VERBOSE | ||
``` | ||
@@ -105,0 +107,0 @@ |
24567
455
271
+ Added@ridi/parser-core@0.5.8(transitive)
+ Addedfs-extra@8.1.0(transitive)
+ Addedstring-natural-compare@2.0.3(transitive)
+ Addedunzipper@0.10.14(transitive)
- Removednatural-orderby@1.1.1
- Removed@ridi/parser-core@0.4.1(transitive)
- Removednatural-orderby@1.1.1(transitive)
- Removedunzipper@0.9.15(transitive)
Updated@ridi/parser-core@^0.5.0