Save current BZZZ config-ui state before CHORUS branding update

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-19 00:19:00 +10:00
parent 6a6a49b7b1
commit c177363a19
16410 changed files with 1789161 additions and 230 deletions

View File

@@ -0,0 +1,37 @@
{
"root": true,
"extends": "@ljharb",
"env": {
"es6": true,
"es2017": true,
"es2020": true,
"es2021": true,
"es2022": true,
},
"rules": {
"array-bracket-newline": 0,
"complexity": 0,
"eqeqeq": [2, "allow-null"],
"func-name-matching": 0,
"id-length": 0,
"max-lines-per-function": [2, 80],
"max-params": [2, 4],
"max-statements": 0,
"max-statements-per-line": [2, { "max": 2 }],
"multiline-comment-style": 0,
"no-magic-numbers": 0,
"sort-keys": 0,
},
"overrides": [
{
"files": "test/**",
"rules": {
"new-cap": 0,
},
},
],
}

View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
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/es-shim-unscopables
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']

View File

@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}

View File

@@ -0,0 +1,35 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v1.1.0](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.2...v1.1.0)
> 11 February 2025
- [New] add types [`2b94d6d`](https://github.com/ljharb/es-shim-unscopables/commit/2b94d6da58c272944de33f7e5b601a56dbb025fe)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `for-each`, `npmignore`, `object-inspect`, `tape` [`bc42bcf`](https://github.com/ljharb/es-shim-unscopables/commit/bc42bcf1901ad9c3e6427c8f39d1ac22e7e98310)
- [meta] add missing `engines.node` [`9ffcc49`](https://github.com/ljharb/es-shim-unscopables/commit/9ffcc491132ae0f7681694630910e1c4eb2cd548)
#### [v1.0.2](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.1...v1.0.2)
> 20 October 2023
- [Deps] remove unused `has` [`f9fc3ba`](https://github.com/ljharb/es-shim-unscopables/commit/f9fc3bad9a291450ef1d1470347d0faffc937e14)
#### [v1.0.1](https://github.com/ljharb/es-shim-unscopables/compare/v1.0.0...v1.0.1)
> 20 October 2023
- [meta] use `npmignore` to autogenerate an npmignore file [`4f29eb9`](https://github.com/ljharb/es-shim-unscopables/commit/4f29eb9cfa28cbc08519446027accf8f7e3c472e)
- [Refactor] use `hasown` instead of `has` [`9d2577b`](https://github.com/ljharb/es-shim-unscopables/commit/9d2577b8bf6354d68111a8c20f020303370ef85f)
- [actions] update checkout action [`4525257`](https://github.com/ljharb/es-shim-unscopables/commit/45252572bf21dc5aab948c99ae0397e90f357718)
#### v1.0.0
> 11 April 2022
- Initial implementation, tests [`0313267`](https://github.com/ljharb/es-shim-unscopables/commit/03132672560a06df8a36685c1688793d445ea034)
- Initial commit [`5a68e27`](https://github.com/ljharb/es-shim-unscopables/commit/5a68e27e8f11d8b453c00e9239b35ec8795c850e)
- [meta] do not publish workflow files [`4e29785`](https://github.com/ljharb/es-shim-unscopables/commit/4e2978541c25ce590589d5f23f311af6ca3618a7)

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 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,57 @@
# es-shim-unscopables <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-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]
Helper package to shim a method into `Array.prototype[Symbol.unscopables]`
## Example
```js
const assert = require('assert');
const shimUnscopables = require('es-shim-unscopables');
let copyWithin;
let concat;
with ([]) {
assert.equal(concat, Array.prototype.concat);
assert.notEqual(copyWithin, Array.prototype.copyWithin);
}
shimUnscopables('concat');
with ([]) {
assert.notEqual(concat, Array.prototype.concat);
assert.notEqual(copyWithin, Array.prototype.copyWithin);
}
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
## Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
[package-url]: https://npmjs.org/package/es-shim-unscopables
[npm-version-svg]: https://versionbadg.es/ljharb/es-shim-unscopables.svg
[deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables.svg
[deps-url]: https://david-dm.org/ljharb/es-shim-unscopables
[dev-deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-shim-unscopables#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-shim-unscopables.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-shim-unscopables.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-shim-unscopables.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-shim-unscopables
[codecov-image]: https://codecov.io/gh/ljharb/es-shim-unscopables/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/es-shim-unscopables/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-shim-unscopables
[actions-url]: https://github.com/ljharb/es-shim-unscopables/actions

View File

@@ -0,0 +1,8 @@
type Unscopableable = string & {
[K in keyof typeof Array.prototype]:
typeof Array.prototype[K] extends Function ? K : never
}[keyof typeof Array.prototype];
declare function shimUnscopables(method: Unscopableable): void;
export = shimUnscopables;

View File

@@ -0,0 +1,22 @@
'use strict';
var hasOwn = require('hasown');
var hasUnscopables = typeof Symbol === 'function' && typeof Symbol.unscopables === 'symbol';
var map = hasUnscopables && Array.prototype[Symbol.unscopables];
var $TypeError = TypeError;
/** @type {import('.')} */
module.exports = function shimUnscopables(method) {
if (typeof method !== 'string' || !method) {
throw new $TypeError('method must be a non-empty string');
}
if (!hasOwn(Array.prototype, method)) {
throw new $TypeError('method must be on Array.prototype');
}
if (hasUnscopables && map) {
map[method] = true;
}
};

View File

@@ -0,0 +1,65 @@
{
"name": "es-shim-unscopables",
"version": "1.1.0",
"description": "Helper package to shim a method into `Array.prototype[Symbol.unscopables]`",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint-disabled": "evalmd README.md",
"lint": "eslint --ext=.js,.mjs .",
"postlint": "tsc && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@\">= 10.2\" audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/es-shim-unscopables.git"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/es-shim-unscopables/issues"
},
"homepage": "https://github.com/ljharb/es-shim-unscopables#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.3",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.3",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"es-value-fixtures": "^1.7.1",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.5",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.13.4",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "^5.8.0-dev.20250211"
},
"dependencies": {
"hasown": "^2.0.2"
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}

View File

@@ -0,0 +1,70 @@
'use strict';
var test = require('tape');
var inspect = require('object-inspect');
var v = require('es-value-fixtures');
var forEach = require('for-each');
var hasOwn = require('hasown');
var shimUnscopables = require('../');
/** @type {(a: symbol, b: symbol) => number} */
var sortSymbols = function (a, b) {
return inspect(a).localeCompare(inspect(b));
};
test('shimUnscopables', function (t) {
t.equal(typeof shimUnscopables, 'function', 'is a function');
forEach(v.nonStrings, function (notNonEmptyString) {
t['throws'](
// @ts-expect-error
function () { shimUnscopables(notNonEmptyString); },
TypeError,
inspect(notNonEmptyString) + ' is not a non-empty String'
);
});
t['throws'](
// @ts-expect-error
function () { shimUnscopables('x'); },
TypeError,
inspect('x') + ' is not on Array.prototype'
);
t.test('no symbols', { skip: typeof Symbol === 'function' }, function (st) {
st.doesNotThrow(function () { shimUnscopables('forEach'); });
st.end();
});
t.test('symbols, no unscopables', { skip: typeof Symbol !== 'function' || !!Symbol.unscopables }, function (st) {
st.deepEqual(Object.getOwnPropertySymbols(Array.prototype), [Symbol.iterator]);
shimUnscopables('forEach');
st.deepEqual(Object.getOwnPropertySymbols(Array.prototype), [Symbol.iterator]);
st.end();
});
t.test('Symbol.unscopables', { skip: typeof Symbol !== 'function' || !Symbol.unscopables }, function (st) {
st.deepEqual(
Object.getOwnPropertySymbols(Array.prototype).sort(sortSymbols),
[Symbol.iterator, Symbol.unscopables]
);
st.notOk(hasOwn(Array.prototype[Symbol.unscopables], 'forEach'), 'unscopables map lacks forEach');
shimUnscopables('forEach');
st.deepEqual(
Object.getOwnPropertySymbols(Array.prototype).sort(sortSymbols),
[Symbol.iterator, Symbol.unscopables]
);
st.equal(Array.prototype[Symbol.unscopables].forEach, true, 'unscopables map has forEach');
st.end();
});
t.end();
});

View File

@@ -0,0 +1,43 @@
/* eslint no-restricted-syntax: 0, no-with: 0, strict: 0 */
var test = require('tape');
var shimUnscopables = require('../');
test('`with` statement', { skip: typeof Symbol !== 'function' || !Symbol.unscopables }, function (t) {
// @ts-expect-error this variable is declared in case unscopables doesn't work
var entries;
// @ts-expect-error this variable is declared in case unscopables doesn't work
var concat;
// @ts-expect-error `with` unsupported
with ([]) {
t.equal(concat, Array.prototype.concat, 'concat is dynamically bound');
t.notEqual(entries, Array.prototype.entries, 'entries is not dynamically bound');
}
/** @type {Record<PropertyKey, unknown>} */
var obj = {
foo: 1,
bar: 2
};
// @ts-expect-error this variable is declared in case unscopables doesn't work
var foo;
// @ts-expect-error this variable is declared in case unscopables doesn't work
var bar;
obj[Symbol.unscopables] = { foo: true };
// @ts-expect-error `with` unsupported
with (obj) {
t.equal(foo, undefined);
t.equal(bar, obj.bar);
}
shimUnscopables('concat');
// @ts-expect-error `with` unsupported
with ([]) {
t.notEqual(concat, Array.prototype.concat, 'concat is no longer dynamically bound');
t.notEqual(entries, Array.prototype.entries, 'entries is still not dynamically bound');
}
t.end();
});

View File

@@ -0,0 +1,10 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "es2021",
},
"exclude": [
"coverage",
"test/list-exports"
],
}