Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

fix(promise-polyfill): remove babel-polyfill and let babel do magic #726

Merged
merged 1 commit into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": "> 0.25%, not dead",
"useBuiltIns": "usage"
}
]
],
"presets": ["@babel/preset-env"],
"env": {
"npm": {
"plugins": [
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"webpack-cli": "3.2.1"
},
"dependencies": {
"@babel/polyfill": "^7.2.5",
"algolia-aerial": "^1.5.3",
"algoliasearch": "^3.31.0",
"autocomplete.js": "^0.35.0",
Expand Down
5 changes: 3 additions & 2 deletions src/configure/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ const extractParams = ({
extracted.aroundLatLngViaIP = aroundLatLngViaIP;
}

return Object.assign(extracted, {
return {
...extracted,
aroundRadius,
insideBoundingBox,
insidePolygon,
getRankingInfo,
});
};
};

const extractControls = ({
Expand Down
14 changes: 8 additions & 6 deletions src/createAutocompleteSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ export default function createAutocompleteSource({
}

function searcher(query, cb) {
const searchParams = Object.assign(
{},
params,
userCoords && { aroundLatLng: userCoords },
{ query }
);
const searchParams = {
...params,
query,
};

if (userCoords) {
searchParams.aroundLatLng = userCoords;
}

return placesClient
.search(controls.computeQueryParams(searchParams))
Expand Down
2 changes: 1 addition & 1 deletion src/instantsearch/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AlgoliaPlacesWidget {
}

if (searchParameters.aroundLatLng === undefined && !this.query) {
const newUiState = Object.assign({}, uiState);
const newUiState = { ...uiState };
delete newUiState.places;
return newUiState;
}
Expand Down
2 changes: 1 addition & 1 deletion src/places.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function places(options) {
placesInstance.autocomplete = autocompleteInstance;

placesInstance.configure = configuration => {
const safeConfig = Object.assign({}, configuration);
const safeConfig = { ...configuration };

delete safeConfig.onHits;
delete safeConfig.onError;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
"@babel/helper-regex" "^7.0.0"
regexpu-core "^4.1.3"

"@babel/polyfill@^7.0.0", "@babel/polyfill@^7.2.5":
"@babel/polyfill@^7.0.0":
version "7.2.5"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d"
integrity sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==
Expand Down