This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
class ChainItem { | |
static BEGINNING = 0; | |
static MIDDLE = 1; | |
static END = 2; | |
before = Object.create(null); | |
after = Object.create(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Promise(function (resolve) { | |
const iframe = document.createElement('iframe'); | |
window.document.head.append(iframe); | |
const pd = Object.getOwnPropertyDescriptor(iframe.contentWindow, 'localStorage'); | |
Object.defineProperty(window, 'localStorage', pd); | |
iframe.remove(); | |
if (window.localStorage.__token) { | |
resolve(window.localStorage.__token); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function I(username, ups, isSubmission) { | |
const obj = { | |
submissions: { | |
count: +!!isSubmission, | |
karma: isSubmission ? ups : 0 | |
}, | |
comments: { | |
count: +!isSubmission, | |
karma: !isSubmission ? ups : 0 | |
}, |