Skip to content

Commit

Permalink
修复已知BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed May 9, 2020
1 parent 4d1f0ab commit c7f1f32
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-transform-runtime"
]
}
30 changes: 13 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
/* global hexo */
'use strict';

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

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); } }

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 fs = require('hexo-fs');

var path = require('path');
Expand Down Expand Up @@ -82,11 +78,11 @@ function getBangumiPage(_x, _x2) {
}

function _getBangumiPage() {
_getBangumiPage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(vmid, status) {
_getBangumiPage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(vmid, status) {
var _response$data, _response$data2, _response$data3, _response$data4, _response$data4$data;

var response;
return regeneratorRuntime.wrap(function _callee$(_context) {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
Expand Down Expand Up @@ -149,12 +145,12 @@ function getBangumi(_x3, _x4, _x5) {
}

function _getBangumi() {
_getBangumi = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(vmid, status, pn) {
_getBangumi = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(vmid, status, pn) {
var _response$data5;

var response, $data, _response$data6, data, list, _iterator, _step, _bangumi$areas, _bangumi$areas$, _bangumi$stat, _bangumi$stat2, _bangumi$stat3, _bangumi$rating, bangumi, cover, href;

return regeneratorRuntime.wrap(function _callee2$(_context2) {
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
Expand Down Expand Up @@ -232,9 +228,9 @@ function biliBangumi(_x6, _x7) {
}

function _biliBangumi() {
_biliBangumi = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(vmid, status) {
_biliBangumi = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(vmid, status) {
var page, list, i, data;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
Expand Down Expand Up @@ -263,7 +259,7 @@ function _biliBangumi() {

case 9:
data = _context3.sent;
list.push.apply(list, _toConsumableArray(data));
list.push.apply(list, (0, _toConsumableArray2["default"])(data));

case 11:
i++;
Expand Down Expand Up @@ -292,9 +288,9 @@ function saveBangumiData(_x8) {
}

function _saveBangumiData() {
_saveBangumiData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(vmid) {
_saveBangumiData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(vmid) {
var startTime, wantWatch, watching, watched, endTime, bangumis;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
Expand Down
10 changes: 6 additions & 4 deletions lib/bangumi-generator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'use strict';

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 _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var ejs = require('ejs');

Expand All @@ -18,12 +20,12 @@ var log = require('hexo-log')({
});

module.exports = /*#__PURE__*/function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(locals) {
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(locals) {
var _config$bangumi;

var config, root, wantWatch, watching, watched, _JSON$parse, __, contents;

return regeneratorRuntime.wrap(function _callee$(_context) {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-bilibili-bangumi",
"version": "1.2.0",
"version": "1.2.1",
"description": "hexo bilibili番剧页",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -32,6 +32,7 @@
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"babel-preset-minify": "^0.5.1",
"clean-css-cli": "^4.3.0"
Expand Down

0 comments on commit c7f1f32

Please sign in to comment.