progress on migrating to heex templates and font-icons

This commit is contained in:
Adam Piontek 2022-08-13 07:32:36 -04:00
parent d43daafdb7
commit 3eff955672
21793 changed files with 2161968 additions and 16895 deletions

View file

@ -0,0 +1,13 @@
root = true
[*]
indent_style = tab;
insert_final_newline = true;
quote_type = auto;
space_after_anonymous_functions = true;
space_after_control_statements = true;
spaces_around_operators = true;
trim_trailing_whitespace = true;
spaces_in_brackets = false;
end_of_line = lf;

View file

@ -0,0 +1 @@
coverage/

View file

@ -0,0 +1,20 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": [2, { "min": 1, "max": 30 }],
"new-cap": [2, { "capIsNewExceptions": ["CreateDataProperty", "IsCallable", "RequireObjectCoercible", "ToObject"] }]
},
"overrides": [
{
"files": "test/**",
"rules": {
"max-lines-per-function": 0,
"no-invalid-this": 1
},
},
],
}

View file

@ -0,0 +1,13 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"test"
]
}

View file

@ -0,0 +1,88 @@
2.1.2 / 2021-02-20
=================
* [Deps] update `call-bind`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `functions-have-names`, `has-strict-mode`, `tape`
* [meta] do not publish github action workflow files
* [meta] gitignore coverage output
* [actions] update workflows
2.1.1 / 2020-11-26
=================
* [Fix] do not mutate the native function when present
* [Deps] update `es-abstract`; use `call-bind` where applicable
* [meta] remove unused Makefile and associated utilities
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `functions-have-names`; add `aud`
* [actions] add Require Allow Edits workflow
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
* [Tests] migrate tests to Github Actions
* [Tests] run `nyc` on all tests
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
* [Tests] only audit prod deps
2.1.0 / 2019-12-12
=================
* [New] add auto entry point
* [Refactor] use split-up `es-abstract` (78% bundle size decrease)
* [readme] fix repo URLs, remove testling
* [Docs] Fix formatting in the README (#30)
* [Deps] update `define-properties`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `covert`, `replace`, `semver`, `tape`, `@es-shims/api`; add `safe-publish-latest`
* [meta] add `funding` field
* [meta] Only apps should have lockfiles.
* [Tests] use shared travis-ci configs
* [Tests] use `functions-have-names`
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
* [Tests] remove `jscs`
* [actions] add automatic rebasing / merge commit blocking
2.0.3 / 2016-07-26
=================
* [Fix] Update implementation to not return `undefined` descriptors
* [Deps] update `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `jscs`, `nsp`, `tape`, `semver`
* [Dev Deps] remove unused eccheck script + dep
* [Tests] up to `node` `v6.3`, `v5.12`, `v4.4`
* [Tests] use pretest/posttest for linting/security
* Update to stage 4
2.0.2 / 2016-01-27
=================
* [Fix] ensure that `Object.getOwnPropertyDescriptors` does not fail when `Object.prototype` has a poisoned setter (#1, #2)
2.0.1 / 2016-01-27
=================
* [Deps] move `@es-shims/api` to dev deps
2.0.0 / 2016-01-27
=================
* [Breaking] implement the es-shims API
* [Deps] update `define-properties`, `es-abstract`
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`
* [Tests] fix npm upgrades in older nodes
* [Tests] up to `node` `v5.5`
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
1.0.4 / 2015-07-20
=================
* [Tests] Test on `io.js` `v2.4`
* [Deps, Dev Deps] Update `define-properties`, `tape`, `eslint`, `semver`
1.0.3 / 2015-06-28
=================
* Increase robustness by caching `Array#{concat, reduce}`
* [Deps] Update `define_properties`
* [Dev Deps] Update `eslint`, `semver`, `nsp`
* [Tests] Test up to `io.js` `v2.3`
1.0.2 / 2015-05-23
=================
* Update `es-abstract`, `tape`, `eslint`, `jscs`, `semver`, `covert`
* Test up to `io.js` `v2.0`
1.0.1 / 2015-03-20
=================
* Update `es-abstract`, `editorconfig-tools`, `nsp`, `eslint`, `semver`, `replace`
1.0.0 / 2015-02-17
=================
* v1.0.0

View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Jordan Harband
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.

View file

@ -0,0 +1,95 @@
# Object.getOwnPropertyDescriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.
Invoke its "shim" method to shim `Object.getOwnPropertyDescriptors` if it is unavailable, and if `Object.getOwnPropertyDescriptor` is available.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://github.com/tc39/ecma262/pull/582).
## Example
```js
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
var obj = { normal: Infinity };
var enumDescriptor = {
enumerable: false,
writable: false,
configurable: true,
value: true
};
var writableDescriptor = {
enumerable: true,
writable: true,
configurable: true,
value: 42
};
var symbol = Symbol();
var symDescriptor = {
enumerable: true,
writable: true,
configurable: false,
value: [symbol]
};
Object.defineProperty(obj, 'enumerable', enumDescriptor);
Object.defineProperty(obj, 'writable', writableDescriptor);
Object.defineProperty(obj, 'symbol', symDescriptor);
var descriptors = getDescriptors(obj);
assert.deepEqual(descriptors, {
normal: {
enumerable: true,
writable: true,
configurable: true,
value: Infinity
},
enumerable: enumDescriptor,
writable: writableDescriptor,
symbol: symDescriptor
});
```
```js
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is not present */
delete Object.getOwnPropertyDescriptors;
var shimmedDescriptors = getDescriptors.shim();
assert.equal(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
```
```js
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is present */
var shimmedDescriptors = getDescriptors.shim();
assert.notEqual(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/object.getownpropertydescriptors
[npm-version-svg]: http://versionbadg.es/es-shims/object.getownpropertydescriptors.svg
[travis-svg]: https://travis-ci.org/es-shims/Object.getOwnPropertyDescriptors.svg
[travis-url]: https://travis-ci.org/es-shims/Object.getOwnPropertyDescriptors
[deps-svg]: https://david-dm.org/es-shims/object.getownpropertydescriptors.svg
[deps-url]: https://david-dm.org/es-shims/object.getownpropertydescriptors
[dev-deps-svg]: https://david-dm.org/es-shims/object.getownpropertydescriptors/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/object.getownpropertydescriptors#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object.getownpropertydescriptors.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/object.getownpropertydescriptors.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/object.getownpropertydescriptors.svg
[downloads-url]: http://npm-stat.com/charts.html?package=object.getownpropertydescriptors

View file

@ -0,0 +1,3 @@
'use strict';
require('./shim')();

View file

@ -0,0 +1,38 @@
'use strict';
var CreateDataProperty = require('es-abstract/2020/CreateDataProperty');
var IsCallable = require('es-abstract/2020/IsCallable');
var RequireObjectCoercible = require('es-abstract/2020/RequireObjectCoercible');
var ToObject = require('es-abstract/2020/ToObject');
var callBound = require('call-bind/callBound');
var $gOPD = Object.getOwnPropertyDescriptor;
var $getOwnNames = Object.getOwnPropertyNames;
var $getSymbols = Object.getOwnPropertySymbols;
var $concat = callBound('Array.prototype.concat');
var $reduce = callBound('Array.prototype.reduce');
var getAll = $getSymbols ? function (obj) {
return $concat($getOwnNames(obj), $getSymbols(obj));
} : $getOwnNames;
var isES5 = IsCallable($gOPD) && IsCallable($getOwnNames);
module.exports = function getOwnPropertyDescriptors(value) {
RequireObjectCoercible(value);
if (!isES5) {
throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
}
var O = ToObject(value);
return $reduce(
getAll(O),
function (acc, key) {
var descriptor = $gOPD(O, key);
if (typeof descriptor !== 'undefined') {
CreateDataProperty(acc, key, descriptor);
}
return acc;
},
{}
);
};

View file

@ -0,0 +1,18 @@
'use strict';
var define = require('define-properties');
var callBind = require('call-bind');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var bound = callBind(getPolyfill(), Object);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;

View file

@ -0,0 +1,75 @@
{
"name": "object.getownpropertydescriptors",
"version": "2.1.2",
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"description": "ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.",
"license": "MIT",
"main": "index.js",
"scripts": {
"prepublish": "safe-publish-latest",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"posttest": "npx aud --production",
"tests-only": "nyc tape 'test/**/*.js'",
"lint": "eslint .",
"postlint": "es-shim-api --bound"
},
"repository": {
"type": "git",
"url": "git://github.com/es-shims/object.getownpropertydescriptors.git"
},
"keywords": [
"Object.getOwnPropertyDescriptors",
"descriptor",
"property descriptor",
"ES8",
"ES2017",
"shim",
"polyfill",
"getOwnPropertyDescriptor",
"es-shim API"
],
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.2"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^17.5.1",
"aud": "^1.1.4",
"eslint": "^7.20.0",
"functions-have-names": "^1.2.2",
"has-strict-mode": "^1.0.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"tape": "^5.2.0"
},
"testling": {
"files": [
"test/index.js",
"test/shimmed.js"
],
"browsers": [
"iexplore/9.0..latest",
"firefox/4.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/5.0..10.0",
"chrome/20.0..latest",
"chrome/canary",
"opera/12.0..latest",
"opera/next",
"safari/5.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"engines": {
"node": ">= 0.8"
}
}

View file

@ -0,0 +1,7 @@
'use strict';
var implementation = require('./implementation');
module.exports = function getPolyfill() {
return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation;
};

View file

@ -0,0 +1,14 @@
'use strict';
var getPolyfill = require('./polyfill');
var define = require('define-properties');
module.exports = function shimGetOwnPropertyDescriptors() {
var polyfill = getPolyfill();
define(
Object,
{ getOwnPropertyDescriptors: polyfill },
{ getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } }
);
return polyfill;
};

View file

@ -0,0 +1,20 @@
'use strict';
var implementation = require('../implementation');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(implementation, Object), t);
t.end();
});

View file

@ -0,0 +1,17 @@
'use strict';
var getDescriptors = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad object/this value', function (st) {
st['throws'](function () { return getDescriptors(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return getDescriptors(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(getDescriptors, t);
t.end();
});

View file

@ -0,0 +1,36 @@
'use strict';
require('../auto');
var getDescriptors = require('../');
var test = require('tape');
var defineProperties = require('define-properties');
var runTests = require('./tests');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
test('shimmed', function (t) {
t.equal(Object.getOwnPropertyDescriptors.length, 1, 'Object.getOwnPropertyDescriptors has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.getOwnPropertyDescriptors.name, 'getOwnPropertyDescriptors', 'Object.getOwnPropertyDescriptors has name "getOwnPropertyDescriptors"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'getOwnPropertyDescriptors'), 'Object.getOwnPropertyDescriptors is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad object/this value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return getDescriptors(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return getDescriptors(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
runTests(Object.getOwnPropertyDescriptors, t);
t.end();
});

View file

@ -0,0 +1,122 @@
'use strict';
module.exports = function (getDescriptors, t) {
var enumDescriptor = {
configurable: true,
enumerable: false,
value: true,
writable: false
};
var writableDescriptor = {
configurable: true,
enumerable: true,
value: 42,
writable: true
};
t.test('works with Object.prototype poisoned setter', { skip: !Object.defineProperty }, function (st) {
var key = 'foo';
var obj = {};
obj[key] = 42;
var expected = {};
expected[key] = {
configurable: true,
enumerable: true,
value: 42,
writable: true
};
/* eslint-disable no-extend-native, accessor-pairs */
Object.defineProperty(Object.prototype, key, { configurable: true, set: function (v) { throw new Error(v); } });
/* eslint-enable no-extend-native, accessor-pairs */
var hasOwnNamesBug = false;
try {
Object.getOwnPropertyNames(obj);
} catch (e) {
// v8 in node 0.6 - 0.12 has a bug :-(
hasOwnNamesBug = true;
st.comment('SKIP: this engine has a bug with Object.getOwnPropertyNames: it can not handle a throwing setter on Object.prototype.');
}
if (!hasOwnNamesBug) {
st.doesNotThrow(function () {
var result = getDescriptors(obj);
st.deepEqual(result, expected, 'got expected descriptors');
});
}
delete Object.prototype[key];
st.end();
});
t.test('gets all expected non-Symbol descriptors', function (st) {
var obj = { normal: Infinity };
Object.defineProperty(obj, 'enumerable', enumDescriptor);
Object.defineProperty(obj, 'writable', writableDescriptor);
var descriptors = getDescriptors(obj);
st.deepEqual(descriptors, {
enumerable: enumDescriptor,
normal: {
configurable: true,
enumerable: true,
value: Infinity,
writable: true
},
writable: writableDescriptor
});
st.end();
});
var supportsSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
t.test('gets Symbol descriptors too', { skip: !supportsSymbols }, function (st) {
var symbol = Symbol('sym');
var symDescriptor = {
configurable: false,
enumerable: true,
value: [symbol],
writable: true
};
var obj = { normal: Infinity };
Object.defineProperty(obj, 'enumerable', enumDescriptor);
Object.defineProperty(obj, 'writable', writableDescriptor);
Object.defineProperty(obj, 'symbol', symDescriptor);
var descriptors = getDescriptors(obj);
st.deepEqual(descriptors, {
enumerable: enumDescriptor,
normal: {
configurable: true,
enumerable: true,
value: Infinity,
writable: true
},
symbol: symDescriptor,
writable: writableDescriptor
});
st.end();
});
/* global Proxy */
var supportsProxy = typeof Proxy === 'function';
t.test('Proxies that return an undefined descriptor', { skip: !supportsProxy }, function (st) {
var obj = { foo: true };
var fooDescriptor = Object.getOwnPropertyDescriptor(obj, 'foo');
var proxy = new Proxy(obj, {
getOwnPropertyDescriptor: function (target, key) {
return Object.getOwnPropertyDescriptor(target, key);
},
ownKeys: function () {
return ['foo', 'bar'];
}
});
st.deepEqual(getDescriptors(proxy), { foo: fooDescriptor }, 'object has no descriptors');
st.end();
});
};