Skip to content

Commit

Permalink
fix big number mistake and fuck js and close #59
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Apr 27, 2018
1 parent 84794f6 commit ba4cd24
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"crypto": "1.0.1",
"eslint": "4.19.1",
"form-data": "^2.3.2",
"json-bigint": "0.2.3",
"koa": "2.5.0",
"koa-redis-cache": "3.0.0",
"koa-router": "7.4.0",
Expand Down
3 changes: 2 additions & 1 deletion routes/bilibili/dynamic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const axios = require('axios');
const art = require('art-template');
const path = require('path');
const JSONbig = require('json-bigint');
const config = require('../../config');

module.exports = async (ctx) => {
Expand All @@ -22,7 +23,7 @@ module.exports = async (ctx) => {
description: `${data[0].desc.user_profile.info.uname} 的 bilibili 动态`,
lastBuildDate: new Date().toUTCString(),
item: data.map((item) => {
const parsed = JSON.parse(item.card);
const parsed = JSONbig.parse(item.card);
const data = parsed.item || parsed;

// img
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"

bignumber.js@^4.0.0:
version "4.1.0"
resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1"

boolbase@~1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
Expand Down Expand Up @@ -844,6 +848,12 @@ js-yaml@^3.9.1:
argparse "^1.0.7"
esprima "^4.0.0"

json-bigint@0.2.3:
version "0.2.3"
resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-0.2.3.tgz#118d7f6ff1d38659f19f94cf73e64a75a3f988a8"
dependencies:
bignumber.js "^4.0.0"

json-schema-traverse@^0.3.0:
version "0.3.1"
resolved "http://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
Expand Down

0 comments on commit ba4cd24

Please sign in to comment.