Add m.censor, adjust m.route.Link to use it (#2538)

Also, restructure a few things for better code reuse.
This commit is contained in:
Isiah Meadows 2019-09-30 18:44:39 -04:00 committed by GitHub
parent 3fa1630f91
commit 34f4363357
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 488 additions and 55 deletions

View file

@ -1,6 +1,7 @@
"use strict"
var buildPathname = require("../pathname/build")
var hasOwn = require("../util/hasOwn")
module.exports = function($window, Promise, oncompletion) {
var callbackCount = 0
@ -66,7 +67,7 @@ module.exports = function($window, Promise, oncompletion) {
function hasHeader(args, name) {
for (var key in args.headers) {
if ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true
if (hasOwn.call(args.headers, key) && name.test(key)) return true
}
return false
}
@ -100,7 +101,7 @@ module.exports = function($window, Promise, oncompletion) {
xhr.responseType = responseType
for (var key in args.headers) {
if ({}.hasOwnProperty.call(args.headers, key)) {
if (hasOwn.call(args.headers, key)) {
xhr.setRequestHeader(key, args.headers[key])
}
}