We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbdb255 commit b1fd6bbCopy full SHA for b1fd6bb
common/question/getJSCode.js
@@ -28,8 +28,9 @@ const document = window.document
28
const code = document.querySelector('#code')
29
30
fetch("https://leetcode.cn/graphql/", getCodeDetailJson(todayQuestionEnName)).then((res => res.json())).then(res => {
31
- questionCodeDetail = res.data.question.envInfo;
32
- code.innerHTML = JSON.stringify(questionCodeDetail, null, 2)
+ const questionCodeDetail = res.data.question.codeSnippets.filter(item => item.lang === "JavaScript");
+ const jsCode = questionCodeDetail[0].code
33
+ code.innerHTML = JSON.stringify(jsCode, null, 2)
34
fs.writeFileSync('./index.html', root.serialize())
35
open('./index.html')
36
})
index.html
0 commit comments