Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding typos #28

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
**Welcome to Vixeny: Revolutionize Your Web Development**

<p align="center">
<img src="misc/logo.png" alt="Vixeny Logo" style="max-width: 100%;">
<br>
Expand All @@ -9,6 +7,8 @@
</p>

[![JSR](https://jsr.io/badges/@vixeny/core)](https://jsr.io/@vixeny/core)
![GitHub Actions status](https://github.com/mimiMonads/vixeny/workflows/Deno/badge.svg)
[![npm version](https://img.shields.io/npm/v/vixeny.svg)](https://www.npmjs.com/package/vixeny)

**Vixeny: Pioneering Functional Web Development**

Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@vixeny/core",
"version": "0.1.35",
"version": "0.1.37",
"exports": "./main.ts"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vixeny",
"version": "0.1.35",
"version": "0.1.37",
"description": "A functional router for Bun and Deno",
"main": "main.ts",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/cookieToToken/cookieToTokenMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export default (o?: FunRouterOptions<any>) => (p: Petition) =>
)(
plugins.pluginIsUsing(p)("token"),
)
: () => ({ SystemError: "Crypto is requieres" });
: () => ({ SystemError: "Crypto is requires" });
10 changes: 5 additions & 5 deletions src/components/parameters/singleElement.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @mimiMonads
*
* This code is an object that containts all the logic related with handeling just one parameter
* This code is an object that contains all the logic related with handling just one parameter
*/

export default {
Expand Down Expand Up @@ -44,11 +44,11 @@ export default {
)(
string.indexOf("/", string.indexOf("/") + 2) + offset,
),
fixElementAtTheEnd: (offsett: number) => (string: string) =>
fixElementAtTheEnd: (offset: number) => (string: string) =>
string.slice(
offsett,
offset,
string.indexOf("?") !== -1 ? string.indexOf("?") : string.length,
),
fixElementAndSlashAtTheEnd: (offsett: number) => (string: string) =>
string.slice(offsett, string.indexOf("/", offsett + 1)),
fixElementAndSlashAtTheEnd: (offset: number) => (string: string) =>
string.slice(offset, string.indexOf("/", offset + 1)),
};
2 changes: 1 addition & 1 deletion src/components/parameters/singleElementUsingAt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import mainSlicerUrl from "../../util/slicerURL/mainSlicerUrl.ts";
/**
* @mimiMonads
*
* This code is an object that containts all the logic related with handeling just one parameter
* This code is an object that contains all the logic related with handling just one parameter
*/

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/components/queries/mainQueries.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FunRouterOptions } from "../../options.ts";
import type { Petition } from "../../morphism.ts";
import common from "./common.ts";
import elements from "./querryElements.ts";
import elements from "./queryElements.ts";
import unique from "./unique.ts";
import plugin from "../../exportable/plugin.ts";

Expand Down
4 changes: 2 additions & 2 deletions src/composer/linker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tools from "./composerTools.ts";
import type { FunRouterOptions } from "../options.ts";
import type { Petition } from "../morphism.ts";
import nativeComponets from "./nativeComponents.ts";
import nativeComponents from "./nativeComponents.ts";
import nativeMaps from "./nativeMaps.ts";

export type specialOptions = {
Expand Down Expand Up @@ -34,7 +34,7 @@ export default (o?: specialOptions) => (f: Petition) => (ar: string[]) =>
)(),
)
)(
((or) => nativeComponets(or)(f)(table))(
((or) => nativeComponents(or)(f)(table))(
"mutable" in f
? { ...o, mutable: true } as FunRouterOptions<any>
: o,
Expand Down
2 changes: 1 addition & 1 deletion src/exportable/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const composer = {
type: "morphism";
typeNotNeeded: true;
specificReturnType: true;
retunType: Promise<BodyNull> | BodyNull;
returnType: Promise<BodyNull> | BodyNull;
},
RM,
BM,
Expand Down
10 changes: 5 additions & 5 deletions src/exportable/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
TP extends "response" | "request" | undefined,
O extends StaticFilePlugin<TP>,
>(config: O) => config,
pluginIsUsing: (p: Petition) => (currenName: string) =>
pluginIsUsing: (p: Petition) => (currentName: string) =>
(
(
(args) =>
Expand All @@ -123,13 +123,13 @@ export default {
...new Set(
checkerTools.getDestructedElements(p.f)(
typeof args == "string"
? args + "." + currenName
: currenName,
? args + "." + currentName
: currentName,
).concat(
checkerTools.getDots(p.f)(
typeof args == "string"
? args + "." + currenName
: currenName,
? args + "." + currentName
: currentName,
),
),
),
Expand Down
12 changes: 6 additions & 6 deletions src/morphism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ type MapOptions = {
isAPetition?: boolean;
mutable?: true;
specificReturnType?: boolean;
retunType?: any;
returnType?: any;
};

type HasPath<P extends MapOptions> = P extends { hasPath: true }
Expand Down Expand Up @@ -484,7 +484,7 @@ export type Morphism<
readonly branch?: BM;
readonly method?: ParamsMethod;
readonly crypto?: CO;
readonly args?: MO extends { branch: true } ? AT : never;
readonly args?: MO extends { type: "morphism" } ? AT : never;
readonly query?: QO;
readonly param?: PO;
readonly plugins?: ExtractPluginTypes<RO>;
Expand Down Expand Up @@ -519,7 +519,7 @@ export type Morphism<
>,
AT
>,
): MO["specificReturnType"] extends true ? MO["retunType"]
): MO["specificReturnType"] extends true ? MO["returnType"]
: MO["type"] extends "response" ? Response | Promise<Response>
: MO["type"] extends "request" ? Response | Promise<Response>
: MO["type"] extends "base" ? BodyInit | Promise<BodyInit> | null
Expand Down Expand Up @@ -596,12 +596,12 @@ type WithPlugins<
> =
& Ctx<R, B, QS, PA, O, CR, { hasHeaders: true }, OPT, AR>
& (O extends { cyclePlugin: infer CPM } ? [keyof CPM] extends [never] ? {}
: CPM extends CyclePluginMap ? CyclePlugingFunctions<CPM>
: CPM extends CyclePluginMap ? CyclePluginFunctions<CPM>
: never
: {})
& CryptoContext<CR>;

type CyclePlugingFunctions<CPM extends CyclePluginMap> = {
type CyclePluginFunctions<CPM extends CyclePluginMap> = {
[K in keyof CPM]: CPM[K] extends
{ isFunction: boolean; f: (...args: any) => any }
? ReturnType<ReturnType<CPM[K]["f"]>> // Direct function case
Expand Down Expand Up @@ -798,7 +798,7 @@ interface Ctx<
*/
branch: {
[V in keyof B]: (
ctx: Exclude<B[V]["args"], undefined>,
ctx: B[V]["args"],
) => ReturnType<B[V]["f"]>;
};

Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export type FunRouterOptions<
/**
* @deprecated
*
* When an URL with a valid URL is detected and used it will be added to yout `context`
* When an URL with a valid URL is detected and used it will be added to your `context`
*
* ```ts
* // default
* {
* path: "/route/:name",
* f: ctx => ctx.param.name
* }
* // this behavour can change with this option, for example:
* // this behaviour can change with this option, for example:
* {
* path: "/route/-name",
* f: ctx => ctx.param.name
Expand Down
12 changes: 6 additions & 6 deletions src/router/composer/methods1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default (o?: FunRouterOptions<any>) =>
)
: o?.router?.strictTrailingSlash === false
? typeof o.indexBase?.at === "number"
? baseWithStricTrailingSlachesAndAt(
? baseWithStricTrailingSlashesAndAt(
parsed,
)(o.indexBase.at)
: baseWithStricTrailingSlaches(
: baseWithStricTrailingSlashes(
parsed,
)
: typeof o?.indexBase?.at === "number"
Expand Down Expand Up @@ -54,8 +54,8 @@ const baseIndexed = (index: number) => (strictTrailingSlash: boolean) =>
})${strictTrailingSlash ? `|| '/'` : ""}) `,
)();

// TODO: check for posible optimization switching `?` for `/?`
const baseWithStricTrailingSlaches =
// TODO: check for possible optimization switching `?` for `/?`
const baseWithStricTrailingSlashes =
(p: (url: string) => number) => (url: string) =>
(
(start) =>
Expand All @@ -71,8 +71,8 @@ const baseWithStricTrailingSlaches =
)
)(url.indexOf("/", url.indexOf("//") + 2));

// TODO: check for posible optimization switching `?` for `/?`
const baseWithStricTrailingSlachesAndAt =
// TODO: check for possible optimization switching `?` for `/?`
const baseWithStricTrailingSlashesAndAt =
(p: (url: string) => number) => (at: number) =>
(
(slicer) => (url: string) =>
Expand Down
2 changes: 1 addition & 1 deletion src/router/solver1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default ((o?: FunRouterOptions<any>) => (atlas: Atlas1) =>
)(
solver(o)(atlas)(0)(
(atlas[4][0] as Atlas1[0]).length === 0
//exist wildcards (inluding static server) and server
//exist wildcards (including static server) and server
? atlas[3].length - 4 + (atlas[4][3] as Atlas1[3]).length
//just the server (null)
: null as unknown as number,
Expand Down
2 changes: 1 addition & 1 deletion src/staticFiles/composedPaths.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { fileServerPetition, Petition } from "../morphism.ts";
import staticFileTools from "./staticFileTools.ts";

//TODO: make it more redable 🙏
//TODO: make it more readable 🙏

export default (f: fileServerPetition) =>
(name: string) =>
Expand Down
2 changes: 1 addition & 1 deletion test/components/cookieToToken/cookieToToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test("jwt signing with an invalid request", async () => {
);
});

test("jwt signing with a valid request but not using the righ cookie", async () => {
test("jwt signing with a valid request but not using the right cookie", async () => {
assert.deepStrictEqual(
await wrap()()
.stdPetition({
Expand Down
2 changes: 1 addition & 1 deletion test/components/parameters/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Deno.test("parameters single", () => {
);
});

Deno.test("parameters muliple", () => {
Deno.test("parameters multiple", () => {
assertEquals(
mainParameters()(
petitions.common()({
Expand Down
12 changes: 6 additions & 6 deletions test/composer/checker/checker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const pluginHello = {
name: Symbol.for("hello"),
isFunction: true,
type: "string",
f: () => () => () => "pluging",
f: () => () => () => "plugin",
};

const pluginMethod = {
name: Symbol.for("method"),
type: "string",
f: () => () => () => "pluging",
f: () => () => () => "plugin",
};

const opt = {
Expand All @@ -23,7 +23,7 @@ const opt = {
};

// Test
Deno.test("check behaivour", async () => {
Deno.test("check behaviour", async () => {
assertEquals(
mainCheck()(
petitions.common()({
Expand All @@ -44,7 +44,7 @@ Deno.test("check behaivour", async () => {
);
});

Deno.test("check only behaivour", async () => {
Deno.test("check only behaviour", async () => {
assertEquals(
mainCheck()(
petitions.common()({
Expand Down Expand Up @@ -128,7 +128,7 @@ Deno.test("check only behaivour", async () => {
);
});

Deno.test("check remove behaivour", async () => {
Deno.test("check remove behaviour", async () => {
assertEquals(
mainCheck()(
petitions.common()({
Expand Down Expand Up @@ -182,7 +182,7 @@ Deno.test("check remove behaivour", async () => {
);
});

Deno.test("check remove behaivour", async () => {
Deno.test("check remove behaviour", async () => {
assertEquals(
mainCheck()(
petitions.common()({
Expand Down
4 changes: 2 additions & 2 deletions test/exportable/wrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Deno.test("wrap checking std", async () => {
);
});

Deno.test("wrap checking costum", async () => {
Deno.test("wrap checking custom", async () => {
assertEquals(
await serve(
new Request("http://example.com/customHello"),
Expand Down Expand Up @@ -175,7 +175,7 @@ Deno.test("wrap monoidal properties", async () => {
}]) as unknown as Petition[];
});

//check if your token is valid, return null if it's invalid, otherwise retruns the token
//check if your token is valid, return null if it's invalid, otherwise returns the token
// const validToken = petitions.resolve()({
// crypto: {
// globalKey: 'Secret!',
Expand Down
2 changes: 1 addition & 1 deletion test/staticFile/composedPaths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import test from "node:test";
import composer from "../../src/staticFiles/composedPaths.ts";

test(
"static file cheking file in composition",
"static file checking file in composition",
() => {
assert.deepStrictEqual(
"/fun.test.ts",
Expand Down
4 changes: 2 additions & 2 deletions test/staticFile/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import main from "../../src/staticFiles/staticFileMain.ts";
import { petitions } from "../../src/morphism.ts";

test(
"static file cheking logo",
"static file checking logo",
() =>
assert.deepStrictEqual(
main()({
Expand All @@ -19,7 +19,7 @@ test(
);

test(
"static file cheking extension",
"static file checking extension",
() =>
assert.deepStrictEqual(
main()({
Expand Down
2 changes: 1 addition & 1 deletion test/staticFile/mime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import test from "node:test";
import staticFileTools from "../../src/staticFiles/staticFileTools.ts";

test(
"cheking mime",
"checking mime",
() => {
assert.deepStrictEqual(
staticFileTools.mimeForm({
Expand Down
6 changes: 6 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = ["node_modules/**/*"]

[default.extend-words]
ND = "ND"

Loading