Skip to content

Commit

Permalink
Merge pull request #35 from MrAntix/main
Browse files Browse the repository at this point in the history
chore(quality): best practice
  • Loading branch information
ntix authored Feb 2, 2024
2 parents 30e5afb + 76f6f56 commit c47345e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/parsing/dates/dates-equals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ describe('dates-equals', () => {
});

describe('not', () => {
const parser = Is.date.not.equals('2000-01-01');
const notParser = Is.date.not.equals('2000-01-01');

it('success', () => {
const value = parseDate('3000-01-01');
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.empty);
expect(result.value).toEqual(value);
});

it('failure', () => {
const value = parseDate('2000-01-01');
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.not(ParseErrors.equals(value)));
expect(result.value).toEqual(value);
Expand Down
4 changes: 2 additions & 2 deletions src/parsing/json/IJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export namespace IJson {

export interface Parser<T = unknown> extends IParser<T> {

readonly for: <T>(schema: ComplexSchema<T>) => IComplex.Parser<T>;
readonly use: <T>(parser: IParser<T>) => IParser<T>;
readonly for: <U>(schema: ComplexSchema<U>) => IComplex.Parser<U>;
readonly use: <U>(parser: IParser<U>) => IParser<U>;
}
}
6 changes: 3 additions & 3 deletions src/parsing/numbers/numbers-float-anyOf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ describe('numbers-float-anyOf', () => {
});

describe('not', () => {
const parser = Is.float.not.anyOf(anyOf);
const notParser = Is.float.not.anyOf(anyOf);

it('success', () => {
const value = 1;
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.empty);
expect(result.value).toEqual(value);
});

it('failure', () => {
const value = anyOf[0];
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.not(ParseErrors.anyOf(anyOf)));
expect(result.value).toEqual(value);
Expand Down
6 changes: 3 additions & 3 deletions src/parsing/numbers/numbers-float-equals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ describe('numbers-float-equals', () => {
});

describe('not', () => {
const parser = Is.float.not.equals(10);
const notParser = Is.float.not.equals(10);

it('success', () => {
const value = 9;
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.empty);
expect(result.value).toEqual(value);
});

it('failure', () => {
const value = 10;
const result = parser.parse(value);
const result = notParser.parse(value);

expect(result.errors).toEqual(ParseErrors.not(ParseErrors.equals(value)));
expect(result.value).toEqual(value);
Expand Down
4 changes: 2 additions & 2 deletions src/parsing/strings/strings-equals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ describe('strings-equals', () => {
});

it('success ignore case', () => {
const parser = Is.string.equals(expectedValue, true);
const ignoreCaseParser = Is.string.equals(expectedValue, true);
const value = expectedValue.toUpperCase();
const result = parser.parse(value);
const result = ignoreCaseParser.parse(value);

expect(result.errors).toEqual(ParseErrors.empty);
expect(result.value).toEqual(value);
Expand Down

0 comments on commit c47345e

Please sign in to comment.