Skip to content

Commit ff67211

Browse files
authored
chore: fix typos, drop redundant format() (#344)
1 parent 032925e commit ff67211

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/extensions/persist.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { invariant } from 'outvariant'
22
import { unset } from 'es-toolkit/compat'
33
import { defineExtension } from '#/src/extensions/index.js'
44
import {
5-
Collection,
65
kCollectionId,
76
kPrimaryKey,
87
kRelationMap,
8+
type Collection,
99
type RecordType,
1010
} from '#/src/collection.js'
1111
import { Logger } from '#/src/logger.js'
@@ -81,7 +81,7 @@ export function persist() {
8181
persistedData.collectionId,
8282
)
8383

84-
logger.log(`found (${persistedData.records.length}) records to hydate!`)
84+
logger.log(`found (${persistedData.records.length}) records to hydrate!`)
8585

8686
await Promise.all(
8787
persistedData.records.map(async (serializedRecord) => {

src/extensions/sync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
type Collection,
88
type RecordType,
99
} from '#/src/collection.js'
10-
import { Query } from '#/src/query.js'
10+
import type { Query } from '#/src/query.js'
1111
import { isObject, type PropertyPath } from '#/src/utils.js'
1212
import { Logger } from '#/src/logger.js'
1313
import {

src/relation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { StandardSchemaV1 } from '@standard-schema/spec'
2-
import { invariant, format } from 'outvariant'
2+
import { invariant } from 'outvariant'
33
import { isEqual } from 'es-toolkit'
44
import { get, set, unset } from 'es-toolkit/compat'
55
import {
@@ -433,11 +433,7 @@ export abstract class Relation {
433433
},
434434
set: () => {
435435
throw new RelationError(
436-
format(
437-
'Failed to set property "%s" on collection (%s): relational properties are read-only and can only be updated via collection updates',
438-
serializedPath,
439-
this.ownerCollection[kCollectionId],
440-
),
436+
`Failed to set property "${serializedPath}" on collection (${this.ownerCollection[kCollectionId]}): relational properties are read-only and can only be updated via collection updates`,
441437
RelationErrorCodes.UNEXPECTED_SET_EXPRESSION,
442438
this.#createErrorDetails(),
443439
)

0 commit comments

Comments
 (0)