Skip to content

Commit

Permalink
Merge pull request #20 from asos-craigmorten/fix/support-deno-1.4.0
Browse files Browse the repository at this point in the history
fix(deno): support Deno 1.4.0 strict type checks
  • Loading branch information
nebrelbug committed Sep 15, 2020
2 parents a4c28ee + de96f9b commit 7690d06
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions deno_dist/compile-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Parse from "./parse.ts";

/* TYPES */

import { EtaConfig } from "./config.ts";
import { AstObject } from "./parse.ts";
import type { EtaConfig } from "./config.ts";
import type { AstObject } from "./parse.ts";

/* END TYPES */

Expand Down
4 changes: 2 additions & 2 deletions deno_dist/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import EtaErr from "./err.ts";

/* TYPES */

import { EtaConfig, PartialConfig } from "./config.ts";
import { CallbackFn } from "./file-handlers.ts";
import type { EtaConfig, PartialConfig } from "./config.ts";
import type { CallbackFn } from "./file-handlers.ts";
import { getAsyncFunctionConstructor } from "./polyfills.ts";
export type TemplateFunction = (
data: object,
Expand Down
4 changes: 2 additions & 2 deletions deno_dist/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import EtaErr from "./err.ts";

/* TYPES */

import { TemplateFunction } from "./compile.ts";
import { Cacher } from "./storage.ts";
import type { TemplateFunction } from "./compile.ts";
import type { Cacher } from "./storage.ts";

type trimConfig = "nl" | "slurp" | false;

Expand Down
2 changes: 1 addition & 1 deletion deno_dist/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Cacher } from "./storage.ts";

/* TYPES */

import { TemplateFunction } from "./compile.ts";
import type { TemplateFunction } from "./compile.ts";

/* END TYPES */

Expand Down
8 changes: 6 additions & 2 deletions deno_dist/file-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import { promiseImpl } from "./polyfills.ts";

/* TYPES */

import { EtaConfig, PartialConfig, EtaConfigWithFilename } from "./config.ts";
import { TemplateFunction } from "./compile.ts";
import type {
EtaConfig,
PartialConfig,
EtaConfigWithFilename,
} from "./config.ts";
import type { TemplateFunction } from "./compile.ts";

export type CallbackFn = (err: Error | null, str?: string) => void;

Expand Down
2 changes: 1 addition & 1 deletion deno_dist/file-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { includeFile } from "./file-handlers.ts";

/* TYPES */

import { EtaConfig } from "./config.ts";
import type { EtaConfig } from "./config.ts";

interface GenericData {
[index: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import EtaErr from "./err.ts";

/* TYPES */

import { EtaConfig } from "./config.ts";
import type { EtaConfig } from "./config.ts";

/* END TYPES */

Expand Down
2 changes: 1 addition & 1 deletion deno_dist/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { trimWS } from "./utils.ts";

/* TYPES */

import { EtaConfig } from "./config.ts";
import type { EtaConfig } from "./config.ts";

export type TagType = "r" | "e" | "i" | "";

Expand Down
6 changes: 3 additions & 3 deletions deno_dist/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import EtaErr from "./err.ts";

/* TYPES */

import { EtaConfig, PartialConfig } from "./config.ts";
import { TemplateFunction } from "./compile.ts";
import { CallbackFn } from "./file-handlers.ts";
import type { EtaConfig, PartialConfig } from "./config.ts";
import type { TemplateFunction } from "./compile.ts";
import type { CallbackFn } from "./file-handlers.ts";

/* END TYPES */

Expand Down
2 changes: 1 addition & 1 deletion deno_dist/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { trimLeft, trimRight } from "./polyfills.ts";

/* TYPES */

import { EtaConfig } from "./config.ts";
import type { EtaConfig } from "./config.ts";

interface EscapeMap {
"&": "&";
Expand Down
4 changes: 2 additions & 2 deletions src/compile-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Parse from './parse'

/* TYPES */

import { EtaConfig } from './config'
import { AstObject } from './parse'
import type { EtaConfig } from './config'
import type { AstObject } from './parse'

/* END TYPES */

Expand Down
4 changes: 2 additions & 2 deletions src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import EtaErr from './err'

/* TYPES */

import { EtaConfig, PartialConfig } from './config'
import { CallbackFn } from './file-handlers'
import type { EtaConfig, PartialConfig } from './config'
import type { CallbackFn } from './file-handlers'
import { getAsyncFunctionConstructor } from './polyfills'
export type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string

Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import EtaErr from './err'

/* TYPES */

import { TemplateFunction } from './compile'
import { Cacher } from './storage'
import type { TemplateFunction } from './compile'
import type { Cacher } from './storage'

type trimConfig = 'nl' | 'slurp' | false

Expand Down
2 changes: 1 addition & 1 deletion src/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Cacher } from './storage'

/* TYPES */

import { TemplateFunction } from './compile'
import type { TemplateFunction } from './compile'

/* END TYPES */

Expand Down
4 changes: 2 additions & 2 deletions src/file-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { promiseImpl } from './polyfills'

/* TYPES */

import { EtaConfig, PartialConfig, EtaConfigWithFilename } from './config'
import { TemplateFunction } from './compile'
import type { EtaConfig, PartialConfig, EtaConfigWithFilename } from './config'
import type { TemplateFunction } from './compile'

export type CallbackFn = (err: Error | null, str?: string) => void

Expand Down
2 changes: 1 addition & 1 deletion src/file-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { includeFile } from './file-handlers'

/* TYPES */

import { EtaConfig } from './config'
import type { EtaConfig } from './config'

interface GenericData {
[index: string]: any // eslint-disable-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion src/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import EtaErr from './err'

/* TYPES */

import { EtaConfig } from './config'
import type { EtaConfig } from './config'

/* END TYPES */

Expand Down
2 changes: 1 addition & 1 deletion src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { trimWS } from './utils'

/* TYPES */

import { EtaConfig } from './config'
import type { EtaConfig } from './config'

export type TagType = 'r' | 'e' | 'i' | ''

Expand Down
6 changes: 3 additions & 3 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import EtaErr from './err'

/* TYPES */

import { EtaConfig, PartialConfig } from './config'
import { TemplateFunction } from './compile'
import { CallbackFn } from './file-handlers'
import type { EtaConfig, PartialConfig } from './config'
import type { TemplateFunction } from './compile'
import type { CallbackFn } from './file-handlers'

/* END TYPES */

Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { trimLeft, trimRight } from './polyfills'

/* TYPES */

import { EtaConfig } from './config'
import type { EtaConfig } from './config'

interface EscapeMap {
'&': '&'
Expand Down

0 comments on commit 7690d06

Please sign in to comment.