forked from wmsmacdonald/vcdiff-decoder
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from ably-forks/tree-shaking
Make library tree-shakable
- Loading branch information
Showing
18 changed files
with
1,364 additions
and
981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Check | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Use Node.js 8.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 8.x | ||
|
||
- run: npm ci | ||
- run: npm run grunt -- test:node | ||
- run: npm run grunt -- test:browser:local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
npm-debug.log | ||
local.log | ||
browserstack.err | ||
test/build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
'use strict'; | ||
|
||
function NearCache(size) { | ||
this.size = size; | ||
this.near = new Array(this.size).fill(0); | ||
this.nextSlot = 0; | ||
} | ||
|
||
NearCache.prototype.update = function(address) { | ||
if (this.near.length > 0) { | ||
this.near[this.nextSlot] = address; | ||
this.nextSlot = (this.nextSlot + 1) % this.near.length; | ||
export default class NearCache { | ||
constructor(size) { | ||
this.size = size; | ||
this.near = new Array(this.size).fill(0); | ||
this.nextSlot = 0; | ||
} | ||
}; | ||
|
||
NearCache.prototype.get = function(m, offset) { | ||
let address = this.near[m] + offset; | ||
return address; | ||
}; | ||
update(address) { | ||
if (this.near.length > 0) { | ||
this.near[this.nextSlot] = address; | ||
this.nextSlot = (this.nextSlot + 1) % this.near.length; | ||
} | ||
} | ||
|
||
module.exports = NearCache; | ||
get(m, offset) { | ||
let address = this.near[m] + offset; | ||
return address; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
'use strict'; | ||
|
||
function SameCache(size) { | ||
this.size = size; | ||
this.same = new Array(this.size * 256).fill(0); | ||
} | ||
|
||
SameCache.prototype.update = function(address) { | ||
if (this.same.length > 0) { | ||
this.same[address % (this.size * 256)] = address; | ||
export default class SameCache { | ||
constructor(size) { | ||
this.size = size; | ||
this.same = new Array(this.size * 256).fill(0); | ||
} | ||
}; | ||
|
||
SameCache.prototype.get = function(m, offset) { | ||
let address = this.same[m * 256 + offset]; | ||
return address; | ||
}; | ||
update(address) { | ||
if (this.same.length > 0) { | ||
this.same[address % (this.size * 256)] = address; | ||
} | ||
}; | ||
|
||
module.exports = SameCache; | ||
get(m, offset) { | ||
let address = this.same[m * 256 + offset]; | ||
return address; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.