mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
refactor(path): reorg (#101)
This commit is contained in:
parent
41a2d21826
commit
5be16ba599
18 changed files with 38 additions and 36 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
A framework for creating HTTP/HTTPS servers inspired by GoLang.
|
||||
|
||||
- **[path](./path/)**
|
||||
- **[path](./fs/path)**
|
||||
|
||||
File path manipulation.
|
||||
|
||||
|
|
2
fs/path.ts
Normal file
2
fs/path.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
export * from "./path/mod.ts";
|
||||
export * from "./path/interface.ts";
|
7
fs/path/README.md
Normal file
7
fs/path/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Deno Path Manipulation Libraries
|
||||
|
||||
Usage:
|
||||
|
||||
```ts
|
||||
import * as path from "https://deno.land/x/fs/path.ts";
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
test(function basename() {
|
||||
assertEqual(path.basename(".js", ".js"), "");
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
test(function dirname() {
|
||||
assertEqual(path.posix.dirname("/a/b/"), "/a");
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
const slashRE = /\//g;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
test(function isAbsolute() {
|
||||
assertEqual(path.posix.isAbsolute("/home/foo"), true);
|
|
@ -1,5 +1,5 @@
|
|||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
const backslashRE = /\\/g;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
const winPaths = [
|
||||
// [path, root]
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
|
||||
const relativeTests = {
|
||||
win32:
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
import { cwd } from "deno";
|
||||
|
||||
const windowsTests =
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright the Browserify authors. MIT License.
|
||||
// Ported from https://github.com/browserify/path-browserify/
|
||||
|
||||
import { test, assertEqual } from "../testing/mod.ts";
|
||||
import * as path from "./index.ts";
|
||||
import { test, assertEqual } from "../../testing/mod.ts";
|
||||
import * as path from "./mod.ts";
|
||||
import { cwd } from "deno";
|
||||
|
||||
const pwd = cwd();
|
|
@ -12,7 +12,7 @@ import {
|
|||
Response
|
||||
} from "./http.ts";
|
||||
import { cwd, DenoError, ErrorKind, args, stat, readDir, open } from "deno";
|
||||
import { extname } from "../path/index.ts";
|
||||
import { extname } from "../fs/path.ts";
|
||||
import * as extensionsMap from "./extension_map.json";
|
||||
|
||||
const dirViewerTemplate = `
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# Deno Path Manipulation Libraries
|
||||
|
||||
Usage:
|
||||
|
||||
```ts
|
||||
import * as path from "https://deno.land/x/path/index.ts";
|
||||
```
|
18
test.ts
18
test.ts
|
@ -10,15 +10,15 @@ import "mkdirp/test.ts";
|
|||
import "net/bufio_test.ts";
|
||||
import "net/http_test.ts";
|
||||
import "net/textproto_test.ts";
|
||||
import "path/basename_test.ts";
|
||||
import "path/dirname_test.ts";
|
||||
import "path/extname_test.ts";
|
||||
import "path/isabsolute_test.ts";
|
||||
import "path/join_test.ts";
|
||||
import "path/parse_format_test.ts";
|
||||
import "path/relative_test.ts";
|
||||
import "path/resolve_test.ts";
|
||||
import "path/zero_length_strings_test.ts";
|
||||
import "fs/path/basename_test.ts";
|
||||
import "fs/path/dirname_test.ts";
|
||||
import "fs/path/extname_test.ts";
|
||||
import "fs/path/isabsolute_test.ts";
|
||||
import "fs/path/join_test.ts";
|
||||
import "fs/path/parse_format_test.ts";
|
||||
import "fs/path/relative_test.ts";
|
||||
import "fs/path/resolve_test.ts";
|
||||
import "fs/path/zero_length_strings_test.ts";
|
||||
import "testing/test.ts";
|
||||
|
||||
import { runTests, completePromise } from "net/file_server_test.ts";
|
||||
|
|
Loading…
Reference in a new issue