Cleaned up project. Moved backend logic to FastAPI. Changed login/register routes to use FastAPI

This commit is contained in:
2024-10-12 22:12:08 +00:00
parent eddd1d8ef7
commit 97bce587d2
154 changed files with 1389 additions and 2658 deletions

48
node_modules/string-width/index.d.ts generated vendored
View File

@ -1,29 +1,29 @@
declare const stringWidth: {
export interface Options {
/**
Get the visual width of a string - the number of columns required to display it.
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
@example
```
import stringWidth = require('string-width');
stringWidth('a');
//=> 1
stringWidth('古');
//=> 2
stringWidth('\u001B[1m古\u001B[22m');
//=> 2
```
@default true
*/
(string: string): number;
// TODO: remove this in the next major version, refactor the whole definition to:
// declare function stringWidth(string: string): number;
// export = stringWidth;
default: typeof stringWidth;
readonly ambiguousIsNarrow: boolean;
}
export = stringWidth;
/**
Get the visual width of a string - the number of columns required to display it.
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
@example
```
import stringWidth from 'string-width';
stringWidth('a');
//=> 1
stringWidth('古');
//=> 2
stringWidth('\u001B[1m古\u001B[22m');
//=> 2
```
*/
export default function stringWidth(string: string, options?: Options): number;

45
node_modules/string-width/index.js generated vendored
View File

@ -1,13 +1,17 @@
'use strict';
const stripAnsi = require('strip-ansi');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const emojiRegex = require('emoji-regex');
import stripAnsi from 'strip-ansi';
import eastAsianWidth from 'eastasianwidth';
import emojiRegex from 'emoji-regex';
const stringWidth = string => {
export default function stringWidth(string, options = {}) {
if (typeof string !== 'string' || string.length === 0) {
return 0;
}
options = {
ambiguousIsNarrow: true,
...options
};
string = stripAnsi(string);
if (string.length === 0) {
@ -16,32 +20,35 @@ const stringWidth = string => {
string = string.replace(emojiRegex(), ' ');
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
let width = 0;
for (let i = 0; i < string.length; i++) {
const code = string.codePointAt(i);
for (const character of string) {
const codePoint = character.codePointAt(0);
// Ignore control characters
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
continue;
}
// Ignore combining characters
if (code >= 0x300 && code <= 0x36F) {
if (codePoint >= 0x300 && codePoint <= 0x36F) {
continue;
}
// Surrogates
if (code > 0xFFFF) {
i++;
const code = eastAsianWidth.eastAsianWidth(character);
switch (code) {
case 'F':
case 'W':
width += 2;
break;
case 'A':
width += ambiguousCharacterWidth;
break;
default:
width += 1;
}
width += isFullwidthCodePoint(code) ? 2 : 1;
}
return width;
};
module.exports = stringWidth;
// TODO: remove this in the next major version
module.exports.default = stringWidth;
}

2
node_modules/string-width/license generated vendored
View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.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:

View File

@ -1,16 +1,19 @@
{
"name": "string-width",
"version": "4.2.3",
"version": "5.1.2",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": "sindresorhus/string-width",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
@ -44,13 +47,13 @@
"fixed-width"
],
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}

25
node_modules/string-width/readme.md generated vendored
View File

@ -6,18 +6,16 @@ Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_
Useful to be able to measure the actual width of command-line output.
## Install
```
$ npm install string-width
```
## Usage
```js
const stringWidth = require('string-width');
import stringWidth from 'string-width';
stringWidth('a');
//=> 1
@ -29,6 +27,26 @@ stringWidth('\u001B[1m古\u001B[22m');
//=> 2
```
## API
### stringWidth(string, options?)
#### string
Type: `string`
The string to be counted.
#### options
Type: `object`
##### ambiguousIsNarrow
Type: `boolean`\
Default: `false`
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
## Related
@ -36,7 +54,6 @@ stringWidth('\u001B[1m古\u001B[22m');
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
---
<div align="center">