This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

31
frontend/node_modules/fault/index.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
'use strict'
var formatter = require('format')
var fault = create(Error)
module.exports = fault
fault.eval = create(EvalError)
fault.range = create(RangeError)
fault.reference = create(ReferenceError)
fault.syntax = create(SyntaxError)
fault.type = create(TypeError)
fault.uri = create(URIError)
fault.create = create
// Create a new `EConstructor`, with the formatted `format` as a first argument.
function create(EConstructor) {
FormattedError.displayName = EConstructor.displayName || EConstructor.name
return FormattedError
function FormattedError(format) {
if (format) {
format = formatter.apply(null, arguments)
}
return new EConstructor(format)
}
}

22
frontend/node_modules/fault/license generated vendored Normal file
View File

@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
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.

79
frontend/node_modules/fault/package.json generated vendored Normal file
View File

@@ -0,0 +1,79 @@
{
"name": "fault",
"version": "1.0.4",
"description": "Functional errors with formatted output",
"license": "MIT",
"keywords": [
"error",
"exception",
"printf",
"sprintf",
"vsprintf",
"format",
"string"
],
"repository": "wooorm/fault",
"bugs": "https://github.com/wooorm/fault/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"files": [
"index.js"
],
"dependencies": {
"format": "^0.2.0"
},
"devDependencies": {
"browserify": "^16.0.0",
"nyc": "^15.0.0",
"prettier": "^1.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.0.0",
"xo": "^0.25.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
"build-bundle": "browserify . -s fault -o fault.js",
"build-mangle": "browserify . -s fault -p tinyify -o fault.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js",
"test": "npm run format && npm run build && npm run test-coverage"
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"unicorn/prefer-reflect-apply": "off"
},
"ignores": [
"fault.js"
]
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
}
}

138
frontend/node_modules/fault/readme.md generated vendored Normal file
View File

@@ -0,0 +1,138 @@
# fault
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Functional errors with formatted output.
## Install
[npm][]:
```sh
npm install fault
```
## Use
```js
var fault = require('fault')
throw fault('Hello %s!', 'Eric')
```
Yields:
```text
Error: Hello Eric!
at FormattedError (~/node_modules/fault/index.js:30:12)
at Object.<anonymous> (~/example.js:3:7)
```
Or, format a float in a type error:
```js
var fault = require('fault')
throw fault.type('Who doesnt like %f? \uD83C\uDF70', Math.PI)
```
Yields:
```text
TypeError: Who doesnt like 3.141593? 🍰
at Function.FormattedError [as type] (~/node_modules/fault/index.js:30:12)
at Object.<anonymous> (~/example.js:3:7)
```
## API
### `fault(format?[, values...])`
Create an error with a printf-like formatted message.
###### Parameters
* `format` (`string`, optional)
* `values` (`*`, optional)
###### Formatters
* `%s` — String
* `%b` — Binary
* `%c` — Character
* `%d` — Decimal
* `%f` — Floating point
* `%o` — Octal
* `%x` — Lowercase hexadecimal
* `%X` — Uppercase hexadecimal
* `%` followed by any other character, prints that character
See [`samsonjs/format`][fmt] for argument parsing.
###### Returns
An instance of [`Error`][error].
###### Other errors
* `fault.eval(format?[, values...])` — [EvalError][]
* `fault.range(format?[, values...])` — [RangeError][]
* `fault.reference(format?[, values...])` — [ReferenceError][]
* `fault.syntax(format?[, values...])` — [SyntaxError][]
* `fault.type(format?[, values...])` — [TypeError][]
* `fault.uri(format?[, values...])` — [URIError][]
#### `fault.create(Constructor)`
Factory to create instances of `ErrorConstructor` with support for formatting.
Used internally to wrap the global error constructors, exposed for custom
errors.
Returns a function just like `fault`.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://img.shields.io/travis/wooorm/fault.svg
[build]: https://travis-ci.org/wooorm/fault
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/fault.svg
[coverage]: https://codecov.io/github/wooorm/fault
[downloads-badge]: https://img.shields.io/npm/dm/fault.svg
[downloads]: https://www.npmjs.com/package/fault
[size-badge]: https://img.shields.io/bundlephobia/minzip/fault.svg
[size]: https://bundlephobia.com/result?p=fault
[npm]: https://docs.npmjs.com/cli/install
[license]: license
[author]: https://wooorm.com
[fmt]: https://github.com/samsonjs/format
[error]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/Error
[evalerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/EvalError
[rangeerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/RangeError
[referenceerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/ReferenceError
[syntaxerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/SyntaxError
[typeerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/TypeError
[urierror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/URIError.