Skip to content

Releases: mswjs/data

v0.11.0

04 Nov 23:28
Compare
Choose a tag to compare

v0.11.0 (04/11/2022)

Features

  • query: add gt/gte/lt/lte to string comparators (#246) (d7f180f)

v0.10.2

30 Aug 23:27
Compare
Choose a tag to compare

v0.10.2 (30/08/2022)

Bug Fixes

v0.10.1

11 May 13:02
Compare
Choose a tag to compare

v0.10.1 (11/05/2022)

Bug Fixes

  • manyOf: exclude undefined from non-nullable without value (#209) (0185ae8)

v0.10.0

06 Apr 23:23
4d43ca0
Compare
Choose a tag to compare

0.10.0 (2022-04-06)

Features

  • manyOf: return empty array for non-nullable without value (#201) (4d43ca0)

v0.9.2

26 Feb 13:35
d8ab2e7
Compare
Choose a tag to compare

0.9.2 (2022-02-26)

Bug Fixes

  • return non-nullable data for "strict" queries (#141) (d8ab2e7)

v0.9.1

26 Feb 13:01
c5e35f0
Compare
Choose a tag to compare

0.9.1 (2022-02-26)

Bug Fixes

  • executeQuery: support circular references when updating entities (#163) (c5e35f0)

v0.9.0

05 Feb 11:31
d32f154
Compare
Choose a tag to compare

0.9.0 (2022-02-05)

Features

  • exports "PRIMARY_KEY" and "ENTITY_TYPE" symbols (#191) (d32f154)

You can use these symbols to read or transform entities dynamically:

import { PRIMARY_KEY } from '@mswjs/data'

// This utility replaces the actual entity values
// with their primary key/values pairs for lazy evaluation later
// (custom logic from your client, if any).
function toLazyEntity(entity) {
  const primaryKeyName = entity[PRIMARY_KEY]
  return { [primaryKeyName]: entity[primaryKeyName] }
}

// Usage
db.users.findMany({}).map(toLazyEntity)

v0.8.4

18 Dec 19:25
Compare
Choose a tag to compare

Bug fixes

  • Fixes the annotation of the nullable relationships that allowed them to be undefined (#180).

v0.8.3

03 Dec 11:50
Compare
Choose a tag to compare

Features

  • Adds runtime validation when updating a relationship (#175):
    • Forbids updating a relationship to reference a different model.
    • Forbids updating a relationship to a compatible plain object (the next value for a relationship must be an entity of the expected model).

Bug fixes

  • When updating a nested relationship produces a corrupted entity (#175).
  • Annotates the evolver function when updating a relationship (#175).

v0.8.2

27 Nov 12:16
Compare
Choose a tag to compare

Features

  • Annotates all relational properties as potentially undefined (#158).

Bug fixes

  • Fixes a regression that reset an array of plain objects when defining a model to an empty array (#169).