A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.
MIT License
1.28k
stars
56
forks
source link
Make Freezer usable with strict Content Security Policy #100
This is a small PR to ensure Freezer can be used with a strict Content Security Policy. At present, it cannot, because of a line in utils.js that evals a string: var global = (new Function("return this")());.
I fixed this by replacing the line with the same functionality as used by Browserify:
var global = typeof global !== 'undefined' ?
global :
typeof self !== 'undefined' ?
self :
typeof window !== 'undefined' ?
window :
{};
Hi there,
This is a small PR to ensure Freezer can be used with a strict Content Security Policy. At present, it cannot, because of a line in utils.js that evals a string:
var global = (new Function("return this")());
.I fixed this by replacing the line with the same functionality as used by Browserify:
For background, you can read a detailed discussion of how to get the global Javascript object here: https://www.contentful.com/blog/2017/01/17/the-global-object-in-javascript/
And browserify's use of this approach is here: https://github.com/substack/insert-module-globals/blob/769f4bd08e01b77a620f2e2de1d2249c8311b0a2/index.js#L30
Many thanks for such a beautiful library!
Greg