1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 01:59:06 -05:00

refactor(path): reorg (denoland/deno_std#101)

Original: 5be16ba599
This commit is contained in:
木杉 2019-01-11 06:11:44 +08:00 committed by Ryan Dahl
parent 6f8dc44a2b
commit 57c877c443
18 changed files with 38 additions and 36 deletions

View file

@ -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
View file

@ -0,0 +1,2 @@
export * from "./path/mod.ts";
export * from "./path/interface.ts";

7
fs/path/README.md Normal file
View file

@ -0,0 +1,7 @@
# Deno Path Manipulation Libraries
Usage:
```ts
import * as path from "https://deno.land/x/fs/path.ts";
```

View file

@ -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"), "");

View file

@ -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");

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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]

View file

@ -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:

View file

@ -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 =

View file

@ -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();

View file

@ -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 = `

View file

@ -1,7 +0,0 @@
# Deno Path Manipulation Libraries
Usage:
```ts
import * as path from "https://deno.land/x/path/index.ts";
```

18
test.ts
View file

@ -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";