mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
883f129939
* docs(bytes): trim module documentation * fix * tweaks * tweak
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
/**
|
|
* Helper functions for working with
|
|
* {@linkcode https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array | Uint8Array}
|
|
* byte slices.
|
|
*
|
|
* ```ts
|
|
* import { concat, indexOfNeedle, endsWith } from "@std/bytes";
|
|
* import { assertEquals } from "@std/assert/assert-equals";
|
|
*
|
|
* const a = new Uint8Array([0, 1, 2]);
|
|
* const b = new Uint8Array([3, 4, 5]);
|
|
*
|
|
* const c = concat([a, b]);
|
|
*
|
|
* assertEquals(c, new Uint8Array([0, 1, 2, 3, 4, 5]));
|
|
*
|
|
* assertEquals(indexOfNeedle(c, new Uint8Array([2, 3])), 2);
|
|
*
|
|
* assertEquals(endsWith(c, b), true);
|
|
* ```
|
|
*
|
|
* @module
|
|
*/
|
|
export * from "./concat.ts";
|
|
export * from "./copy.ts";
|
|
export * from "./ends_with.ts";
|
|
export * from "./equals.ts";
|
|
export * from "./includes_needle.ts";
|
|
export * from "./index_of_needle.ts";
|
|
export * from "./last_index_of_needle.ts";
|
|
export * from "./repeat.ts";
|
|
export * from "./starts_with.ts";
|