mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 05:34:21 +08:00
No changes in the changelog (https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) to concern ourselves about, but one useful change is they upgraded the log4js dependency which was spitting out console messages on each test run. This is fixed with this version of Karma. Bug: none Change-Id: Ic49618cbda7a079cacb9813f5129692a83508a92 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3745621 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
33 lines
791 B
JavaScript
33 lines
791 B
JavaScript
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
|
|
}
|