Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ridi/comic-parser

Package Overview
Dependencies
Maintainers
12
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ridi/comic-parser - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

114

lib/ComicParser.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -8,66 +10,47 @@ value: true

var _parserCore = require("@ridi/parser-core");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _imageSize = _interopRequireDefault(require("image-size"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _path = _interopRequireDefault(require("path"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _stringNaturalCompare = _interopRequireDefault(require("string-natural-compare"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _Book = _interopRequireDefault(require("./model/Book"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _Item = _interopRequireDefault(require("./model/Item"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _ReadContext = _interopRequireDefault(require("./model/ReadContext"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ParseContext = _interopRequireDefault(require("./model/ParseContext"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
var _parserCore = require("@ridi/parser-core");
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
var _imageSize = _interopRequireDefault(require("image-size"));
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
var _path = _interopRequireDefault(require("path"));
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
var _stringNaturalCompare = _interopRequireDefault(require("string-natural-compare"));
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
var _Book = _interopRequireDefault(require("./model/Book"));
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
var _Item = _interopRequireDefault(require("./model/Item"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var _ReadContext = _interopRequireDefault(require("./model/ReadContext"));
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _ParseContext = _interopRequireDefault(require("./model/ParseContext"));
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var ComicParser =
/*#__PURE__*/
function (_Parser) {
_inherits(ComicParser, _Parser);
_createClass(ComicParser, null, [{
(0, _inherits2["default"])(ComicParser, _Parser);
(0, _createClass2["default"])(ComicParser, null, [{
key: "parseDefaultOptions",

@@ -79,3 +62,3 @@

get: function get() {
return _objectSpread({}, _get(_getPrototypeOf(ComicParser), "parseDefaultOptions", this), {
return _objectSpread({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(ComicParser), "parseDefaultOptions", this), {
// File extension to allow when extracting lists.

@@ -94,3 +77,3 @@ ext: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],

get: function get() {
return _objectSpread({}, _get(_getPrototypeOf(ComicParser), "parseOptionTypes", this), {
return _objectSpread({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(ComicParser), "parseOptionTypes", this), {
ext: 'Array',

@@ -107,3 +90,3 @@ parseImageSize: 'Boolean|Number'

get: function get() {
return _objectSpread({}, _get(_getPrototypeOf(ComicParser), "readDefaultOptions", this), {
return _objectSpread({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(ComicParser), "readDefaultOptions", this), {
// If false, reads image into a buffer.

@@ -120,3 +103,3 @@ base64: false

get: function get() {
return _objectSpread({}, _get(_getPrototypeOf(ComicParser), "readOptionTypes", this), {
return _objectSpread({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(ComicParser), "readOptionTypes", this), {
base64: 'Boolean'

@@ -138,3 +121,3 @@ });

function ComicParser(input, cryptoProvider, logLevel) {
_classCallCheck(this, ComicParser);
(0, _classCallCheck2["default"])(this, ComicParser);

@@ -144,3 +127,3 @@ /* istanbul ignore next */

cryptoProvider = (0, _parserCore.isString)(cryptoProvider) ? undefined : cryptoProvider;
return _possibleConstructorReturn(this, _getPrototypeOf(ComicParser).call(this, input, cryptoProvider, {
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(ComicParser).call(this, input, cryptoProvider, {
namespace: 'ComicParser',

@@ -155,3 +138,3 @@ logLevel: logLevel

_createClass(ComicParser, [{
(0, _createClass2["default"])(ComicParser, [{
key: "_getParseContextClass",

@@ -195,3 +178,3 @@ value: function _getParseContextClass() {

value: function _parseTasks() {
return [].concat(_toConsumableArray(_get(_getPrototypeOf(ComicParser.prototype), "_parseTasks", this).call(this)), [{
return [].concat((0, _toConsumableArray2["default"])((0, _get2["default"])((0, _getPrototypeOf2["default"])(ComicParser.prototype), "_parseTasks", this).call(this)), [{
fun: this._parse,

@@ -212,9 +195,9 @@ name: 'parse'

value: function () {
var _parse2 = _asyncToGenerator(
var _parse2 = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(context) {
_regenerator["default"].mark(function _callee2(context) {
var _this = this;
var entries, rawBook, options, items;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {

@@ -238,6 +221,6 @@ switch (_context2.prev = _context2.next) {

/*#__PURE__*/
_asyncToGenerator(
(0, _asyncToGenerator2["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
_regenerator["default"].mark(function _callee() {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {

@@ -298,7 +281,7 @@ switch (_context.prev = _context.next) {

value: function () {
var _parseImageSize2 = _asyncToGenerator(
var _parseImageSize2 = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3(entry, options) {
_regenerator["default"].mark(function _callee3(entry, options) {
var parseImageSize, readOptions, buffer, size;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {

@@ -366,7 +349,7 @@ switch (_context3.prev = _context3.next) {

value: function () {
var _read2 = _asyncToGenerator(
var _read2 = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee5(context) {
_regenerator["default"].mark(function _callee5(context) {
var items, entries, options, results;
return regeneratorRuntime.wrap(function _callee5$(_context5) {
return _regenerator["default"].wrap(function _callee5$(_context5) {
while (1) {

@@ -381,7 +364,7 @@ switch (_context5.prev = _context5.next) {

/*#__PURE__*/
_asyncToGenerator(
(0, _asyncToGenerator2["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee4() {
_regenerator["default"].mark(function _callee4() {
var entry, file;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) {

@@ -391,3 +374,3 @@ switch (_context4.prev = _context4.next) {

entry = entries.find(item.path);
/* istanbul ignore else */
/* istanbul ignore next */

@@ -441,3 +424,2 @@ if (!(!options.force && !(0, _parserCore.isExists)(entry))) {

}]);
return ComicParser;

@@ -444,0 +426,0 @@ }(_parserCore.Parser);

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
Object.defineProperty(exports, "CryptoProvider", {
enumerable: true,
get: function get() {
return _parserCore.CryptoProvider;
}
});
Object.defineProperty(exports, "AesCryptor", {
enumerable: true,
get: function get() {
return _parserCore.AesCryptor;
}
});
Object.defineProperty(exports, "Hash", {
enumerable: true,
get: function get() {
return _parserCore.Hash;
}
});
Object.defineProperty(exports, "Errors", {
enumerable: true,
get: function get() {
return _parserCore.Errors;
}
});
Object.defineProperty(exports, "LogLevel", {
enumerable: true,
get: function get() {
return _parserCore.LogLevel;
}
});
Object.defineProperty(exports, "ComicParser", {
enumerable: true,
get: function get() {
return _ComicParser["default"];
}
});
Object.defineProperty(exports, "ComicBook", {
enumerable: true,
get: function get() {
return _Book["default"];
}
});

@@ -12,16 +55,2 @@ var _parserCore = require("@ridi/parser-core");

var _Book = _interopRequireDefault(require("./model/Book"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = {
ComicParser: _ComicParser["default"],
Errors: _parserCore.Errors,
LogLevel: _parserCore.LogLevel,
CryptoProvider: _parserCore.CryptoProvider,
AesCryptor: _parserCore.AesCryptor,
Hash: _parserCore.Hash,
ComicBook: _Book["default"]
};
exports["default"] = _default;
module.exports = exports.default;
var _Book = _interopRequireDefault(require("./model/Book"));
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -8,12 +10,8 @@ value: true

var _Item = _interopRequireDefault(require("./Item"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _Item = _interopRequireDefault(require("./Item"));
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var Book =

@@ -24,5 +22,3 @@ /*#__PURE__*/

var rawBook = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Book);
(0, _classCallCheck2["default"])(this, Book);
this.items = (rawBook.items || []).map(function (rawObj) {

@@ -34,3 +30,3 @@ return new _Item["default"](rawObj);

_createClass(Book, [{
(0, _createClass2["default"])(Book, [{
key: "toRaw",

@@ -45,3 +41,2 @@ value: function toRaw() {

}]);
return Book;

@@ -48,0 +43,0 @@ }();

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -8,2 +10,8 @@ value: true

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _parserCore = require("@ridi/parser-core");

@@ -13,20 +21,10 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var Item =
/*#__PURE__*/
function () {
_createClass(Item, [{
(0, _createClass2["default"])(Item, [{
key: "mimeType",

@@ -53,5 +51,3 @@ get: function get() {

var freeze = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
_classCallCheck(this, Item);
(0, _classCallCheck2["default"])(this, Item);
this.index = rawObj.index;

@@ -76,3 +72,3 @@ this.path = rawObj.path;

_createClass(Item, [{
(0, _createClass2["default"])(Item, [{
key: "toRaw",

@@ -91,3 +87,2 @@ value: function toRaw() {

}]);
return Item;

@@ -94,0 +89,0 @@ }();

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -8,11 +10,8 @@ value: true

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _Book = _interopRequireDefault(require("./Book"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Context = function Context() {
_classCallCheck(this, Context);
(0, _classCallCheck2["default"])(this, Context);
this.options = undefined;

@@ -19,0 +18,0 @@ this.entries = undefined;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -8,7 +10,6 @@ value: true

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var ReadContext = function ReadContext() {
_classCallCheck(this, ReadContext);
(0, _classCallCheck2["default"])(this, ReadContext);
this.items = undefined;

@@ -15,0 +16,0 @@ this.entries = undefined;

{
"name": "@ridi/comic-parser",
"version": "0.6.5",
"version": "0.6.6",
"description": "Common comic data parser for Ridibooks services",

@@ -21,3 +21,3 @@ "author": {

"dependencies": {
"@ridi/parser-core": "^0.6.5",
"@ridi/parser-core": "^0.6.6",
"fs-extra": "^8.0.0",

@@ -24,0 +24,0 @@ "image-size": "^0.7.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc