MCPcopy Create free account
hub / github.com/fastify/fastify / factoryBucket

Function factoryBucket

test/schema-feature.test.js:1556–1574  ·  view source on GitHub ↗
(storeInit)

Source from the content-addressed store, hash-verified

1554 const initStoreQueue = []
1555
1556 function factoryBucket (storeInit) {
1557 builtBucket++
1558 t.assert.deepStrictEqual(initStoreQueue.pop(), storeInit)
1559 const store = new Map(storeInit)
1560 return {
1561 add (schema) {
1562 added++
1563 store.set(schema.$id, schema)
1564 },
1565 getSchema (id) {
1566 return store.get(id)
1567 },
1568 getSchemas () {
1569 // what is returned by this function, will be the `storeInit` parameter
1570 initStoreQueue.push(store)
1571 return store
1572 }
1573 }
1574 }
1575
1576 const fastify = Fastify({
1577 schemaController: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected