Skip to content

Commit

Permalink
Fix Deno/Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 13, 2022
1 parent c970f2e commit 3a2f449
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions dist/thinker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -923,14 +923,14 @@
let diff;

if (!times[id]) {
times[id] = process.hrtime();
times[id] = performance.now();
return;
}

diff = process.hrtime(times[id]);
diff = performance.now() - times[id];
times[id] = undefined;

return (diff[0] * 1e9 + diff[1]) / 1E6;
return diff;
};
}());

Expand Down
2 changes: 1 addition & 1 deletion dist/thinker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.mjs.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/thinker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -917,14 +917,14 @@ let time = (function () {
let diff;

if (!times[id]) {
times[id] = process.hrtime();
times[id] = performance.now();
return;
}

diff = process.hrtime(times[id]);
diff = performance.now() - times[id];
times[id] = undefined;

return (diff[0] * 1e9 + diff[1]) / 1E6;
return diff;
};
}());

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thinker-fts",
"version": "2.0.0",
"version": "2.0.1",
"description": "Pure Javascript/Node.js in-memory full text search engine.",
"author": "Hexagon <github.com/hexagon>",
"contributors": [
Expand Down
8 changes: 3 additions & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

// Helper function for measuring execution time
let time = (function () {
let times = {};
Expand All @@ -8,14 +6,14 @@ let time = (function () {
let diff;

if (!times[id]) {
times[id] = process.hrtime();
times[id] = performance.now();
return;
}

diff = process.hrtime(times[id]);
diff = performance.now() - times[id];
times[id] = undefined;

return (diff[0] * 1e9 + diff[1]) / 1E6;
return diff;
};
}());

Expand Down

0 comments on commit 3a2f449

Please sign in to comment.