From f90f62fa52eccd020026b6899de1b3c7ae0288b6 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 8 Mar 2019 09:25:16 +0900 Subject: Use Deno global var instead of built-in "deno" module (denoland/deno_std#247) Original: https://github.com/denoland/deno_std/commit/395392912d69fe320d74c1f95a27be8e4adc0fa6 --- io/bufio.ts | 4 +++- io/bufio_test.ts | 3 ++- io/iotest.ts | 4 ++-- io/ioutil.ts | 3 ++- io/ioutil_test.ts | 3 ++- io/readers.ts | 3 ++- io/util.ts | 3 ++- io/writers.ts | 2 +- 8 files changed, 16 insertions(+), 9 deletions(-) (limited to 'io') diff --git a/io/bufio.ts b/io/bufio.ts index f583a2ff9..f057952fe 100644 --- a/io/bufio.ts +++ b/io/bufio.ts @@ -3,7 +3,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -import { Reader, ReadResult, Writer } from "deno"; +type Reader = Deno.Reader; +type ReadResult = Deno.ReadResult; +type Writer = Deno.Writer; import { charCode, copyBytes } from "./util.ts"; import { assert } from "../testing/asserts.ts"; diff --git a/io/bufio_test.ts b/io/bufio_test.ts index aed58d9ed..1351b7e37 100644 --- a/io/bufio_test.ts +++ b/io/bufio_test.ts @@ -4,7 +4,8 @@ // license that can be found in the LICENSE file. const { Buffer } = Deno; -import { Reader, ReadResult } from "deno"; +type Reader = Deno.Reader; +type ReadResult = Deno.ReadResult; import { test } from "../testing/mod.ts"; import { assert, assertEquals } from "../testing/asserts.ts"; import { BufReader, BufWriter } from "./bufio.ts"; diff --git a/io/iotest.ts b/io/iotest.ts index e3a42f58a..9973562a7 100644 --- a/io/iotest.ts +++ b/io/iotest.ts @@ -2,8 +2,8 @@ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - -import { Reader, ReadResult } from "deno"; +type Reader = Deno.Reader; +type ReadResult = Deno.ReadResult; /** OneByteReader returns a Reader that implements * each non-empty Read by reading one byte from r. diff --git a/io/ioutil.ts b/io/ioutil.ts index 2d189620d..484aba281 100644 --- a/io/ioutil.ts +++ b/io/ioutil.ts @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { BufReader } from "./bufio.ts"; -import { Reader, Writer } from "deno"; +type Reader = Deno.Reader; +type Writer = Deno.Writer; import { assert } from "../testing/asserts.ts"; /** copy N size at the most. If read size is lesser than N, then returns nread */ diff --git a/io/ioutil_test.ts b/io/ioutil_test.ts index 72adfcec2..c6980ebb9 100644 --- a/io/ioutil_test.ts +++ b/io/ioutil_test.ts @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. const { Buffer } = Deno; -import { Reader, ReadResult } from "deno"; +type Reader = Deno.Reader; +type ReadResult = Deno.ReadResult; import { test } from "../testing/mod.ts"; import { assertEquals } from "../testing/asserts.ts"; import { diff --git a/io/readers.ts b/io/readers.ts index df0299356..915d73e6c 100644 --- a/io/readers.ts +++ b/io/readers.ts @@ -1,5 +1,6 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { Reader, ReadResult } from "deno"; +type Reader = Deno.Reader; +type ReadResult = Deno.ReadResult; import { encode } from "../strings/strings.ts"; /** Reader utility for strings */ diff --git a/io/util.ts b/io/util.ts index d87776ee5..30df2a0e1 100644 --- a/io/util.ts +++ b/io/util.ts @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. const { Buffer, mkdir, open } = Deno; -import { File, Reader } from "deno"; +type File = Deno.File; +type Reader = Deno.Reader; import { encode } from "../strings/strings.ts"; import * as path from "../fs/path.ts"; // `off` is the offset into `dst` where it will at which to begin writing values diff --git a/io/writers.ts b/io/writers.ts index 15c2628ac..07c5743ad 100644 --- a/io/writers.ts +++ b/io/writers.ts @@ -1,5 +1,5 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { Writer } from "deno"; +type Writer = Deno.Writer; import { decode, encode } from "../strings/strings.ts"; /** Writer utility for buffering string chunks */ -- cgit v1.2.3