mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
js: avoid use of BigInt operations for older safari browsers [#103]
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
RangeResponse,
|
||||
EtagMismatch,
|
||||
PMTiles,
|
||||
getUint64,
|
||||
} from "../index";
|
||||
|
||||
test("varint", () => {
|
||||
@@ -171,6 +172,16 @@ test("cache getHeader", async () => {
|
||||
assert.strictEqual(header.maxLat, 1);
|
||||
});
|
||||
|
||||
test("getUint64", async () => {
|
||||
const view = new DataView(new ArrayBuffer(8));
|
||||
view.setBigUint64(0, 0n, true);
|
||||
assert.strictEqual(getUint64(view, 0), 0);
|
||||
view.setBigUint64(0, 1n, true);
|
||||
assert.strictEqual(getUint64(view, 0), 1);
|
||||
view.setBigUint64(0, 9007199254740991n, true);
|
||||
assert.strictEqual(getUint64(view, 0), 9007199254740991);
|
||||
});
|
||||
|
||||
test("cache check against empty", async () => {
|
||||
const source = new TestNodeFileSource("test/data/empty.pmtiles", "1");
|
||||
const cache = new SharedPromiseCache();
|
||||
|
||||
Reference in New Issue
Block a user