提交 2ba7de2d 编写于 作者: B Bert Belder 提交者: Ryan Dahl

Change `import { x } from "deno"` to `const { x } = Deno` (denoland/deno_std#218)


Original: https://github.com/denoland/deno_std/commit/6063378a9284a48d42e37b4899f947c5c8bbf0b3
上级 a7bf1913
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { exit, noColor } from "deno";
const { exit, noColor } = Deno;
interface BenchmarkClock {
start: number;
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { noColor } from "deno";
const { noColor } = Deno;
interface Code {
open: string;
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { listen, copy } from "deno";
const { listen, copy } = Deno;
(async () => {
const addr = "0.0.0.0:8080";
......
#!/usr/bin/env deno --allow-net --allow-env
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { args, env, exit, readFile } from "deno";
const { args, env, exit, readFile } = Deno;
import { parse } from "https://deno.land/x/flags/mod.ts";
function pathBase(p: string): string {
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { run } from "deno";
const { run } = Deno;
import { test, assertEqual } from "../testing/mod.ts";
/** Example of how to do basic tests */
......
......@@ -5,7 +5,7 @@ Command line arguments parser for Deno based on minimist
# Example
```ts
import { args } from "deno";
const { args } = Deno;
import { parse } from "https://deno.land/x/flags/mod.ts";
console.dir(parse(args));
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { args } from "deno";
const { args } = Deno;
import { parse } from "./mod.ts";
console.dir(parse(args));
#!/usr/bin/env deno --allow-run --allow-write --allow-read
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { exit, args } from "deno";
const { exit, args } = Deno;
import { parse } from "./flags/mod.ts";
import { xrun, executableSuffix } from "./prettier/util.ts";
......
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
import { platform } from "deno";
const { platform } = Deno;
// Alphabet chars.
export const CHAR_UPPERCASE_A = 65; /* A */
......
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
import { cwd, env } from "deno";
const { cwd, env } = Deno;
import { FormatInputPathObject, ParsedPath } from "./interface.ts";
import {
isWindows,
......
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
const { cwd } = Deno;
import { test, assertEqual } from "../../testing/mod.ts";
import * as path from "./mod.ts";
import { cwd } from "deno";
const windowsTests =
// arguments result
......
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
const { cwd } = Deno;
import { test, assertEqual } from "../../testing/mod.ts";
import * as path from "./mod.ts";
import { cwd } from "deno";
const pwd = cwd();
......
import {
FileInfo,
cwd,
readDir,
readDirSync,
readlink,
readlinkSync,
stat,
statSync
} from "deno";
import { relative } from "path.ts";
const { readDir, readDirSync, readlink, readlinkSync, stat, statSync } = Deno;
import { FileInfo } from "deno";
export interface WalkOptions {
maxDepth?: number;
......
import {
const {
cwd,
chdir,
FileInfo,
makeTempDir,
mkdir,
open,
platform,
remove,
symlink
} from "deno";
} = Deno;
import { FileInfo } from "deno";
import { walk, walkSync, WalkOptions } from "./walk.ts";
import { test, assert, TestFunction } from "../testing/mod.ts";
......
......@@ -6,13 +6,14 @@
// TODO Add tests like these:
// https://github.com/indexzero/http-server/blob/master/test/http-server-test.js
const { ErrorKind, cwd, args, stat, readDir, open } = Deno;
import { DenoError } from "deno";
import {
listenAndServe,
ServerRequest,
setContentLength,
Response
} from "./server.ts";
import { cwd, DenoError, ErrorKind, args, stat, readDir, open } from "deno";
import { extname } from "../fs/path.ts";
import { contentType } from "../media_types/mod.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { readFile, run } from "deno";
const { readFile, run } = Deno;
import { test, assert, assertEqual } from "../testing/mod.ts";
import { BufReader } from "../io/bufio.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { listen, Conn, toAsyncIterator, Reader, Writer, copy } from "deno";
const { listen, toAsyncIterator, copy } = Deno;
import { Conn, Reader, Writer } from "deno";
import { BufReader, BufState, BufWriter } from "../io/bufio.ts";
import { TextProtoReader } from "../textproto/mod.ts";
import { STATUS_TEXT } from "./http_status.ts";
......
......@@ -5,7 +5,7 @@
// Ported from
// https://github.com/golang/go/blob/master/src/net/http/responsewrite_test.go
import { Buffer } from "deno";
const { Buffer } = Deno;
import { assertEqual, test } from "../testing/mod.ts";
import { Response, ServerRequest } from "./server.ts";
import { BufReader, BufWriter } from "../io/bufio.ts";
......
......@@ -3,7 +3,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import { Buffer, Reader, ReadResult } from "deno";
const { Buffer } = Deno;
import { Reader, ReadResult } from "deno";
import { test, assert, assertEqual } from "../testing/mod.ts";
import { BufReader, BufState, BufWriter } from "./bufio.ts";
import * as iotest from "./iotest.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { Buffer, Reader, ReadResult } from "deno";
const { Buffer } = Deno;
import { Reader, ReadResult } from "deno";
import { assert, assertEqual, runTests, test } from "../testing/mod.ts";
import {
copyN,
......
const { copy } = Deno;
import { assert, test } from "../testing/mod.ts";
import { MultiReader, StringReader } from "./readers.ts";
import { StringWriter } from "./writers.ts";
import { copy } from "deno";
import { copyN } from "./ioutil.ts";
import { decode } from "../strings/strings.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { Buffer, File, mkdir, open, Reader } from "deno";
const { Buffer, mkdir, open } = Deno;
import { File, Reader } from "deno";
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
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
const { remove } = Deno;
import { test, assert } from "../testing/mod.ts";
import { copyBytes, tempFile } from "./util.ts";
import { remove } from "deno";
import * as path from "../fs/path.ts";
test(function testCopyBytes() {
......
const { copy } = Deno;
import { assert, test } from "../testing/mod.ts";
import { StringWriter } from "./writers.ts";
import { StringReader } from "./readers.ts";
import { copyN } from "./ioutil.ts";
import { copy } from "deno";
test(async function ioStringWriter() {
const w = new StringWriter("base");
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { open, File, Writer } from "deno";
const { open } = Deno;
import { File, Writer } from "deno";
import { getLevelByName, LogLevel } from "./levels.ts";
import { LogRecord } from "./logger.ts";
import { red, yellow, blue, bold } from "../colors/mod.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { Buffer, Closer, copy, Reader, ReadResult, remove, Writer } from "deno";
const { Buffer, copy, remove } = Deno;
import { Closer, Reader, ReadResult, Writer } from "deno";
import { FormFile } from "./formfile.ts";
import {
bytesFindIndex,
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
const { Buffer, copy, open, remove } = Deno;
import { assert, test } from "../testing/mod.ts";
import {
matchAfterPrefix,
......@@ -7,7 +8,6 @@ import {
MultipartWriter,
scanUntilBoundary
} from "./multipart.ts";
import { Buffer, copy, open, remove } from "deno";
import * as path from "../fs/path.ts";
import { FormFile, isFormFile } from "./formfile.ts";
import { StringWriter } from "../io/writers.ts";
......
......@@ -2,16 +2,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// This script formats the given source files. If the files are omitted, it
// formats the all files in the repository.
import {
args,
platform,
readAll,
lstat,
exit,
run,
readFile,
writeFile
} from "deno";
const { args, platform, readAll, lstat, exit, run, readFile, writeFile } = Deno;
import { xrun } from "./util.ts";
import { parse } from "../flags/mod.ts";
import { prettier, prettierPlugins } from "./prettier.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, assertEqual } from "../testing/mod.ts";
import { xrun, executableSuffix } from "./util.ts";
import { readAll } from "deno";
const { readAll } = Deno;
const decoder = new TextDecoder();
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { platform, run } from "deno";
const { platform, run } = Deno;
// Runs a command in cross-platform way
export function xrun(opts) {
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { Buffer, Writer, Conn } from "deno";
const { Buffer } = Deno;
import { Writer, Conn } from "deno";
import { BufReader, BufWriter } from "../io/bufio.ts";
import { readLong, readShort, sliceLongToBytes } from "../io/ioutil.ts";
import { Sha1 } from "./sha1.ts";
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import "./sha1_test.ts";
import { Buffer } from "deno";
const { Buffer } = Deno;
import { BufReader } from "../io/bufio.ts";
import { assert, assertEqual, test } from "../testing/mod.ts";
import {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册