Skip to content

Commit 330612d

Browse files
authored
Merge pull request #12 from inaiat/fix/add_readonly_to_types/omurilo
2 parents 550f7f6 + ea16202 commit 330612d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inaiat/fastify-papr",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Fastify Papr Plugin Integration",
55
"type": "module",
66
"engines": {

src/papr-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const paprHelper = (fastify: Readonly<FastifyInstance>, db: Db, disableSc
2424
const registerIndexes = async (collectionName: string, indexes: readonly IndexDescription[]) => db.collection(collectionName).createIndexes(indexes as IndexDescription[])
2525

2626
return {
27-
async register(schemas: ModelRegistrationPair<PaprModels>, indexes: IndexesRegistrationPair[] = []): Promise<PaprModels> {
27+
async register(schemas: ModelRegistrationPair<PaprModels>, indexes: readonly IndexesRegistrationPair[] = []): Promise<PaprModels> {
2828
indexes.map(async ({ collectionIndexes, collectionName}) => {
2929
const index = await registerIndexes(collectionName, collectionIndexes)
3030
fastify.log.info(`Indexes to ${collectionName} created`)

src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type ModelRegistrationPair<T> = {
1010

1111
export type IndexesRegistrationPair = {
1212
collectionName: string;
13-
collectionIndexes: IndexDescription[];
13+
collectionIndexes: readonly IndexDescription[];
1414
}
1515

1616
export type PaprModels = Record<string, Model<any, any>>
@@ -22,7 +22,7 @@ export type FastifyPaprOptions = {
2222
db: Db;
2323
models: ModelRegistrationPair<PaprModels>;
2424
disableSchemaReconciliation?: boolean;
25-
indexes?: IndexesRegistrationPair[];
25+
indexes?: readonly IndexesRegistrationPair[];
2626
}
2727

2828
declare module 'fastify' {

0 commit comments

Comments
 (0)