parent
79e4c4a104
commit
2ca8fa6e66
5 changed files with 16 additions and 7 deletions
12
.eslintrc.js
12
.eslintrc.js
|
|
@ -4,6 +4,9 @@ module.exports = {
|
|||
"commonjs": true,
|
||||
"node": true
|
||||
},
|
||||
"globals": {
|
||||
"Promise": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"accessor-pairs": "error",
|
||||
|
|
@ -67,7 +70,7 @@ module.exports = {
|
|||
"keyword-spacing": "off",
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"windows"
|
||||
"unix"
|
||||
],
|
||||
"lines-around-comment": "error",
|
||||
"max-depth": "off",
|
||||
|
|
@ -134,6 +137,7 @@ module.exports = {
|
|||
"no-process-env": "error",
|
||||
"no-process-exit": "error",
|
||||
"no-proto": "error",
|
||||
"no-redeclare": "off",
|
||||
"no-restricted-globals": "error",
|
||||
"no-restricted-imports": "error",
|
||||
"no-restricted-modules": "error",
|
||||
|
|
@ -161,6 +165,12 @@ module.exports = {
|
|||
"no-unneeded-ternary": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"varsIgnorePattern": "module"
|
||||
}
|
||||
],
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@ coverage
|
|||
node_modules
|
||||
jsconfig.json
|
||||
.vscode
|
||||
npm-debug.log
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ module.exports = function(callback) {
|
|||
var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout
|
||||
return function(synchronous) {
|
||||
var now = new Date().getTime()
|
||||
var diff = now - last
|
||||
if (synchronous === true || last === 0 || now - last >= time) {
|
||||
last = now
|
||||
callback()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ require.$$current = function() {
|
|||
var pathnameEnd = searchIndex > -1 ? searchIndex : hashIndex > -1 ? hashIndex : href.length
|
||||
try {throw new Error} catch (e) {var error = e}
|
||||
var src = error.stack.match(/^(?:(?!^Error|\/module\/module\.js).)*$/m).toString().match(/((?:file|https|http):\/\/.+)(?::\d+){2}/)[1] || href.slice(0, pathnameEnd)
|
||||
var base = href.slice(0, href.lastIndexOf("/", pathnameEnd) + 1)
|
||||
return src.replace(/\.js$/, "")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ module.exports = function($window, Promise) {
|
|||
resolve(data)
|
||||
$window[callbackKey] = undefined
|
||||
}
|
||||
script.onerror = function(e) {
|
||||
script.onerror = function() {
|
||||
script.parentNode.removeChild(script)
|
||||
reject(new Error("JSONP request failed"))
|
||||
$window[callbackKey] = undefined
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue