Skip to content

Commit

Permalink
Add removeAccentedCharacters function
Browse files Browse the repository at this point in the history
  • Loading branch information
G43riko committed Oct 11, 2024
1 parent b47a8a3 commit 4ff025d
Show file tree
Hide file tree
Showing 28 changed files with 452 additions and 183 deletions.
16 changes: 11 additions & 5 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"workspace": ["./workspaces/enums", "./workspaces/utils"],
"tasks": {
"bench": "deno bench",
"bench:utils": "deno bench --filter utils",
"doc": "deno doc --html --name=\"@g43/tools\" --output=docs workspaces/enums/src/index.ts workspaces/utils/src/index.ts",
"doc:utils": "deno doc --html --name=\"@g43/utils\" --output=docs workspaces/utils/src/index.ts",
"doc:enums": "deno doc --html --name=\"@g43/enums\" --output=docs workspaces/enums/src/index.ts",
"test": "deno test workspaces/**/src/**/*.spec.ts",
"test:doc": "deno test --doc workspaces/**/src/**/*.ts",
Expand All @@ -19,14 +19,20 @@
}
},
"test": {
"exclude": ["**/*.bench.ts"]
"exclude": ["**/*.bench.ts", "srcOld"]
},
"bench": {
"include": ["workspaces/**/src"]
"include": ["workspaces/**/src"],
"exclude": ["srcOld"]
},
"fmt": {
"lineWidth": 120,
"indentWidth": 4
"indentWidth": 4,
"exclude": [
"docs",
"coverage",
"srcOld"
]
},
"compilerOptions": {
"strict": true
Expand All @@ -35,4 +41,4 @@
"@std/assert": "jsr:@std/assert@1.0.6",
"@std/http": "jsr:@std/http@1.0.8"
}
}
}
12 changes: 6 additions & 6 deletions workspaces/enums/src/button.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export enum Button {
LEFT = 0,
MIDDLE = 1,
RIGHT = 2,
BACK = 3,
FORWARD = 4,
UNKNOWN = -1,
LEFT = 0,
MIDDLE = 1,
RIGHT = 2,
BACK = 3,
FORWARD = 4,
UNKNOWN = -1,
NO_BUTTON = -2,
}
82 changes: 41 additions & 41 deletions workspaces/enums/src/http-status-codes.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
export enum HttpStatusCodes {
CONTINUE = 100,
SWITCHING_PROTOCOLS = 101,
OK = 200,
CREATED = 201,
ACCEPTED = 202,
NON_AUTHORITATIVE_INFORMATION = 203,
NO_CONTENT = 204,
RESET_CONTENT = 205,
PARTIAL_CONTENT = 206,
MULTIPLE_CHOICES = 300,
MOVED_PERMANENTLY = 301,
FOUND = 302,
SEE_OTHER = 303,
NOT_MODIFIED = 304,
USE_PROXY = 305,
TEMPORARY_REDIRECT = 307,
BAD_REQUEST = 400,
UNAUTHORIZED = 401,
PAYMENT_REQUIRED = 402,
FORBIDDEN = 403,
NOT_FOUND = 404,
METHOD_NOT_ALLOWED = 405,
NOT_ACCEPTABLE = 406,
PROXY_AUTHENTICATION_REQUIRED = 407,
REQUEST_TIMEOUT = 408,
CONFLICT = 409,
GONE = 410,
LENGTH_REQUIRED = 411,
PRECONDITION_FAILED = 412,
REQUEST_ENTITY_TOO_LARGE = 413,
REQUEST_URI_TOO_LONG = 414,
UNSUPPORTED_MEDIA_TYPE = 415,
CONTINUE = 100,
SWITCHING_PROTOCOLS = 101,
OK = 200,
CREATED = 201,
ACCEPTED = 202,
NON_AUTHORITATIVE_INFORMATION = 203,
NO_CONTENT = 204,
RESET_CONTENT = 205,
PARTIAL_CONTENT = 206,
MULTIPLE_CHOICES = 300,
MOVED_PERMANENTLY = 301,
FOUND = 302,
SEE_OTHER = 303,
NOT_MODIFIED = 304,
USE_PROXY = 305,
TEMPORARY_REDIRECT = 307,
BAD_REQUEST = 400,
UNAUTHORIZED = 401,
PAYMENT_REQUIRED = 402,
FORBIDDEN = 403,
NOT_FOUND = 404,
METHOD_NOT_ALLOWED = 405,
NOT_ACCEPTABLE = 406,
PROXY_AUTHENTICATION_REQUIRED = 407,
REQUEST_TIMEOUT = 408,
CONFLICT = 409,
GONE = 410,
LENGTH_REQUIRED = 411,
PRECONDITION_FAILED = 412,
REQUEST_ENTITY_TOO_LARGE = 413,
REQUEST_URI_TOO_LONG = 414,
UNSUPPORTED_MEDIA_TYPE = 415,
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
EXPECTATION_FAILED = 417,
UNPROCESSABLE_ENTITY = 422,
TOO_MANY_REQUESTS = 429,
INTERNAL_SERVER_ERROR = 500,
NOT_IMPLEMENTED = 501,
BAD_GATEWAY = 502,
SERVICE_UNAVAILABLE = 503,
GATEWAY_TIMEOUT = 504,
HTTP_VERSION_NOT_SUPPORTED = 505,
EXPECTATION_FAILED = 417,
UNPROCESSABLE_ENTITY = 422,
TOO_MANY_REQUESTS = 429,
INTERNAL_SERVER_ERROR = 500,
NOT_IMPLEMENTED = 501,
BAD_GATEWAY = 502,
SERVICE_UNAVAILABLE = 503,
GATEWAY_TIMEOUT = 504,
HTTP_VERSION_NOT_SUPPORTED = 505,
}
2 changes: 1 addition & 1 deletion workspaces/enums/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export * from "./origin.ts";
export * from "./keys.ts";
export * from "./pointer-type.ts";
export * from "./button.ts";
export * from "./http-status-codes.ts";
export * from "./http-status-codes.ts";
134 changes: 67 additions & 67 deletions workspaces/enums/src/keys.ts
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
export enum Keys {
ARROW_UP = "ArrowUp",
ARROW_DOWN = "ArrowDown",
ARROW_LEFT = "ArrowLeft",
ARROW_RIGHT = "ArrowRight",
DELETE = "Delete",
CONTROL = "ControlLeft",
ALT = "AltLeft",
SHIFT = "ShiftLeft",
BACKSPACE = "Backspace",
TAB = "Tab",
PAGE_UP = "PageUp",
PAGE_DOWN = "PageDown",
ESCAPE = "Escape",
SPACE = "Space",
ENTER = "Enter",
ARROW_UP = "ArrowUp",
ARROW_DOWN = "ArrowDown",
ARROW_LEFT = "ArrowLeft",
ARROW_RIGHT = "ArrowRight",
DELETE = "Delete",
CONTROL = "ControlLeft",
ALT = "AltLeft",
SHIFT = "ShiftLeft",
BACKSPACE = "Backspace",
TAB = "Tab",
PAGE_UP = "PageUp",
PAGE_DOWN = "PageDown",
ESCAPE = "Escape",
SPACE = "Space",
ENTER = "Enter",
NUMPAD_ENTER = "NumpadEnter",
A = "KeyA",
B = "KeyB",
C = "KeyC",
D = "KeyD",
E = "KeyE",
F = "KeyF",
G = "KeyG",
H = "KeyH",
I = "KeyI",
J = "KeyJ",
L = "KeyL",
M = "KeyM",
N = "KeyN",
O = "KeyO",
P = "KeyP",
Q = "KeyQ",
R = "KeyR",
S = "KeyS",
T = "KeyT",
U = "KeyU",
V = "KeyV",
W = "KeyW",
X = "KeyX",
Y = "KeyY",
Z = "KeyZ",
A = "KeyA",
B = "KeyB",
C = "KeyC",
D = "KeyD",
E = "KeyE",
F = "KeyF",
G = "KeyG",
H = "KeyH",
I = "KeyI",
J = "KeyJ",
L = "KeyL",
M = "KeyM",
N = "KeyN",
O = "KeyO",
P = "KeyP",
Q = "KeyQ",
R = "KeyR",
S = "KeyS",
T = "KeyT",
U = "KeyU",
V = "KeyV",
W = "KeyW",
X = "KeyX",
Y = "KeyY",
Z = "KeyZ",

DIGIT_1 = "Digit1",
DIGIT_2 = "Digit2",
DIGIT_3 = "Digit3",
DIGIT_4 = "Digit4",
DIGIT_5 = "Digit5",
DIGIT_6 = "Digit6",
DIGIT_7 = "Digit7",
DIGIT_8 = "Digit8",
DIGIT_9 = "Digit9",
DIGIT_0 = "Digit0",
DIGIT_1 = "Digit1",
DIGIT_2 = "Digit2",
DIGIT_3 = "Digit3",
DIGIT_4 = "Digit4",
DIGIT_5 = "Digit5",
DIGIT_6 = "Digit6",
DIGIT_7 = "Digit7",
DIGIT_8 = "Digit8",
DIGIT_9 = "Digit9",
DIGIT_0 = "Digit0",
}

