Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
Remove dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleJune committed Oct 17, 2020
1 parent 5ef8adb commit 0a8f45d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Collections

[![version](https://img.shields.io/badge/release-v0.9.0-success)](https://github.com/udibo/collections/tree/v0.9.0)
[![deno doc](https://img.shields.io/badge/deno-doc-success?logo=deno)](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.ts)
[![version](https://img.shields.io/badge/release-v0.9.1-success)](https://github.com/udibo/collections/tree/v0.9.1)
[![deno doc](https://img.shields.io/badge/deno-doc-success?logo=deno)](https://doc.deno.land/https/deno.land/x/collections@v0.9.1/mod.ts)
[![deno version](https://img.shields.io/badge/deno-v1.4.6-success?logo=deno)](https://github.com/denoland/deno/tree/v1.4.6)
[![CI](https://github.com/udibo/collections/workflows/CI/badge.svg)](https://github.com/udibo/collections/actions?query=workflow%3ACI)
[![license](https://img.shields.io/github/license/udibo/collections)](https://github.com/udibo/collections/blob/master/LICENSE)
Expand All @@ -20,18 +20,18 @@ but can also be imported directly from GitHub using raw content URLs.

```ts
// Import from Deno's third party module registry
import { Vector } from "https://deno.land/x/collections@v0.9.0/mod.ts";
import { Vector } from "https://deno.land/x/collections@v0.9.1/mod.ts";
// Import from GitHub
import { Vector } "https://raw.githubusercontent.com/udibo/collections/v0.9.0/mod.ts";
import { Vector } "https://raw.githubusercontent.com/udibo/collections/v0.9.1/mod.ts";
```
If you do not need all of the sub-modules, you can choose to just import the sub-modules you need.
```ts
// Import from Deno's third party module registry
import { Vector } from "https://deno.land/x/collections@v0.9.0/vector.ts";
import { Vector } from "https://deno.land/x/collections@v0.9.1/vector.ts";
// Import from GitHub
import { Vector } from "https://raw.githubusercontent.com/udibo/collections/v0.9.0/vector.ts";
import { Vector } from "https://raw.githubusercontent.com/udibo/collections/v0.9.1/vector.ts";
```

### Node.js
Expand All @@ -41,14 +41,14 @@ Node.js fully supports ES Modules.
If a Node.js package has the type "module" specified in its package.json file, the JavaScript bundle can be imported as a `.js` file.

```js
import { Vector } from "./collections_v0.9.0.js";
import { Vector } from "./collections_v0.9.1.js";
```

The default type for Node.js packages is "commonjs".
To import the bundle into a commonjs package, the file extension of the JavaScript bundle must be changed from `.js` to `.mjs`.

```js
import { Vector } from "./collections_v0.9.0.mjs";
import { Vector } from "./collections_v0.9.1.mjs";
```

See [Node.js Documentation](https://nodejs.org/api/esm.html) for more information.
Expand All @@ -66,15 +66,15 @@ Script tags for ES modules must have the type attribute set to "module".

```js
// main.js
import { Vector } from "./collections_v0.9.0.js";
import { Vector } from "./collections_v0.9.1.js";
```

You can also embed a module script directly into an HTML file by placing the JavaScript code
within the body of the script tag.

```html
<script type="module">
import { Vector } from "./collections_v0.9.0.js";
import { Vector } from "./collections_v0.9.1.js";
</script>
```

Expand All @@ -88,14 +88,14 @@ A double-ended queue implemented with a growable ring buffer.
Vector is faster than JavaScript's built in Array class for unshifting and shifting
because it only requires reallocation when increasing the capacity.

See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.ts#Vector) for more information.
See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.1/mod.ts#Vector) for more information.

### BinaryHeap

A priority queue implemented with a binary heap. The heap is in decending order by default,
using JavaScript's built in comparison operators to sort the values.

See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.ts#BinaryHeap) for more information.
See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.1/mod.ts#BinaryHeap) for more information.

#### BinaryHeap Efficiency

Expand All @@ -110,8 +110,8 @@ See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.t
Creating and using max and min heaps:

```ts
import { BinaryHeap } from "https://deno.land/x/collections@v0.9.0/binary_heap.ts";
import { ascend } from "https://deno.land/x/collections@v0.9.0/comparators.ts";
import { BinaryHeap } from "https://deno.land/x/collections@v0.9.1/binary_heap.ts";
import { ascend } from "https://deno.land/x/collections@v0.9.1/comparators.ts";

const maxHeap: BinaryHeap<number> = new BinaryHeap();
maxHeap.push(...[4, 1, 3, 6, 2]); // 5
Expand All @@ -133,7 +133,7 @@ maxHeap.pop(); // 3
An unbalanced binary search tree. The values are in ascending order by default,
using JavaScript's built in comparison operators to sort the values.

See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.ts#BSTree) for more information.
See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.1/mod.ts#BSTree) for more information.

#### BSTree Efficiency

Expand All @@ -154,7 +154,7 @@ Red-Black Trees require fewer rotations than AVL Trees, so they can provide fast
A red-black tree. The values are in ascending order by default,
using JavaScript's built in comparison operators to sort the values.

See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.0/mod.ts#RBTree) for more information.
See [deno docs](https://doc.deno.land/https/deno.land/x/collections@v0.9.1/mod.ts#RBTree) for more information.

#### RBTree Efficiency

Expand Down
2 changes: 1 addition & 1 deletion vector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** This module is browser compatible. */

import { swap } from "https://deno.land/x/collections@v0.8.0/common.ts";
import { swap } from "./common.ts";
import type { compare, map } from "./common.ts";

const maxCapacity: number = Math.pow(2, 32) - 1;
Expand Down

0 comments on commit 0a8f45d

Please sign in to comment.