ember-source 4.5.0-beta.1 → 4.6.0-alpha.3
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.
- package/blueprints-js/-addon-import.js +48 -0
- package/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js +24 -0
- package/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +12 -0
- package/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/component/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component/files/__root__/__templatepath__/__templatename__.hbs +1 -0
- package/blueprints-js/component-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-class/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component-class-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +34 -0
- package/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +38 -0
- package/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +31 -0
- package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/controller/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/helper/files/__root__/__collection__/__name__.js +5 -0
- package/blueprints-js/helper/mu-files/__root__/__collection__/__name__.js +7 -0
- package/blueprints-js/helper-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +26 -0
- package/blueprints-js/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +28 -0
- package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +18 -0
- package/blueprints-js/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +15 -0
- package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +17 -0
- package/blueprints-js/initializer/files/__root__/initializers/__name__.js +5 -0
- package/blueprints-js/initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +28 -0
- package/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +31 -0
- package/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +25 -0
- package/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +37 -0
- package/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js +5 -0
- package/blueprints-js/instance-initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +30 -0
- package/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +32 -0
- package/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +26 -0
- package/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +39 -0
- package/blueprints-js/mixin/files/__root__/mixins/__name__.js +3 -0
- package/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/route/files/__root__/__path__/__name__.js +9 -0
- package/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs +2 -0
- package/blueprints-js/route-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js +1 -0
- package/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +15 -0
- package/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js +17 -0
- package/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/service/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/template/files/__root__/__path__/__name__.hbs +0 -0
- package/blueprints-js/test-framework-detector.js +60 -0
- package/blueprints-js/util/files/__root__/utils/__name__.js +3 -0
- package/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js +10 -0
- package/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +10 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +4 -4
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +112 -136
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +584 -944
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/error-handling/index.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +21 -11
- package/dist/packages/@ember/-internals/metal/index.js +16 -9
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +0 -4
- package/dist/packages/@ember/-internals/runtime/lib/compare.js +4 -3
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +281 -368
- package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -5
- package/dist/packages/@ember/application/lib/application.js +4 -1
- package/dist/packages/@ember/canary-features/index.js +2 -2
- package/dist/packages/@ember/controller/lib/controller_mixin.js +8 -18
- package/dist/packages/@ember/engine/index.js +3 -1
- package/dist/packages/@ember/object/index.js +16 -8
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +6 -4
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +74 -365
- package/dist/packages/@ember/test/adapter.js +2 -2
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/lib/adapters/adapter.js +11 -27
- package/dist/packages/ember-testing/lib/adapters/qunit.js +8 -16
- package/dist/packages/ember-testing/lib/ext/application.js +28 -19
- package/dist/packages/ember-testing/lib/helpers/and_then.js +4 -1
- package/dist/packages/ember-testing/lib/helpers/current_path.js +5 -0
- package/dist/packages/ember-testing/lib/helpers/current_route_name.js +5 -0
- package/dist/packages/ember-testing/lib/helpers/current_url.js +8 -1
- package/dist/packages/ember-testing/lib/helpers/visit.js +12 -2
- package/dist/packages/ember-testing/lib/helpers/wait.js +6 -1
- package/dist/packages/ember-testing/lib/initializers.js +3 -3
- package/dist/packages/ember-testing/lib/test/adapter.js +2 -1
- package/dist/packages/ember-testing/lib/test/helpers.js +3 -1
- package/dist/packages/ember-testing/lib/test/on_inject_helpers.js +2 -2
- package/dist/packages/ember-testing/lib/test/promise.js +8 -8
- package/dist/packages/ember-testing/lib/test/waiters.js +14 -45
- package/dist/packages/ember-testing/lib/test.js +1 -1
- package/docs/data.json +745 -729
- package/package.json +7 -6
package/dist/ember.debug.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
|
7
7
|
* @license Licensed under MIT license
|
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
|
9
|
-
* @version 4.
|
|
9
|
+
* @version 4.6.0-alpha.3
|
|
10
10
|
*/
|
|
11
11
|
/* eslint-disable no-var */
|
|
12
12
|
|
|
@@ -1390,7 +1390,7 @@ define("@ember/-internals/error-handling/index", ["exports"], function (_exports
|
|
|
1390
1390
|
onerror = handler;
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
1393
|
-
var dispatchOverride; // allows testing adapter to override dispatch
|
|
1393
|
+
var dispatchOverride = null; // allows testing adapter to override dispatch
|
|
1394
1394
|
|
|
1395
1395
|
function getDispatchOverride() {
|
|
1396
1396
|
return dispatchOverride;
|
|
@@ -5178,14 +5178,25 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
5178
5178
|
return string.replace(badChars, escapeChar);
|
|
5179
5179
|
}
|
|
5180
5180
|
/**
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5181
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
5182
|
+
when the string is used in a template. To say this another way,
|
|
5183
|
+
strings marked with `htmlSafe` will not be HTML escaped.
|
|
5184
|
+
|
|
5185
|
+
A word of warning - The `htmlSafe` method does not make the string safe;
|
|
5186
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
5187
|
+
as HTML. If a string contains user inputs or other untrusted
|
|
5188
|
+
data, you must sanitize the string before using the `htmlSafe` method.
|
|
5189
|
+
Otherwise your code is vulnerable to
|
|
5190
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
5191
|
+
There are many open source sanitization libraries to choose from,
|
|
5192
|
+
both for front end and server-side sanitization.
|
|
5184
5193
|
|
|
5185
5194
|
```javascript
|
|
5186
5195
|
import { htmlSafe } from '@ember/template';
|
|
5187
5196
|
|
|
5188
|
-
|
|
5197
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
5198
|
+
|
|
5199
|
+
htmlSafe(someTrustedorSanitizedString)
|
|
5189
5200
|
```
|
|
5190
5201
|
|
|
5191
5202
|
@method htmlSafe
|
|
@@ -7434,7 +7445,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7434
7445
|
return value;
|
|
7435
7446
|
}
|
|
7436
7447
|
|
|
7437
|
-
}
|
|
7448
|
+
}
|
|
7449
|
+
|
|
7450
|
+
var NO_OP = () => {}; // This wrapper logic prevents us from rerendering in case of a hard failure
|
|
7438
7451
|
// during render. This prevents infinite revalidation type loops from occuring,
|
|
7439
7452
|
// and ensures that errors are not swallowed by subsequent follow on failures.
|
|
7440
7453
|
|
|
@@ -7542,10 +7555,6 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7542
7555
|
}
|
|
7543
7556
|
}
|
|
7544
7557
|
|
|
7545
|
-
function K() {
|
|
7546
|
-
/* noop */
|
|
7547
|
-
}
|
|
7548
|
-
|
|
7549
7558
|
var renderSettledDeferred = null;
|
|
7550
7559
|
/*
|
|
7551
7560
|
Returns a promise which will resolve when rendering has settled. Settled in
|
|
@@ -7564,7 +7573,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7564
7573
|
|
|
7565
7574
|
if (!(0, _runloop._getCurrentRunLoop)()) {
|
|
7566
7575
|
// ensure a runloop has been kicked off
|
|
7567
|
-
_runloop._backburner.schedule('actions', null,
|
|
7576
|
+
_runloop._backburner.schedule('actions', null, NO_OP);
|
|
7568
7577
|
}
|
|
7569
7578
|
}
|
|
7570
7579
|
|
|
@@ -7593,7 +7602,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7593
7602
|
}
|
|
7594
7603
|
|
|
7595
7604
|
loops++;
|
|
7596
|
-
return _runloop._backburner.join(null,
|
|
7605
|
+
return _runloop._backburner.join(null, NO_OP);
|
|
7597
7606
|
}
|
|
7598
7607
|
}
|
|
7599
7608
|
|
|
@@ -8901,10 +8910,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
8901
8910
|
_exports.tracked = tracked;
|
|
8902
8911
|
_exports.trySet = trySet;
|
|
8903
8912
|
|
|
8904
|
-
/**
|
|
8905
|
-
@module @ember/object
|
|
8906
|
-
*/
|
|
8907
|
-
|
|
8908
8913
|
/*
|
|
8909
8914
|
The event system uses a series of nested hashes to store listeners on an
|
|
8910
8915
|
object. When a listener is registered, or when an event arrives, these
|
|
@@ -9583,6 +9588,12 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
9583
9588
|
} else {
|
|
9584
9589
|
return array.objectAt(index);
|
|
9585
9590
|
}
|
|
9591
|
+
} // Ideally, we'd use MutableArray.detect but for unknown reasons this causes
|
|
9592
|
+
// the node tests to fail strangely.
|
|
9593
|
+
|
|
9594
|
+
|
|
9595
|
+
function isMutableArray(obj) {
|
|
9596
|
+
return obj != null && typeof obj.replace === 'function';
|
|
9586
9597
|
}
|
|
9587
9598
|
|
|
9588
9599
|
function replace(array, start, deleteCount, items) {
|
|
@@ -9590,10 +9601,11 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
9590
9601
|
items = EMPTY_ARRAY;
|
|
9591
9602
|
}
|
|
9592
9603
|
|
|
9593
|
-
if (
|
|
9594
|
-
replaceInNativeArray(array, start, deleteCount, items);
|
|
9595
|
-
} else {
|
|
9604
|
+
if (isMutableArray(array)) {
|
|
9596
9605
|
array.replace(start, deleteCount, items);
|
|
9606
|
+
} else {
|
|
9607
|
+
(true && !(Array.isArray(array)) && (0, _debug.assert)('Can only replace content of a native array or MutableArray', Array.isArray(array)));
|
|
9608
|
+
replaceInNativeArray(array, start, deleteCount, items);
|
|
9597
9609
|
}
|
|
9598
9610
|
}
|
|
9599
9611
|
|
|
@@ -12229,7 +12241,10 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
12229
12241
|
|
|
12230
12242
|
|
|
12231
12243
|
keys() {
|
|
12232
|
-
|
|
12244
|
+
var keys = _keys(this);
|
|
12245
|
+
|
|
12246
|
+
(true && !(keys) && (0, _debug.assert)('[BUG] Missing keys for mixin!', keys));
|
|
12247
|
+
return keys;
|
|
12233
12248
|
}
|
|
12234
12249
|
/** @internal */
|
|
12235
12250
|
|
|
@@ -12323,8 +12338,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
12323
12338
|
if (mixin.properties) {
|
|
12324
12339
|
var props = Object.keys(mixin.properties);
|
|
12325
12340
|
|
|
12326
|
-
for (var
|
|
12327
|
-
ret.add(
|
|
12341
|
+
for (var prop of props) {
|
|
12342
|
+
ret.add(prop);
|
|
12328
12343
|
}
|
|
12329
12344
|
} else if (mixin.mixins) {
|
|
12330
12345
|
mixin.mixins.forEach(x => _keys(x, ret, seen));
|
|
@@ -17067,9 +17082,6 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
17067
17082
|
_exports.default = void 0;
|
|
17068
17083
|
_exports.triggerEvent = triggerEvent;
|
|
17069
17084
|
|
|
17070
|
-
/**
|
|
17071
|
-
@module @ember/routing
|
|
17072
|
-
*/
|
|
17073
17085
|
function defaultDidTransition(infos) {
|
|
17074
17086
|
updatePaths(this);
|
|
17075
17087
|
|
|
@@ -19529,9 +19541,10 @@ define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/r
|
|
|
19529
19541
|
// SSt `------'`
|
|
19530
19542
|
|
|
19531
19543
|
function spaceship(a, b) {
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19544
|
+
// SAFETY: `Math.sign` always returns `-1` for negative, `0` for zero, and `1`
|
|
19545
|
+
// for positive numbers. (The extra precision is useful for the way we use
|
|
19546
|
+
// this in the context of `compare`.)
|
|
19547
|
+
return Math.sign(a - b);
|
|
19535
19548
|
}
|
|
19536
19549
|
/**
|
|
19537
19550
|
@module @ember/utils
|
|
@@ -20119,15 +20132,15 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20119
20132
|
|
|
20120
20133
|
var identityFunction = item => item;
|
|
20121
20134
|
|
|
20122
|
-
function uniqBy(array,
|
|
20123
|
-
if (
|
|
20124
|
-
|
|
20135
|
+
function uniqBy(array, keyOrFunc) {
|
|
20136
|
+
if (keyOrFunc === void 0) {
|
|
20137
|
+
keyOrFunc = identityFunction;
|
|
20125
20138
|
}
|
|
20126
20139
|
|
|
20127
20140
|
(true && !(isArray(array)) && (0, _debug.assert)(`first argument passed to \`uniqBy\` should be array`, isArray(array)));
|
|
20128
20141
|
var ret = A();
|
|
20129
20142
|
var seen = new Set();
|
|
20130
|
-
var getter = typeof
|
|
20143
|
+
var getter = typeof keyOrFunc === 'function' ? keyOrFunc : item => (0, _metal.get)(item, keyOrFunc);
|
|
20131
20144
|
array.forEach(item => {
|
|
20132
20145
|
var val = getter(item);
|
|
20133
20146
|
|
|
@@ -20139,8 +20152,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20139
20152
|
return ret;
|
|
20140
20153
|
}
|
|
20141
20154
|
|
|
20142
|
-
function iter(
|
|
20143
|
-
var
|
|
20155
|
+
function iter() {
|
|
20156
|
+
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
|
20157
|
+
args[_key2] = arguments[_key2];
|
|
20158
|
+
}
|
|
20159
|
+
|
|
20160
|
+
var valueProvided = args.length === 2;
|
|
20161
|
+
var [key, value] = args;
|
|
20144
20162
|
return valueProvided ? item => value === (0, _metal.get)(item, key) : item => Boolean((0, _metal.get)(item, key));
|
|
20145
20163
|
}
|
|
20146
20164
|
|
|
@@ -20148,6 +20166,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20148
20166
|
var len = array.length;
|
|
20149
20167
|
|
|
20150
20168
|
for (var index = startAt; index < len; index++) {
|
|
20169
|
+
// SAFETY: Because we're checking the index this value should always be set.
|
|
20151
20170
|
var item = (0, _metal.objectAt)(array, index);
|
|
20152
20171
|
|
|
20153
20172
|
if (predicate(item, index, array)) {
|
|
@@ -20159,17 +20178,29 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20159
20178
|
}
|
|
20160
20179
|
|
|
20161
20180
|
function find(array, callback, target) {
|
|
20181
|
+
if (target === void 0) {
|
|
20182
|
+
target = null;
|
|
20183
|
+
}
|
|
20184
|
+
|
|
20162
20185
|
var predicate = callback.bind(target);
|
|
20163
20186
|
var index = findIndex(array, predicate, 0);
|
|
20164
20187
|
return index === -1 ? undefined : (0, _metal.objectAt)(array, index);
|
|
20165
20188
|
}
|
|
20166
20189
|
|
|
20167
20190
|
function any(array, callback, target) {
|
|
20191
|
+
if (target === void 0) {
|
|
20192
|
+
target = null;
|
|
20193
|
+
}
|
|
20194
|
+
|
|
20168
20195
|
var predicate = callback.bind(target);
|
|
20169
20196
|
return findIndex(array, predicate, 0) !== -1;
|
|
20170
20197
|
}
|
|
20171
20198
|
|
|
20172
20199
|
function every(array, callback, target) {
|
|
20200
|
+
if (target === void 0) {
|
|
20201
|
+
target = null;
|
|
20202
|
+
}
|
|
20203
|
+
|
|
20173
20204
|
var cb = callback.bind(target);
|
|
20174
20205
|
|
|
20175
20206
|
var predicate = (item, index, array) => !cb(item, index, array);
|
|
@@ -20194,12 +20225,8 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20194
20225
|
}
|
|
20195
20226
|
|
|
20196
20227
|
function removeAt(array, index, len) {
|
|
20197
|
-
if (len === void 0) {
|
|
20198
|
-
len = 1;
|
|
20199
|
-
}
|
|
20200
|
-
|
|
20201
20228
|
(true && !(index > -1 && index < array.length) && (0, _debug.assert)(`\`removeAt\` index provided is out of range`, index > -1 && index < array.length));
|
|
20202
|
-
(0, _metal.replace)(array, index, len, EMPTY_ARRAY);
|
|
20229
|
+
(0, _metal.replace)(array, index, len !== null && len !== void 0 ? len : 1, EMPTY_ARRAY);
|
|
20203
20230
|
return array;
|
|
20204
20231
|
}
|
|
20205
20232
|
|
|
@@ -20238,24 +20265,24 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20238
20265
|
*/
|
|
20239
20266
|
|
|
20240
20267
|
|
|
20241
|
-
function isArray(
|
|
20242
|
-
var obj = _obj;
|
|
20243
|
-
|
|
20268
|
+
function isArray(obj) {
|
|
20244
20269
|
if (true
|
|
20245
20270
|
/* DEBUG */
|
|
20246
|
-
&& typeof
|
|
20247
|
-
|
|
20271
|
+
&& typeof obj === 'object' && obj !== null) {
|
|
20272
|
+
// SAFETY: Property read checks are safe if it's an object
|
|
20273
|
+
var possibleProxyContent = obj[_metal.PROXY_CONTENT];
|
|
20248
20274
|
|
|
20249
20275
|
if (possibleProxyContent !== undefined) {
|
|
20250
20276
|
obj = possibleProxyContent;
|
|
20251
20277
|
}
|
|
20252
|
-
}
|
|
20278
|
+
} // SAFETY: Property read checks are safe if it's an object
|
|
20279
|
+
|
|
20253
20280
|
|
|
20254
20281
|
if (!obj || obj.setInterval) {
|
|
20255
20282
|
return false;
|
|
20256
20283
|
}
|
|
20257
20284
|
|
|
20258
|
-
if (Array.isArray(obj) ||
|
|
20285
|
+
if (Array.isArray(obj) || EmberArray.detect(obj)) {
|
|
20259
20286
|
return true;
|
|
20260
20287
|
}
|
|
20261
20288
|
|
|
@@ -20263,7 +20290,8 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20263
20290
|
|
|
20264
20291
|
if ('array' === type) {
|
|
20265
20292
|
return true;
|
|
20266
|
-
}
|
|
20293
|
+
} // SAFETY: Property read checks are safe if it's an object
|
|
20294
|
+
|
|
20267
20295
|
|
|
20268
20296
|
var length = obj.length;
|
|
20269
20297
|
|
|
@@ -20281,54 +20309,17 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20281
20309
|
*/
|
|
20282
20310
|
|
|
20283
20311
|
|
|
20284
|
-
function nonEnumerableComputed() {
|
|
20285
|
-
var property = (0, _metal.computed)(
|
|
20312
|
+
function nonEnumerableComputed(callback) {
|
|
20313
|
+
var property = (0, _metal.computed)(callback);
|
|
20286
20314
|
property.enumerable = false;
|
|
20287
20315
|
return property;
|
|
20288
20316
|
}
|
|
20289
20317
|
|
|
20290
20318
|
function mapBy(key) {
|
|
20291
20319
|
return this.map(next => (0, _metal.get)(next, key));
|
|
20292
|
-
}
|
|
20293
|
-
// ARRAY
|
|
20294
|
-
//
|
|
20295
|
-
|
|
20296
|
-
/**
|
|
20297
|
-
This mixin implements Observer-friendly Array-like behavior. It is not a
|
|
20298
|
-
concrete implementation, but it can be used up by other classes that want
|
|
20299
|
-
to appear like arrays.
|
|
20300
|
-
|
|
20301
|
-
For example, ArrayProxy is a concrete class that can be instantiated to
|
|
20302
|
-
implement array-like behavior. This class uses the Array Mixin by way of
|
|
20303
|
-
the MutableArray mixin, which allows observable changes to be made to the
|
|
20304
|
-
underlying array.
|
|
20305
|
-
|
|
20306
|
-
This mixin defines methods specifically for collections that provide
|
|
20307
|
-
index-ordered access to their contents. When you are designing code that
|
|
20308
|
-
needs to accept any kind of Array-like object, you should use these methods
|
|
20309
|
-
instead of Array primitives because these will properly notify observers of
|
|
20310
|
-
changes to the array.
|
|
20311
|
-
|
|
20312
|
-
Although these methods are efficient, they do add a layer of indirection to
|
|
20313
|
-
your application so it is a good idea to use them only when you need the
|
|
20314
|
-
flexibility of using both true JavaScript arrays and "virtual" arrays such
|
|
20315
|
-
as controllers and collections.
|
|
20316
|
-
|
|
20317
|
-
You can use the methods defined in this module to access and modify array
|
|
20318
|
-
contents in an observable-friendly way. You can also be notified whenever
|
|
20319
|
-
the membership of an array changes by using `.observes('myArray.[]')`.
|
|
20320
|
-
|
|
20321
|
-
To support `EmberArray` in your own class, you must override two
|
|
20322
|
-
primitives to use it: `length()` and `objectAt()`.
|
|
20323
|
-
|
|
20324
|
-
@class EmberArray
|
|
20325
|
-
@uses Enumerable
|
|
20326
|
-
@since Ember 0.9.0
|
|
20327
|
-
@public
|
|
20328
|
-
*/
|
|
20329
|
-
|
|
20320
|
+
}
|
|
20330
20321
|
|
|
20331
|
-
var
|
|
20322
|
+
var EmberArray = _metal.Mixin.create(_enumerable.default, {
|
|
20332
20323
|
init() {
|
|
20333
20324
|
this._super(...arguments);
|
|
20334
20325
|
|
|
@@ -20337,28 +20328,28 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20337
20328
|
|
|
20338
20329
|
/**
|
|
20339
20330
|
__Required.__ You must implement this method to apply this mixin.
|
|
20340
|
-
|
|
20331
|
+
Your array must support the `length` property. Your replace methods should
|
|
20341
20332
|
set this property whenever it changes.
|
|
20342
|
-
|
|
20333
|
+
@property {Number} length
|
|
20343
20334
|
@public
|
|
20344
20335
|
*/
|
|
20345
20336
|
|
|
20346
20337
|
/**
|
|
20347
20338
|
Returns the object at the given `index`. If the given `index` is negative
|
|
20348
20339
|
or is greater or equal than the array length, returns `undefined`.
|
|
20349
|
-
|
|
20340
|
+
This is one of the primitives you must implement to support `EmberArray`.
|
|
20350
20341
|
If your object supports retrieving the value of an array item using `get()`
|
|
20351
20342
|
(i.e. `myArray.get(0)`), then you do not need to implement this method
|
|
20352
20343
|
yourself.
|
|
20353
|
-
|
|
20344
|
+
```javascript
|
|
20354
20345
|
let arr = ['a', 'b', 'c', 'd'];
|
|
20355
|
-
|
|
20346
|
+
arr.objectAt(0); // 'a'
|
|
20356
20347
|
arr.objectAt(3); // 'd'
|
|
20357
20348
|
arr.objectAt(-1); // undefined
|
|
20358
20349
|
arr.objectAt(4); // undefined
|
|
20359
20350
|
arr.objectAt(5); // undefined
|
|
20360
20351
|
```
|
|
20361
|
-
|
|
20352
|
+
@method objectAt
|
|
20362
20353
|
@param {Number} idx The index of the item to return.
|
|
20363
20354
|
@return {*} item at index or undefined
|
|
20364
20355
|
@public
|
|
@@ -20366,12 +20357,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20366
20357
|
|
|
20367
20358
|
/**
|
|
20368
20359
|
This returns the objects at the specified indexes, using `objectAt`.
|
|
20369
|
-
|
|
20360
|
+
```javascript
|
|
20370
20361
|
let arr = ['a', 'b', 'c', 'd'];
|
|
20371
|
-
|
|
20362
|
+
arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c']
|
|
20372
20363
|
arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined]
|
|
20373
20364
|
```
|
|
20374
|
-
|
|
20365
|
+
@method objectsAt
|
|
20375
20366
|
@param {Array} indexes An array of indexes of items to return.
|
|
20376
20367
|
@return {Array}
|
|
20377
20368
|
@public
|
|
@@ -20384,13 +20375,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20384
20375
|
This is the handler for the special array content property. If you get
|
|
20385
20376
|
this property, it will return this. If you set this property to a new
|
|
20386
20377
|
array, it will replace the current content.
|
|
20387
|
-
|
|
20378
|
+
```javascript
|
|
20388
20379
|
let peopleToMoon = ['Armstrong', 'Aldrin'];
|
|
20389
|
-
|
|
20390
|
-
|
|
20380
|
+
peopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']
|
|
20381
|
+
peopleToMoon.set('[]', ['Collins']); // ['Collins']
|
|
20391
20382
|
peopleToMoon.get('[]'); // ['Collins']
|
|
20392
20383
|
```
|
|
20393
|
-
|
|
20384
|
+
@property []
|
|
20394
20385
|
@return this
|
|
20395
20386
|
@public
|
|
20396
20387
|
*/
|
|
@@ -20399,7 +20390,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20399
20390
|
return this;
|
|
20400
20391
|
},
|
|
20401
20392
|
|
|
20402
|
-
set(
|
|
20393
|
+
set(_key, value) {
|
|
20403
20394
|
this.replace(0, this.length, value);
|
|
20404
20395
|
return this;
|
|
20405
20396
|
}
|
|
@@ -20408,17 +20399,17 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20408
20399
|
|
|
20409
20400
|
/**
|
|
20410
20401
|
The first object in the array, or `undefined` if the array is empty.
|
|
20411
|
-
|
|
20402
|
+
```javascript
|
|
20412
20403
|
let vowels = ['a', 'e', 'i', 'o', 'u'];
|
|
20413
20404
|
vowels.firstObject; // 'a'
|
|
20414
|
-
|
|
20405
|
+
vowels.shiftObject();
|
|
20415
20406
|
vowels.firstObject; // 'e'
|
|
20416
|
-
|
|
20407
|
+
vowels.reverseObjects();
|
|
20417
20408
|
vowels.firstObject; // 'u'
|
|
20418
|
-
|
|
20409
|
+
vowels.clear();
|
|
20419
20410
|
vowels.firstObject; // undefined
|
|
20420
20411
|
```
|
|
20421
|
-
|
|
20412
|
+
@property firstObject
|
|
20422
20413
|
@return {Object | undefined} The first object in the array
|
|
20423
20414
|
@public
|
|
20424
20415
|
*/
|
|
@@ -20428,7 +20419,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20428
20419
|
|
|
20429
20420
|
/**
|
|
20430
20421
|
The last object in the array, or `undefined` if the array is empty.
|
|
20431
|
-
|
|
20422
|
+
@property lastObject
|
|
20432
20423
|
@return {Object | undefined} The last object in the array
|
|
20433
20424
|
@public
|
|
20434
20425
|
*/
|
|
@@ -20442,13 +20433,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20442
20433
|
Returns a new array that is a slice of the receiver. This implementation
|
|
20443
20434
|
uses the observable array methods to retrieve the objects for the new
|
|
20444
20435
|
slice.
|
|
20445
|
-
|
|
20436
|
+
```javascript
|
|
20446
20437
|
let arr = ['red', 'green', 'blue'];
|
|
20447
|
-
|
|
20438
|
+
arr.slice(0); // ['red', 'green', 'blue']
|
|
20448
20439
|
arr.slice(0, 2); // ['red', 'green']
|
|
20449
20440
|
arr.slice(1, 100); // ['green', 'blue']
|
|
20450
20441
|
```
|
|
20451
|
-
|
|
20442
|
+
@method slice
|
|
20452
20443
|
@param {Number} beginIndex (Optional) index to begin slicing from.
|
|
20453
20444
|
@param {Number} endIndex (Optional) index to end the slice at (but not included).
|
|
20454
20445
|
@return {Array} New array with specified slice
|
|
@@ -20466,13 +20457,17 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20466
20457
|
beginIndex = length + beginIndex;
|
|
20467
20458
|
}
|
|
20468
20459
|
|
|
20460
|
+
var validatedEndIndex;
|
|
20461
|
+
|
|
20469
20462
|
if (endIndex === undefined || endIndex > length) {
|
|
20470
|
-
|
|
20463
|
+
validatedEndIndex = length;
|
|
20471
20464
|
} else if (endIndex < 0) {
|
|
20472
|
-
|
|
20465
|
+
validatedEndIndex = length + endIndex;
|
|
20466
|
+
} else {
|
|
20467
|
+
validatedEndIndex = endIndex;
|
|
20473
20468
|
}
|
|
20474
20469
|
|
|
20475
|
-
while (beginIndex <
|
|
20470
|
+
while (beginIndex < validatedEndIndex) {
|
|
20476
20471
|
ret[ret.length] = (0, _metal.objectAt)(this, beginIndex++);
|
|
20477
20472
|
}
|
|
20478
20473
|
|
|
@@ -20482,29 +20477,29 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20482
20477
|
/**
|
|
20483
20478
|
Used to determine the passed object's first occurrence in the array.
|
|
20484
20479
|
Returns the index if found, -1 if no match is found.
|
|
20485
|
-
|
|
20480
|
+
The optional `startAt` argument can be used to pass a starting
|
|
20486
20481
|
index to search from, effectively slicing the searchable portion
|
|
20487
20482
|
of the array. If it's negative it will add the array length to
|
|
20488
20483
|
the startAt value passed in as the index to search from. If less
|
|
20489
20484
|
than or equal to `-1 * array.length` the entire array is searched.
|
|
20490
|
-
|
|
20485
|
+
```javascript
|
|
20491
20486
|
let arr = ['a', 'b', 'c', 'd', 'a'];
|
|
20492
|
-
|
|
20487
|
+
arr.indexOf('a'); // 0
|
|
20493
20488
|
arr.indexOf('z'); // -1
|
|
20494
20489
|
arr.indexOf('a', 2); // 4
|
|
20495
20490
|
arr.indexOf('a', -1); // 4, equivalent to indexOf('a', 4)
|
|
20496
20491
|
arr.indexOf('a', -100); // 0, searches entire array
|
|
20497
20492
|
arr.indexOf('b', 3); // -1
|
|
20498
20493
|
arr.indexOf('a', 100); // -1
|
|
20499
|
-
|
|
20494
|
+
let people = [{ name: 'Zoey' }, { name: 'Bob' }]
|
|
20500
20495
|
let newPerson = { name: 'Tom' };
|
|
20501
20496
|
people = [newPerson, ...people, newPerson];
|
|
20502
|
-
|
|
20497
|
+
people.indexOf(newPerson); // 0
|
|
20503
20498
|
people.indexOf(newPerson, 1); // 3
|
|
20504
20499
|
people.indexOf(newPerson, -4); // 0
|
|
20505
20500
|
people.indexOf(newPerson, 10); // -1
|
|
20506
20501
|
```
|
|
20507
|
-
|
|
20502
|
+
@method indexOf
|
|
20508
20503
|
@param {Object} object the item to search for
|
|
20509
20504
|
@param {Number} startAt optional starting location to search, default 0
|
|
20510
20505
|
@return {Number} index or -1 if not found
|
|
@@ -20516,7 +20511,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20516
20511
|
|
|
20517
20512
|
/**
|
|
20518
20513
|
Returns the index of the given `object`'s last occurrence.
|
|
20519
|
-
|
|
20514
|
+
- If no `startAt` argument is given, the search starts from
|
|
20520
20515
|
the last position.
|
|
20521
20516
|
- If it's greater than or equal to the length of the array,
|
|
20522
20517
|
the search starts from the last position.
|
|
@@ -20524,10 +20519,10 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20524
20519
|
of the array i.e. `startAt + array.length`.
|
|
20525
20520
|
- If it's any other positive number, will search backwards
|
|
20526
20521
|
from that index of the array.
|
|
20527
|
-
|
|
20528
|
-
|
|
20522
|
+
Returns -1 if no match is found.
|
|
20523
|
+
```javascript
|
|
20529
20524
|
let arr = ['a', 'b', 'c', 'd', 'a'];
|
|
20530
|
-
|
|
20525
|
+
arr.lastIndexOf('a'); // 4
|
|
20531
20526
|
arr.lastIndexOf('z'); // -1
|
|
20532
20527
|
arr.lastIndexOf('a', 2); // 0
|
|
20533
20528
|
arr.lastIndexOf('a', -1); // 4
|
|
@@ -20535,7 +20530,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20535
20530
|
arr.lastIndexOf('b', 3); // 1
|
|
20536
20531
|
arr.lastIndexOf('a', 100); // 4
|
|
20537
20532
|
```
|
|
20538
|
-
|
|
20533
|
+
@method lastIndexOf
|
|
20539
20534
|
@param {Object} object the item to search for
|
|
20540
20535
|
@param {Number} startAt optional starting location to search from
|
|
20541
20536
|
backwards, defaults to `(array.length - 1)`
|
|
@@ -20567,26 +20562,26 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20567
20562
|
Iterates through the array, calling the passed function on each
|
|
20568
20563
|
item. This method corresponds to the `forEach()` method defined in
|
|
20569
20564
|
JavaScript 1.6.
|
|
20570
|
-
|
|
20565
|
+
The callback method you provide should have the following signature (all
|
|
20571
20566
|
parameters are optional):
|
|
20572
|
-
|
|
20567
|
+
```javascript
|
|
20573
20568
|
function(item, index, array);
|
|
20574
20569
|
```
|
|
20575
|
-
|
|
20570
|
+
- `item` is the current item in the iteration.
|
|
20576
20571
|
- `index` is the current index in the iteration.
|
|
20577
20572
|
- `array` is the array itself.
|
|
20578
|
-
|
|
20573
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
20579
20574
|
object that will be set as `this` on the context. This is a good way
|
|
20580
20575
|
to give your iterator function access to the current object.
|
|
20581
|
-
|
|
20582
|
-
|
|
20576
|
+
Example Usage:
|
|
20577
|
+
```javascript
|
|
20583
20578
|
let foods = [
|
|
20584
20579
|
{ name: 'apple', eaten: false },
|
|
20585
20580
|
{ name: 'banana', eaten: false },
|
|
20586
20581
|
{ name: 'carrot', eaten: false }
|
|
20587
20582
|
];
|
|
20588
|
-
|
|
20589
|
-
|
|
20583
|
+
foods.forEach((food) => food.eaten = true);
|
|
20584
|
+
let output = '';
|
|
20590
20585
|
foods.forEach((item, index, array) =>
|
|
20591
20586
|
output += `${index + 1}/${array.length} ${item.name}\n`;
|
|
20592
20587
|
);
|
|
@@ -20595,7 +20590,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20595
20590
|
// 2/3 banana
|
|
20596
20591
|
// 3/3 carrot
|
|
20597
20592
|
```
|
|
20598
|
-
|
|
20593
|
+
@method forEach
|
|
20599
20594
|
@param {Function} callback The callback to execute
|
|
20600
20595
|
@param {Object} [target] The target object to use
|
|
20601
20596
|
@return {Object} receiver
|
|
@@ -20619,16 +20614,16 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20619
20614
|
|
|
20620
20615
|
/**
|
|
20621
20616
|
Alias for `mapBy`.
|
|
20622
|
-
|
|
20617
|
+
Returns the value of the named
|
|
20623
20618
|
property on all items in the enumeration.
|
|
20624
|
-
|
|
20619
|
+
```javascript
|
|
20625
20620
|
let people = [{name: 'Joe'}, {name: 'Matt'}];
|
|
20626
|
-
|
|
20621
|
+
people.getEach('name');
|
|
20627
20622
|
// ['Joe', 'Matt'];
|
|
20628
|
-
|
|
20623
|
+
people.getEach('nonexistentProperty');
|
|
20629
20624
|
// [undefined, undefined];
|
|
20630
20625
|
```
|
|
20631
|
-
|
|
20626
|
+
@method getEach
|
|
20632
20627
|
@param {String} key name of the property
|
|
20633
20628
|
@return {Array} The mapped array.
|
|
20634
20629
|
@public
|
|
@@ -20640,12 +20635,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20640
20635
|
ergonomic than using other methods defined on this helper. If the object
|
|
20641
20636
|
implements Observable, the value will be changed to `set(),` otherwise
|
|
20642
20637
|
it will be set directly. `null` objects are skipped.
|
|
20643
|
-
|
|
20638
|
+
```javascript
|
|
20644
20639
|
let people = [{name: 'Joe'}, {name: 'Matt'}];
|
|
20645
|
-
|
|
20640
|
+
people.setEach('zipCode', '10011');
|
|
20646
20641
|
// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
|
|
20647
20642
|
```
|
|
20648
|
-
|
|
20643
|
+
@method setEach
|
|
20649
20644
|
@param {String} key The key to set
|
|
20650
20645
|
@param {Object} value The object to set
|
|
20651
20646
|
@return {Object} receiver
|
|
@@ -20658,24 +20653,24 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20658
20653
|
/**
|
|
20659
20654
|
Maps all of the items in the enumeration to another value, returning
|
|
20660
20655
|
a new array. This method corresponds to `map()` defined in JavaScript 1.6.
|
|
20661
|
-
|
|
20656
|
+
The callback method you provide should have the following signature (all
|
|
20662
20657
|
parameters are optional):
|
|
20663
|
-
|
|
20658
|
+
```javascript
|
|
20664
20659
|
function(item, index, array);
|
|
20665
20660
|
let arr = [1, 2, 3, 4, 5, 6];
|
|
20666
|
-
|
|
20661
|
+
arr.map(element => element * element);
|
|
20667
20662
|
// [1, 4, 9, 16, 25, 36];
|
|
20668
|
-
|
|
20663
|
+
arr.map((element, index) => element + index);
|
|
20669
20664
|
// [1, 3, 5, 7, 9, 11];
|
|
20670
20665
|
```
|
|
20671
|
-
|
|
20666
|
+
- `item` is the current item in the iteration.
|
|
20672
20667
|
- `index` is the current index in the iteration.
|
|
20673
20668
|
- `array` is the array itself.
|
|
20674
|
-
|
|
20675
|
-
|
|
20669
|
+
It should return the mapped value.
|
|
20670
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
20676
20671
|
object that will be set as `this` on the context. This is a good way
|
|
20677
20672
|
to give your iterator function access to the current object.
|
|
20678
|
-
|
|
20673
|
+
@method map
|
|
20679
20674
|
@param {Function} callback The callback to execute
|
|
20680
20675
|
@param {Object} [target] The target object to use
|
|
20681
20676
|
@return {Array} The mapped array.
|
|
@@ -20695,14 +20690,14 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20695
20690
|
/**
|
|
20696
20691
|
Similar to map, this specialized function returns the value of the named
|
|
20697
20692
|
property on all items in the enumeration.
|
|
20698
|
-
|
|
20693
|
+
```javascript
|
|
20699
20694
|
let people = [{name: 'Joe'}, {name: 'Matt'}];
|
|
20700
|
-
|
|
20695
|
+
people.mapBy('name');
|
|
20701
20696
|
// ['Joe', 'Matt'];
|
|
20702
|
-
|
|
20697
|
+
people.mapBy('unknownProperty');
|
|
20703
20698
|
// [undefined, undefined];
|
|
20704
20699
|
```
|
|
20705
|
-
|
|
20700
|
+
@method mapBy
|
|
20706
20701
|
@param {String} key name of the property
|
|
20707
20702
|
@return {Array} The mapped array.
|
|
20708
20703
|
@public
|
|
@@ -20712,42 +20707,42 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20712
20707
|
/**
|
|
20713
20708
|
Returns a new array with all of the items in the enumeration that the provided
|
|
20714
20709
|
callback function returns true for. This method corresponds to [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
|
|
20715
|
-
|
|
20716
|
-
|
|
20710
|
+
The callback method should have the following signature:
|
|
20711
|
+
```javascript
|
|
20717
20712
|
function(item, index, array);
|
|
20718
20713
|
```
|
|
20719
|
-
|
|
20714
|
+
- `item` is the current item in the iteration.
|
|
20720
20715
|
- `index` is the current index in the iteration.
|
|
20721
20716
|
- `array` is the array itself.
|
|
20722
|
-
|
|
20717
|
+
All parameters are optional. The function should return `true` to include the item
|
|
20723
20718
|
in the results, and `false` otherwise.
|
|
20724
|
-
|
|
20725
|
-
|
|
20719
|
+
Example:
|
|
20720
|
+
```javascript
|
|
20726
20721
|
function isAdult(person) {
|
|
20727
20722
|
return person.age > 18;
|
|
20728
20723
|
};
|
|
20729
|
-
|
|
20730
|
-
|
|
20724
|
+
let people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);
|
|
20725
|
+
people.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
|
|
20731
20726
|
```
|
|
20732
|
-
|
|
20727
|
+
Note that in addition to a callback, you can pass an optional target object
|
|
20733
20728
|
that will be set as `this` on the context. This is a good way to give your
|
|
20734
20729
|
iterator function access to the current object. For example:
|
|
20735
|
-
|
|
20730
|
+
```javascript
|
|
20736
20731
|
function isAdultAndEngineer(person) {
|
|
20737
20732
|
return person.age > 18 && this.engineering;
|
|
20738
20733
|
}
|
|
20739
|
-
|
|
20734
|
+
class AdultsCollection {
|
|
20740
20735
|
engineering = false;
|
|
20741
|
-
|
|
20736
|
+
constructor(opts = {}) {
|
|
20742
20737
|
super(...arguments);
|
|
20743
|
-
|
|
20738
|
+
this.engineering = opts.engineering;
|
|
20744
20739
|
this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);
|
|
20745
20740
|
}
|
|
20746
20741
|
}
|
|
20747
|
-
|
|
20742
|
+
let collection = new AdultsCollection({ engineering: true });
|
|
20748
20743
|
collection.people.filter(isAdultAndEngineer, { target: collection });
|
|
20749
20744
|
```
|
|
20750
|
-
|
|
20745
|
+
@method filter
|
|
20751
20746
|
@param {Function} callback The callback to execute
|
|
20752
20747
|
@param {Object} [target] The target object to use
|
|
20753
20748
|
@return {Array} A filtered array.
|
|
@@ -20771,20 +20766,20 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20771
20766
|
/**
|
|
20772
20767
|
Returns an array with all of the items in the enumeration where the passed
|
|
20773
20768
|
function returns false. This method is the inverse of filter().
|
|
20774
|
-
|
|
20769
|
+
The callback method you provide should have the following signature (all
|
|
20775
20770
|
parameters are optional):
|
|
20776
|
-
|
|
20771
|
+
```javascript
|
|
20777
20772
|
function(item, index, array);
|
|
20778
20773
|
```
|
|
20779
|
-
|
|
20774
|
+
- *item* is the current item in the iteration.
|
|
20780
20775
|
- *index* is the current index in the iteration
|
|
20781
20776
|
- *array* is the array itself.
|
|
20782
|
-
|
|
20783
|
-
|
|
20777
|
+
It should return a falsey value to include the item in the results.
|
|
20778
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
20784
20779
|
object that will be set as "this" on the context. This is a good way
|
|
20785
20780
|
to give your iterator function access to the current object.
|
|
20786
|
-
|
|
20787
|
-
|
|
20781
|
+
Example Usage:
|
|
20782
|
+
```javascript
|
|
20788
20783
|
const food = [
|
|
20789
20784
|
{ food: 'apple', isFruit: true },
|
|
20790
20785
|
{ food: 'bread', isFruit: false },
|
|
@@ -20794,7 +20789,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20794
20789
|
return thing.isFruit;
|
|
20795
20790
|
}); // [{food: 'bread', isFruit: false}]
|
|
20796
20791
|
```
|
|
20797
|
-
|
|
20792
|
+
@method reject
|
|
20798
20793
|
@param {Function} callback The callback to execute
|
|
20799
20794
|
@param {Object} [target] The target object to use
|
|
20800
20795
|
@return {Array} A rejected array.
|
|
@@ -20807,6 +20802,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20807
20802
|
|
|
20808
20803
|
(true && !(typeof callback === 'function') && (0, _debug.assert)('`reject` expects a function as first argument.', typeof callback === 'function'));
|
|
20809
20804
|
return this.filter(function () {
|
|
20805
|
+
// @ts-expect-error TS doesn't like us using arguments like this
|
|
20810
20806
|
return !callback.apply(target, arguments);
|
|
20811
20807
|
});
|
|
20812
20808
|
},
|
|
@@ -20815,19 +20811,20 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20815
20811
|
Filters the array by the property and an optional value. If a value is given, it returns
|
|
20816
20812
|
the items that have said value for the property. If not, it returns all the items that
|
|
20817
20813
|
have a truthy value for the property.
|
|
20818
|
-
|
|
20819
|
-
|
|
20814
|
+
Example Usage:
|
|
20815
|
+
```javascript
|
|
20820
20816
|
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);
|
|
20821
|
-
|
|
20817
|
+
things.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]
|
|
20822
20818
|
things.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
|
|
20823
20819
|
```
|
|
20824
|
-
|
|
20820
|
+
@method filterBy
|
|
20825
20821
|
@param {String} key the property to test
|
|
20826
20822
|
@param {*} [value] optional value to test against.
|
|
20827
20823
|
@return {Array} filtered array
|
|
20828
20824
|
@public
|
|
20829
20825
|
*/
|
|
20830
20826
|
filterBy() {
|
|
20827
|
+
// @ts-expect-error TS doesn't like the ...arguments spread here.
|
|
20831
20828
|
return this.filter(iter(...arguments));
|
|
20832
20829
|
},
|
|
20833
20830
|
|
|
@@ -20835,8 +20832,8 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20835
20832
|
Returns an array with the items that do not have truthy values for the provided key.
|
|
20836
20833
|
You can pass an optional second argument with a target value to reject for the key.
|
|
20837
20834
|
Otherwise this will reject objects where the provided property evaluates to false.
|
|
20838
|
-
|
|
20839
|
-
|
|
20835
|
+
Example Usage:
|
|
20836
|
+
```javascript
|
|
20840
20837
|
let food = [
|
|
20841
20838
|
{ name: "apple", isFruit: true },
|
|
20842
20839
|
{ name: "carrot", isFruit: false },
|
|
@@ -20845,44 +20842,45 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20845
20842
|
food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]
|
|
20846
20843
|
food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
|
|
20847
20844
|
```
|
|
20848
|
-
|
|
20845
|
+
@method rejectBy
|
|
20849
20846
|
@param {String} key the property to test
|
|
20850
20847
|
@param {*} [value] optional value to test against.
|
|
20851
20848
|
@return {Array} rejected array
|
|
20852
20849
|
@public
|
|
20853
20850
|
*/
|
|
20854
20851
|
rejectBy() {
|
|
20852
|
+
// @ts-expect-error TS doesn't like the ...arguments spread here.
|
|
20855
20853
|
return this.reject(iter(...arguments));
|
|
20856
20854
|
},
|
|
20857
20855
|
|
|
20858
20856
|
/**
|
|
20859
20857
|
Returns the first item in the array for which the callback returns true.
|
|
20860
20858
|
This method is similar to the `find()` method defined in ECMAScript 2015.
|
|
20861
|
-
|
|
20859
|
+
The callback method you provide should have the following signature (all
|
|
20862
20860
|
parameters are optional):
|
|
20863
|
-
|
|
20861
|
+
```javascript
|
|
20864
20862
|
function(item, index, array);
|
|
20865
20863
|
```
|
|
20866
|
-
|
|
20864
|
+
- `item` is the current item in the iteration.
|
|
20867
20865
|
- `index` is the current index in the iteration.
|
|
20868
20866
|
- `array` is the array itself.
|
|
20869
|
-
|
|
20867
|
+
It should return the `true` to include the item in the results, `false`
|
|
20870
20868
|
otherwise.
|
|
20871
|
-
|
|
20869
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
20872
20870
|
object that will be set as `this` on the context. This is a good way
|
|
20873
20871
|
to give your iterator function access to the current object.
|
|
20874
|
-
|
|
20875
|
-
|
|
20872
|
+
Example Usage:
|
|
20873
|
+
```javascript
|
|
20876
20874
|
let users = [
|
|
20877
20875
|
{ id: 1, name: 'Yehuda' },
|
|
20878
20876
|
{ id: 2, name: 'Tom' },
|
|
20879
20877
|
{ id: 3, name: 'Melanie' },
|
|
20880
20878
|
{ id: 4, name: 'Leah' }
|
|
20881
20879
|
];
|
|
20882
|
-
|
|
20880
|
+
users.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]
|
|
20883
20881
|
users.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
|
|
20884
20882
|
```
|
|
20885
|
-
|
|
20883
|
+
@method find
|
|
20886
20884
|
@param {Function} callback The callback to execute
|
|
20887
20885
|
@param {Object} [target] The target object to use
|
|
20888
20886
|
@return {Object} Found item or `undefined`.
|
|
@@ -20901,52 +20899,54 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20901
20899
|
Returns the first item with a property matching the passed value. You
|
|
20902
20900
|
can pass an optional second argument with the target value. Otherwise
|
|
20903
20901
|
this will match any property that evaluates to `true`.
|
|
20904
|
-
|
|
20905
|
-
|
|
20906
|
-
|
|
20902
|
+
This method works much like the more generic `find()` method.
|
|
20903
|
+
Usage Example:
|
|
20904
|
+
```javascript
|
|
20907
20905
|
let users = [
|
|
20908
20906
|
{ id: 1, name: 'Yehuda', isTom: false },
|
|
20909
20907
|
{ id: 2, name: 'Tom', isTom: true },
|
|
20910
20908
|
{ id: 3, name: 'Melanie', isTom: false },
|
|
20911
20909
|
{ id: 4, name: 'Leah', isTom: false }
|
|
20912
20910
|
];
|
|
20913
|
-
|
|
20911
|
+
users.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }
|
|
20914
20912
|
users.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }
|
|
20915
20913
|
users.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
|
|
20916
20914
|
```
|
|
20917
|
-
|
|
20915
|
+
@method findBy
|
|
20918
20916
|
@param {String} key the property to test
|
|
20919
20917
|
@param {String} [value] optional value to test against.
|
|
20920
20918
|
@return {Object} found item or `undefined`
|
|
20921
20919
|
@public
|
|
20922
20920
|
*/
|
|
20923
20921
|
findBy() {
|
|
20924
|
-
|
|
20922
|
+
// @ts-expect-error TS doesn't like the ...arguments spread here.
|
|
20923
|
+
var callback = iter(...arguments);
|
|
20924
|
+
return find(this, callback);
|
|
20925
20925
|
},
|
|
20926
20926
|
|
|
20927
20927
|
/**
|
|
20928
20928
|
Returns `true` if the passed function returns true for every item in the
|
|
20929
20929
|
enumeration. This corresponds with the `Array.prototype.every()` method defined in ES5.
|
|
20930
|
-
|
|
20931
|
-
|
|
20930
|
+
The callback method should have the following signature:
|
|
20931
|
+
```javascript
|
|
20932
20932
|
function(item, index, array);
|
|
20933
20933
|
```
|
|
20934
|
-
|
|
20934
|
+
- `item` is the current item in the iteration.
|
|
20935
20935
|
- `index` is the current index in the iteration.
|
|
20936
20936
|
- `array` is the array itself.
|
|
20937
|
-
|
|
20938
|
-
|
|
20937
|
+
All params are optional. The method should return `true` or `false`.
|
|
20938
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
20939
20939
|
object that will be set as `this` on the context. This is a good way
|
|
20940
20940
|
to give your iterator function access to the current object.
|
|
20941
|
-
|
|
20942
|
-
|
|
20941
|
+
Usage example:
|
|
20942
|
+
```javascript
|
|
20943
20943
|
function isAdult(person) {
|
|
20944
20944
|
return person.age > 18;
|
|
20945
20945
|
};
|
|
20946
|
-
|
|
20946
|
+
const people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);
|
|
20947
20947
|
const areAllAdults = people.every(isAdult);
|
|
20948
20948
|
```
|
|
20949
|
-
|
|
20949
|
+
@method every
|
|
20950
20950
|
@param {Function} callback The callback to execute
|
|
20951
20951
|
@param {Object} [target] The target object to use
|
|
20952
20952
|
@return {Boolean}
|
|
@@ -20965,7 +20965,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20965
20965
|
Returns `true` if the passed property resolves to the value of the second
|
|
20966
20966
|
argument for all items in the array. This method is often simpler/faster
|
|
20967
20967
|
than using a callback.
|
|
20968
|
-
|
|
20968
|
+
Note that like the native `Array.every`, `isEvery` will return true when called
|
|
20969
20969
|
on any empty array.
|
|
20970
20970
|
```javascript
|
|
20971
20971
|
class Language {
|
|
@@ -20974,20 +20974,20 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20974
20974
|
this.programmingLanguage = isProgrammingLanguage;
|
|
20975
20975
|
}
|
|
20976
20976
|
}
|
|
20977
|
-
|
|
20977
|
+
const compiledLanguages = [
|
|
20978
20978
|
new Language('Java', true),
|
|
20979
20979
|
new Language('Go', true),
|
|
20980
20980
|
new Language('Rust', true)
|
|
20981
20981
|
]
|
|
20982
|
-
|
|
20982
|
+
const languagesKnownByMe = [
|
|
20983
20983
|
new Language('Javascript', true),
|
|
20984
20984
|
new Language('English', false),
|
|
20985
20985
|
new Language('Ruby', true)
|
|
20986
20986
|
]
|
|
20987
|
-
|
|
20987
|
+
compiledLanguages.isEvery('programmingLanguage'); // true
|
|
20988
20988
|
languagesKnownByMe.isEvery('programmingLanguage'); // false
|
|
20989
20989
|
```
|
|
20990
|
-
|
|
20990
|
+
@method isEvery
|
|
20991
20991
|
@param {String} key the property to test
|
|
20992
20992
|
@param {String} [value] optional value to test against. Defaults to `true`
|
|
20993
20993
|
@return {Boolean}
|
|
@@ -20995,7 +20995,9 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
20995
20995
|
@public
|
|
20996
20996
|
*/
|
|
20997
20997
|
isEvery() {
|
|
20998
|
-
|
|
20998
|
+
// @ts-expect-error TS doesn't like the ...arguments spread here.
|
|
20999
|
+
var callback = iter(...arguments);
|
|
21000
|
+
return every(this, callback);
|
|
20999
21001
|
},
|
|
21000
21002
|
|
|
21001
21003
|
/**
|
|
@@ -21003,27 +21005,27 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21003
21005
|
present in the array until it finds the one where callback returns a truthy
|
|
21004
21006
|
value (i.e. `true`). If such an element is found, any() immediately returns
|
|
21005
21007
|
true. Otherwise, any() returns false.
|
|
21006
|
-
|
|
21008
|
+
```javascript
|
|
21007
21009
|
function(item, index, array);
|
|
21008
21010
|
```
|
|
21009
|
-
|
|
21011
|
+
- `item` is the current item in the iteration.
|
|
21010
21012
|
- `index` is the current index in the iteration.
|
|
21011
21013
|
- `array` is the array object itself.
|
|
21012
|
-
|
|
21014
|
+
Note that in addition to a callback, you can also pass an optional target
|
|
21013
21015
|
object that will be set as `this` on the context. It can be a good way
|
|
21014
21016
|
to give your iterator function access to an object in cases where an ES6
|
|
21015
21017
|
arrow function would not be appropriate.
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
+
Usage Example:
|
|
21019
|
+
```javascript
|
|
21018
21020
|
let includesManager = people.any(this.findPersonInManagersList, this);
|
|
21019
|
-
|
|
21021
|
+
let includesStockHolder = people.any(person => {
|
|
21020
21022
|
return this.findPersonInStockHoldersList(person)
|
|
21021
21023
|
});
|
|
21022
|
-
|
|
21024
|
+
if (includesManager || includesStockHolder) {
|
|
21023
21025
|
Paychecks.addBiggerBonus();
|
|
21024
21026
|
}
|
|
21025
21027
|
```
|
|
21026
|
-
|
|
21028
|
+
@method any
|
|
21027
21029
|
@param {Function} callback The callback to execute
|
|
21028
21030
|
@param {Object} [target] The target object to use
|
|
21029
21031
|
@return {Boolean} `true` if the passed function returns `true` for any item
|
|
@@ -21042,16 +21044,16 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21042
21044
|
Returns `true` if the passed property resolves to the value of the second
|
|
21043
21045
|
argument for any item in the array. This method is often simpler/faster
|
|
21044
21046
|
than using a callback.
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
+
Example usage:
|
|
21048
|
+
```javascript
|
|
21047
21049
|
const food = [
|
|
21048
21050
|
{ food: 'apple', isFruit: true },
|
|
21049
21051
|
{ food: 'bread', isFruit: false },
|
|
21050
21052
|
{ food: 'banana', isFruit: true }
|
|
21051
21053
|
];
|
|
21052
|
-
|
|
21054
|
+
food.isAny('isFruit'); // true
|
|
21053
21055
|
```
|
|
21054
|
-
|
|
21056
|
+
@method isAny
|
|
21055
21057
|
@param {String} key the property to test
|
|
21056
21058
|
@param {String} [value] optional value to test against. Defaults to `true`
|
|
21057
21059
|
@return {Boolean}
|
|
@@ -21059,44 +21061,47 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21059
21061
|
@public
|
|
21060
21062
|
*/
|
|
21061
21063
|
isAny() {
|
|
21062
|
-
|
|
21064
|
+
// @ts-expect-error TS doesn't like us using arguments like this
|
|
21065
|
+
var callback = iter(...arguments);
|
|
21066
|
+
return any(this, callback);
|
|
21063
21067
|
},
|
|
21064
21068
|
|
|
21065
21069
|
/**
|
|
21066
21070
|
This will combine the values of the array into a single value. It
|
|
21067
21071
|
is a useful way to collect a summary value from an array. This
|
|
21068
21072
|
corresponds to the `reduce()` method defined in JavaScript 1.8.
|
|
21069
|
-
|
|
21073
|
+
The callback method you provide should have the following signature (all
|
|
21070
21074
|
parameters are optional):
|
|
21071
|
-
|
|
21075
|
+
```javascript
|
|
21072
21076
|
function(previousValue, item, index, array);
|
|
21073
21077
|
```
|
|
21074
|
-
|
|
21078
|
+
- `previousValue` is the value returned by the last call to the iterator.
|
|
21075
21079
|
- `item` is the current item in the iteration.
|
|
21076
21080
|
- `index` is the current index in the iteration.
|
|
21077
21081
|
- `array` is the array itself.
|
|
21078
|
-
|
|
21079
|
-
|
|
21082
|
+
Return the new cumulative value.
|
|
21083
|
+
In addition to the callback you can also pass an `initialValue`. An error
|
|
21080
21084
|
will be raised if you do not pass an initial value and the enumerator is
|
|
21081
21085
|
empty.
|
|
21082
|
-
|
|
21086
|
+
Note that unlike the other methods, this method does not allow you to
|
|
21083
21087
|
pass a target object to set as this for the callback. It's part of the
|
|
21084
21088
|
spec. Sorry.
|
|
21085
|
-
|
|
21086
|
-
|
|
21089
|
+
Example Usage:
|
|
21090
|
+
```javascript
|
|
21087
21091
|
let numbers = [1, 2, 3, 4, 5];
|
|
21088
|
-
|
|
21092
|
+
numbers.reduce(function(summation, current) {
|
|
21089
21093
|
return summation + current;
|
|
21090
21094
|
}); // 15 (1 + 2 + 3 + 4 + 5)
|
|
21091
|
-
|
|
21095
|
+
numbers.reduce(function(summation, current) {
|
|
21092
21096
|
return summation + current;
|
|
21093
21097
|
}, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)
|
|
21094
|
-
|
|
21095
|
-
|
|
21098
|
+
|
|
21099
|
+
let binaryValues = [true, false, false];
|
|
21100
|
+
binaryValues.reduce(function(truthValue, current) {
|
|
21096
21101
|
return truthValue && current;
|
|
21097
21102
|
}); // false (true && false && false)
|
|
21098
21103
|
```
|
|
21099
|
-
|
|
21104
|
+
@method reduce
|
|
21100
21105
|
@param {Function} callback The callback to execute
|
|
21101
21106
|
@param {Object} initialValue Initial value for the reduce
|
|
21102
21107
|
@return {Object} The reduced value.
|
|
@@ -21116,40 +21121,45 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21116
21121
|
Invokes the named method on every object in the receiver that
|
|
21117
21122
|
implements it. This method corresponds to the implementation in
|
|
21118
21123
|
Prototype 1.6.
|
|
21119
|
-
|
|
21124
|
+
```javascript
|
|
21120
21125
|
class Person {
|
|
21121
21126
|
name = null;
|
|
21122
|
-
|
|
21127
|
+
constructor(name) {
|
|
21123
21128
|
this.name = name;
|
|
21124
21129
|
}
|
|
21125
|
-
|
|
21130
|
+
greet(prefix='Hello') {
|
|
21126
21131
|
return `${prefix} ${this.name}`;
|
|
21127
21132
|
}
|
|
21128
21133
|
}
|
|
21129
|
-
|
|
21130
|
-
|
|
21134
|
+
let people = [new Person('Joe'), new Person('Matt')];
|
|
21135
|
+
people.invoke('greet'); // ['Hello Joe', 'Hello Matt']
|
|
21131
21136
|
people.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
|
|
21132
21137
|
```
|
|
21133
|
-
|
|
21138
|
+
@method invoke
|
|
21134
21139
|
@param {String} methodName the name of the method
|
|
21135
21140
|
@param {Object...} args optional arguments to pass as well.
|
|
21136
21141
|
@return {Array} return values from calling invoke.
|
|
21137
21142
|
@public
|
|
21138
21143
|
*/
|
|
21139
21144
|
invoke(methodName) {
|
|
21140
|
-
for (var
|
|
21141
|
-
args[
|
|
21145
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key3 = 1; _key3 < _len2; _key3++) {
|
|
21146
|
+
args[_key3 - 1] = arguments[_key3];
|
|
21142
21147
|
}
|
|
21143
21148
|
|
|
21144
|
-
var ret = A();
|
|
21145
|
-
|
|
21149
|
+
var ret = A(); // SAFETY: This is not entirely safe and the code will not work with Ember proxies
|
|
21150
|
+
|
|
21151
|
+
this.forEach(item => {
|
|
21152
|
+
var _a, _b;
|
|
21153
|
+
|
|
21154
|
+
return ret.push((_b = (_a = item)[methodName]) === null || _b === void 0 ? void 0 : _b.call(_a, ...args));
|
|
21155
|
+
});
|
|
21146
21156
|
return ret;
|
|
21147
21157
|
},
|
|
21148
21158
|
|
|
21149
21159
|
/**
|
|
21150
21160
|
Simply converts the object into a genuine array. The order is not
|
|
21151
21161
|
guaranteed. Corresponds to the method implemented by Prototype.
|
|
21152
|
-
|
|
21162
|
+
@method toArray
|
|
21153
21163
|
@return {Array} the object as an array.
|
|
21154
21164
|
@public
|
|
21155
21165
|
*/
|
|
@@ -21159,11 +21169,11 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21159
21169
|
|
|
21160
21170
|
/**
|
|
21161
21171
|
Returns a copy of the array with all `null` and `undefined` elements removed.
|
|
21162
|
-
|
|
21172
|
+
```javascript
|
|
21163
21173
|
let arr = ['a', null, 'c', undefined];
|
|
21164
21174
|
arr.compact(); // ['a', 'c']
|
|
21165
21175
|
```
|
|
21166
|
-
|
|
21176
|
+
@method compact
|
|
21167
21177
|
@return {Array} the array without null and undefined elements.
|
|
21168
21178
|
@public
|
|
21169
21179
|
*/
|
|
@@ -21174,13 +21184,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21174
21184
|
/**
|
|
21175
21185
|
Used to determine if the array contains the passed object.
|
|
21176
21186
|
Returns `true` if found, `false` otherwise.
|
|
21177
|
-
|
|
21187
|
+
The optional `startAt` argument can be used to pass a starting
|
|
21178
21188
|
index to search from, effectively slicing the searchable portion
|
|
21179
21189
|
of the array. If it's negative it will add the array length to
|
|
21180
21190
|
the startAt value passed in as the index to search from. If less
|
|
21181
21191
|
than or equal to `-1 * array.length` the entire array is searched.
|
|
21182
|
-
|
|
21183
|
-
|
|
21192
|
+
This method has the same behavior of JavaScript's [Array.includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes).
|
|
21193
|
+
```javascript
|
|
21184
21194
|
[1, 2, 3].includes(2); // true
|
|
21185
21195
|
[1, 2, 3].includes(4); // false
|
|
21186
21196
|
[1, 2, 3].includes(3, 2); // true
|
|
@@ -21190,7 +21200,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21190
21200
|
[1, 2, 3].includes(1, -4); // true
|
|
21191
21201
|
[1, 2, NaN].includes(NaN); // true
|
|
21192
21202
|
```
|
|
21193
|
-
|
|
21203
|
+
@method includes
|
|
21194
21204
|
@param {Object} object The object to search for.
|
|
21195
21205
|
@param {Number} startAt optional starting location to search, default 0
|
|
21196
21206
|
@return {Boolean} `true` if object is found in the array.
|
|
@@ -21202,19 +21212,19 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21202
21212
|
|
|
21203
21213
|
/**
|
|
21204
21214
|
Sorts the array by the keys specified in the argument.
|
|
21205
|
-
|
|
21206
|
-
|
|
21215
|
+
You may provide multiple arguments to sort by multiple properties.
|
|
21216
|
+
```javascript
|
|
21207
21217
|
let colors = [
|
|
21208
21218
|
{ name: 'red', weight: 500 },
|
|
21209
21219
|
{ name: 'green', weight: 600 },
|
|
21210
21220
|
{ name: 'blue', weight: 500 }
|
|
21211
21221
|
];
|
|
21212
|
-
|
|
21222
|
+
colors.sortBy('name');
|
|
21213
21223
|
// [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]
|
|
21214
|
-
|
|
21224
|
+
colors.sortBy('weight', 'name');
|
|
21215
21225
|
// [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
|
|
21216
21226
|
```
|
|
21217
|
-
|
|
21227
|
+
@method sortBy
|
|
21218
21228
|
@param {String} property name(s) to sort on
|
|
21219
21229
|
@return {Array} The sorted array.
|
|
21220
21230
|
@since 1.2.0
|
|
@@ -21242,12 +21252,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21242
21252
|
/**
|
|
21243
21253
|
Returns a new array that contains only unique values. The default
|
|
21244
21254
|
implementation returns an array regardless of the receiver type.
|
|
21245
|
-
|
|
21255
|
+
```javascript
|
|
21246
21256
|
let arr = ['a', 'a', 'b', 'b'];
|
|
21247
21257
|
arr.uniq(); // ['a', 'b']
|
|
21248
21258
|
```
|
|
21249
|
-
|
|
21250
|
-
|
|
21259
|
+
This only works on primitive data types, e.g. Strings, Numbers, etc.
|
|
21260
|
+
@method uniq
|
|
21251
21261
|
@return {EmberArray}
|
|
21252
21262
|
@public
|
|
21253
21263
|
*/
|
|
@@ -21258,13 +21268,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21258
21268
|
/**
|
|
21259
21269
|
Returns a new array that contains only items containing a unique property value.
|
|
21260
21270
|
The default implementation returns an array regardless of the receiver type.
|
|
21261
|
-
|
|
21271
|
+
```javascript
|
|
21262
21272
|
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
|
|
21263
21273
|
arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }]
|
|
21264
|
-
|
|
21274
|
+
let arr = [2.2, 2.1, 3.2, 3.3];
|
|
21265
21275
|
arr.uniqBy(Math.floor); // [2.2, 3.2];
|
|
21266
21276
|
```
|
|
21267
|
-
|
|
21277
|
+
@method uniqBy
|
|
21268
21278
|
@param {String,Function} key
|
|
21269
21279
|
@return {EmberArray}
|
|
21270
21280
|
@public
|
|
@@ -21277,11 +21287,11 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21277
21287
|
Returns a new array that excludes the passed value. The default
|
|
21278
21288
|
implementation returns an array regardless of the receiver type.
|
|
21279
21289
|
If the receiver does not contain the value it returns the original array.
|
|
21280
|
-
|
|
21290
|
+
```javascript
|
|
21281
21291
|
let arr = ['a', 'b', 'a', 'c'];
|
|
21282
21292
|
arr.without('a'); // ['b', 'c']
|
|
21283
21293
|
```
|
|
21284
|
-
|
|
21294
|
+
@method without
|
|
21285
21295
|
@param {Object} value
|
|
21286
21296
|
@return {EmberArray}
|
|
21287
21297
|
@public
|
|
@@ -21297,36 +21307,15 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21297
21307
|
}
|
|
21298
21308
|
|
|
21299
21309
|
});
|
|
21300
|
-
/**
|
|
21301
|
-
This mixin defines the API for modifying array-like objects. These methods
|
|
21302
|
-
can be applied only to a collection that keeps its items in an ordered set.
|
|
21303
|
-
It builds upon the Array mixin and adds methods to modify the array.
|
|
21304
|
-
One concrete implementations of this class include ArrayProxy.
|
|
21305
|
-
|
|
21306
|
-
It is important to use the methods in this class to modify arrays so that
|
|
21307
|
-
changes are observable. This allows the binding system in Ember to function
|
|
21308
|
-
correctly.
|
|
21309
|
-
|
|
21310
|
-
|
|
21311
|
-
Note that an Array can change even if it does not implement this mixin.
|
|
21312
|
-
For example, one might implement a SparseArray that cannot be directly
|
|
21313
|
-
modified, but if its underlying enumerable changes, it will change also.
|
|
21314
|
-
|
|
21315
|
-
@class MutableArray
|
|
21316
|
-
@uses EmberArray
|
|
21317
|
-
@uses MutableEnumerable
|
|
21318
|
-
@public
|
|
21319
|
-
*/
|
|
21320
21310
|
|
|
21321
|
-
|
|
21322
|
-
var MutableArray = _metal.Mixin.create(ArrayMixin, _mutable_enumerable.default, {
|
|
21311
|
+
var MutableArray = _metal.Mixin.create(EmberArray, _mutable_enumerable.default, {
|
|
21323
21312
|
/**
|
|
21324
21313
|
__Required.__ You must implement this method to apply this mixin.
|
|
21325
|
-
|
|
21314
|
+
This is one of the primitives you must implement to support `Array`.
|
|
21326
21315
|
You should replace amt objects started at idx with the objects in the
|
|
21327
21316
|
passed array.
|
|
21328
|
-
|
|
21329
|
-
|
|
21317
|
+
Note that this method is expected to validate the type(s) of objects that it expects.
|
|
21318
|
+
@method replace
|
|
21330
21319
|
@param {Number} idx Starting index in the array to replace. If
|
|
21331
21320
|
idx >= length, then append to the end of the array.
|
|
21332
21321
|
@param {Number} amt Number of elements that should be removed from
|
|
@@ -21339,13 +21328,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21339
21328
|
/**
|
|
21340
21329
|
Remove all elements from the array. This is useful if you
|
|
21341
21330
|
want to reuse an existing array without having to recreate it.
|
|
21342
|
-
|
|
21331
|
+
```javascript
|
|
21343
21332
|
let colors = ['red', 'green', 'blue'];
|
|
21344
|
-
|
|
21333
|
+
colors.length; // 3
|
|
21345
21334
|
colors.clear(); // []
|
|
21346
21335
|
colors.length; // 0
|
|
21347
21336
|
```
|
|
21348
|
-
|
|
21337
|
+
@method clear
|
|
21349
21338
|
@return {Array} An empty Array.
|
|
21350
21339
|
@public
|
|
21351
21340
|
*/
|
|
@@ -21363,12 +21352,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21363
21352
|
/**
|
|
21364
21353
|
This will use the primitive `replace()` method to insert an object at the
|
|
21365
21354
|
specified index.
|
|
21366
|
-
|
|
21355
|
+
```javascript
|
|
21367
21356
|
let colors = ['red', 'green', 'blue'];
|
|
21368
|
-
|
|
21357
|
+
colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue']
|
|
21369
21358
|
colors.insertAt(5, 'orange'); // Error: Index out of range
|
|
21370
21359
|
```
|
|
21371
|
-
|
|
21360
|
+
@method insertAt
|
|
21372
21361
|
@param {Number} idx index of insert the object at.
|
|
21373
21362
|
@param {Object} object object to insert
|
|
21374
21363
|
@return {EmberArray} receiver
|
|
@@ -21382,15 +21371,15 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21382
21371
|
/**
|
|
21383
21372
|
Remove an object at the specified index using the `replace()` primitive
|
|
21384
21373
|
method. You can pass either a single index, or a start and a length.
|
|
21385
|
-
|
|
21374
|
+
If you pass a start and length that is beyond the
|
|
21386
21375
|
length this method will throw an assertion.
|
|
21387
|
-
|
|
21376
|
+
```javascript
|
|
21388
21377
|
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];
|
|
21389
|
-
|
|
21378
|
+
colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange']
|
|
21390
21379
|
colors.removeAt(2, 2); // ['green', 'blue']
|
|
21391
21380
|
colors.removeAt(4, 2); // Error: Index out of range
|
|
21392
21381
|
```
|
|
21393
|
-
|
|
21382
|
+
@method removeAt
|
|
21394
21383
|
@param {Number} start index, start of range
|
|
21395
21384
|
@param {Number} len length of passing range
|
|
21396
21385
|
@return {EmberArray} receiver
|
|
@@ -21403,12 +21392,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21403
21392
|
/**
|
|
21404
21393
|
Push the object onto the end of the array. Works just like `push()` but it
|
|
21405
21394
|
is KVO-compliant.
|
|
21406
|
-
|
|
21395
|
+
```javascript
|
|
21407
21396
|
let colors = ['red', 'green'];
|
|
21408
|
-
|
|
21397
|
+
colors.pushObject('black'); // ['red', 'green', 'black']
|
|
21409
21398
|
colors.pushObject(['yellow']); // ['red', 'green', ['yellow']]
|
|
21410
21399
|
```
|
|
21411
|
-
|
|
21400
|
+
@method pushObject
|
|
21412
21401
|
@param {*} obj object to push
|
|
21413
21402
|
@return object same object passed as a param
|
|
21414
21403
|
@public
|
|
@@ -21420,13 +21409,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21420
21409
|
/**
|
|
21421
21410
|
Add the objects in the passed array to the end of the array. Defers
|
|
21422
21411
|
notifying observers of the change until all objects are added.
|
|
21423
|
-
|
|
21412
|
+
```javascript
|
|
21424
21413
|
let colors = ['red'];
|
|
21425
|
-
|
|
21414
|
+
colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange']
|
|
21426
21415
|
```
|
|
21427
|
-
|
|
21428
|
-
@param {
|
|
21429
|
-
@return {
|
|
21416
|
+
@method pushObjects
|
|
21417
|
+
@param {Array} objects the objects to add
|
|
21418
|
+
@return {MutableArray} receiver
|
|
21430
21419
|
@public
|
|
21431
21420
|
*/
|
|
21432
21421
|
pushObjects(objects) {
|
|
@@ -21437,12 +21426,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21437
21426
|
/**
|
|
21438
21427
|
Pop object from array or nil if none are left. Works just like `pop()` but
|
|
21439
21428
|
it is KVO-compliant.
|
|
21440
|
-
|
|
21429
|
+
```javascript
|
|
21441
21430
|
let colors = ['red', 'green', 'blue'];
|
|
21442
|
-
|
|
21431
|
+
colors.popObject(); // 'blue'
|
|
21443
21432
|
console.log(colors); // ['red', 'green']
|
|
21444
21433
|
```
|
|
21445
|
-
|
|
21434
|
+
@method popObject
|
|
21446
21435
|
@return object
|
|
21447
21436
|
@public
|
|
21448
21437
|
*/
|
|
@@ -21461,12 +21450,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21461
21450
|
/**
|
|
21462
21451
|
Shift an object from start of array or nil if none are left. Works just
|
|
21463
21452
|
like `shift()` but it is KVO-compliant.
|
|
21464
|
-
|
|
21453
|
+
```javascript
|
|
21465
21454
|
let colors = ['red', 'green', 'blue'];
|
|
21466
|
-
|
|
21455
|
+
colors.shiftObject(); // 'red'
|
|
21467
21456
|
console.log(colors); // ['green', 'blue']
|
|
21468
21457
|
```
|
|
21469
|
-
|
|
21458
|
+
@method shiftObject
|
|
21470
21459
|
@return object
|
|
21471
21460
|
@public
|
|
21472
21461
|
*/
|
|
@@ -21483,12 +21472,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21483
21472
|
/**
|
|
21484
21473
|
Unshift an object to start of array. Works just like `unshift()` but it is
|
|
21485
21474
|
KVO-compliant.
|
|
21486
|
-
|
|
21475
|
+
```javascript
|
|
21487
21476
|
let colors = ['red'];
|
|
21488
|
-
|
|
21477
|
+
colors.unshiftObject('yellow'); // ['yellow', 'red']
|
|
21489
21478
|
colors.unshiftObject(['black']); // [['black'], 'yellow', 'red']
|
|
21490
21479
|
```
|
|
21491
|
-
|
|
21480
|
+
@method unshiftObject
|
|
21492
21481
|
@param {*} obj object to unshift
|
|
21493
21482
|
@return object same object passed as a param
|
|
21494
21483
|
@public
|
|
@@ -21500,12 +21489,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21500
21489
|
/**
|
|
21501
21490
|
Adds the named objects to the beginning of the array. Defers notifying
|
|
21502
21491
|
observers until all objects have been added.
|
|
21503
|
-
|
|
21492
|
+
```javascript
|
|
21504
21493
|
let colors = ['red'];
|
|
21505
|
-
|
|
21494
|
+
colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red']
|
|
21506
21495
|
colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
|
|
21507
21496
|
```
|
|
21508
|
-
|
|
21497
|
+
@method unshiftObjects
|
|
21509
21498
|
@param {Enumerable} objects the objects to add
|
|
21510
21499
|
@return {EmberArray} receiver
|
|
21511
21500
|
@public
|
|
@@ -21518,7 +21507,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21518
21507
|
/**
|
|
21519
21508
|
Reverse objects in the array. Works just like `reverse()` but it is
|
|
21520
21509
|
KVO-compliant.
|
|
21521
|
-
|
|
21510
|
+
@method reverseObjects
|
|
21522
21511
|
@return {EmberArray} receiver
|
|
21523
21512
|
@public
|
|
21524
21513
|
*/
|
|
@@ -21537,12 +21526,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21537
21526
|
/**
|
|
21538
21527
|
Replace all the receiver's content with content of the argument.
|
|
21539
21528
|
If argument is an empty array receiver will be cleared.
|
|
21540
|
-
|
|
21529
|
+
```javascript
|
|
21541
21530
|
let colors = ['red', 'green', 'blue'];
|
|
21542
|
-
|
|
21531
|
+
colors.setObjects(['black', 'white']); // ['black', 'white']
|
|
21543
21532
|
colors.setObjects([]); // []
|
|
21544
21533
|
```
|
|
21545
|
-
|
|
21534
|
+
@method setObjects
|
|
21546
21535
|
@param {EmberArray} objects array whose content will be used for replacing
|
|
21547
21536
|
the content of the receiver
|
|
21548
21537
|
@return {EmberArray} receiver with the new content
|
|
@@ -21560,13 +21549,13 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21560
21549
|
|
|
21561
21550
|
/**
|
|
21562
21551
|
Remove all occurrences of an object in the array.
|
|
21563
|
-
|
|
21552
|
+
```javascript
|
|
21564
21553
|
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];
|
|
21565
|
-
|
|
21554
|
+
cities.removeObject('Chicago'); // ['Berlin', 'Lima']
|
|
21566
21555
|
cities.removeObject('Lima'); // ['Berlin']
|
|
21567
21556
|
cities.removeObject('Tokyo') // ['Berlin']
|
|
21568
21557
|
```
|
|
21569
|
-
|
|
21558
|
+
@method removeObject
|
|
21570
21559
|
@param {*} obj object to remove
|
|
21571
21560
|
@return {EmberArray} receiver
|
|
21572
21561
|
@public
|
|
@@ -21587,7 +21576,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21587
21576
|
|
|
21588
21577
|
/**
|
|
21589
21578
|
Removes each object in the passed array from the receiver.
|
|
21590
|
-
|
|
21579
|
+
@method removeObjects
|
|
21591
21580
|
@param {EmberArray} objects the objects to remove
|
|
21592
21581
|
@return {EmberArray} receiver
|
|
21593
21582
|
@public
|
|
@@ -21596,6 +21585,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21596
21585
|
(0, _metal.beginPropertyChanges)();
|
|
21597
21586
|
|
|
21598
21587
|
for (var i = objects.length - 1; i >= 0; i--) {
|
|
21588
|
+
// SAFETY: Due to the loop structure we know this will always exist.
|
|
21599
21589
|
this.removeObject(objects[i]);
|
|
21600
21590
|
}
|
|
21601
21591
|
|
|
@@ -21606,12 +21596,12 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21606
21596
|
/**
|
|
21607
21597
|
Push the object onto the end of the array if it is not already
|
|
21608
21598
|
present in the array.
|
|
21609
|
-
|
|
21599
|
+
```javascript
|
|
21610
21600
|
let cities = ['Chicago', 'Berlin'];
|
|
21611
|
-
|
|
21601
|
+
cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima']
|
|
21612
21602
|
cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima']
|
|
21613
21603
|
```
|
|
21614
|
-
|
|
21604
|
+
@method addObject
|
|
21615
21605
|
@param {*} obj object to add, if not already present
|
|
21616
21606
|
@return {EmberArray} receiver
|
|
21617
21607
|
@public
|
|
@@ -21628,7 +21618,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21628
21618
|
|
|
21629
21619
|
/**
|
|
21630
21620
|
Adds each object in the passed array to the receiver.
|
|
21631
|
-
|
|
21621
|
+
@method addObjects
|
|
21632
21622
|
@param {EmberArray} objects the objects to add.
|
|
21633
21623
|
@return {EmberArray} receiver
|
|
21634
21624
|
@public
|
|
@@ -21641,62 +21631,6 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21641
21631
|
}
|
|
21642
21632
|
|
|
21643
21633
|
});
|
|
21644
|
-
/**
|
|
21645
|
-
Creates an `Ember.NativeArray` from an Array-like object.
|
|
21646
|
-
Does not modify the original object's contents. `A()` is not needed if
|
|
21647
|
-
`EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,
|
|
21648
|
-
it is recommended that you use `A()` when creating addons for
|
|
21649
|
-
ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`
|
|
21650
|
-
will be `true`.
|
|
21651
|
-
|
|
21652
|
-
Example
|
|
21653
|
-
|
|
21654
|
-
```app/components/my-component.js
|
|
21655
|
-
import Component from '@ember/component';
|
|
21656
|
-
import { A } from '@ember/array';
|
|
21657
|
-
|
|
21658
|
-
export default Component.extend({
|
|
21659
|
-
tagName: 'ul',
|
|
21660
|
-
classNames: ['pagination'],
|
|
21661
|
-
|
|
21662
|
-
init() {
|
|
21663
|
-
this._super(...arguments);
|
|
21664
|
-
|
|
21665
|
-
if (!this.get('content')) {
|
|
21666
|
-
this.set('content', A());
|
|
21667
|
-
this.set('otherContent', A([1,2,3]));
|
|
21668
|
-
}
|
|
21669
|
-
}
|
|
21670
|
-
});
|
|
21671
|
-
```
|
|
21672
|
-
|
|
21673
|
-
@method A
|
|
21674
|
-
@static
|
|
21675
|
-
@for @ember/array
|
|
21676
|
-
@return {Ember.NativeArray}
|
|
21677
|
-
@public
|
|
21678
|
-
*/
|
|
21679
|
-
// Add Ember.Array to Array.prototype. Remove methods with native
|
|
21680
|
-
// implementations and supply some more optimized versions of generic methods
|
|
21681
|
-
// because they are so common.
|
|
21682
|
-
|
|
21683
|
-
/**
|
|
21684
|
-
@module ember
|
|
21685
|
-
*/
|
|
21686
|
-
|
|
21687
|
-
/**
|
|
21688
|
-
The NativeArray mixin contains the properties needed to make the native
|
|
21689
|
-
Array support MutableArray and all of its dependent APIs. Unless you
|
|
21690
|
-
have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to
|
|
21691
|
-
false, this will be applied automatically. Otherwise you can apply the mixin
|
|
21692
|
-
at anytime by calling `Ember.NativeArray.apply(Array.prototype)`.
|
|
21693
|
-
|
|
21694
|
-
@class Ember.NativeArray
|
|
21695
|
-
@uses MutableArray
|
|
21696
|
-
@uses Observable
|
|
21697
|
-
@public
|
|
21698
|
-
*/
|
|
21699
|
-
|
|
21700
21634
|
|
|
21701
21635
|
_exports.MutableArray = MutableArray;
|
|
21702
21636
|
|
|
@@ -21722,6 +21656,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21722
21656
|
_exports.NativeArray = NativeArray;
|
|
21723
21657
|
var ignore = ['length'];
|
|
21724
21658
|
NativeArray.keys().forEach(methodName => {
|
|
21659
|
+
// SAFETY: It's safe to read unknown properties from an object
|
|
21725
21660
|
if (Array.prototype[methodName]) {
|
|
21726
21661
|
ignore.push(methodName);
|
|
21727
21662
|
}
|
|
@@ -21734,22 +21669,25 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
21734
21669
|
NativeArray.apply(Array.prototype, true);
|
|
21735
21670
|
|
|
21736
21671
|
_exports.A = A = function (arr) {
|
|
21737
|
-
(true && !(!(this instanceof A)) && (0, _debug.assert)('You cannot create an Ember Array with `new A()`, please update to calling A as a function: `A()`', !(this instanceof A)));
|
|
21672
|
+
(true && !(!(this instanceof A)) && (0, _debug.assert)('You cannot create an Ember Array with `new A()`, please update to calling A as a function: `A()`', !(this instanceof A))); // SAFTEY: Since we are extending prototypes all true native arrays are Ember NativeArrays
|
|
21673
|
+
|
|
21738
21674
|
return arr || [];
|
|
21739
21675
|
};
|
|
21740
21676
|
} else {
|
|
21741
21677
|
_exports.A = A = function (arr) {
|
|
21742
21678
|
(true && !(!(this instanceof A)) && (0, _debug.assert)('You cannot create an Ember Array with `new A()`, please update to calling A as a function: `A()`', !(this instanceof A)));
|
|
21743
21679
|
|
|
21744
|
-
if (
|
|
21745
|
-
|
|
21680
|
+
if ((0, _utils.isEmberArray)(arr)) {
|
|
21681
|
+
// SAFETY: If it's a true native array and it is also an EmberArray then it should be an Ember NativeArray
|
|
21682
|
+
return arr;
|
|
21683
|
+
} else {
|
|
21684
|
+
// SAFETY: This will return an NativeArray but TS can't infer that.
|
|
21685
|
+
return NativeArray.apply(arr !== null && arr !== void 0 ? arr : []);
|
|
21746
21686
|
}
|
|
21747
|
-
|
|
21748
|
-
return ArrayMixin.detect(arr) ? arr : NativeArray.apply(arr);
|
|
21749
21687
|
};
|
|
21750
21688
|
}
|
|
21751
21689
|
|
|
21752
|
-
var _default =
|
|
21690
|
+
var _default = EmberArray;
|
|
21753
21691
|
_exports.default = _default;
|
|
21754
21692
|
});
|
|
21755
21693
|
define("@ember/-internals/runtime/lib/mixins/comparable", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
|
|
@@ -23057,7 +22995,7 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
|
|
|
23057
22995
|
@method replaceContent
|
|
23058
22996
|
@param {Number} idx The starting index
|
|
23059
22997
|
@param {Number} amt The number of items to remove from the content.
|
|
23060
|
-
@param {
|
|
22998
|
+
@param {Array} objects Optional array of objects to insert.
|
|
23061
22999
|
@return {void}
|
|
23062
23000
|
@public
|
|
23063
23001
|
*/
|
|
@@ -23065,9 +23003,9 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
|
|
|
23065
23003
|
|
|
23066
23004
|
replaceContent(idx, amt, objects) {
|
|
23067
23005
|
var content = (0, _metal.get)(this, 'content');
|
|
23068
|
-
(true && !(content) && (0, _debug.assert)('[BUG] Called
|
|
23006
|
+
(true && !(content) && (0, _debug.assert)('[BUG] Called replaceContent without content', content));
|
|
23069
23007
|
(true && !(isMutable(content)) && (0, _debug.assert)('Mutating a non-mutable array is not allowed', isMutable(content)));
|
|
23070
|
-
|
|
23008
|
+
(0, _metal.replace)(content, idx, amt, objects);
|
|
23071
23009
|
} // Overriding objectAt is not supported.
|
|
23072
23010
|
|
|
23073
23011
|
|
|
@@ -23156,7 +23094,12 @@ define("@ember/-internals/runtime/lib/system/array_proxy", ["exports", "@ember/-
|
|
|
23156
23094
|
if (arrangedContent && !arrangedContent.isDestroyed) {
|
|
23157
23095
|
// @ts-expect-error This check is still good for ensuring correctness
|
|
23158
23096
|
(true && !(arrangedContent !== this) && (0, _debug.assert)("Can't set ArrayProxy's content to itself", arrangedContent !== this));
|
|
23159
|
-
(true && !(
|
|
23097
|
+
(true && !(function (arr) {
|
|
23098
|
+
return Array.isArray(arr) || _array.default.detect(arr);
|
|
23099
|
+
}(arrangedContent)) && (0, _debug.assert)(`ArrayProxy expects a native Array, EmberArray, or ArrayProxy, but you passed ${typeof arrangedContent}`, function (arr) {
|
|
23100
|
+
return Array.isArray(arr) || _array.default.detect(arr);
|
|
23101
|
+
}(arrangedContent)));
|
|
23102
|
+
(true && !(!arrangedContent.isDestroyed) && (0, _debug.assert)('ArrayProxy expected its contents to not be destroyed', !arrangedContent.isDestroyed));
|
|
23160
23103
|
(0, _metal.addArrayObserver)(arrangedContent, this, ARRAY_OBSERVER_MAPPING);
|
|
23161
23104
|
this._arrangedContent = arrangedContent;
|
|
23162
23105
|
}
|
|
@@ -28119,6 +28062,9 @@ define("@ember/application/lib/application", ["exports", "@ember/-internals/util
|
|
|
28119
28062
|
|
|
28120
28063
|
}
|
|
28121
28064
|
|
|
28065
|
+
Application.initializer = (0, _engine.buildInitializerMethod)('initializers', 'initializer');
|
|
28066
|
+
Application.instanceInitializer = (0, _engine.buildInitializerMethod)('instanceInitializers', 'instance initializer');
|
|
28067
|
+
|
|
28122
28068
|
function commonSetupRegistry(registry) {
|
|
28123
28069
|
registry.register('router:main', _routing.Router);
|
|
28124
28070
|
registry.register('-view-registry:main', {
|
|
@@ -28324,8 +28270,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
28324
28270
|
@public
|
|
28325
28271
|
*/
|
|
28326
28272
|
var DEFAULT_FEATURES = {
|
|
28327
|
-
EMBER_LIBRARIES_ISREGISTERED:
|
|
28328
|
-
EMBER_IMPROVED_INSTRUMENTATION:
|
|
28273
|
+
EMBER_LIBRARIES_ISREGISTERED: null,
|
|
28274
|
+
EMBER_IMPROVED_INSTRUMENTATION: null,
|
|
28329
28275
|
EMBER_UNIQUE_ID_HELPER: true,
|
|
28330
28276
|
EMBER_DEFAULT_HELPER_MANAGER: true
|
|
28331
28277
|
};
|
|
@@ -28499,31 +28445,21 @@ define("@ember/controller/lib/controller_mixin", ["exports", "@ember/-internals/
|
|
|
28499
28445
|
});
|
|
28500
28446
|
_exports.default = void 0;
|
|
28501
28447
|
var MODEL = (0, _utils.symbol)('MODEL');
|
|
28502
|
-
/**
|
|
28503
|
-
@module ember
|
|
28504
|
-
*/
|
|
28505
|
-
|
|
28506
|
-
/**
|
|
28507
|
-
@class ControllerMixin
|
|
28508
|
-
@namespace Ember
|
|
28509
|
-
@uses Ember.ActionHandler
|
|
28510
|
-
@private
|
|
28511
|
-
*/
|
|
28512
28448
|
|
|
28513
|
-
var
|
|
28449
|
+
var ControllerMixin = _metal.Mixin.create(_runtime.ActionHandler, {
|
|
28514
28450
|
/* ducktype as a controller */
|
|
28515
28451
|
isController: true,
|
|
28516
28452
|
|
|
28517
28453
|
/**
|
|
28518
28454
|
The object to which actions from the view should be sent.
|
|
28519
|
-
|
|
28455
|
+
For example, when a Handlebars template uses the `{{action}}` helper,
|
|
28520
28456
|
it will attempt to send the action to the view's controller's `target`.
|
|
28521
|
-
|
|
28457
|
+
By default, the value of the target property is set to the router, and
|
|
28522
28458
|
is injected when a controller is instantiated. This injection is applied
|
|
28523
28459
|
as part of the application's initialization process. In most cases the
|
|
28524
28460
|
`target` property will automatically be set to the logical consumer of
|
|
28525
28461
|
actions for the controller.
|
|
28526
|
-
|
|
28462
|
+
@property target
|
|
28527
28463
|
@default null
|
|
28528
28464
|
@public
|
|
28529
28465
|
*/
|
|
@@ -28533,7 +28469,7 @@ define("@ember/controller/lib/controller_mixin", ["exports", "@ember/-internals/
|
|
|
28533
28469
|
/**
|
|
28534
28470
|
The controller's current model. When retrieving or modifying a controller's
|
|
28535
28471
|
model, this property should be used instead of the `content` property.
|
|
28536
|
-
|
|
28472
|
+
@property model
|
|
28537
28473
|
@public
|
|
28538
28474
|
*/
|
|
28539
28475
|
model: (0, _metal.computed)({
|
|
@@ -28541,13 +28477,14 @@ define("@ember/controller/lib/controller_mixin", ["exports", "@ember/-internals/
|
|
|
28541
28477
|
return this[MODEL];
|
|
28542
28478
|
},
|
|
28543
28479
|
|
|
28544
|
-
set(
|
|
28480
|
+
set(_key, value) {
|
|
28545
28481
|
return this[MODEL] = value;
|
|
28546
28482
|
}
|
|
28547
28483
|
|
|
28548
28484
|
})
|
|
28549
28485
|
});
|
|
28550
28486
|
|
|
28487
|
+
var _default = ControllerMixin;
|
|
28551
28488
|
_exports.default = _default;
|
|
28552
28489
|
});
|
|
28553
28490
|
define("@ember/debug/container-debug-adapter", ["exports", "@ember/-internals/extension-support"], function (_exports, _extensionSupport) {
|
|
@@ -29620,6 +29557,7 @@ define("@ember/engine/index", ["exports", "@ember/engine/lib/engine-parent", "@e
|
|
|
29620
29557
|
Object.defineProperty(_exports, "__esModule", {
|
|
29621
29558
|
value: true
|
|
29622
29559
|
});
|
|
29560
|
+
_exports.buildInitializerMethod = buildInitializerMethod;
|
|
29623
29561
|
_exports.default = void 0;
|
|
29624
29562
|
Object.defineProperty(_exports, "getEngineParent", {
|
|
29625
29563
|
enumerable: true,
|
|
@@ -30045,6 +29983,8 @@ define("@ember/engine/index", ["exports", "@ember/engine/lib/engine-parent", "@e
|
|
|
30045
29983
|
};
|
|
30046
29984
|
return ResolverClass.create(props);
|
|
30047
29985
|
}
|
|
29986
|
+
/** @internal */
|
|
29987
|
+
|
|
30048
29988
|
|
|
30049
29989
|
function buildInitializerMethod(bucketName, humanName) {
|
|
30050
29990
|
return function (initializer) {
|
|
@@ -31241,8 +31181,12 @@ define("@ember/object/index", ["exports", "@ember/debug", "@ember/-internals/met
|
|
|
31241
31181
|
*/
|
|
31242
31182
|
var BINDINGS_MAP = new WeakMap();
|
|
31243
31183
|
|
|
31184
|
+
function hasProto(obj) {
|
|
31185
|
+
return obj != null && obj.constructor !== undefined && typeof obj.constructor.proto === 'function';
|
|
31186
|
+
}
|
|
31187
|
+
|
|
31244
31188
|
function setupAction(target, key, actionFn) {
|
|
31245
|
-
if (target
|
|
31189
|
+
if (hasProto(target)) {
|
|
31246
31190
|
target.constructor.proto();
|
|
31247
31191
|
}
|
|
31248
31192
|
|
|
@@ -31252,6 +31196,7 @@ define("@ember/object/index", ["exports", "@ember/debug", "@ember/-internals/met
|
|
|
31252
31196
|
target.actions = parentActions ? Object.assign({}, parentActions) : {};
|
|
31253
31197
|
}
|
|
31254
31198
|
|
|
31199
|
+
(true && !(target.actions != null) && (0, _debug.assert)("[BUG] Somehow the target doesn't have actions!", target.actions != null));
|
|
31255
31200
|
target.actions[key] = actionFn;
|
|
31256
31201
|
return {
|
|
31257
31202
|
get() {
|
|
@@ -31275,13 +31220,17 @@ define("@ember/object/index", ["exports", "@ember/debug", "@ember/-internals/met
|
|
|
31275
31220
|
};
|
|
31276
31221
|
}
|
|
31277
31222
|
|
|
31278
|
-
function action(
|
|
31223
|
+
function action() {
|
|
31279
31224
|
var actionFn;
|
|
31280
31225
|
|
|
31281
|
-
|
|
31282
|
-
|
|
31226
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31227
|
+
args[_key] = arguments[_key];
|
|
31228
|
+
}
|
|
31229
|
+
|
|
31230
|
+
if (!(0, _metal.isElementDescriptor)(args)) {
|
|
31231
|
+
actionFn = args[0];
|
|
31283
31232
|
|
|
31284
|
-
var decorator = function (target, key,
|
|
31233
|
+
var decorator = function (target, key, _desc, _meta, isClassicDecorator) {
|
|
31285
31234
|
(true && !(isClassicDecorator) && (0, _debug.assert)('The @action decorator may only be passed a method when used in classic classes. You should decorate methods directly in native classes', isClassicDecorator));
|
|
31286
31235
|
(true && !(typeof actionFn === 'function') && (0, _debug.assert)('The action() decorator must be passed a method when used in classic classes', typeof actionFn === 'function'));
|
|
31287
31236
|
return setupAction(target, key, actionFn);
|
|
@@ -31291,10 +31240,13 @@ define("@ember/object/index", ["exports", "@ember/debug", "@ember/-internals/met
|
|
|
31291
31240
|
return decorator;
|
|
31292
31241
|
}
|
|
31293
31242
|
|
|
31294
|
-
|
|
31295
|
-
|
|
31243
|
+
var [target, key, desc] = args;
|
|
31244
|
+
actionFn = desc === null || desc === void 0 ? void 0 : desc.value;
|
|
31245
|
+
(true && !(typeof actionFn === 'function') && (0, _debug.assert)('The @action decorator must be applied to methods when used in native classes', typeof actionFn === 'function')); // SAFETY: TS types are weird with decorators. This should work.
|
|
31246
|
+
|
|
31296
31247
|
return setupAction(target, key, actionFn);
|
|
31297
|
-
}
|
|
31248
|
+
} // SAFETY: TS types are weird with decorators. This should work.
|
|
31249
|
+
|
|
31298
31250
|
|
|
31299
31251
|
(0, _metal.setClassicDecorator)(action);
|
|
31300
31252
|
});
|
|
@@ -31350,8 +31302,7 @@ define("@ember/object/lib/computed/computed_macros", ["exports", "@ember/-intern
|
|
|
31350
31302
|
expandedProperties.push(entry);
|
|
31351
31303
|
}
|
|
31352
31304
|
|
|
31353
|
-
for (var
|
|
31354
|
-
var property = properties[i];
|
|
31305
|
+
for (var property of properties) {
|
|
31355
31306
|
(true && !(property.indexOf(' ') < 0) && (0, _debug.assert)(`Dependent keys passed to \`${predicateName}\` computed macro can't have spaces.`, property.indexOf(' ') < 0));
|
|
31356
31307
|
(0, _metal.expandProperties)(property, extractProperty);
|
|
31357
31308
|
}
|
|
@@ -31360,23 +31311,26 @@ define("@ember/object/lib/computed/computed_macros", ["exports", "@ember/-intern
|
|
|
31360
31311
|
}
|
|
31361
31312
|
|
|
31362
31313
|
function generateComputedWithPredicate(name, predicate) {
|
|
31363
|
-
return function () {
|
|
31364
|
-
for (var _len = arguments.length,
|
|
31365
|
-
|
|
31314
|
+
return function (dependentKey) {
|
|
31315
|
+
for (var _len = arguments.length, additionalDependentKeys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
31316
|
+
additionalDependentKeys[_key - 1] = arguments[_key];
|
|
31366
31317
|
}
|
|
31367
31318
|
|
|
31319
|
+
var properties = [dependentKey, ...additionalDependentKeys];
|
|
31368
31320
|
(true && !(!(0, _metal.isElementDescriptor)(properties)) && (0, _debug.assert)(`You attempted to use @${name} as a decorator directly, but it requires at least one dependent key parameter`, !(0, _metal.isElementDescriptor)(properties)));
|
|
31369
31321
|
var dependentKeys = expandPropertiesToArray(name, properties);
|
|
31370
31322
|
var computedFunc = (0, _metal.computed)(...dependentKeys, function () {
|
|
31371
31323
|
var lastIdx = dependentKeys.length - 1;
|
|
31372
31324
|
|
|
31373
31325
|
for (var i = 0; i < lastIdx; i++) {
|
|
31326
|
+
// SAFETY: `i` is derived from the length of `dependentKeys`
|
|
31374
31327
|
var value = (0, _metal.get)(this, dependentKeys[i]);
|
|
31375
31328
|
|
|
31376
31329
|
if (!predicate(value)) {
|
|
31377
31330
|
return value;
|
|
31378
31331
|
}
|
|
31379
|
-
}
|
|
31332
|
+
} // SAFETY: `lastIdx` is derived from the length of `dependentKeys`
|
|
31333
|
+
|
|
31380
31334
|
|
|
31381
31335
|
return (0, _metal.get)(this, dependentKeys[lastIdx]);
|
|
31382
31336
|
});
|
|
@@ -32137,7 +32091,7 @@ define("@ember/object/lib/computed/computed_macros", ["exports", "@ember/-intern
|
|
|
32137
32091
|
});
|
|
32138
32092
|
}
|
|
32139
32093
|
});
|
|
32140
|
-
define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/debug", "@ember/-internals/metal", "@ember/-internals/runtime"], function (_exports, _debug, _metal, _runtime) {
|
|
32094
|
+
define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/debug", "@ember/-internals/metal", "@ember/-internals/runtime", "@ember/-internals/runtime/lib/mixins/array"], function (_exports, _debug, _metal, _runtime, _array) {
|
|
32141
32095
|
"use strict";
|
|
32142
32096
|
|
|
32143
32097
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -32161,6 +32115,10 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32161
32115
|
/**
|
|
32162
32116
|
@module @ember/object
|
|
32163
32117
|
*/
|
|
32118
|
+
function isNativeOrEmberArray(obj) {
|
|
32119
|
+
return Array.isArray(obj) || _array.default.detect(obj);
|
|
32120
|
+
}
|
|
32121
|
+
|
|
32164
32122
|
function reduceMacro(dependentKey, callback, initialValue, name) {
|
|
32165
32123
|
(true && !(!/[[\]{}]/g.test(dependentKey)) && (0, _debug.assert)(`Dependent key passed to \`${name}\` computed macro shouldn't contain brace expanding pattern.`, !/[[\]{}]/g.test(dependentKey)));
|
|
32166
32124
|
return (0, _metal.computed)(`${dependentKey}.[]`, function () {
|
|
@@ -32188,7 +32146,7 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32188
32146
|
return (0, _metal.computed)(dependentKey, ...additionalDependentKeys, function () {
|
|
32189
32147
|
var value = (0, _metal.get)(this, propertyName);
|
|
32190
32148
|
|
|
32191
|
-
if ((
|
|
32149
|
+
if (isNativeOrEmberArray(value)) {
|
|
32192
32150
|
return (0, _runtime.A)(callback.call(this, value));
|
|
32193
32151
|
} else {
|
|
32194
32152
|
return (0, _runtime.A)();
|
|
@@ -32360,95 +32318,25 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32360
32318
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @min as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32361
32319
|
return reduceMacro(dependentKey, (min, item) => Math.min(min, item), Infinity, 'min');
|
|
32362
32320
|
}
|
|
32363
|
-
/**
|
|
32364
|
-
Returns an array mapped via the callback
|
|
32365
|
-
|
|
32366
|
-
The callback method you provide should have the following signature:
|
|
32367
|
-
- `item` is the current item in the iteration.
|
|
32368
|
-
- `index` is the integer index of the current item in the iteration.
|
|
32369
|
-
|
|
32370
|
-
```javascript
|
|
32371
|
-
function mapCallback(item, index);
|
|
32372
|
-
```
|
|
32373
|
-
|
|
32374
|
-
Example:
|
|
32375
|
-
|
|
32376
|
-
```javascript
|
|
32377
|
-
import { set } from '@ember/object';
|
|
32378
|
-
import { map } from '@ember/object/computed';
|
|
32379
|
-
|
|
32380
|
-
class Hamster {
|
|
32381
|
-
constructor(chores) {
|
|
32382
|
-
set(this, 'chores', chores);
|
|
32383
|
-
}
|
|
32384
|
-
|
|
32385
|
-
@map('chores', function(chore, index) {
|
|
32386
|
-
return `${chore.toUpperCase()}!`;
|
|
32387
|
-
})
|
|
32388
|
-
excitingChores;
|
|
32389
|
-
});
|
|
32390
|
-
|
|
32391
|
-
let hamster = new Hamster(['clean', 'write more unit tests']);
|
|
32392
|
-
|
|
32393
|
-
hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
|
|
32394
|
-
```
|
|
32395
|
-
|
|
32396
|
-
You can optionally pass an array of additional dependent keys as the second
|
|
32397
|
-
parameter to the macro, if your map function relies on any external values:
|
|
32398
|
-
|
|
32399
|
-
```javascript
|
|
32400
|
-
import { set } from '@ember/object';
|
|
32401
|
-
import { map } from '@ember/object/computed';
|
|
32402
|
-
|
|
32403
|
-
class Hamster {
|
|
32404
|
-
shouldUpperCase = false;
|
|
32405
|
-
|
|
32406
|
-
constructor(chores) {
|
|
32407
|
-
set(this, 'chores', chores);
|
|
32408
|
-
}
|
|
32409
|
-
|
|
32410
|
-
@map('chores', ['shouldUpperCase'], function(chore, index) {
|
|
32411
|
-
if (this.shouldUpperCase) {
|
|
32412
|
-
return `${chore.toUpperCase()}!`;
|
|
32413
|
-
} else {
|
|
32414
|
-
return `${chore}!`;
|
|
32415
|
-
}
|
|
32416
|
-
})
|
|
32417
|
-
excitingChores;
|
|
32418
|
-
}
|
|
32419
|
-
|
|
32420
|
-
let hamster = new Hamster(['clean', 'write more unit tests']);
|
|
32421
|
-
|
|
32422
|
-
hamster.excitingChores; // ['clean!', 'write more unit tests!']
|
|
32423
|
-
|
|
32424
|
-
set(hamster, 'shouldUpperCase', true);
|
|
32425
|
-
hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
|
|
32426
|
-
```
|
|
32427
|
-
|
|
32428
|
-
@method map
|
|
32429
|
-
@for @ember/object/computed
|
|
32430
|
-
@static
|
|
32431
|
-
@param {String} dependentKey
|
|
32432
|
-
@param {Array} [additionalDependentKeys] optional array of additional
|
|
32433
|
-
dependent keys
|
|
32434
|
-
@param {Function} callback
|
|
32435
|
-
@return {ComputedProperty} an array mapped via the callback
|
|
32436
|
-
@public
|
|
32437
|
-
*/
|
|
32438
|
-
|
|
32439
32321
|
|
|
32440
|
-
function map(dependentKey,
|
|
32322
|
+
function map(dependentKey, additionalDependentKeysOrCallback, callback) {
|
|
32441
32323
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @map as a decorator directly, but it requires atleast `dependentKey` and `callback` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32324
|
+
(true && !(typeof callback === 'function' || callback === undefined && typeof additionalDependentKeysOrCallback === 'function') && (0, _debug.assert)('The final parameter provided to map must be a callback function', typeof callback === 'function' || callback === undefined && typeof additionalDependentKeysOrCallback === 'function'));
|
|
32325
|
+
(true && !(Array.isArray(additionalDependentKeysOrCallback) || typeof additionalDependentKeysOrCallback === 'function') && (0, _debug.assert)('The second parameter provided to map must either be the callback or an array of additional dependent keys', Array.isArray(additionalDependentKeysOrCallback) || typeof additionalDependentKeysOrCallback === 'function'));
|
|
32326
|
+
var additionalDependentKeys;
|
|
32442
32327
|
|
|
32443
|
-
if (
|
|
32444
|
-
callback =
|
|
32328
|
+
if (typeof additionalDependentKeysOrCallback === 'function') {
|
|
32329
|
+
callback = additionalDependentKeysOrCallback;
|
|
32445
32330
|
additionalDependentKeys = [];
|
|
32331
|
+
} else {
|
|
32332
|
+
additionalDependentKeys = additionalDependentKeysOrCallback;
|
|
32446
32333
|
}
|
|
32447
32334
|
|
|
32448
|
-
|
|
32449
|
-
(true && !(
|
|
32335
|
+
var cCallback = callback;
|
|
32336
|
+
(true && !(cCallback) && (0, _debug.assert)('[BUG] Missing callback', cCallback));
|
|
32450
32337
|
return arrayMacro(dependentKey, additionalDependentKeys, function (value) {
|
|
32451
|
-
|
|
32338
|
+
// This is so dumb...
|
|
32339
|
+
return Array.isArray(value) ? value.map(cCallback, this) : value.map(cCallback, this);
|
|
32452
32340
|
});
|
|
32453
32341
|
}
|
|
32454
32342
|
/**
|
|
@@ -32507,125 +32395,24 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32507
32395
|
(true && !(!/[[\]{}]/g.test(dependentKey)) && (0, _debug.assert)(`Dependent key passed to \`mapBy\` computed macro shouldn't contain brace expanding pattern.`, !/[[\]{}]/g.test(dependentKey)));
|
|
32508
32396
|
return map(`${dependentKey}.@each.${propertyKey}`, item => (0, _metal.get)(item, propertyKey));
|
|
32509
32397
|
}
|
|
32510
|
-
/**
|
|
32511
|
-
Filters the array by the callback.
|
|
32512
|
-
|
|
32513
|
-
The callback method you provide should have the following signature:
|
|
32514
|
-
- `item` is the current item in the iteration.
|
|
32515
|
-
- `index` is the integer index of the current item in the iteration.
|
|
32516
|
-
- `array` is the dependant array itself.
|
|
32517
|
-
|
|
32518
|
-
```javascript
|
|
32519
|
-
function filterCallback(item, index, array);
|
|
32520
|
-
```
|
|
32521
|
-
|
|
32522
|
-
Example:
|
|
32523
|
-
|
|
32524
|
-
```javascript
|
|
32525
|
-
import { set } from '@ember/object';
|
|
32526
|
-
import { filter } from '@ember/object/computed';
|
|
32527
|
-
|
|
32528
|
-
class Hamster {
|
|
32529
|
-
constructor(chores) {
|
|
32530
|
-
set(this, 'chores', chores);
|
|
32531
|
-
}
|
|
32532
|
-
|
|
32533
|
-
@filter('chores', function(chore, index, array) {
|
|
32534
|
-
return !chore.done;
|
|
32535
|
-
})
|
|
32536
|
-
remainingChores;
|
|
32537
|
-
}
|
|
32538
|
-
|
|
32539
|
-
let hamster = Hamster.create([
|
|
32540
|
-
{ name: 'cook', done: true },
|
|
32541
|
-
{ name: 'clean', done: true },
|
|
32542
|
-
{ name: 'write more unit tests', done: false }
|
|
32543
|
-
]);
|
|
32544
|
-
|
|
32545
|
-
hamster.remainingChores; // [{name: 'write more unit tests', done: false}]
|
|
32546
|
-
```
|
|
32547
|
-
|
|
32548
|
-
You can also use `@each.property` in your dependent key, the callback will
|
|
32549
|
-
still use the underlying array:
|
|
32550
|
-
|
|
32551
|
-
```javascript
|
|
32552
|
-
import { set } from '@ember/object';
|
|
32553
|
-
import { filter } from '@ember/object/computed';
|
|
32554
|
-
|
|
32555
|
-
class Hamster {
|
|
32556
|
-
constructor(chores) {
|
|
32557
|
-
set(this, 'chores', chores);
|
|
32558
|
-
}
|
|
32559
|
-
|
|
32560
|
-
@filter('chores.@each.done', function(chore, index, array) {
|
|
32561
|
-
return !chore.done;
|
|
32562
|
-
})
|
|
32563
|
-
remainingChores;
|
|
32564
|
-
}
|
|
32565
|
-
|
|
32566
|
-
let hamster = new Hamster([
|
|
32567
|
-
{ name: 'cook', done: true },
|
|
32568
|
-
{ name: 'clean', done: true },
|
|
32569
|
-
{ name: 'write more unit tests', done: false }
|
|
32570
|
-
]);
|
|
32571
|
-
hamster.remainingChores; // [{name: 'write more unit tests', done: false}]
|
|
32572
|
-
|
|
32573
|
-
set(hamster.chores[2], 'done', true);
|
|
32574
|
-
hamster.remainingChores; // []
|
|
32575
|
-
```
|
|
32576
|
-
|
|
32577
|
-
Finally, you can optionally pass an array of additional dependent keys as the
|
|
32578
|
-
second parameter to the macro, if your filter function relies on any external
|
|
32579
|
-
values:
|
|
32580
|
-
|
|
32581
|
-
```javascript
|
|
32582
|
-
import { filter } from '@ember/object/computed';
|
|
32583
|
-
|
|
32584
|
-
class Hamster {
|
|
32585
|
-
constructor(chores) {
|
|
32586
|
-
set(this, 'chores', chores);
|
|
32587
|
-
}
|
|
32588
|
-
|
|
32589
|
-
doneKey = 'finished';
|
|
32590
|
-
|
|
32591
|
-
@filter('chores', ['doneKey'], function(chore, index, array) {
|
|
32592
|
-
return !chore[this.doneKey];
|
|
32593
|
-
})
|
|
32594
|
-
remainingChores;
|
|
32595
|
-
}
|
|
32596
|
-
|
|
32597
|
-
let hamster = new Hamster([
|
|
32598
|
-
{ name: 'cook', finished: true },
|
|
32599
|
-
{ name: 'clean', finished: true },
|
|
32600
|
-
{ name: 'write more unit tests', finished: false }
|
|
32601
|
-
]);
|
|
32602
|
-
|
|
32603
|
-
hamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
|
|
32604
|
-
```
|
|
32605
|
-
|
|
32606
|
-
@method filter
|
|
32607
|
-
@for @ember/object/computed
|
|
32608
|
-
@static
|
|
32609
|
-
@param {String} dependentKey
|
|
32610
|
-
@param {Array} [additionalDependentKeys] optional array of additional dependent keys
|
|
32611
|
-
@param {Function} callback
|
|
32612
|
-
@return {ComputedProperty} the filtered array
|
|
32613
|
-
@public
|
|
32614
|
-
*/
|
|
32615
32398
|
|
|
32616
|
-
|
|
32617
|
-
function filter(dependentKey, additionalDependentKeys, callback) {
|
|
32399
|
+
function filter(dependentKey, additionalDependentKeysOrCallback, callback) {
|
|
32618
32400
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @filter as a decorator directly, but it requires atleast `dependentKey` and `callback` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32401
|
+
(true && !(typeof callback === 'function' || callback === undefined && typeof additionalDependentKeysOrCallback === 'function') && (0, _debug.assert)('The final parameter provided to filter must be a callback function', typeof callback === 'function' || callback === undefined && typeof additionalDependentKeysOrCallback === 'function'));
|
|
32402
|
+
(true && !(Array.isArray(additionalDependentKeysOrCallback) || typeof additionalDependentKeysOrCallback === 'function') && (0, _debug.assert)('The second parameter provided to filter must either be the callback or an array of additional dependent keys', Array.isArray(additionalDependentKeysOrCallback) || typeof additionalDependentKeysOrCallback === 'function'));
|
|
32403
|
+
var additionalDependentKeys;
|
|
32619
32404
|
|
|
32620
|
-
if (
|
|
32621
|
-
callback =
|
|
32405
|
+
if (typeof additionalDependentKeysOrCallback === 'function') {
|
|
32406
|
+
callback = additionalDependentKeysOrCallback;
|
|
32622
32407
|
additionalDependentKeys = [];
|
|
32408
|
+
} else {
|
|
32409
|
+
additionalDependentKeys = additionalDependentKeysOrCallback;
|
|
32623
32410
|
}
|
|
32624
32411
|
|
|
32625
|
-
|
|
32626
|
-
(true && !(Array.isArray(additionalDependentKeys)) && (0, _debug.assert)('The second parameter provided to filter must either be the callback or an array of additional dependent keys', Array.isArray(additionalDependentKeys)));
|
|
32412
|
+
var cCallback = callback;
|
|
32627
32413
|
return arrayMacro(dependentKey, additionalDependentKeys, function (value) {
|
|
32628
|
-
|
|
32414
|
+
// This is a really silly way to keep TS happy
|
|
32415
|
+
return Array.isArray(value) ? value.filter(cCallback, this) : value.filter(cCallback, this);
|
|
32629
32416
|
});
|
|
32630
32417
|
}
|
|
32631
32418
|
/**
|
|
@@ -32716,19 +32503,20 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32716
32503
|
*/
|
|
32717
32504
|
|
|
32718
32505
|
|
|
32719
|
-
function uniq() {
|
|
32720
|
-
for (var _len = arguments.length,
|
|
32721
|
-
|
|
32506
|
+
function uniq(dependentKey) {
|
|
32507
|
+
for (var _len = arguments.length, additionalDependentKeys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
32508
|
+
additionalDependentKeys[_key - 1] = arguments[_key];
|
|
32722
32509
|
}
|
|
32723
32510
|
|
|
32724
32511
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @uniq/@union as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32512
|
+
var args = [dependentKey, ...additionalDependentKeys];
|
|
32725
32513
|
return multiArrayMacro(args, function (dependentKeys) {
|
|
32726
32514
|
var uniq = (0, _runtime.A)();
|
|
32727
32515
|
var seen = new Set();
|
|
32728
32516
|
dependentKeys.forEach(dependentKey => {
|
|
32729
32517
|
var value = (0, _metal.get)(this, dependentKey);
|
|
32730
32518
|
|
|
32731
|
-
if ((
|
|
32519
|
+
if (isNativeOrEmberArray(value)) {
|
|
32732
32520
|
value.forEach(item => {
|
|
32733
32521
|
if (!seen.has(item)) {
|
|
32734
32522
|
seen.add(item);
|
|
@@ -32784,7 +32572,7 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32784
32572
|
(true && !(!/[[\]{}]/g.test(dependentKey)) && (0, _debug.assert)(`Dependent key passed to \`uniqBy\` computed macro shouldn't contain brace expanding pattern.`, !/[[\]{}]/g.test(dependentKey)));
|
|
32785
32573
|
return (0, _metal.computed)(`${dependentKey}.[]`, function () {
|
|
32786
32574
|
var list = (0, _metal.get)(this, dependentKey);
|
|
32787
|
-
return (
|
|
32575
|
+
return isNativeOrEmberArray(list) ? (0, _runtime.uniqBy)(list, propertyKey) : (0, _runtime.A)();
|
|
32788
32576
|
}).readOnly();
|
|
32789
32577
|
}
|
|
32790
32578
|
/**
|
|
@@ -32873,24 +32661,26 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32873
32661
|
|
|
32874
32662
|
_exports.union = union;
|
|
32875
32663
|
|
|
32876
|
-
function intersect() {
|
|
32877
|
-
for (var _len2 = arguments.length,
|
|
32878
|
-
|
|
32664
|
+
function intersect(dependentKey) {
|
|
32665
|
+
for (var _len2 = arguments.length, additionalDependentKeys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
32666
|
+
additionalDependentKeys[_key2 - 1] = arguments[_key2];
|
|
32879
32667
|
}
|
|
32880
32668
|
|
|
32881
32669
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @intersect as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32670
|
+
var args = [dependentKey, ...additionalDependentKeys];
|
|
32882
32671
|
return multiArrayMacro(args, function (dependentKeys) {
|
|
32883
32672
|
var arrays = dependentKeys.map(dependentKey => {
|
|
32884
32673
|
var array = (0, _metal.get)(this, dependentKey);
|
|
32885
|
-
return
|
|
32674
|
+
return Array.isArray(array) ? array : [];
|
|
32886
32675
|
});
|
|
32887
|
-
var
|
|
32888
|
-
|
|
32676
|
+
var firstArray = arrays.pop();
|
|
32677
|
+
(true && !(firstArray) && (0, _debug.assert)('Attempted to apply multiArrayMacro for intersect without any dependentKeys', firstArray));
|
|
32678
|
+
var results = firstArray.filter(candidate => {
|
|
32679
|
+
for (var array of arrays) {
|
|
32889
32680
|
var found = false;
|
|
32890
|
-
var array = arrays[i];
|
|
32891
32681
|
|
|
32892
|
-
for (var
|
|
32893
|
-
if (
|
|
32682
|
+
for (var item of array) {
|
|
32683
|
+
if (item === candidate) {
|
|
32894
32684
|
found = true;
|
|
32895
32685
|
break;
|
|
32896
32686
|
}
|
|
@@ -32959,12 +32749,12 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
32959
32749
|
var setA = (0, _metal.get)(this, setAProperty);
|
|
32960
32750
|
var setB = (0, _metal.get)(this, setBProperty);
|
|
32961
32751
|
|
|
32962
|
-
if (!(
|
|
32752
|
+
if (!isNativeOrEmberArray(setA)) {
|
|
32963
32753
|
return (0, _runtime.A)();
|
|
32964
32754
|
}
|
|
32965
32755
|
|
|
32966
|
-
if (!(
|
|
32967
|
-
return
|
|
32756
|
+
if (!isNativeOrEmberArray(setB)) {
|
|
32757
|
+
return setA;
|
|
32968
32758
|
}
|
|
32969
32759
|
|
|
32970
32760
|
return setA.filter(x => setB.indexOf(x) === -1);
|
|
@@ -33003,12 +32793,13 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
33003
32793
|
*/
|
|
33004
32794
|
|
|
33005
32795
|
|
|
33006
|
-
function collect() {
|
|
33007
|
-
for (var _len3 = arguments.length,
|
|
33008
|
-
|
|
32796
|
+
function collect(dependentKey) {
|
|
32797
|
+
for (var _len3 = arguments.length, additionalDependentKeys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
32798
|
+
additionalDependentKeys[_key3 - 1] = arguments[_key3];
|
|
33009
32799
|
}
|
|
33010
32800
|
|
|
33011
32801
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @collect as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
32802
|
+
var dependentKeys = [dependentKey, ...additionalDependentKeys];
|
|
33012
32803
|
return multiArrayMacro(dependentKeys, function () {
|
|
33013
32804
|
var res = dependentKeys.map(key => {
|
|
33014
32805
|
var val = (0, _metal.get)(this, key);
|
|
@@ -33017,148 +32808,8 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
33017
32808
|
return (0, _runtime.A)(res);
|
|
33018
32809
|
}, 'collect');
|
|
33019
32810
|
}
|
|
33020
|
-
/**
|
|
33021
|
-
A computed property which returns a new array with all the properties from the
|
|
33022
|
-
first dependent array sorted based on a property or sort function. The sort
|
|
33023
|
-
macro can be used in two different ways:
|
|
33024
|
-
|
|
33025
|
-
1. By providing a sort callback function
|
|
33026
|
-
2. By providing an array of keys to sort the array
|
|
33027
|
-
|
|
33028
|
-
In the first form, the callback method you provide should have the following
|
|
33029
|
-
signature:
|
|
33030
|
-
|
|
33031
|
-
```javascript
|
|
33032
|
-
function sortCallback(itemA, itemB);
|
|
33033
|
-
```
|
|
33034
|
-
|
|
33035
|
-
- `itemA` the first item to compare.
|
|
33036
|
-
- `itemB` the second item to compare.
|
|
33037
|
-
|
|
33038
|
-
This function should return negative number (e.g. `-1`) when `itemA` should
|
|
33039
|
-
come before `itemB`. It should return positive number (e.g. `1`) when `itemA`
|
|
33040
|
-
should come after `itemB`. If the `itemA` and `itemB` are equal this function
|
|
33041
|
-
should return `0`.
|
|
33042
|
-
|
|
33043
|
-
Therefore, if this function is comparing some numeric values, simple `itemA -
|
|
33044
|
-
itemB` or `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of
|
|
33045
|
-
series of `if`.
|
|
33046
|
-
|
|
33047
|
-
Example:
|
|
33048
|
-
|
|
33049
|
-
```javascript
|
|
33050
|
-
import { set } from '@ember/object';
|
|
33051
|
-
import { sort } from '@ember/object/computed';
|
|
33052
|
-
|
|
33053
|
-
class ToDoList {
|
|
33054
|
-
constructor(todos) {
|
|
33055
|
-
set(this, 'todos', todos);
|
|
33056
|
-
}
|
|
33057
|
-
|
|
33058
|
-
// using a custom sort function
|
|
33059
|
-
@sort('todos', function(a, b){
|
|
33060
|
-
if (a.priority > b.priority) {
|
|
33061
|
-
return 1;
|
|
33062
|
-
} else if (a.priority < b.priority) {
|
|
33063
|
-
return -1;
|
|
33064
|
-
}
|
|
33065
|
-
|
|
33066
|
-
return 0;
|
|
33067
|
-
})
|
|
33068
|
-
priorityTodos;
|
|
33069
|
-
}
|
|
33070
|
-
|
|
33071
|
-
let todoList = new ToDoList([
|
|
33072
|
-
{ name: 'Unit Test', priority: 2 },
|
|
33073
|
-
{ name: 'Documentation', priority: 3 },
|
|
33074
|
-
{ name: 'Release', priority: 1 }
|
|
33075
|
-
]);
|
|
33076
|
-
|
|
33077
|
-
todoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
|
|
33078
|
-
```
|
|
33079
|
-
|
|
33080
|
-
You can also optionally pass an array of additional dependent keys as the
|
|
33081
|
-
second parameter, if your sort function is dependent on additional values that
|
|
33082
|
-
could changes:
|
|
33083
|
-
|
|
33084
|
-
```js
|
|
33085
|
-
import EmberObject, { set } from '@ember/object';
|
|
33086
|
-
import { sort } from '@ember/object/computed';
|
|
33087
|
-
|
|
33088
|
-
class ToDoList {
|
|
33089
|
-
sortKey = 'priority';
|
|
33090
|
-
|
|
33091
|
-
constructor(todos) {
|
|
33092
|
-
set(this, 'todos', todos);
|
|
33093
|
-
}
|
|
33094
|
-
|
|
33095
|
-
// using a custom sort function
|
|
33096
|
-
@sort('todos', ['sortKey'], function(a, b){
|
|
33097
|
-
if (a[this.sortKey] > b[this.sortKey]) {
|
|
33098
|
-
return 1;
|
|
33099
|
-
} else if (a[this.sortKey] < b[this.sortKey]) {
|
|
33100
|
-
return -1;
|
|
33101
|
-
}
|
|
33102
|
-
|
|
33103
|
-
return 0;
|
|
33104
|
-
})
|
|
33105
|
-
sortedTodos;
|
|
33106
|
-
});
|
|
33107
|
-
|
|
33108
|
-
let todoList = new ToDoList([
|
|
33109
|
-
{ name: 'Unit Test', priority: 2 },
|
|
33110
|
-
{ name: 'Documentation', priority: 3 },
|
|
33111
|
-
{ name: 'Release', priority: 1 }
|
|
33112
|
-
]);
|
|
33113
|
-
|
|
33114
|
-
todoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
|
|
33115
|
-
```
|
|
33116
|
-
|
|
33117
|
-
In the second form, you should provide the key of the array of sort values as
|
|
33118
|
-
the second parameter:
|
|
33119
|
-
|
|
33120
|
-
```javascript
|
|
33121
|
-
import { set } from '@ember/object';
|
|
33122
|
-
import { sort } from '@ember/object/computed';
|
|
33123
|
-
|
|
33124
|
-
class ToDoList {
|
|
33125
|
-
constructor(todos) {
|
|
33126
|
-
set(this, 'todos', todos);
|
|
33127
|
-
}
|
|
33128
|
-
|
|
33129
|
-
// using standard ascending sort
|
|
33130
|
-
todosSorting = ['name'];
|
|
33131
|
-
@sort('todos', 'todosSorting') sortedTodos;
|
|
33132
|
-
|
|
33133
|
-
// using descending sort
|
|
33134
|
-
todosSortingDesc = ['name:desc'];
|
|
33135
|
-
@sort('todos', 'todosSortingDesc') sortedTodosDesc;
|
|
33136
|
-
}
|
|
33137
|
-
|
|
33138
|
-
let todoList = new ToDoList([
|
|
33139
|
-
{ name: 'Unit Test', priority: 2 },
|
|
33140
|
-
{ name: 'Documentation', priority: 3 },
|
|
33141
|
-
{ name: 'Release', priority: 1 }
|
|
33142
|
-
]);
|
|
33143
|
-
|
|
33144
|
-
todoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]
|
|
33145
|
-
todoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
|
|
33146
|
-
```
|
|
33147
|
-
|
|
33148
|
-
@method sort
|
|
33149
|
-
@for @ember/object/computed
|
|
33150
|
-
@static
|
|
33151
|
-
@param {String} itemsKey
|
|
33152
|
-
@param {String|Function|Array} sortDefinitionOrDependentKeys The key of the sort definition (an array of sort properties),
|
|
33153
|
-
the sort function, or an array of additional dependent keys
|
|
33154
|
-
@param {Function?} sortDefinition the sort function (when used with additional dependent keys)
|
|
33155
|
-
@return {ComputedProperty} computes a new sorted array based on the sort
|
|
33156
|
-
property array or callback function
|
|
33157
|
-
@public
|
|
33158
|
-
*/
|
|
33159
|
-
|
|
33160
32811
|
|
|
33161
|
-
function sort(itemsKey,
|
|
32812
|
+
function sort(itemsKey, additionalDependentKeysOrDefinition, sortDefinition) {
|
|
33162
32813
|
(true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @sort as a decorator directly, but it requires atleast an `itemsKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));
|
|
33163
32814
|
|
|
33164
32815
|
if (true
|
|
@@ -33167,25 +32818,31 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
33167
32818
|
var argumentsValid = false;
|
|
33168
32819
|
|
|
33169
32820
|
if (arguments.length === 2) {
|
|
33170
|
-
argumentsValid = typeof itemsKey === 'string' && (typeof
|
|
32821
|
+
argumentsValid = typeof itemsKey === 'string' && (typeof additionalDependentKeysOrDefinition === 'string' || typeof additionalDependentKeysOrDefinition === 'function');
|
|
33171
32822
|
}
|
|
33172
32823
|
|
|
33173
32824
|
if (arguments.length === 3) {
|
|
33174
|
-
argumentsValid = typeof itemsKey === 'string' && Array.isArray(
|
|
32825
|
+
argumentsValid = typeof itemsKey === 'string' && Array.isArray(additionalDependentKeysOrDefinition) && typeof sortDefinition === 'function';
|
|
33175
32826
|
}
|
|
33176
32827
|
|
|
33177
32828
|
(true && !(argumentsValid) && (0, _debug.assert)('The `sort` computed macro can either be used with an array of sort properties or with a sort function. If used with an array of sort properties, it must receive exactly two arguments: the key of the array to sort, and the key of the array of sort properties. If used with a sort function, it may receive up to three arguments: the key of the array to sort, an optional additional array of dependent keys for the computed property, and the sort function.', argumentsValid));
|
|
33178
32829
|
}
|
|
33179
32830
|
|
|
33180
|
-
|
|
33181
|
-
|
|
32831
|
+
var additionalDependentKeys;
|
|
32832
|
+
var sortDefinitionOrString;
|
|
32833
|
+
|
|
32834
|
+
if (Array.isArray(additionalDependentKeysOrDefinition)) {
|
|
32835
|
+
additionalDependentKeys = additionalDependentKeysOrDefinition;
|
|
32836
|
+
sortDefinitionOrString = sortDefinition;
|
|
32837
|
+
} else {
|
|
33182
32838
|
additionalDependentKeys = [];
|
|
32839
|
+
sortDefinitionOrString = additionalDependentKeysOrDefinition;
|
|
33183
32840
|
}
|
|
33184
32841
|
|
|
33185
|
-
if (typeof
|
|
33186
|
-
return customSort(itemsKey, additionalDependentKeys,
|
|
32842
|
+
if (typeof sortDefinitionOrString === 'function') {
|
|
32843
|
+
return customSort(itemsKey, additionalDependentKeys, sortDefinitionOrString);
|
|
33187
32844
|
} else {
|
|
33188
|
-
return propertySort(itemsKey,
|
|
32845
|
+
return propertySort(itemsKey, sortDefinitionOrString);
|
|
33189
32846
|
}
|
|
33190
32847
|
}
|
|
33191
32848
|
|
|
@@ -33200,12 +32857,16 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
33200
32857
|
function propertySort(itemsKey, sortPropertiesKey) {
|
|
33201
32858
|
var cp = (0, _metal.autoComputed)(function (key) {
|
|
33202
32859
|
var sortProperties = (0, _metal.get)(this, sortPropertiesKey);
|
|
33203
|
-
(true && !(
|
|
32860
|
+
(true && !(function (arr) {
|
|
32861
|
+
return isNativeOrEmberArray(arr) && arr.every(s => typeof s === 'string');
|
|
32862
|
+
}(sortProperties)) && (0, _debug.assert)(`The sort definition for '${key}' on ${this} must be a function or an array of strings`, function (arr) {
|
|
32863
|
+
return isNativeOrEmberArray(arr) && arr.every(s => typeof s === 'string');
|
|
32864
|
+
}(sortProperties)));
|
|
33204
32865
|
var itemsKeyIsAtThis = itemsKey === '@this';
|
|
33205
32866
|
var normalizedSortProperties = normalizeSortProperties(sortProperties);
|
|
33206
32867
|
var items = itemsKeyIsAtThis ? this : (0, _metal.get)(this, itemsKey);
|
|
33207
32868
|
|
|
33208
|
-
if (!(
|
|
32869
|
+
if (!isNativeOrEmberArray(items)) {
|
|
33209
32870
|
return (0, _runtime.A)();
|
|
33210
32871
|
}
|
|
33211
32872
|
|
|
@@ -33219,17 +32880,20 @@ define("@ember/object/lib/computed/reduce_computed_macros", ["exports", "@ember/
|
|
|
33219
32880
|
}
|
|
33220
32881
|
|
|
33221
32882
|
function normalizeSortProperties(sortProperties) {
|
|
33222
|
-
|
|
32883
|
+
var callback = p => {
|
|
33223
32884
|
var [prop, direction] = p.split(':');
|
|
33224
|
-
direction = direction || 'asc';
|
|
32885
|
+
direction = direction || 'asc'; // SAFETY: There will always be at least one value returned by split
|
|
32886
|
+
|
|
33225
32887
|
return [prop, direction];
|
|
33226
|
-
}
|
|
32888
|
+
}; // This nonsense is necessary since technically the two map implementations diverge.
|
|
32889
|
+
|
|
32890
|
+
|
|
32891
|
+
return Array.isArray(sortProperties) ? sortProperties.map(callback) : sortProperties.map(callback);
|
|
33227
32892
|
}
|
|
33228
32893
|
|
|
33229
32894
|
function sortByNormalizedSortProperties(items, normalizedSortProperties) {
|
|
33230
32895
|
return (0, _runtime.A)(items.slice().sort((itemA, itemB) => {
|
|
33231
|
-
for (var
|
|
33232
|
-
var [prop, direction] = normalizedSortProperties[i];
|
|
32896
|
+
for (var [prop, direction] of normalizedSortProperties) {
|
|
33233
32897
|
var result = (0, _runtime.compare)((0, _metal.get)(itemA, prop), (0, _metal.get)(itemB, prop));
|
|
33234
32898
|
|
|
33235
32899
|
if (result !== 0) {
|
|
@@ -34712,7 +34376,7 @@ define("@ember/test/adapter", ["exports", "ember-testing"], function (_exports,
|
|
|
34712
34376
|
value: true
|
|
34713
34377
|
});
|
|
34714
34378
|
_exports.default = void 0;
|
|
34715
|
-
var _default = _emberTesting.
|
|
34379
|
+
var _default = _emberTesting.Adapter;
|
|
34716
34380
|
_exports.default = _default;
|
|
34717
34381
|
});
|
|
34718
34382
|
define("@ember/test/index", ["exports", "require"], function (_exports, _require) {
|
|
@@ -52620,50 +52284,34 @@ define("ember-testing/lib/adapters/adapter", ["exports", "@ember/-internals/runt
|
|
|
52620
52284
|
});
|
|
52621
52285
|
_exports.default = void 0;
|
|
52622
52286
|
|
|
52623
|
-
|
|
52624
|
-
return this;
|
|
52625
|
-
}
|
|
52626
|
-
/**
|
|
52627
|
-
@module @ember/test
|
|
52628
|
-
*/
|
|
52629
|
-
|
|
52630
|
-
/**
|
|
52631
|
-
The primary purpose of this class is to create hooks that can be implemented
|
|
52632
|
-
by an adapter for various test frameworks.
|
|
52633
|
-
|
|
52634
|
-
@class TestAdapter
|
|
52635
|
-
@public
|
|
52636
|
-
*/
|
|
52637
|
-
|
|
52638
|
-
|
|
52639
|
-
var _default = _runtime.Object.extend({
|
|
52287
|
+
var Adapter = _runtime.Object.extend({
|
|
52640
52288
|
/**
|
|
52641
52289
|
This callback will be called whenever an async operation is about to start.
|
|
52642
|
-
|
|
52290
|
+
Override this to call your framework's methods that handle async
|
|
52643
52291
|
operations.
|
|
52644
|
-
|
|
52292
|
+
@public
|
|
52645
52293
|
@method asyncStart
|
|
52646
52294
|
*/
|
|
52647
|
-
asyncStart
|
|
52295
|
+
asyncStart() {},
|
|
52648
52296
|
|
|
52649
52297
|
/**
|
|
52650
52298
|
This callback will be called whenever an async operation has completed.
|
|
52651
|
-
|
|
52299
|
+
@public
|
|
52652
52300
|
@method asyncEnd
|
|
52653
52301
|
*/
|
|
52654
|
-
asyncEnd
|
|
52302
|
+
asyncEnd() {},
|
|
52655
52303
|
|
|
52656
52304
|
/**
|
|
52657
52305
|
Override this method with your testing framework's false assertion.
|
|
52658
52306
|
This function is called whenever an exception occurs causing the testing
|
|
52659
52307
|
promise to fail.
|
|
52660
|
-
|
|
52661
|
-
|
|
52308
|
+
QUnit example:
|
|
52309
|
+
```javascript
|
|
52662
52310
|
exception: function(error) {
|
|
52663
52311
|
ok(false, error);
|
|
52664
52312
|
};
|
|
52665
52313
|
```
|
|
52666
|
-
|
|
52314
|
+
@public
|
|
52667
52315
|
@method exception
|
|
52668
52316
|
@param {String} error The exception to be raised.
|
|
52669
52317
|
*/
|
|
@@ -52673,6 +52321,7 @@ define("ember-testing/lib/adapters/adapter", ["exports", "@ember/-internals/runt
|
|
|
52673
52321
|
|
|
52674
52322
|
});
|
|
52675
52323
|
|
|
52324
|
+
var _default = Adapter;
|
|
52676
52325
|
_exports.default = _default;
|
|
52677
52326
|
});
|
|
52678
52327
|
define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils", "ember-testing/lib/adapters/adapter"], function (_exports, _utils, _adapter) {
|
|
@@ -52684,27 +52333,17 @@ define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils"
|
|
|
52684
52333
|
_exports.default = void 0;
|
|
52685
52334
|
|
|
52686
52335
|
/* globals QUnit */
|
|
52336
|
+
function isVeryOldQunit(obj) {
|
|
52337
|
+
return obj != null && typeof obj.stop === 'function';
|
|
52338
|
+
}
|
|
52687
52339
|
|
|
52688
|
-
|
|
52689
|
-
@module ember
|
|
52690
|
-
*/
|
|
52691
|
-
|
|
52692
|
-
/**
|
|
52693
|
-
This class implements the methods defined by TestAdapter for the
|
|
52694
|
-
QUnit testing framework.
|
|
52695
|
-
|
|
52696
|
-
@class QUnitAdapter
|
|
52697
|
-
@namespace Ember.Test
|
|
52698
|
-
@extends TestAdapter
|
|
52699
|
-
@public
|
|
52700
|
-
*/
|
|
52701
|
-
var _default = _adapter.default.extend({
|
|
52340
|
+
var QUnitAdapter = _adapter.default.extend({
|
|
52702
52341
|
init() {
|
|
52703
52342
|
this.doneCallbacks = [];
|
|
52704
52343
|
},
|
|
52705
52344
|
|
|
52706
52345
|
asyncStart() {
|
|
52707
|
-
if (
|
|
52346
|
+
if (isVeryOldQunit(QUnit)) {
|
|
52708
52347
|
// very old QUnit version
|
|
52709
52348
|
// eslint-disable-next-line qunit/no-qunit-stop
|
|
52710
52349
|
QUnit.stop();
|
|
@@ -52717,7 +52356,7 @@ define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils"
|
|
|
52717
52356
|
// checking for QUnit.stop here (even though we _need_ QUnit.start) because
|
|
52718
52357
|
// QUnit.start() still exists in QUnit 2.x (it just throws an error when calling
|
|
52719
52358
|
// inside a test context)
|
|
52720
|
-
if (
|
|
52359
|
+
if (isVeryOldQunit(QUnit)) {
|
|
52721
52360
|
QUnit.start();
|
|
52722
52361
|
} else {
|
|
52723
52362
|
var done = this.doneCallbacks.pop(); // This can be null if asyncStart() was called outside of a test
|
|
@@ -52734,9 +52373,10 @@ define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils"
|
|
|
52734
52373
|
|
|
52735
52374
|
});
|
|
52736
52375
|
|
|
52376
|
+
var _default = QUnitAdapter;
|
|
52737
52377
|
_exports.default = _default;
|
|
52738
52378
|
});
|
|
52739
|
-
define("ember-testing/lib/ext/application", ["@ember/application", "ember-testing/lib/setup_for_testing", "ember-testing/lib/test/helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/run", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/adapter"], function (_application, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter) {
|
|
52379
|
+
define("ember-testing/lib/ext/application", ["@ember/application", "ember-testing/lib/setup_for_testing", "ember-testing/lib/test/helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/run", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/adapter", "@ember/debug"], function (_application, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter, _debug) {
|
|
52740
52380
|
"use strict";
|
|
52741
52381
|
|
|
52742
52382
|
_application.default.reopen({
|
|
@@ -52745,7 +52385,7 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52745
52385
|
are created once you call `injectTestHelpers` on your `Application`
|
|
52746
52386
|
instance. The included helpers are also available on the `window` object by
|
|
52747
52387
|
default, but can be used from this object on the individual application also.
|
|
52748
|
-
|
|
52388
|
+
@property testHelpers
|
|
52749
52389
|
@type {Object}
|
|
52750
52390
|
@default {}
|
|
52751
52391
|
@public
|
|
@@ -52755,9 +52395,9 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52755
52395
|
/**
|
|
52756
52396
|
This property will contain the original methods that were registered
|
|
52757
52397
|
on the `helperContainer` before `injectTestHelpers` is called.
|
|
52758
|
-
|
|
52398
|
+
When `removeTestHelpers` is called, these methods are restored to the
|
|
52759
52399
|
`helperContainer`.
|
|
52760
|
-
|
|
52400
|
+
@property originalMethods
|
|
52761
52401
|
@type {Object}
|
|
52762
52402
|
@default {}
|
|
52763
52403
|
@private
|
|
@@ -52769,7 +52409,7 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52769
52409
|
This property indicates whether or not this application is currently in
|
|
52770
52410
|
testing mode. This is set when `setupForTesting` is called on the current
|
|
52771
52411
|
application.
|
|
52772
|
-
|
|
52412
|
+
@property testing
|
|
52773
52413
|
@type {Boolean}
|
|
52774
52414
|
@default false
|
|
52775
52415
|
@since 1.3.0
|
|
@@ -52784,11 +52424,11 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52784
52424
|
(preventing both accidental leaking of state between tests and interference
|
|
52785
52425
|
with your testing framework). `setupForTesting` should only be called after
|
|
52786
52426
|
setting a custom `router` class (for example `App.Router = Router.extend(`).
|
|
52787
|
-
|
|
52788
|
-
|
|
52427
|
+
Example:
|
|
52428
|
+
```
|
|
52789
52429
|
App.setupForTesting();
|
|
52790
52430
|
```
|
|
52791
|
-
|
|
52431
|
+
@method setupForTesting
|
|
52792
52432
|
@public
|
|
52793
52433
|
*/
|
|
52794
52434
|
setupForTesting() {
|
|
@@ -52802,7 +52442,7 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52802
52442
|
/**
|
|
52803
52443
|
This will be used as the container to inject the test helpers into. By
|
|
52804
52444
|
default the helpers are injected into `window`.
|
|
52805
|
-
|
|
52445
|
+
@property helperContainer
|
|
52806
52446
|
@type {Object} The object to be used for test helpers.
|
|
52807
52447
|
@default window
|
|
52808
52448
|
@since 1.2.0
|
|
@@ -52816,13 +52456,13 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52816
52456
|
to `window`. If a function of the same name has already been defined it will be cached
|
|
52817
52457
|
(so that it can be reset if the helper is removed with `unregisterHelper` or
|
|
52818
52458
|
`removeTestHelpers`).
|
|
52819
|
-
|
|
52459
|
+
Any callbacks registered with `onInjectHelpers` will be called once the
|
|
52820
52460
|
helpers have been injected.
|
|
52821
|
-
|
|
52461
|
+
Example:
|
|
52822
52462
|
```
|
|
52823
52463
|
App.injectTestHelpers();
|
|
52824
52464
|
```
|
|
52825
|
-
|
|
52465
|
+
@method injectTestHelpers
|
|
52826
52466
|
@public
|
|
52827
52467
|
*/
|
|
52828
52468
|
injectTestHelpers(helperContainer) {
|
|
@@ -52843,8 +52483,11 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52843
52483
|
this.testHelpers = {};
|
|
52844
52484
|
|
|
52845
52485
|
for (var name in _helpers.helpers) {
|
|
52846
|
-
|
|
52847
|
-
this.
|
|
52486
|
+
// SAFETY: It is safe to access a property on an object
|
|
52487
|
+
this.originalMethods[name] = this.helperContainer[name]; // SAFETY: It is not quite as safe to do this, but it _seems_ to be ok.
|
|
52488
|
+
|
|
52489
|
+
this.testHelpers[name] = this.helperContainer[name] = helper(this, name); // SAFETY: We checked that it exists
|
|
52490
|
+
|
|
52848
52491
|
protoWrap(_promise.default.prototype, name, helper(this, name), _helpers.helpers[name].meta.wait);
|
|
52849
52492
|
}
|
|
52850
52493
|
|
|
@@ -52854,11 +52497,11 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52854
52497
|
/**
|
|
52855
52498
|
This removes all helpers that have been registered, and resets and functions
|
|
52856
52499
|
that were overridden by the helpers.
|
|
52857
|
-
|
|
52858
|
-
|
|
52500
|
+
Example:
|
|
52501
|
+
```javascript
|
|
52859
52502
|
App.removeTestHelpers();
|
|
52860
52503
|
```
|
|
52861
|
-
|
|
52504
|
+
@public
|
|
52862
52505
|
@method removeTestHelpers
|
|
52863
52506
|
*/
|
|
52864
52507
|
removeTestHelpers() {
|
|
@@ -52867,7 +52510,8 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52867
52510
|
}
|
|
52868
52511
|
|
|
52869
52512
|
for (var name in _helpers.helpers) {
|
|
52870
|
-
this.helperContainer[name] = this.originalMethods[name];
|
|
52513
|
+
this.helperContainer[name] = this.originalMethods[name]; // SAFETY: This is a weird thing, but it's not technically unsafe here.
|
|
52514
|
+
|
|
52871
52515
|
delete _promise.default.prototype[name];
|
|
52872
52516
|
delete this.testHelpers[name];
|
|
52873
52517
|
delete this.originalMethods[name];
|
|
@@ -52880,6 +52524,7 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52880
52524
|
|
|
52881
52525
|
|
|
52882
52526
|
function protoWrap(proto, name, callback, isAsync) {
|
|
52527
|
+
// SAFETY: This isn't entirely safe, but it _seems_ to be ok.
|
|
52883
52528
|
proto[name] = function () {
|
|
52884
52529
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
52885
52530
|
args[_key] = arguments[_key];
|
|
@@ -52888,6 +52533,7 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52888
52533
|
if (isAsync) {
|
|
52889
52534
|
return callback.apply(this, args);
|
|
52890
52535
|
} else {
|
|
52536
|
+
// SAFETY: This is not actually safe.
|
|
52891
52537
|
return this.then(function () {
|
|
52892
52538
|
return callback.apply(this, args);
|
|
52893
52539
|
});
|
|
@@ -52896,8 +52542,10 @@ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testin
|
|
|
52896
52542
|
}
|
|
52897
52543
|
|
|
52898
52544
|
function helper(app, name) {
|
|
52899
|
-
var
|
|
52900
|
-
|
|
52545
|
+
var helper = _helpers.helpers[name];
|
|
52546
|
+
(true && !(helper) && (0, _debug.assert)(`[BUG] Missing helper: ${name}`, helper));
|
|
52547
|
+
var fn = helper.method;
|
|
52548
|
+
var meta = helper.meta;
|
|
52901
52549
|
|
|
52902
52550
|
if (!meta.wait) {
|
|
52903
52551
|
return function () {
|
|
@@ -52961,7 +52609,7 @@ define("ember-testing/lib/helpers", ["ember-testing/lib/test/helpers", "ember-te
|
|
|
52961
52609
|
(0, _helpers.registerHelper)('currentURL', _current_url.default);
|
|
52962
52610
|
(0, _helpers.registerHelper)('resumeTest', _pause_test.resumeTest);
|
|
52963
52611
|
});
|
|
52964
|
-
define("ember-testing/lib/helpers/and_then", ["exports"], function (_exports) {
|
|
52612
|
+
define("ember-testing/lib/helpers/and_then", ["exports", "@ember/debug"], function (_exports, _debug) {
|
|
52965
52613
|
"use strict";
|
|
52966
52614
|
|
|
52967
52615
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -52970,10 +52618,12 @@ define("ember-testing/lib/helpers/and_then", ["exports"], function (_exports) {
|
|
|
52970
52618
|
_exports.default = andThen;
|
|
52971
52619
|
|
|
52972
52620
|
function andThen(app, callback) {
|
|
52973
|
-
|
|
52621
|
+
var wait = app.testHelpers['wait'];
|
|
52622
|
+
(true && !(wait) && (0, _debug.assert)('[BUG] Missing wait helper', wait));
|
|
52623
|
+
return wait(callback(app));
|
|
52974
52624
|
}
|
|
52975
52625
|
});
|
|
52976
|
-
define("ember-testing/lib/helpers/current_path", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
|
|
52626
|
+
define("ember-testing/lib/helpers/current_path", ["exports", "@ember/-internals/metal", "@ember/-internals/routing", "@ember/debug"], function (_exports, _metal, _routing, _debug) {
|
|
52977
52627
|
"use strict";
|
|
52978
52628
|
|
|
52979
52629
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -53004,12 +52654,15 @@ define("ember-testing/lib/helpers/current_path", ["exports", "@ember/-internals/
|
|
|
53004
52654
|
@public
|
|
53005
52655
|
*/
|
|
53006
52656
|
function currentPath(app) {
|
|
52657
|
+
(true && !(app.__container__) && (0, _debug.assert)('[BUG] app.__container__ is not set', app.__container__));
|
|
52658
|
+
|
|
53007
52659
|
var routingService = app.__container__.lookup('service:-routing');
|
|
53008
52660
|
|
|
52661
|
+
(true && !(routingService instanceof _routing.RoutingService) && (0, _debug.assert)('[BUG] service:-routing is not a RoutingService', routingService instanceof _routing.RoutingService));
|
|
53009
52662
|
return (0, _metal.get)(routingService, 'currentPath');
|
|
53010
52663
|
}
|
|
53011
52664
|
});
|
|
53012
|
-
define("ember-testing/lib/helpers/current_route_name", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
|
|
52665
|
+
define("ember-testing/lib/helpers/current_route_name", ["exports", "@ember/-internals/metal", "@ember/-internals/routing", "@ember/debug"], function (_exports, _metal, _routing, _debug) {
|
|
53013
52666
|
"use strict";
|
|
53014
52667
|
|
|
53015
52668
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -53039,12 +52692,15 @@ define("ember-testing/lib/helpers/current_route_name", ["exports", "@ember/-inte
|
|
|
53039
52692
|
@public
|
|
53040
52693
|
*/
|
|
53041
52694
|
function currentRouteName(app) {
|
|
52695
|
+
(true && !(app.__container__) && (0, _debug.assert)('[BUG] app.__container__ is not set', app.__container__));
|
|
52696
|
+
|
|
53042
52697
|
var routingService = app.__container__.lookup('service:-routing');
|
|
53043
52698
|
|
|
52699
|
+
(true && !(routingService instanceof _routing.RoutingService) && (0, _debug.assert)('[BUG] service:-routing is not a RoutingService', routingService instanceof _routing.RoutingService));
|
|
53044
52700
|
return (0, _metal.get)(routingService, 'currentRouteName');
|
|
53045
52701
|
}
|
|
53046
52702
|
});
|
|
53047
|
-
define("ember-testing/lib/helpers/current_url", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
|
|
52703
|
+
define("ember-testing/lib/helpers/current_url", ["exports", "@ember/-internals/metal", "@ember/debug", "@ember/routing/router"], function (_exports, _metal, _debug, _router) {
|
|
53048
52704
|
"use strict";
|
|
53049
52705
|
|
|
53050
52706
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -53075,9 +52731,14 @@ define("ember-testing/lib/helpers/current_url", ["exports", "@ember/-internals/m
|
|
|
53075
52731
|
@public
|
|
53076
52732
|
*/
|
|
53077
52733
|
function currentURL(app) {
|
|
52734
|
+
(true && !(app.__container__) && (0, _debug.assert)('[BUG] app.__container__ is not set', app.__container__));
|
|
52735
|
+
|
|
53078
52736
|
var router = app.__container__.lookup('router:main');
|
|
53079
52737
|
|
|
53080
|
-
|
|
52738
|
+
(true && !(router instanceof _router.default) && (0, _debug.assert)('[BUG] router:main is not a Router', router instanceof _router.default));
|
|
52739
|
+
var location = (0, _metal.get)(router, 'location');
|
|
52740
|
+
(true && !(typeof location !== 'string') && (0, _debug.assert)('[BUG] location is still a string', typeof location !== 'string'));
|
|
52741
|
+
return location.getURL();
|
|
53081
52742
|
}
|
|
53082
52743
|
});
|
|
53083
52744
|
define("ember-testing/lib/helpers/pause_test", ["exports", "@ember/-internals/runtime", "@ember/debug"], function (_exports, _runtime, _debug) {
|
|
@@ -53152,7 +52813,7 @@ define("ember-testing/lib/helpers/pause_test", ["exports", "@ember/-internals/ru
|
|
|
53152
52813
|
}, 'TestAdapter paused promise');
|
|
53153
52814
|
}
|
|
53154
52815
|
});
|
|
53155
|
-
define("ember-testing/lib/helpers/visit", ["exports", "@ember/runloop"], function (_exports, _runloop) {
|
|
52816
|
+
define("ember-testing/lib/helpers/visit", ["exports", "@ember/debug", "@ember/routing/router", "@ember/runloop"], function (_exports, _debug, _router, _runloop) {
|
|
53156
52817
|
"use strict";
|
|
53157
52818
|
|
|
53158
52819
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -53179,18 +52840,24 @@ define("ember-testing/lib/helpers/visit", ["exports", "@ember/runloop"], functio
|
|
|
53179
52840
|
@public
|
|
53180
52841
|
*/
|
|
53181
52842
|
function visit(app, url) {
|
|
52843
|
+
(true && !(app.__container__) && (0, _debug.assert)('[BUG] Missing container', app.__container__));
|
|
52844
|
+
|
|
53182
52845
|
var router = app.__container__.lookup('router:main');
|
|
53183
52846
|
|
|
52847
|
+
(true && !(router instanceof _router.default) && (0, _debug.assert)('[BUG] router:main is not a Router', router instanceof _router.default));
|
|
53184
52848
|
var shouldHandleURL = false;
|
|
53185
52849
|
app.boot().then(() => {
|
|
52850
|
+
(true && !(typeof router.location !== 'string') && (0, _debug.assert)('[BUG] router.location is still a string', typeof router.location !== 'string'));
|
|
53186
52851
|
router.location.setURL(url);
|
|
53187
52852
|
|
|
53188
52853
|
if (shouldHandleURL) {
|
|
52854
|
+
(true && !(app.__deprecatedInstance__) && (0, _debug.assert)("[BUG] __deprecatedInstance__ isn't set", app.__deprecatedInstance__));
|
|
53189
52855
|
(0, _runloop.run)(app.__deprecatedInstance__, 'handleURL', url);
|
|
53190
52856
|
}
|
|
53191
52857
|
});
|
|
53192
52858
|
|
|
53193
52859
|
if (app._readinessDeferrals > 0) {
|
|
52860
|
+
// SAFETY: This should be safe, though it is odd.
|
|
53194
52861
|
router.initialURL = url;
|
|
53195
52862
|
(0, _runloop.run)(app, 'advanceReadiness');
|
|
53196
52863
|
delete router.initialURL;
|
|
@@ -53198,10 +52865,12 @@ define("ember-testing/lib/helpers/visit", ["exports", "@ember/runloop"], functio
|
|
|
53198
52865
|
shouldHandleURL = true;
|
|
53199
52866
|
}
|
|
53200
52867
|
|
|
53201
|
-
|
|
52868
|
+
var wait = app.testHelpers['wait'];
|
|
52869
|
+
(true && !(wait) && (0, _debug.assert)('[BUG] missing wait helper', wait));
|
|
52870
|
+
return wait();
|
|
53202
52871
|
}
|
|
53203
52872
|
});
|
|
53204
|
-
define("ember-testing/lib/helpers/wait", ["exports", "ember-testing/lib/test/waiters", "@ember/-internals/runtime", "@ember/runloop", "ember-testing/lib/test/pending_requests"], function (_exports, _waiters, _runtime, _runloop, _pending_requests) {
|
|
52873
|
+
define("ember-testing/lib/helpers/wait", ["exports", "ember-testing/lib/test/waiters", "@ember/-internals/runtime", "@ember/runloop", "ember-testing/lib/test/pending_requests", "@ember/debug", "@ember/routing/router"], function (_exports, _waiters, _runtime, _runloop, _pending_requests, _debug, _router) {
|
|
53205
52874
|
"use strict";
|
|
53206
52875
|
|
|
53207
52876
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -53245,8 +52914,11 @@ define("ember-testing/lib/helpers/wait", ["exports", "ember-testing/lib/test/wai
|
|
|
53245
52914
|
*/
|
|
53246
52915
|
function wait(app, value) {
|
|
53247
52916
|
return new _runtime.RSVP.Promise(function (resolve) {
|
|
53248
|
-
|
|
52917
|
+
(true && !(app.__container__) && (0, _debug.assert)('[BUG] Missing container', app.__container__));
|
|
52918
|
+
|
|
52919
|
+
var router = app.__container__.lookup('router:main');
|
|
53249
52920
|
|
|
52921
|
+
(true && !(router instanceof _router.default) && (0, _debug.assert)('[BUG] Expected router:main to be a subclass of Ember Router', router instanceof _router.default)); // Every 10ms, poll for the async thing to have finished
|
|
53250
52922
|
|
|
53251
52923
|
var watcher = setInterval(() => {
|
|
53252
52924
|
// 1. If the router is loading, keep polling
|
|
@@ -53282,9 +52954,9 @@ define("ember-testing/lib/initializers", ["@ember/application"], function (_appl
|
|
|
53282
52954
|
"use strict";
|
|
53283
52955
|
|
|
53284
52956
|
var name = 'deferReadiness in `testing` mode';
|
|
53285
|
-
(0, _application.onLoad)('Ember.Application', function (
|
|
53286
|
-
if (!
|
|
53287
|
-
|
|
52957
|
+
(0, _application.onLoad)('Ember.Application', function (ApplicationClass) {
|
|
52958
|
+
if (!ApplicationClass.initializers[name]) {
|
|
52959
|
+
ApplicationClass.initializer({
|
|
53288
52960
|
name: name,
|
|
53289
52961
|
|
|
53290
52962
|
initialize(application) {
|
|
@@ -53355,7 +53027,7 @@ define("ember-testing/lib/test", ["exports", "ember-testing/lib/test/helpers", "
|
|
|
53355
53027
|
var Test = {
|
|
53356
53028
|
/**
|
|
53357
53029
|
Hash containing all known test helpers.
|
|
53358
|
-
|
|
53030
|
+
@property _helpers
|
|
53359
53031
|
@private
|
|
53360
53032
|
@since 1.7.0
|
|
53361
53033
|
*/
|
|
@@ -53438,7 +53110,8 @@ define("ember-testing/lib/test/adapter", ["exports", "@ember/-internals/error-ha
|
|
|
53438
53110
|
}
|
|
53439
53111
|
|
|
53440
53112
|
function adapterDispatch(error) {
|
|
53441
|
-
adapter.exception(error);
|
|
53113
|
+
adapter.exception(error); // @ts-expect-error Normally unreachable
|
|
53114
|
+
|
|
53442
53115
|
console.error(error.stack); // eslint-disable-line no-console
|
|
53443
53116
|
}
|
|
53444
53117
|
});
|
|
@@ -53581,7 +53254,9 @@ define("ember-testing/lib/test/helpers", ["exports", "ember-testing/lib/test/pro
|
|
|
53581
53254
|
|
|
53582
53255
|
|
|
53583
53256
|
function unregisterHelper(name) {
|
|
53584
|
-
delete helpers[name];
|
|
53257
|
+
delete helpers[name]; // SAFETY: This isn't necessarily a safe thing to do, but in terms of the immediate types here
|
|
53258
|
+
// it won't error.
|
|
53259
|
+
|
|
53585
53260
|
delete _promise.default.prototype[name];
|
|
53586
53261
|
}
|
|
53587
53262
|
});
|
|
@@ -53630,8 +53305,8 @@ define("ember-testing/lib/test/on_inject_helpers", ["exports"], function (_expor
|
|
|
53630
53305
|
}
|
|
53631
53306
|
|
|
53632
53307
|
function invokeInjectHelpersCallbacks(app) {
|
|
53633
|
-
for (var
|
|
53634
|
-
|
|
53308
|
+
for (var callback of callbacks) {
|
|
53309
|
+
callback(app);
|
|
53635
53310
|
}
|
|
53636
53311
|
}
|
|
53637
53312
|
});
|
|
@@ -53680,22 +53355,17 @@ define("ember-testing/lib/test/promise", ["exports", "@ember/-internals/runtime"
|
|
|
53680
53355
|
_exports.getLastPromise = getLastPromise;
|
|
53681
53356
|
_exports.promise = promise;
|
|
53682
53357
|
_exports.resolve = resolve;
|
|
53683
|
-
var lastPromise;
|
|
53358
|
+
var lastPromise = null;
|
|
53684
53359
|
|
|
53685
53360
|
class TestPromise extends _runtime.RSVP.Promise {
|
|
53686
|
-
constructor() {
|
|
53687
|
-
super(
|
|
53361
|
+
constructor(executor, label) {
|
|
53362
|
+
super(executor, label);
|
|
53688
53363
|
lastPromise = this;
|
|
53689
53364
|
}
|
|
53690
53365
|
|
|
53691
|
-
then(
|
|
53692
|
-
var
|
|
53693
|
-
|
|
53694
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
53695
|
-
args[_key - 1] = arguments[_key];
|
|
53696
|
-
}
|
|
53697
|
-
|
|
53698
|
-
return super.then(onFulfillment, ...args);
|
|
53366
|
+
then(onFulfilled, onRejected, label) {
|
|
53367
|
+
var normalizedOnFulfilled = typeof onFulfilled === 'function' ? result => isolate(onFulfilled, result) : undefined;
|
|
53368
|
+
return super.then(normalizedOnFulfilled, onRejected, label);
|
|
53699
53369
|
}
|
|
53700
53370
|
|
|
53701
53371
|
}
|
|
@@ -53747,10 +53417,10 @@ define("ember-testing/lib/test/promise", ["exports", "@ember/-internals/runtime"
|
|
|
53747
53417
|
// 3. Return the last promise created during method
|
|
53748
53418
|
|
|
53749
53419
|
|
|
53750
|
-
function isolate(
|
|
53420
|
+
function isolate(onFulfilled, result) {
|
|
53751
53421
|
// Reset lastPromise for nested helpers
|
|
53752
53422
|
lastPromise = null;
|
|
53753
|
-
var value =
|
|
53423
|
+
var value = onFulfilled(result);
|
|
53754
53424
|
var promise = lastPromise;
|
|
53755
53425
|
lastPromise = null; // If the method returned a promise
|
|
53756
53426
|
// return that promise. If not,
|
|
@@ -53794,55 +53464,25 @@ define("ember-testing/lib/test/waiters", ["exports"], function (_exports) {
|
|
|
53794
53464
|
*/
|
|
53795
53465
|
var contexts = [];
|
|
53796
53466
|
var callbacks = [];
|
|
53797
|
-
/**
|
|
53798
|
-
This allows ember-testing to play nicely with other asynchronous
|
|
53799
|
-
events, such as an application that is waiting for a CSS3
|
|
53800
|
-
transition or an IndexDB transaction. The waiter runs periodically
|
|
53801
|
-
after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
|
|
53802
|
-
until the returning result is truthy. After the waiters finish, the next async helper
|
|
53803
|
-
is executed and the process repeats.
|
|
53804
|
-
|
|
53805
|
-
For example:
|
|
53806
|
-
|
|
53807
|
-
```javascript
|
|
53808
|
-
import { registerWaiter } from '@ember/test';
|
|
53809
|
-
|
|
53810
|
-
registerWaiter(function() {
|
|
53811
|
-
return myPendingTransactions() === 0;
|
|
53812
|
-
});
|
|
53813
|
-
```
|
|
53814
|
-
The `context` argument allows you to optionally specify the `this`
|
|
53815
|
-
with which your callback will be invoked.
|
|
53816
|
-
|
|
53817
|
-
For example:
|
|
53818
|
-
|
|
53819
|
-
```javascript
|
|
53820
|
-
import { registerWaiter } from '@ember/test';
|
|
53821
|
-
|
|
53822
|
-
registerWaiter(MyDB, MyDB.hasPendingTransactions);
|
|
53823
|
-
```
|
|
53824
|
-
|
|
53825
|
-
@public
|
|
53826
|
-
@for @ember/test
|
|
53827
|
-
@static
|
|
53828
|
-
@method registerWaiter
|
|
53829
|
-
@param {Object} context (optional)
|
|
53830
|
-
@param {Function} callback
|
|
53831
|
-
@since 1.2.0
|
|
53832
|
-
*/
|
|
53833
53467
|
|
|
53834
|
-
function registerWaiter(
|
|
53468
|
+
function registerWaiter() {
|
|
53469
|
+
var checkedCallback;
|
|
53470
|
+
var checkedContext;
|
|
53471
|
+
|
|
53835
53472
|
if (arguments.length === 1) {
|
|
53836
|
-
|
|
53837
|
-
|
|
53473
|
+
checkedContext = null;
|
|
53474
|
+
checkedCallback = arguments.length <= 0 ? undefined : arguments[0];
|
|
53475
|
+
} else {
|
|
53476
|
+
checkedContext = arguments.length <= 0 ? undefined : arguments[0];
|
|
53477
|
+
checkedCallback = arguments.length <= 1 ? undefined : arguments[1];
|
|
53838
53478
|
}
|
|
53839
53479
|
|
|
53840
|
-
if (indexOf(
|
|
53480
|
+
if (indexOf(checkedContext, checkedCallback) > -1) {
|
|
53841
53481
|
return;
|
|
53842
53482
|
}
|
|
53843
53483
|
|
|
53844
|
-
contexts.push(
|
|
53845
|
-
callbacks.push(
|
|
53484
|
+
contexts.push(checkedContext);
|
|
53485
|
+
callbacks.push(checkedCallback);
|
|
53846
53486
|
}
|
|
53847
53487
|
/**
|
|
53848
53488
|
`unregisterWaiter` is used to unregister a callback that was
|
|
@@ -53899,7 +53539,7 @@ define("ember-testing/lib/test/waiters", ["exports"], function (_exports) {
|
|
|
53899
53539
|
|
|
53900
53540
|
for (var i = 0; i < callbacks.length; i++) {
|
|
53901
53541
|
var context = contexts[i];
|
|
53902
|
-
var callback = callbacks[i];
|
|
53542
|
+
var callback = callbacks[i]; // SAFETY: The loop ensures that this exists
|
|
53903
53543
|
|
|
53904
53544
|
if (!callback.call(context)) {
|
|
53905
53545
|
return true;
|
|
@@ -54405,7 +54045,7 @@ define("ember/version", ["exports"], function (_exports) {
|
|
|
54405
54045
|
value: true
|
|
54406
54046
|
});
|
|
54407
54047
|
_exports.default = void 0;
|
|
54408
|
-
var _default = "4.
|
|
54048
|
+
var _default = "4.6.0-alpha.3";
|
|
54409
54049
|
_exports.default = _default;
|
|
54410
54050
|
});
|
|
54411
54051
|
define("route-recognizer", ["exports"], function (_exports) {
|