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

61
web/node_modules/prr/.jshintrc generated vendored Normal file
View file

@ -0,0 +1,61 @@
{
"predef": [ ]
, "bitwise": false
, "camelcase": false
, "curly": false
, "eqeqeq": false
, "forin": false
, "immed": false
, "latedef": false
, "newcap": true
, "noarg": true
, "noempty": true
, "nonew": true
, "plusplus": false
, "quotmark": true
, "regexp": false
, "undef": true
, "unused": true
, "strict": false
, "trailing": true
, "maxlen": 120
, "asi": true
, "boss": true
, "debug": true
, "eqnull": true
, "es5": true
, "esnext": true
, "evil": true
, "expr": true
, "funcscope": false
, "globalstrict": false
, "iterator": false
, "lastsemic": true
, "laxbreak": true
, "laxcomma": true
, "loopfunc": true
, "multistr": false
, "onecase": false
, "proto": false
, "regexdash": false
, "scripturl": true
, "smarttabs": false
, "shadow": false
, "sub": true
, "supernew": false
, "validthis": true
, "browser": true
, "couch": false
, "devel": false
, "dojo": false
, "mootools": false
, "node": true
, "nonstandard": true
, "prototypejs": false
, "rhino": false
, "worker": true
, "wsh": false
, "nomen": false
, "onevar": true
, "passfail": false
}

1
web/node_modules/prr/.npmignore generated vendored Normal file
View file

@ -0,0 +1 @@
node_modules

10
web/node_modules/prr/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,10 @@
language: node_js
node_js:
- 0.8
- "0.10"
branches:
only:
- master
notifications:
email:
- rod@vagg.org

11
web/node_modules/prr/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,11 @@
The MIT License (MIT)
=====================
Copyright (c) 2014 Rod Vagg
---------------------------
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.

47
web/node_modules/prr/README.md generated vendored Normal file
View file

@ -0,0 +1,47 @@
# prr [![Build Status](https://secure.travis-ci.org/rvagg/prr.png)](http://travis-ci.org/rvagg/prr)
An sensible alternative to `Object.defineProperty()`. Available in npm and Ender as **prr**.
## Usage
Set the property `'foo'` (`obj.foo`) to have the value `'bar'` with default options (`'enumerable'`, `'configurable'` and `'writable'` are all `false`):
```js
prr(obj, 'foo', 'bar')
```
Adjust the default options:
```js
prr(obj, 'foo', 'bar', { enumerable: true, writable: true })
```
Do the same operation for multiple properties:
```js
prr(obj, { one: 'one', two: 'two' })
// or with options:
prr(obj, { one: 'one', two: 'two' }, { enumerable: true, writable: true })
```
### Simplify!
But obviously, having to write out the full options object makes it nearly as bad as the original `Object.defineProperty()` so we can simplify.
As an alternative method we can use an options string where each character represents a option: `'e'=='enumerable'`, `'c'=='configurable'` and `'w'=='writable'`:
```js
prr(obj, 'foo', 'bar', 'ew') // enumerable and writable but not configurable
// muliple properties:
prr(obj, { one: 'one', two: 'two' }, 'ewc') // configurable too
```
## Where can I use it?
Anywhere! For pre-ES5 environments *prr* will simply fall-back to an `object[property] = value` so you can get close to what you want.
*prr* is Ender-compatible so you can include it in your Ender build and `$.prr(...)` or `var prr = require('prr'); prr(...)`.
## Licence
prr is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

26
web/node_modules/prr/package.json generated vendored Normal file
View file

@ -0,0 +1,26 @@
{
"name": "prr",
"description": "A better Object.defineProperty()",
"version": "1.0.1",
"homepage": "https://github.com/rvagg/prr",
"author": "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
"keywords": [
"property",
"properties",
"defineProperty",
"ender"
],
"main": "./prr.js",
"repository": {
"type": "git",
"url": "https://github.com/rvagg/prr.git"
},
"dependencies": {},
"devDependencies": {
"tap": "*"
},
"scripts": {
"test": "node ./test.js"
},
"license": "MIT"
}

