Skip to content

Commit 0062329

Browse files
committed
fix: remove unnecessary alias
1 parent a14e8c3 commit 0062329

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

src/Liqe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export {
1717
ExpressionToken,
1818
FieldToken,
1919
Highlight,
20-
HydratedAst as LiqeQuery,
20+
LiqeQuery,
2121
ImplicitBooleanOperatorToken,
2222
ImplicitFieldToken,
2323
LiteralExpressionToken,

src/createStringTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
parseRegex,
99
} from './parseRegex';
1010
import type {
11-
HydratedAst,
11+
LiqeQuery,
1212
} from './types';
1313

1414
type RegExpCache = Record<string, RegExp>;
@@ -27,7 +27,7 @@ const createRegexTest = (regexCache: RegExpCache, regex: string) => {
2727
};
2828
};
2929

30-
export const createStringTest = (regexCache: RegExpCache, ast: HydratedAst) => {
30+
export const createStringTest = (regexCache: RegExpCache, ast: LiqeQuery) => {
3131
if (ast.type !== 'Tag') {
3232
throw new Error('Expected a tag expression.');
3333
}

src/filter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import {
22
internalFilter,
33
} from './internalFilter';
44
import type {
5-
HydratedAst,
5+
LiqeQuery,
66
} from './types';
77

88
export const filter = <T extends Object>(
9-
ast: HydratedAst,
9+
ast: LiqeQuery,
1010
data: readonly T[],
1111
): readonly T[] => {
1212
return internalFilter(

src/highlight.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
internalFilter,
66
} from './internalFilter';
77
import type {
8-
HydratedAst,
8+
LiqeQuery,
99
Highlight,
1010
InternalHighlight,
1111
} from './types';
@@ -16,7 +16,7 @@ type AggregatedHighlight = {
1616
};
1717

1818
export const highlight = <T extends Object>(
19-
ast: HydratedAst,
19+
ast: LiqeQuery,
2020
data: T,
2121
): Highlight[] => {
2222
const highlights: InternalHighlight[] = [];

src/hydrateAst.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import {
1212
} from './isSafePath';
1313
import type {
1414
ParserAst,
15-
HydratedAst,
15+
LiqeQuery,
1616
} from './types';
1717

1818
const optionalChainingIsSupported = isOptionalChainingSupported();
1919

20-
export const hydrateAst = (subject: ParserAst): HydratedAst => {
21-
const newSubject: HydratedAst = {
20+
export const hydrateAst = (subject: ParserAst): LiqeQuery => {
21+
const newSubject: LiqeQuery = {
2222
...subject,
2323
};
2424

src/internalFilter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import {
1111
testRange,
1212
} from './testRange';
1313
import type {
14-
HydratedAst,
14+
LiqeQuery,
1515
InternalHighlight,
1616
InternalTest,
1717
} from './types';
1818

1919
const optionalChainingIsSupported = isOptionalChainingSupported();
2020

21-
const createValueTest = (ast: HydratedAst): InternalTest => {
21+
const createValueTest = (ast: LiqeQuery): InternalTest => {
2222
if (ast.type !== 'Tag') {
2323
throw new Error('Expected a tag expression.');
2424
}
@@ -73,7 +73,7 @@ const createValueTest = (ast: HydratedAst): InternalTest => {
7373
};
7474

7575
const testValue = (
76-
ast: HydratedAst,
76+
ast: LiqeQuery,
7777
value: unknown,
7878
resultFast: boolean,
7979
path: readonly string[],
@@ -138,7 +138,7 @@ const testValue = (
138138

139139
const testField = <T extends Object>(
140140
row: T,
141-
ast: HydratedAst,
141+
ast: LiqeQuery,
142142
resultFast: boolean,
143143
path: readonly string[],
144144
highlights: InternalHighlight[],
@@ -230,7 +230,7 @@ const testField = <T extends Object>(
230230
};
231231

232232
export const internalFilter = <T extends Object>(
233-
ast: HydratedAst,
233+
ast: LiqeQuery,
234234
rows: readonly T[],
235235
resultFast: boolean = true,
236236
path: readonly string[] = [],

src/parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import {
77
hydrateAst,
88
} from './hydrateAst';
99
import type {
10-
HydratedAst,
10+
LiqeQuery,
1111
ParserAst,
1212
} from './types';
1313

1414
const rules = nearley.Grammar.fromCompiled(grammar);
1515

1616
const MESSAGE_RULE = /Syntax error at line (?<line>\d+) col (?<column>\d+)/;
1717

18-
export const parse = (query: string): HydratedAst => {
18+
export const parse = (query: string): LiqeQuery => {
1919
if (query.trim() === '') {
2020
return {
2121
location: {

src/serialize.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {
22
ExpressionToken,
3-
HydratedAst,
3+
LiqeQuery,
44
} from './types';
55

66
const quote = (value: string, quotes: 'double' | 'single') => {
@@ -46,7 +46,7 @@ const serializeExpression = (expression: ExpressionToken) => {
4646
throw new Error('Unexpected AST type.');
4747
};
4848

49-
const serializeTag = (ast: HydratedAst) => {
49+
const serializeTag = (ast: LiqeQuery) => {
5050
if (ast.type !== 'Tag') {
5151
throw new Error('Expected a tag expression.');
5252
}
@@ -68,7 +68,7 @@ const serializeTag = (ast: HydratedAst) => {
6868
return left + operator.operator + patEnd + serializeExpression(expression);
6969
};
7070

71-
export const serialize = (ast: HydratedAst): string => {
71+
export const serialize = (ast: LiqeQuery): string => {
7272
if (ast.type === 'ParenthesizedExpression') {
7373
if (!('location' in ast.expression)) {
7474
throw new Error('Expected location in expression.');

src/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {
22
filter,
33
} from './filter';
44
import type {
5-
HydratedAst,
5+
LiqeQuery,
66
} from './types';
77

8-
export const test = <T extends Object>(ast: HydratedAst, subject: T) => {
8+
export const test = <T extends Object>(ast: LiqeQuery, subject: T) => {
99
return filter(ast, [subject]).length === 1;
1010
};

src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ export type ParenthesizedExpressionToken = {
114114

115115
export type ParserAst = EmptyExpression | LogicalExpressionToken | ParenthesizedExpressionToken | TagToken | UnaryOperatorToken;
116116

117-
export type HydratedAst = ParserAst & {
117+
export type LiqeQuery = ParserAst & {
118118
getValue?: (subject: unknown) => unknown,
119-
left?: HydratedAst,
120-
operand?: HydratedAst,
121-
right?: HydratedAst,
119+
left?: LiqeQuery,
120+
operand?: LiqeQuery,
121+
right?: LiqeQuery,
122122
};
123123

124124
export type InternalHighlight = {

0 commit comments

Comments
 (0)