/**
* @deprecated
*/
export class KeysOld {
public static readonly ENTER = 13;
public static readonly TAB = 9;
public static readonly W = 87;
public static readonly A = 65;
public static readonly S = 83;
public static readonly D = 68;
public static readonly Q = 81;
public static readonly E = 69;
public static readonly F = 70;
public static readonly LCONTROL = 17;
public static readonly ESCAPE = 27;
public static readonly LALT = 18;
public static readonly LSHIFT = 16;
public static readonly SPACE = 32;
public static readonly ARROW_UP = 38;
public static readonly ARROW_DOWN = 40;
public static readonly ENTER = 13;
public static readonly TAB = 9;
public static readonly W = 87;
public static readonly A = 65;
public static readonly S = 83;
public static readonly D = 68;
public static readonly Q = 81;
public static readonly E = 69;
public static readonly F = 70;
public static readonly LCONTROL = 17;
public static readonly ESCAPE = 27;
public static readonly LALT = 18;
public static readonly LSHIFT = 16;
public static readonly SPACE = 32;
public static readonly ARROW_UP = 38;
public static readonly ARROW_DOWN = 40;
public static readonly ARROW_RIGHT = 39;
public static readonly ARROW_LEFT = 37;
public static readonly ARROW_LEFT = 37;
}
18 changes: 9 additions & 9 deletions workspaces/enums/src/origin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export enum Origin {
TR = "TR",
TR = "TR",
CENTER = "CENTER",
TL = "TL",
BR = "BR",
BL = "BL",
T = "T",
L = "L",
R = "R",
B = "B"
}
TL = "TL",
BR = "BR",
BL = "BL",
T = "T",
L = "L",
R = "R",
B = "B",
}
6 changes: 3 additions & 3 deletions workspaces/enums/src/pointer-type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum PointerType {
TOUCH = "TOUCH",
MOUSE = "MOUSE",
PEN = "PEN",
TOUCH = "TOUCH",
MOUSE = "MOUSE",
PEN = "PEN",
UNKNOWN = "UNKNOWN",
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion workspaces/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./utils/array-utils.ts";
export * from "./utils/string-utils.ts";
export * from "./utils/string-utils/index.ts";
export * from "./utils/input-utils.ts";
export * from "./utils/origin-utils.ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Keys} from "@g43/enums";
import { Keys } from "@g43/enums";

declare type KeyboardEvent = any;
export function extractKeyFromEvent(event: KeyboardEvent): Keys {
return event.code as Keys;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4ff025d

Please sign in to comment.