bv-ui-core
Advanced tools
Comparing version 0.10.0 to 0.10.1
# Changelog | ||
## 0.10.1 | ||
* Check for existence of callback to loadScript/loadStylesheet before attempting to call. | ||
* Always allow 'www' subdomain with any url in domainPolice. | ||
## 0.10.0 | ||
@@ -4,0 +9,0 @@ |
@@ -28,3 +28,3 @@ /** | ||
return host === domain; | ||
return host === domain || host === ("www." + domain); | ||
} | ||
@@ -31,0 +31,0 @@ |
@@ -51,2 +51,4 @@ # domainPolice | ||
Prefixing `.` on the `domain` will allow it to match all subdomains as well. | ||
URL hosts which include `www.` will be allowed with domain name match. | ||
Given the above example, the following domains are all valid: | ||
@@ -59,2 +61,3 @@ | ||
- `no-prefixing-dot.foo.com` | ||
- `www.no-prefixing-dot.foo.com` | ||
@@ -61,0 +64,0 @@ Domains that would not be allowed: |
@@ -135,3 +135,5 @@ /* eslint no-use-before-define: 0 */ | ||
// to reload it, so we'll just call the callback and return. | ||
callback(); | ||
if (typeof callback === 'function') { | ||
callback(); | ||
} | ||
return; | ||
@@ -276,3 +278,5 @@ } | ||
// to reload it, so we'll just call the callback and return. | ||
callback(); | ||
if (typeof callback === 'function') { | ||
callback(); | ||
} | ||
return; | ||
@@ -279,0 +283,0 @@ } |
{ | ||
"name": "bv-ui-core", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"license": "Apache 2.0", | ||
@@ -5,0 +5,0 @@ "description": "Bazaarvoice UI-related JavaScript", |
@@ -43,2 +43,3 @@ ![](https://travis-ci.org/bazaarvoice/bv-ui-core.svg) | ||
- [cookie](./lib/cookie) | ||
- [cssLoadChecker](./lib/cssLoadChecker) | ||
- [date.now](./lib/date.now) | ||
@@ -45,0 +46,0 @@ - [domainPolice](./lib/domainPolice) |
@@ -37,2 +37,8 @@ /** | ||
{ | ||
domain: 'www.no-prefixing-dot.foo.com', | ||
matchedDomain: 'no-prefixing-dot.foo.com', | ||
isValid: true, | ||
thirdPartyCookieEnabled: true | ||
}, | ||
{ | ||
domain: 'foo.com', | ||
@@ -39,0 +45,0 @@ matchedDomain: undefined, |
@@ -150,2 +150,14 @@ /* eslint no-use-before-define: 0 */ | ||
it('doesn\'t try to execute non-existent callback on second load', function () { | ||
expect(function () { | ||
window.BV = window.BV || {} | ||
window.BV.loadedUrls = { | ||
'/base/test/fixtures/lib.loader.loadscript.js': true | ||
} | ||
loader.loadScript('/base/test/fixtures/lib.loader.loadscript.js', { | ||
namespaceName: 'BV', | ||
forceLoad: false | ||
}); | ||
}).to.not.throw(Error); | ||
}); | ||
}); | ||
@@ -492,2 +504,15 @@ | ||
it('doesn\'t try to execute non-existent callback on second load', function () { | ||
expect(function () { | ||
window.BV = window.BV || {} | ||
window.BV.loadedUrls = { | ||
'/base/test/fixtures/lib.loader.loadstylesheet.css': true | ||
} | ||
loader.loadStyleSheet('/base/test/fixtures/lib.loader.loadstylesheet.css', { | ||
namespaceName: 'BV', | ||
forceLoad: false | ||
}); | ||
}).to.not.throw(Error); | ||
}); | ||
/* | ||
@@ -494,0 +519,0 @@ // TODO: Fix this test; it fails, even though the actual functionality |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159964
3669
59
1