From 6f5a4aa13eec999dd28061eb8ece9b70480821cf Mon Sep 17 00:00:00 2001 From: ssube Date: Thu, 9 Jul 2020 06:40:08 -0500 Subject: [PATCH] fix: require encoding overload for include read callback --- src/type/Include.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/type/Include.ts b/src/type/Include.ts index 90d8a7e..2d20fc8 100644 --- a/src/type/Include.ts +++ b/src/type/Include.ts @@ -2,9 +2,11 @@ import { InvalidArgumentError, NotFoundError } from '@apextoaster/js-utils'; import { SAFE_SCHEMA, safeLoad, Schema, Type as YamlType } from 'js-yaml'; import { join } from 'path'; +export type IncludeReader = (path: string, options: { encoding: string }) => string; + export interface IncludeSchema { exists: (path: string) => boolean; - read: (path: string, encoding: object) => string; + read: IncludeReader; resolve: (path: string) => string; schema: Schema; }