Skip to content

Commit

Permalink
docs(bytes): fix JSDoc examples match new structure (#2968)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Dec 1, 2022
1 parent 0c3ee63 commit 04d57ea
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bytes/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/** Concatenate the given arrays into a new Uint8Array.
*
* ```ts
* import { concat } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { concat } from "https://deno.land/std@$STD_VERSION/bytes/concat.ts";
* const a = new Uint8Array([0, 1, 2]);
* const b = new Uint8Array([3, 4, 5]);
* console.log(concat(a, b)); // [0, 1, 2, 3, 4, 5]
Expand Down
4 changes: 2 additions & 2 deletions bytes/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
* the array.
*
* ```ts
* import { copy } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { copy } from "https://deno.land/std@$STD_VERSION/bytes/copy.ts";
* const src = new Uint8Array([9, 8, 7]);
* const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
* console.log(copy(src, dst)); // 3
* console.log(dst); // [9, 8, 7, 3, 4, 5]
* ```
*
* ```ts
* import { copy } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { copy } from "https://deno.land/std@$STD_VERSION/bytes/copy.ts";
* const src = new Uint8Array([1, 1, 1, 1]);
* const dst = new Uint8Array([0, 0, 0, 0]);
* console.log(copy(src, dst, 1)); // 3
Expand Down
2 changes: 1 addition & 1 deletion bytes/ends_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* The complexity of this function is O(suffix.length).
*
* ```ts
* import { endsWith } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { endsWith } from "https://deno.land/std@$STD_VERSION/bytes/ends_with.ts";
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const suffix = new Uint8Array([1, 2, 3]);
* console.log(endsWith(source, suffix)); // true
Expand Down
2 changes: 1 addition & 1 deletion bytes/includes_needle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { indexOfNeedle } from "./index_of_needle.ts";
* The complexity of this function is O(source.length * needle.length).
*
* ```ts
* import { includesNeedle } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { includesNeedle } from "https://deno.land/std@$STD_VERSION/bytes/includes_needle.ts";
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const needle = new Uint8Array([1, 2]);
* console.log(includesNeedle(source, needle)); // true
Expand Down
2 changes: 1 addition & 1 deletion bytes/index_of_needle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* The complexity of this function is O(source.lenth * needle.length).
*
* ```ts
* import { indexOfNeedle } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { indexOfNeedle } from "https://deno.land/std@$STD_VERSION/bytes/index_of_needle.ts";
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const needle = new Uint8Array([1, 2]);
* console.log(indexOfNeedle(source, needle)); // 1
Expand Down
2 changes: 1 addition & 1 deletion bytes/last_index_of_needle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* The complexity of this function is O(source.lenth * needle.length).
*
* ```ts
* import { lastIndexOfNeedle } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { lastIndexOfNeedle } from "https://deno.land/std@$STD_VERSION/bytes/last_index_of_needle.ts";
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const needle = new Uint8Array([1, 2]);
* console.log(lastIndexOfNeedle(source, needle)); // 5
Expand Down
2 changes: 1 addition & 1 deletion bytes/repeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { copy } from "./copy.ts";
* If `count` is negative, a `RangeError` is thrown.
*
* ```ts
* import { repeat } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { repeat } from "https://deno.land/std@$STD_VERSION/bytes/repeat.ts";
* const source = new Uint8Array([0, 1, 2]);
* console.log(repeat(source, 3)); // [0, 1, 2, 0, 1, 2, 0, 1, 2]
* console.log(repeat(source, 0)); // []
Expand Down
2 changes: 1 addition & 1 deletion bytes/starts_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* The complexity of this function is O(prefix.length).
*
* ```ts
* import { startsWith } from "https://deno.land/std@$STD_VERSION/bytes/mod.ts";
* import { startsWith } from "https://deno.land/std@$STD_VERSION/bytes/starts_with.ts";
* const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
* const prefix = new Uint8Array([0, 1, 2]);
* console.log(startsWith(source, prefix)); // true
Expand Down

0 comments on commit 04d57ea

Please sign in to comment.