Skip to content

Commit

Permalink
actually format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
williamhorning committed May 16, 2024
1 parent 5b473b3 commit 9fbf1c3
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 26 deletions.
6 changes: 3 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export {
Binary,
BSONRegExp,
BSONSymbol,
Binary,
Code,
DBRef,
Decimal128,
deserialize,
Double,
Int32,
Long,
MaxKey,
MinKey,
ObjectId,
serialize,
Timestamp,
UUID,
deserialize,
serialize
} from "jsr:@lucsoft/web-bson@^0.3.1";
export { crypto as stdCrypto } from "jsr:@std/crypto@^0.224.0/crypto";
export { decodeBase64, encodeBase64 } from "jsr:@std/encoding@^0.224.0/base64";
Expand Down
28 changes: 14 additions & 14 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
/**
* @module
*
*
* # deno_mongo
*
*
* **deno_mongo** is a **MongoDB** driver for Deno which also supports Deno Deploy.
*
*
* ## ATTENTION
*
*
* Deno has support for npm modules now, so you can also use `npm:mongodb`.
* See [this](https://github.com/denodrivers/mongo/issues/380) for more details.
*
*
* ## Usage
*
*
* Replace `version` with the latest version of the driver.
*
*
* ```ts
* import { MongoClient } from 'jsr:@db/mongo@version';
* ```
*
*
* See [the README](https://github.com/denodrivers/mongo) for more examples.
*
*
* ## Other community resources and examples
*
*
* - [atlas_sdk](https://deno.land/x/atlas_sdk) - TypeSafe MongoDB Atlas SDK
* - [dangoDB](https://github.com/oslabs-beta/dangoDB) - MongoDB ORM for Deno
* - [deno-deploy-mongo](https://github.com/erfanium/deno-deploy-mongo) - A simple app with Deno, MongoDB, and Oak using MongoDB Atlas
* - [deno_rest](https://github.com/vicky-gonsalves/deno_rest) - An Oak-based template for RESTful APIs using this driver
* - [denomongo-unittest-utils](https://github.com/Gang-of-Fork/denomongo-unittest-utils) - Mock collection for unit tests
*
*/

export {
Binary,
BSONRegExp,
BSONSymbol, Binary, Code,
BSONSymbol,
Code,
DBRef,
Decimal128,
Double,
Expand All @@ -42,11 +43,10 @@ export {
MinKey,
ObjectId,
Timestamp,
UUID
UUID,
} from "./deps.ts";
export { MongoClient } from "./src/client.ts";
export { Collection } from "./src/collection/mod.ts";
export { Database } from "./src/database.ts";
export { GridFSBucket } from "./src/gridfs/bucket.ts";
export * from "./src/types.ts";

2 changes: 1 addition & 1 deletion src/auth/scram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { HandshakeDocument } from "../protocol/handshake.ts";
import { driverMetadata } from "../protocol/mod.ts";
import type { Credential, Document } from "../types.ts";
import { saslprep } from "../utils/saslprep/mod.ts";
import { AuthPlugin, type AuthContext } from "./base.ts";
import { type AuthContext, AuthPlugin } from "./base.ts";
import { pbkdf2 } from "./pbkdf2.ts";

type CryptoMethod = "sha1" | "sha256";
Expand Down
2 changes: 1 addition & 1 deletion src/auth/x509.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HandshakeDocument } from "../protocol/handshake.ts";
import { driverMetadata } from "../protocol/mod.ts";
import type { Credential, Document } from "../types.ts";
import { AuthPlugin, type AuthContext } from "./base.ts";
import { type AuthContext, AuthPlugin } from "./base.ts";

export interface X509Command extends Document {
authenticate: number;
Expand Down
2 changes: 1 addition & 1 deletion src/collection/commands/update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ObjectId } from "../../../deps.ts";
import type { WireProtocol } from "../../protocol/mod.ts";
import type { Document, UpdateOptions } from "../../types.ts";

interface UpdateResponse {
ok: number;
nModified: number;
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/message.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deserialize, serialize } from "../../deps.ts";
import type { Document } from "../types.ts";
import { OpCode, setHeader, type MessageHeader } from "./header.ts";
import { type MessageHeader, OpCode, setHeader } from "./header.ts";

type MessageFlags = number;

Expand Down
8 changes: 6 additions & 2 deletions src/protocol/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import {
MongoDriverError,
MongoServerError,
type MongoErrorInfo,
MongoServerError,
} from "../error.ts";
import type { Document } from "../types.ts";
import { handshake } from "./handshake.ts";
import { parseHeader } from "./header.ts";
import { deserializeMessage, serializeMessage, type Message } from "./message.ts";
import {
deserializeMessage,
type Message,
serializeMessage,
} from "./message.ts";

interface CommandTask {
requestId: number;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/saslprep/sparse_bitfield.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Pager, type Page } from "./memory_pager.ts";
import { type Page, Pager } from "./memory_pager.ts";

/** Is the given number a power of two? */
function powerOfTwo(x: number): boolean {
Expand Down
6 changes: 5 additions & 1 deletion tests/cases/09_geospatial_types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { Database } from "../../mod.ts";
import type { Collection } from "../../src/collection/collection.ts";
import type { Geometry, GeometryObject, Point } from "../../src/types/geojson.ts";
import type {
Geometry,
GeometryObject,
Point,
} from "../../src/types/geojson.ts";
import type {
$box,
$center,
Expand Down
2 changes: 1 addition & 1 deletion tests/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MongoClient, type Database } from "../mod.ts";
import { type Database, MongoClient } from "../mod.ts";

const hostname = "127.0.0.1";

Expand Down

0 comments on commit 9fbf1c3

Please sign in to comment.