Skip to content

Commit

Permalink
Use is.TupleOf
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Dec 27, 2023
1 parent 616ed15 commit 184975f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions denops/skkeleton/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ const validators: Validators = {
globalDictionaries: (x): (string | [string, string])[] => {
if (
!is.ArrayOf(
(x): x is string | [string, string] =>
is.String(x) || is.ArrayOf(is.String)(x) && x.length === 2,
is.OneOf([is.String, is.TupleOf([is.String, is.String])] as const),
)(x)
) {
throw TypeError("'globalDictionaries' must be array of two string tuple");
Expand All @@ -68,8 +67,7 @@ const validators: Validators = {
globalKanaTableFiles: (x): (string | [string, string])[] => {
if (
!is.ArrayOf(
(x): x is string | [string, string] =>
is.String(x) || is.ArrayOf(is.String)(x) && x.length === 2,
is.OneOf([is.String, is.TupleOf([is.String, is.String])] as const),
)(x)
) {
throw TypeError(
Expand Down

0 comments on commit 184975f

Please sign in to comment.