Skip to content

Commit 7290507

Browse files
committed
Rename a type
1 parent 85d525e commit 7290507

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/combinators.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import either, { type Either } from '@matt.kantor/either'
22
import { nothing } from './constructors.js'
33
import type {
4-
AlwaysSucceedingParser,
54
InvalidInputError,
65
Parser,
6+
ParserWhichAlwaysSucceeds,
77
Success,
88
} from './parser.js'
99

@@ -212,7 +212,9 @@ export const transformOutput =
212212
* Outputs are collected in an array.
213213
*/
214214
export const zeroOrMore =
215-
<Output>(parser: Parser<Output>): AlwaysSucceedingParser<readonly Output[]> =>
215+
<Output>(
216+
parser: Parser<Output>,
217+
): ParserWhichAlwaysSucceeds<readonly Output[]> =>
216218
input => {
217219
const result = oneOf([parser, nothing])(input)
218220
const success = either.match(result, {

src/constructors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import either from '@matt.kantor/either'
2-
import type { AlwaysSucceedingParser, Parser } from './parser.js'
2+
import type { Parser, ParserWhichAlwaysSucceeds } from './parser.js'
33

44
export const anySingleCharacter: Parser<string> = input => {
55
const firstCodePoint = input.codePointAt(0)
@@ -30,7 +30,7 @@ export const literal =
3030
message: `input did not begin with \`${text}\``,
3131
})
3232

33-
export const nothing: AlwaysSucceedingParser<undefined> = input =>
33+
export const nothing: ParserWhichAlwaysSucceeds<undefined> = input =>
3434
either.makeRight({
3535
remainingInput: input,
3636
output: undefined,

src/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export type Parser<Output> = (
1414
input: string,
1515
) => Either<InvalidInputError, Success<Output>>
1616

17-
export type AlwaysSucceedingParser<Output> = (
17+
export type ParserWhichAlwaysSucceeds<Output> = (
1818
input: string,
1919
) => Right<Success<Output>>

0 commit comments

Comments
 (0)