63
web/node_modules/prr/prr.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
/*!
* prr
* (c) 2013 Rod Vagg <rod@vagg.org>
* https://github.com/rvagg/prr
* License: MIT
*/
(function (name, context, definition) {
if (typeof module != 'undefined' && module.exports)
module.exports = definition()
else
context[name] = definition()
})('prr', this, function() {
var setProperty = typeof Object.defineProperty == 'function'
? function (obj, key, options) {
Object.defineProperty(obj, key, options)
return obj
}
: function (obj, key, options) { // < es5
obj[key] = options.value
return obj
}
, makeOptions = function (value, options) {
var oo = typeof options == 'object'
, os = !oo && typeof options == 'string'
, op = function (p) {
return oo
? !!options[p]
: os
? options.indexOf(p[0]) > -1
: false
}
return {
enumerable : op('enumerable')
, configurable : op('configurable')
, writable : op('writable')
, value : value
}
}
, prr = function (obj, key, value, options) {
var k
options = makeOptions(value, options)
if (typeof key == 'object') {
for (k in key) {
if (Object.hasOwnProperty.call(key, k)) {
options.value = key[k]
setProperty(obj, k, options)
}
}
return obj
}
return setProperty(obj, key, options)
}
return prr
})

169
web/node_modules/prr/test.js generated vendored Normal file
View file

@ -0,0 +1,169 @@
const test = require('tap').test
, prr = require('./')
test('test prr(o, key, value) form', function (t) {
t.plan(2)
var o = {}
prr(o, 'foo', 'bar')
t.equal(o.foo, 'bar', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo')
, {
enumerable : false
, configurable : false
, writable : false
, value : 'bar'
}
, 'correct property descriptor'
)
t.end()
})
test('test prr(o, { key: value }) form', function (t) {
t.plan(2)
var o = {}
prr(o, { foo: 'bar' })
t.equal(o.foo, 'bar', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo')
, {
enumerable : false
, configurable : false
, writable : false
, value : 'bar'
}
, 'correct property descriptor'
)
t.end()
})
test('test multiple key:value pairs', function (t) {
var o = { foo: 'bar' }
prr(o, { one: 'ONE', two: 'TWO', obj: { o: 'o' }})
t.deepEqual(o, { foo: 'bar' }, 'properties are not enumerable')
t.equal(o.one, 'ONE', 'correctly set property')
t.equal(o.two, 'TWO', 'correctly set property')
t.deepEqual(o.obj, { o: 'o' }, 'correctly set property')
;[ 'one', 'two', 'obj' ].forEach(function (p) {
t.deepEqual(
Object.getOwnPropertyDescriptor(o, p)
, {
enumerable : false
, configurable : false
, writable : false
, value : p == 'obj' ? { o: 'o' } : p.toUpperCase()
}
, 'correct property descriptor'
)
})
t.end()
})
test('test descriptor options', function (t) {
var o = {}
prr(o, 'foo', 'bar', {
enumerable : true
, configurable : false
})
t.equal(o.foo, 'bar', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo')
, {
enumerable : true
, configurable : false
, writable : false
, value : 'bar'
}
, 'correct property descriptor'
)
prr(o, 'foo2', 'bar2', {
enumerable : true
, configurable : true
, writable : false
})
t.equal(o.foo2, 'bar2', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo2')
, {
enumerable : true
, configurable : true
, writable : false
, value : 'bar2'
}
, 'correct property descriptor'
)
prr(o, 'foo3', 'bar3', {
enumerable : true
, configurable : true
, writable : true
})
t.equal(o.foo3, 'bar3', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo3')
, {
enumerable : true
, configurable : true
, writable : true
, value : 'bar3'
}
, 'correct property descriptor'
)
t.end()
})
test('test descriptor options, string form', function (t) {
var o = {}
prr(o, 'foo', 'bar', 'e')
t.equal(o.foo, 'bar', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo')
, {
enumerable : true
, configurable : false
, writable : false
, value : 'bar'
}
, 'correct property descriptor'
)
prr(o, 'foo2', 'bar2', 'ec')
t.equal(o.foo2, 'bar2', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo2')
, {
enumerable : true
, configurable : true
, writable : false
, value : 'bar2'
}
, 'correct property descriptor'
)
prr(o, 'foo3', 'bar3', 'ecw')
t.equal(o.foo3, 'bar3', 'correct value')
t.deepEqual(
Object.getOwnPropertyDescriptor(o, 'foo3')
, {
enumerable : true
, configurable : true
, writable : true
, value : 'bar3'
}
, 'correct property descriptor'
)
t.end()
})