Skip to main content

INTERNAL: The internal package for @std. Do not use this directly.

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
4 weeks ago (1.0.5)

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.

import { diff, diffStr, buildMessage } from "@std/internal";
import { assertEquals } from "@std/assert";

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 },
]);

const diffResult = diffStr("Hello, world!", "Hello, world");

console.log(buildMessage(diffResult));
// [
//   "",
//   "",
//   "    [Diff] Actual / Expected",
//   "",
//   "",
//   "-   Hello, world!",
//   "+   Hello, world",
//   "",
// ]

Add Package

deno add jsr:@std/internal

Import symbol

import * as internal from "@std/internal";

---- OR ----

Import directly with a jsr specifier

import * as internal from "jsr:@std/internal";

Add Package

npx jsr add @std/internal

Import symbol

import * as internal from "@std/internal";

Add Package

yarn dlx jsr add @std/internal

Import symbol

import * as internal from "@std/internal";

Add Package

pnpm dlx jsr add @std/internal

Import symbol

import * as internal from "@std/internal";

Add Package

bunx jsr add @std/internal

Import symbol

import * as internal from "@std/internal";