replace jest with ava
This commit is contained in:
parent
27cc8b23fe
commit
0347b72305
11775 changed files with 84546 additions and 1440575 deletions
24
node_modules/concordance/lib/Registry.js
generated
vendored
Normal file
24
node_modules/concordance/lib/Registry.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use strict'
|
||||
|
||||
class Registry {
|
||||
constructor () {
|
||||
this.counter = 0
|
||||
this.map = new WeakMap()
|
||||
}
|
||||
|
||||
has (value) {
|
||||
return this.map.has(value)
|
||||
}
|
||||
|
||||
get (value) {
|
||||
return this.map.get(value).descriptor
|
||||
}
|
||||
|
||||
alloc (value) {
|
||||
const index = ++this.counter
|
||||
const pointer = {descriptor: null, index}
|
||||
this.map.set(value, pointer)
|
||||
return pointer
|
||||
}
|
||||
}
|
||||
module.exports = Registry
|
||||
Loading…
Add table
Add a link
Reference in a new issue