From 0a8f45dbd4a6ae4b1c1774089ffec105a1167522 Mon Sep 17 00:00:00 2001 From: Kyle June Date: Sat, 17 Oct 2020 15:01:17 -0500 Subject: [PATCH] Remove dependency --- README.md | 32 ++++++++++++++++---------------- vector.ts | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8de83e5..130ee80 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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. @@ -66,7 +66,7 @@ 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 @@ -74,7 +74,7 @@ within the body of the script tag. ```html ``` @@ -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 @@ -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 = new BinaryHeap(); maxHeap.push(...[4, 1, 3, 6, 2]); // 5 @@ -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 @@ -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 diff --git a/vector.ts b/vector.ts index 3a85520..68f2070 100644 --- a/vector.ts +++ b/vector.ts @@ -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;