Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 5175d40

Browse files
boris-petrovbertdeblock
authored andcommitted
fix: resolve ember-polyfills.deprecate-assign deprecation warnings
1 parent 5520bdf commit 5175d40

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

addon/mixins/ajax-request.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import EmberError from '@ember/error';
33
import Mixin from '@ember/object/mixin';
44
import { get } from '@ember/object';
55
import { isEmpty } from '@ember/utils';
6-
import { assign } from '@ember/polyfills';
76
import { join } from '@ember/runloop';
87
import { warn, runInDebug } from '@ember/debug';
98
import Ember from 'ember';
@@ -434,15 +433,15 @@ export default Mixin.create({
434433
*/
435434
_getFullHeadersHash(headers?: Headers): Headers {
436435
const classHeaders = get(this, 'headers');
437-
return assign({}, classHeaders!, headers!);
436+
return { ...classHeaders!, ...headers! };
438437
},
439438

440439
/**
441440
* Created a normalized set of options from the per-request and
442441
* service-level settings
443442
*/
444443
options(url: string, options: AJAXOptions = {}): AJAXOptions {
445-
options = assign({}, options);
444+
options = { ...options };
446445
options.url = this._buildURL(url, options);
447446
options.type = options.type || 'GET';
448447
options.dataType = options.dataType || 'json';

addon/mixins/legacy/normalize-error-response.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Mixin from '@ember/object/mixin';
22
import { isArray } from '@ember/array';
33
import { isNone } from '@ember/utils';
4-
import { assign } from '@ember/polyfills';
54

65
import isString from '../../-private/utils/is-string';
76
import { Headers } from '../../-private/types';
@@ -83,7 +82,7 @@ export default Mixin.create({
8382
if (isJsonApiErrorResponse(payload)) {
8483
return payload.errors.map(function(error) {
8584
if (isObject(error)) {
86-
const ret = assign({}, error);
85+
const ret = { ...error };
8786
ret.status = `${error.status}`;
8887
return ret;
8988
} else {

tests/helpers/start-app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import Application from '../../app';
22
import config from '../../config/environment';
3-
import { assign } from '@ember/polyfills';
43
import { run } from '@ember/runloop';
54

65
export default function startApp(attrs) {
7-
let attributes = assign({}, config.APP);
6+
let attributes = Object.assign({}, config.APP);
87
attributes.autoboot = true;
9-
attributes = assign(attributes, attrs); // use defaults, but you can override;
8+
attributes = Object.assign(attributes, attrs); // use defaults, but you can override;
109

1110
return run(() => {
1211
let application = Application.create(attributes);

0 commit comments

Comments
 (0)