Skip to content

Commit

Permalink
Restructured file organization to be Deno compliant, i.e. use `mod.t…
Browse files Browse the repository at this point in the history
…s` instead of `index.js`. The `package.json` file is still manually maintained.
  • Loading branch information
anywhichway committed Jul 27, 2023
1 parent 690ba6e commit f630fa8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,17 @@ The following operators are supported in patterns.
# Testing

- `constants.js ... 100.000% (3/3)`
- `index.js ... index.js ... 90.196% (690/765)`
- `operators.js ... ... 95.330% (347/364)`
- `denodata.ts ... index.js ... 90.196% (690/765)`
- `operators.ts ... ... 95.330% (347/364)`

# Release History (Reverse Chronological Order)

- Until production release, all versions will just have a tertiary version number.
- Beta commenced when unit test coverage first exceeded 90%
- The exposed API is stable. Additional features may be exposed.

2023-07-28 v0.0.25 (Beta)
- Restructured file organization to be Deno compliant, i.e. use `mod.ts` instead of `index.js`. The `package.json` file is still manually maintained.

2023-07-27 v0.0.24 (Beta)
- Some adjustments to README.md to start brining documentation in line with TypeScript.
Expand Down
5 changes: 5 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Denodata from "./src/denodata.ts";
import operators from "./src/operators.ts";
import DONE from "./src/constants.js";

export {Denodata as default, Denodata as Denobase, Denodata, operators, DONE}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "denodata",
"version": "0.0.24",
"version": "0.0.25",
"description": "Generalized indexing and search for Deno KV",
"type": "module",
"main": "index.ts",
"main": "mod.ts",
"scripts": {
"test": "deno test --allow-net --unstable"
"test": "deno test --allow-net --unstable ./src/denodata.test.js"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions index.test.js → src/denodata.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
import {Denobase} from "./index.ts";
import Denodata from "./denodata.ts";
import {operators} from "./operators.ts";
const {$echoes} = operators;

Expand All @@ -13,7 +13,7 @@ const test = async (deno) => {
} else {
deno = Deno
}
const db = await Denobase();
const db = await Denodata();
const uuidv4 = () => crypto.randomUUID();

class Book {
Expand Down
4 changes: 2 additions & 2 deletions index.ts → src/denodata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {DONE} from "./src/constants.js"
import {DONE} from "./constants.js"
const getValue = (key:string, data:object) :undefined|object => {
const keys: string[] = key.split(".");
let result: any = data;
Expand Down Expand Up @@ -809,4 +809,4 @@ Denodata.prototype.set = async function (key:any, value:any,metadata:object|unde
}


export {Denodata as default,Denodata,Denodata as Denobase};
export default Denodata;
File renamed without changes.
6 changes: 3 additions & 3 deletions operators.ts → src/operators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//const levenshteinDistance = distance;
//const toWords = new ToWords();

import {DONE} from "./src/constants.js";
import soundex from "./src/soundex.js";
import validateLuhn from "./src/validate-luhn.js";
import {DONE} from "./constants.js";
import soundex from "./soundex.js";
import validateLuhn from "./validate-luhn.js";


type Operator = (right:any, params?: { test?:any}) => any;
Expand Down

0 comments on commit f630fa8

Please sign in to comment.