0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

12
web/node_modules/vm-browserify/.github/FUNDING.yml generated vendored Normal file
View file

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/vm-browserify
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

8
web/node_modules/vm-browserify/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,8 @@
language: node_js
dist: xenial
node_js:
- "stable"
script:
- xvfb-run --auto-servernum npm test
services:
- xvfb

23
web/node_modules/vm-browserify/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,23 @@
# vm-browserify Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 1.1.2 - 2019-11-04
* Update another jQuery reference in the readme. (https://github.com/browserify/vm-browserify/pull/27)
* Get rid of jQuery references altogether from samples and readme. (https://github.com/browserify/vm-browserify/commit/d509e8e5afb7b1ead191cbbd49c37a3fb934b2dc)
## 1.1.1 - 2019-11-04
* Update a reference to jQuery in an example file that was setting off some security software. (https://github.com/browserify/vm-browserify/pull/22)
## 1.1.0 - 2018-06-15
* Add `vm.isContext(sandbox)`. (https://github.com/browserify/vm-browserify/commit/038c3cb33edcad9eec33aa8a8beae31b15c1a006)
## 1.0.1 - 2018-04-13
* Remove the `component-indexof` dependency. (https://github.com/browserify/vm-browserify/commit/0d9bd4c99f80db12c5c45e260a23ebfc51ec850d)
## 1.0.0 - 2018-03-23
(This is not a breaking change.)
* Make the `sandbox` argument to `runInNewContext` optional, like in Node. (https://github.com/browserify/vm-browserify/pull/13)
* Substituting `component-indexof` for deprecated `indexof`. (https://github.com/browserify/vm-browserify/pull/14)

18
web/node_modules/vm-browserify/LICENSE generated vendored Normal file
View file

@ -0,0 +1,18 @@
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

160
web/node_modules/vm-browserify/example/run/bundle.js generated vendored Normal file
View file

@ -0,0 +1,160 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
var indexOf = function (xs, item) {
if (xs.indexOf) return xs.indexOf(item);
else for (var i = 0; i < xs.length; i++) {
if (xs[i] === item) return i;
}
return -1;
};
var Object_keys = function (obj) {
if (Object.keys) return Object.keys(obj)
else {
var res = [];
for (var key in obj) res.push(key)
return res;
}
};
var forEach = function (xs, fn) {
if (xs.forEach) return xs.forEach(fn)
else for (var i = 0; i < xs.length; i++) {
fn(xs[i], i, xs);
}
};
var defineProp = (function() {
try {
Object.defineProperty({}, '_', {});
return function(obj, name, value) {
Object.defineProperty(obj, name, {
writable: true,
enumerable: false,
configurable: true,
value: value
})
};
} catch(e) {
return function(obj, name, value) {
obj[name] = value;
};
}
}());
var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
function Context() {}
Context.prototype = {};
var Script = exports.Script = function NodeScript (code) {
if (!(this instanceof Script)) return new Script(code);
this.code = code;
};
Script.prototype.runInContext = function (context) {
if (!(context instanceof Context)) {
throw new TypeError("needs a 'context' argument.");
}
var iframe = document.createElement('iframe');
if (!iframe.style) iframe.style = {};
iframe.style.display = 'none';
document.body.appendChild(iframe);
var win = iframe.contentWindow;
var wEval = win.eval, wExecScript = win.execScript;
if (!wEval && wExecScript) {
// win.eval() magically appears when this is called in IE:
wExecScript.call(win, 'null');
wEval = win.eval;
}
forEach(Object_keys(context), function (key) {
win[key] = context[key];
});
forEach(globals, function (key) {
if (context[key]) {
win[key] = context[key];
}
});
var winKeys = Object_keys(win);
var res = wEval.call(win, this.code);
forEach(Object_keys(win), function (key) {
// Avoid copying circular objects like `top` and `window` by only
// updating existing context properties or new properties in the `win`
// that was only introduced after the eval.
if (key in context || indexOf(winKeys, key) === -1) {
context[key] = win[key];
}
});
forEach(globals, function (key) {
if (!(key in context)) {
defineProp(context, key, win[key]);
}
});
document.body.removeChild(iframe);
return res;
};
Script.prototype.runInThisContext = function () {
return eval(this.code); // maybe...
};
Script.prototype.runInNewContext = function (context) {
var ctx = Script.createContext(context);
var res = this.runInContext(ctx);
if (context) {
forEach(Object_keys(ctx), function (key) {
context[key] = ctx[key];
});
}
return res;
};
forEach(Object_keys(Script.prototype), function (name) {
exports[name] = Script[name] = function (code) {
var s = Script(code);
return s[name].apply(s, [].slice.call(arguments, 1));
};
});
exports.isContext = function (context) {
return context instanceof Context;
};
exports.createScript = function (code) {
return exports.Script(code);
};
exports.createContext = Script.createContext = function (context) {
var copy = new Context();
if(typeof context === 'object') {
forEach(Object_keys(context), function (key) {
copy[key] = context[key];
});
}
return copy;
};
},{}],2:[function(require,module,exports){
var vm = require('vm');
window.addEventListener('load', function () {
var res = vm.runInNewContext('a + 5', { a : 100 });
document.querySelector('#res').textContent = res;
});
},{"vm":1}]},{},[2]);

6
web/node_modules/vm-browserify/example/run/entry.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
var vm = require('vm');
window.addEventListener('load', function () {
var res = vm.runInNewContext('a + 5', { a : 100 });
document.querySelector('#res').textContent = res;
});

View file

@ -0,0 +1,8 @@
<html>
<head>
<script src="/bundle.js"></script>
</head>
<body>
result = <span id="res"></span>
</body>
</html>

6
web/node_modules/vm-browserify/example/run/server.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
var ecstatic = require('ecstatic')(__dirname);
var http = require('http');
http.createServer(ecstatic).listen(8000);
console.log('listening on :8000');
console.log('# remember to run browserify entry.js -o bundle.js');

149
web/node_modules/vm-browserify/index.js generated vendored Normal file
View file

@ -0,0 +1,149 @@
var indexOf = function (xs, item) {
if (xs.indexOf) return xs.indexOf(item);
else for (var i = 0; i < xs.length; i++) {
if (xs[i] === item) return i;
}
return -1;
};
var Object_keys = function (obj) {
if (Object.keys) return Object.keys(obj)
else {
var res = [];
for (var key in obj) res.push(key)
return res;
}
};
var forEach = function (xs, fn) {
if (xs.forEach) return xs.forEach(fn)
else for (var i = 0; i < xs.length; i++) {
fn(xs[i], i, xs);
}
};
var defineProp = (function() {
try {
Object.defineProperty({}, '_', {});
return function(obj, name, value) {
Object.defineProperty(obj, name, {
writable: true,
enumerable: false,
configurable: true,
value: value
})
};
} catch(e) {
return function(obj, name, value) {
obj[name] = value;
};
}
}());
var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
function Context() {}
Context.prototype = {};
var Script = exports.Script = function NodeScript (code) {
if (!(this instanceof Script)) return new Script(code);
this.code = code;
};
Script.prototype.runInContext = function (context) {
if (!(context instanceof Context)) {
throw new TypeError("needs a 'context' argument.");
}
var iframe = document.createElement('iframe');
if (!iframe.style) iframe.style = {};
iframe.style.display = 'none';
document.body.appendChild(iframe);
var win = iframe.contentWindow;
var wEval = win.eval, wExecScript = win.execScript;
if (!wEval && wExecScript) {
// win.eval() magically appears when this is called in IE:
wExecScript.call(win, 'null');
wEval = win.eval;
}
forEach(Object_keys(context), function (key) {
win[key] = context[key];
});
forEach(globals, function (key) {
if (context[key]) {
win[key] = context[key];
}
});
var winKeys = Object_keys(win);
var res = wEval.call(win, this.code);
forEach(Object_keys(win), function (key) {
// Avoid copying circular objects like `top` and `window` by only
// updating existing context properties or new properties in the `win`
// that was only introduced after the eval.
if (key in context || indexOf(winKeys, key) === -1) {
context[key] = win[key];
}
});
forEach(globals, function (key) {
if (!(key in context)) {
defineProp(context, key, win[key]);
}
});
document.body.removeChild(iframe);
return res;
};
Script.prototype.runInThisContext = function () {
return eval(this.code); // maybe...
};
Script.prototype.runInNewContext = function (context) {
var ctx = Script.createContext(context);
var res = this.runInContext(ctx);
if (context) {
forEach(Object_keys(ctx), function (key) {
context[key] = ctx[key];
});
}
return res;
};
forEach(Object_keys(Script.prototype), function (name) {
exports[name] = Script[name] = function (code) {
var s = Script(code);
return s[name].apply(s, [].slice.call(arguments, 1));
};
});
exports.isContext = function (context) {
return context instanceof Context;
};
exports.createScript = function (code) {
return exports.Script(code);
};
exports.createContext = Script.createContext = function (context) {
var copy = new Context();
if(typeof context === 'object') {
forEach(Object_keys(context), function (key) {
copy[key] = context[key];
});
}
return copy;
};

30
web/node_modules/vm-browserify/package.json generated vendored Normal file
View file

@ -0,0 +1,30 @@
{
"name": "vm-browserify",
"version": "1.1.2",
"description": "vm module for the browser",
"main": "index.js",
"repository": {
"type": "git",
"url": "http://github.com/substack/vm-browserify.git"
},
"keywords": [
"vm",
"browser",
"eval"
],
"dependencies": {},
"devDependencies": {
"browserify": "^16.1.1",
"tape": "^4.11.0",
"tape-run": "^6.0.1"
},
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"scripts": {
"test": "browserify test/vm.js | tape-run"
},
"license": "MIT"
}

66
web/node_modules/vm-browserify/readme.markdown generated vendored Normal file
View file

@ -0,0 +1,66 @@
# vm-browserify
emulate node's vm module for the browser
[![Build Status](https://travis-ci.org/browserify/vm-browserify.svg?branch=master)](https://travis-ci.org/browserify/vm-browserify)
# example
Just write some client-side javascript:
``` js
var vm = require('vm');
window.addEventListener('load', function () {
var res = vm.runInNewContext('a + 5', { a : 100 });
document.querySelector('#res').textContent = res;
});
```
compile it with [browserify](http://github.com/substack/node-browserify):
```
browserify entry.js -o bundle.js
```
then whip up some html:
``` html
<html>
<head>
<script src="/bundle.js"></script>
</head>
<body>
result = <span id="res"></span>
</body>
</html>
```
and when you load the page you should see:
```
result = 105
```
# methods
## vm.runInNewContext(code, context={})
Evaluate some `code` in a new iframe with a `context`.
Contexts are like wrapping your code in a `with()` except slightly less terrible
because the code is sandboxed into a new iframe.
# install
This module is depended upon by browserify, so you should just be able to
`require('vm')` and it will just work. However if you want to use this module
directly you can install it with [npm](http://npmjs.org):
```
npm install vm-browserify
```
# license
MIT

10
web/node_modules/vm-browserify/security.md generated vendored Normal file
View file

@ -0,0 +1,10 @@
# Security Policy
## Supported Versions
Only the latest major version is supported at any given time.
## Reporting a Vulnerability
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

35
web/node_modules/vm-browserify/test/vm.js generated vendored Normal file
View file

@ -0,0 +1,35 @@
var test = require('tape');
var vm = require('../');
test('vmRunInNewContext', function (t) {
t.plan(6);
t.equal(vm.runInNewContext('a + 5', { a : 100 }), 105);
(function () {
var vars = { x : 10 };
t.equal(vm.runInNewContext('x++', vars), 10);
t.equal(vars.x, 11);
})();
(function () {
var vars = { x : 10 };
t.equal(vm.runInNewContext('var y = 3; y + x++', vars), 13);
t.equal(vars.x, 11);
t.equal(vars.y, 3);
})();
t.end();
});
test('vmRunInContext', function (t) {
t.plan(2);
var context = vm.createContext({ foo: 1 });
vm.runInContext('var x = 1', context);
t.deepEqual(context, { foo: 1, x: 1 });
vm.runInContext('var y = 1', context);
t.deepEqual(context, { foo: 1, x: 1, y: 1 });
});