Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
100
node_modules/karma/common/stringify.js
generated
vendored
Normal file
100
node_modules/karma/common/stringify.js
generated
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
var serialize = null
|
||||
try {
|
||||
serialize = require('dom-serialize')
|
||||
} catch (e) {
|
||||
// Ignore failure on IE8
|
||||
}
|
||||
|
||||
var instanceOf = require('./util').instanceOf
|
||||
|
||||
function isNode (obj) {
|
||||
return (obj.tagName || obj.nodeName) && obj.nodeType
|
||||
}
|
||||
|
||||
function stringify (obj, depth) {
|
||||
if (depth === 0) {
|
||||
return '...'
|
||||
}
|
||||
|
||||
if (obj === null) {
|
||||
return 'null'
|
||||
}
|
||||
|
||||
switch (typeof obj) {
|
||||
case 'symbol':
|
||||
return obj.toString()
|
||||
case 'string':
|
||||
return "'" + obj + "'"
|
||||
case 'undefined':
|
||||
return 'undefined'
|
||||
case 'function':
|
||||
try {
|
||||
// function abc(a, b, c) { /* code goes here */ }
|
||||
// -> function abc(a, b, c) { ... }
|
||||
return obj.toString().replace(/\{[\s\S]*\}/, '{ ... }')
|
||||
} catch (err) {
|
||||
if (err instanceof TypeError) {
|
||||
// Support older browsers
|
||||
return 'function ' + (obj.name || '') + '() { ... }'
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
case 'boolean':
|
||||
return obj ? 'true' : 'false'
|
||||
case 'object':
|
||||
var strs = []
|
||||
if (instanceOf(obj, 'Array')) {
|
||||
strs.push('[')
|
||||
for (var i = 0, ii = obj.length; i < ii; i++) {
|
||||
if (i) {
|
||||
strs.push(', ')
|
||||
}
|
||||
strs.push(stringify(obj[i], depth - 1))
|
||||
}
|
||||
strs.push(']')
|
||||
} else if (instanceOf(obj, 'Date')) {
|
||||
return obj.toString()
|
||||
} else if (instanceOf(obj, 'Text')) {
|
||||
return obj.nodeValue
|
||||
} else if (instanceOf(obj, 'Comment')) {
|
||||
return '<!--' + obj.nodeValue + '-->'
|
||||
} else if (obj.outerHTML) {
|
||||
return obj.outerHTML
|
||||
} else if (isNode(obj)) {
|
||||
if (serialize) {
|
||||
return serialize(obj)
|
||||
} else {
|
||||
return 'Skipping stringify, no support for dom-serialize'
|
||||
}
|
||||
} else if (instanceOf(obj, 'Error')) {
|
||||
return obj.toString() + '\n' + obj.stack
|
||||
} else {
|
||||
var constructor = 'Object'
|
||||
if (obj.constructor && typeof obj.constructor === 'function') {
|
||||
constructor = obj.constructor.name
|
||||
}
|
||||
|
||||
strs.push(constructor)
|
||||
strs.push('{')
|
||||
var first = true
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
if (first) {
|
||||
first = false
|
||||
} else {
|
||||
strs.push(', ')
|
||||
}
|
||||
|
||||
strs.push(key + ': ' + stringify(obj[key], depth - 1))
|
||||
}
|
||||
}
|
||||
strs.push('}')
|
||||
}
|
||||
return strs.join('')
|
||||
default:
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = stringify
|
32
node_modules/karma/common/util.js
generated
vendored
Normal file
32
node_modules/karma/common/util.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
exports.instanceOf = function (value, constructorName) {
|
||||
return Object.prototype.toString.apply(value) === '[object ' + constructorName + ']'
|
||||
}
|
||||
|
||||
exports.elm = function (id) {
|
||||
return document.getElementById(id)
|
||||
}
|
||||
|
||||
exports.generateId = function (prefix) {
|
||||
return prefix + Math.floor(Math.random() * 10000)
|
||||
}
|
||||
|
||||
exports.isUndefined = function (value) {
|
||||
return typeof value === 'undefined'
|
||||
}
|
||||
|
||||
exports.isDefined = function (value) {
|
||||
return !exports.isUndefined(value)
|
||||
}
|
||||
|
||||
exports.parseQueryParams = function (locationSearch) {
|
||||
var params = {}
|
||||
var pairs = locationSearch.slice(1).split('&')
|
||||
var keyValue
|
||||
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
keyValue = pairs[i].split('=')
|
||||
params[decodeURIComponent(keyValue[0])] = decodeURIComponent(keyValue[1])
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue