2024-04-16 07:09:40 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
// This module is browser compatible.
|
|
|
|
/**
|
|
|
|
* Internal utilities for the public API of the Deno Standard Library.
|
|
|
|
*
|
|
|
|
* Note: this module is for internal use only and should not be used directly.
|
|
|
|
*
|
2024-05-17 04:59:10 +00:00
|
|
|
* ```ts
|
2024-05-17 05:32:03 +00:00
|
|
|
* import { diff, diffStr, buildMessage } from "@std/internal";
|
refactor(assert,async,bytes,cli,collections,crypto,csv,data-structures,datetime,dotenv,encoding,expect,fmt,front-matter,fs,html,http,ini,internal,io,json,jsonc,log,media-types,msgpack,net,path,semver,streams,testing,text,toml,ulid,url,uuid,webgpu,yaml): import from `@std/assert` (#5199)
* refactor: import from `@std/assert`
* update
2024-06-30 08:30:10 +00:00
|
|
|
* import { assertEquals } from "@std/assert";
|
2024-05-17 04:59:10 +00:00
|
|
|
*
|
|
|
|
* const a = [1, 2, 3];
|
|
|
|
* const b = [1, 2, 4];
|
|
|
|
*
|
|
|
|
* assertEquals(diff(a, b), [
|
|
|
|
* { type: "common", value: 1 },
|
|
|
|
* { type: "common", value: 2 },
|
|
|
|
* { type: "removed", value: 3 },
|
|
|
|
* { type: "added", value: 4 },
|
|
|
|
* ]);
|
|
|
|
*
|
2024-05-17 05:32:03 +00:00
|
|
|
* const diffResult = diffStr("Hello, world!", "Hello, world");
|
2024-05-17 04:59:10 +00:00
|
|
|
*
|
|
|
|
* console.log(buildMessage(diffResult));
|
|
|
|
* // [
|
|
|
|
* // "",
|
|
|
|
* // "",
|
|
|
|
* // " [Diff] Actual / Expected",
|
|
|
|
* // "",
|
|
|
|
* // "",
|
|
|
|
* // "- Hello, world!",
|
|
|
|
* // "+ Hello, world",
|
|
|
|
* // "",
|
|
|
|
* // ]
|
|
|
|
* ```
|
|
|
|
*
|
2024-04-16 07:09:40 +00:00
|
|
|
* @module
|
|
|
|
*/
|
2024-09-19 05:38:32 +00:00
|
|
|
export * from "./assertion_state.ts";
|
2024-05-09 06:14:09 +00:00
|
|
|
export * from "./build_message.ts";
|
2024-04-16 07:09:40 +00:00
|
|
|
export * from "./diff.ts";
|
2024-05-09 06:14:09 +00:00
|
|
|
export * from "./diff_str.ts";
|
|
|
|
export * from "./format.ts";
|
2024-05-15 05:00:04 +00:00
|
|
|
export * from "./styles.ts";
|
2024-05-15 07:57:20 +00:00
|
|
|
export * from "./types.ts";
|