@ember-data/store 4.6.2 → 4.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A, default as EmberArray } from '@ember/array';
|
|
1
2
|
import { assert } from '@ember/debug';
|
|
2
3
|
import { DEBUG } from '@glimmer/env';
|
|
3
4
|
|
|
@@ -349,13 +350,17 @@ export class InstanceCache {
|
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
function assertRecordsPassedToHasMany(records: RecordInstance[]) {
|
|
352
|
-
assert(
|
|
353
|
+
assert(
|
|
354
|
+
`You must pass an array of records to set a hasMany relationship`,
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
356
|
+
Array.isArray(records) || EmberArray.detect(records)
|
|
357
|
+
);
|
|
353
358
|
assert(
|
|
354
359
|
`All elements of a hasMany relationship must be instances of Model, you passed ${records
|
|
355
360
|
.map((r) => `${typeof r}`)
|
|
356
361
|
.join(', ')}`,
|
|
357
362
|
(function () {
|
|
358
|
-
return records.every((record) => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);
|
|
363
|
+
return A(records).every((record) => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);
|
|
359
364
|
})()
|
|
360
365
|
);
|
|
361
366
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/store",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.4",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"start": "ember serve"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ember-data/canary-features": "4.6.
|
|
21
|
-
"@ember-data/private-build-infra": "4.6.
|
|
20
|
+
"@ember-data/canary-features": "4.6.4",
|
|
21
|
+
"@ember-data/private-build-infra": "4.6.4",
|
|
22
22
|
"@ember/string": "^3.0.0",
|
|
23
23
|
"@embroider/macros": "^1.8.3",
|
|
24
24
|
"@glimmer/tracking": "^1.1.2",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"ember-cli-typescript": "^5.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ember-data/unpublished-test-infra": "4.6.
|
|
32
|
+
"@ember-data/unpublished-test-infra": "4.6.4",
|
|
33
33
|
"@ember/optional-features": "^2.0.0",
|
|
34
34
|
"@ember/test-helpers": "~2.7.0",
|
|
35
35
|
"@types/ember": "^4.0.0",
|