Skip to content

Commit

Permalink
chore: bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Jun 25, 2021
1 parent a4eb9e9 commit d934f78
Show file tree
Hide file tree
Showing 27 changed files with 1,902 additions and 1,900 deletions.
5 changes: 5 additions & 0 deletions example/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"noImplicitAny": false
}
}
3,598 changes: 1,796 additions & 1,802 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@pollyjs/persister-fs": "^5.0.0",
"@pollyjs/utils": "^5.0.0",
"@types/jasmine": "^3.5.0",
"@types/node": "^14.0.0",
"@types/node": "^15.0.0",
"@types/pollyjs__adapter-node-http": "^2.0.0",
"@types/pollyjs__core": "^4.3.0",
"@types/pollyjs__persister-fs": "^2.0.0",
Expand All @@ -72,12 +72,12 @@
"husky": "^6.0.0",
"jasmine": "^3.5.0",
"jasmine-spec-reporter": "^7.0.0",
"lint-staged": "^10.2.0",
"lint-staged": "^11.0.0",
"nyc": "^15.1.0",
"prettier": "^2.0.0",
"setup-polly-jest": "^0.9.0",
"ts-loader": "^8.0.0",
"ts-node": "^9.0.0",
"ts-loader": "^9.0.0",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.9.0",
"ttypescript": "^1.5.0",
"typescript": "^4.0.0",
Expand All @@ -95,7 +95,7 @@
"serve": "http-server",
"test": "ts-node --project tsconfig-cjs.json --compiler ttypescript -r tsconfig-paths/register node_modules/.bin/jasmine",
"test-record": "POLLY_RECORD=1 npm test",
"ts-node": "ts-node --skip-project",
"ts-node": "ts-node --project example/node/tsconfig.json",
"watch": "concurrently -k \"webpack --config webpack.dev.js --watch\" \"ttsc -p tsconfig-cjs.json --watch\" \"ttsc --watch\""
},
"lint-staged": {
Expand Down
4 changes: 1 addition & 3 deletions spec/GeoJsonDumper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ describe("GeoJSON Dumper", () => {
coordinates: [-77.0365123, 38.8978378],
},
bbox: [
-77.04317326462667,
38.89380528242933,
-77.02993873537334,
-77.04317326462667, 38.89380528242933, -77.02993873537334,
38.90153071757068,
],
};
Expand Down
8 changes: 2 additions & 6 deletions src/GeoJsonDumper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ export default class GeoJsonDumper {

public static dump(geocoded: Geocoded): Feature {
let result = GeoJsonDumper.baseGeoJson;
const {
coordinates,
bounds,
adminLevels,
...geocodedProperties
} = geocoded.toObject();
const { coordinates, bounds, adminLevels, ...geocodedProperties } =
geocoded.toObject();

let properties: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
45 changes: 22 additions & 23 deletions src/GeocoderProviderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,28 @@ export type GeocoderProvider =
| OpenCageProvider
| YandexProvider;

export type GeocoderProviderByOptionsType<
O
> = O extends ChainGeocoderProviderFactoryOptions
? ChainProvider
: O extends BingGeocoderProviderFactoryOptions
? BingProvider
: O extends GeoPluginGeocoderProviderFactoryOptions
? GeoPluginProvider
: O extends GoogleMapsGeocoderProviderFactoryOptions
? GoogleMapsProvider
: O extends LocationIQGeocoderProviderFactoryOptions
? LocationIQProvider
: O extends MapboxGeocoderProviderFactoryOptions
? MapboxProvider
: O extends MapQuestGeocoderProviderFactoryOptions
? MapQuestProvider
: O extends NominatimGeocoderProviderFactoryOptions
? NominatimProvider
: O extends OpenCageGeocoderProviderFactoryOptions
? OpenCageProvider
: O extends YandexGeocoderProviderFactoryOptions
? YandexProvider
: GeocoderProvider;
export type GeocoderProviderByOptionsType<O> =
O extends ChainGeocoderProviderFactoryOptions
? ChainProvider
: O extends BingGeocoderProviderFactoryOptions
? BingProvider
: O extends GeoPluginGeocoderProviderFactoryOptions
? GeoPluginProvider
: O extends GoogleMapsGeocoderProviderFactoryOptions
? GoogleMapsProvider
: O extends LocationIQGeocoderProviderFactoryOptions
? LocationIQProvider
: O extends MapboxGeocoderProviderFactoryOptions
? MapboxProvider
: O extends MapQuestGeocoderProviderFactoryOptions
? MapQuestProvider
: O extends NominatimGeocoderProviderFactoryOptions
? NominatimProvider
: O extends OpenCageGeocoderProviderFactoryOptions
? OpenCageProvider
: O extends YandexGeocoderProviderFactoryOptions
? YandexProvider
: GeocoderProvider;

export default class ProviderFactory {
/**
Expand Down
58 changes: 28 additions & 30 deletions src/provider/ChainProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,20 @@ export default class ChainProvider implements ProviderInterface<Geocoded> {
callbackCalled = true;
}
};
const resultProviderErrorCallback: (
providerName: string
) => ErrorCallback = (providerName) => (responseError) => {
if (errorCallback) {
errorCallback(responseError);
}
if (!errorCallback) {
// eslint-disable-next-line no-console
console.error(
`An error has occurred when geocoding with the provider ${providerName}`,
responseError
);
}
resultProviderCallback(providerName)([]);
};
const resultProviderErrorCallback: (providerName: string) => ErrorCallback =
(providerName) => (responseError) => {
if (errorCallback) {
errorCallback(responseError);
}
if (!errorCallback) {
// eslint-disable-next-line no-console
console.error(
`An error has occurred when geocoding with the provider ${providerName}`,
responseError
);
}
resultProviderCallback(providerName)([]);
};

this.options.providers.forEach((provider) => {
const providerName = provider.constructor.name;
Expand Down Expand Up @@ -290,21 +289,20 @@ export default class ChainProvider implements ProviderInterface<Geocoded> {
callbackCalled = true;
}
};
const resultProviderErrorCallback: (
providerName: string
) => ErrorCallback = (providerName) => (responseError) => {
if (errorCallback) {
errorCallback(responseError);
}
if (!errorCallback) {
// eslint-disable-next-line no-console
console.error(
`An error has occurred when geodecoding with the provider ${providerName}`,
responseError
);
}
resultProviderCallback(providerName)([]);
};
const resultProviderErrorCallback: (providerName: string) => ErrorCallback =
(providerName) => (responseError) => {
if (errorCallback) {
errorCallback(responseError);
}
if (!errorCallback) {
// eslint-disable-next-line no-console
console.error(
`An error has occurred when geodecoding with the provider ${providerName}`,
responseError
);
}
resultProviderCallback(providerName)([]);
};

this.options.providers.forEach((provider) => {
const providerName = provider.constructor.name;
Expand Down
6 changes: 4 additions & 2 deletions src/provider/geoplugin/GeoPluginProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ export interface GeoPluginResult {
geoplugin_currencyConverter: string;
}

type GeoPluginGeocodedResultsCallback = GeocodedResultsCallback<GeoPluginGeocoded>;
type GeoPluginGeocodedResultsCallback =
GeocodedResultsCallback<GeoPluginGeocoded>;

export default class GeoPluginProvider
implements ProviderInterface<GeoPluginGeocoded> {
implements ProviderInterface<GeoPluginGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: ProviderOptionsInterface;
Expand Down
6 changes: 4 additions & 2 deletions src/provider/googlemaps/GoogleMapsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,12 @@ export interface GoogleMapsProviderOptionsInterface
readonly countryCodes?: string[];
}

type GoogleMapsGeocodedResultsCallback = GeocodedResultsCallback<GoogleMapsGeocoded>;
type GoogleMapsGeocodedResultsCallback =
GeocodedResultsCallback<GoogleMapsGeocoded>;

export default class GoogleMapsProvider
implements ProviderInterface<GoogleMapsGeocoded> {
implements ProviderInterface<GoogleMapsGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: GoogleMapsProviderOptionsInterface;
Expand Down
25 changes: 12 additions & 13 deletions src/provider/locationiq/LocationIQProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,19 @@ export interface LocationIQProviderOptionsInterface
readonly source?: "nominatim" | "locationiq";
}

export const defaultLocationIQProviderOptions: LocationIQProviderOptionsInterface = {
...defaultProviderOptions,
apiKey: "",
source: "locationiq",
};
export const defaultLocationIQProviderOptions: LocationIQProviderOptionsInterface =
{
...defaultProviderOptions,
apiKey: "",
source: "locationiq",
};

type LocationIQGeocodedResultsCallback = GeocodedResultsCallback<LocationIQGeocoded>;
type LocationIQGeocodedResultsCallback =
GeocodedResultsCallback<LocationIQGeocoded>;

export default class LocationIQProvider
implements ProviderInterface<LocationIQGeocoded> {
implements ProviderInterface<LocationIQGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: LocationIQProviderOptionsInterface;
Expand Down Expand Up @@ -490,12 +493,8 @@ export default class LocationIQProvider
}
});

const subLocalityLevels: (
| "suburb"
| "neighbourhood"
| "road"
| "name"
)[] = ["suburb", "neighbourhood", "road", "name"];
const subLocalityLevels: ("suburb" | "neighbourhood" | "road" | "name")[] =
["suburb", "neighbourhood", "road", "name"];
subLocalityLevels.forEach((subLocalityLevel, level) => {
if (result.address[subLocalityLevel]) {
geocoded.addSubLocalityLevel(
Expand Down
3 changes: 2 additions & 1 deletion src/provider/mapbox/MapboxProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export const defaultMapboxProviderOptions = {
type MapboxGeocodedResultsCallback = GeocodedResultsCallback<MapboxGeocoded>;

export default class MapboxProvider
implements ProviderInterface<MapboxGeocoded> {
implements ProviderInterface<MapboxGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: MapboxProviderOptionsInterface;
Expand Down
19 changes: 11 additions & 8 deletions src/provider/mapquest/MapQuestProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,20 @@ export interface MapQuestProviderOptionsInterface
readonly source?: "nominatim" | "mapquest";
}

export const defaultMapQuestProviderOptions: MapQuestProviderOptionsInterface = {
...defaultProviderOptions,
apiKey: "",
method: "GET",
source: "mapquest",
};
export const defaultMapQuestProviderOptions: MapQuestProviderOptionsInterface =
{
...defaultProviderOptions,
apiKey: "",
method: "GET",
source: "mapquest",
};

type MapQuestGeocodedResultsCallback = GeocodedResultsCallback<MapQuestGeocoded>;
type MapQuestGeocodedResultsCallback =
GeocodedResultsCallback<MapQuestGeocoded>;

export default class MapQuestProvider
implements ProviderInterface<MapQuestGeocoded> {
implements ProviderInterface<MapQuestGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: MapQuestProviderOptionsInterface;
Expand Down
6 changes: 4 additions & 2 deletions src/provider/nominatim/NominatimProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,12 @@ export const defaultNominatimProviderOptions = {
userAgent: "",
};

type NominatimGeocodedResultsCallback = GeocodedResultsCallback<NominatimGeocoded>;
type NominatimGeocodedResultsCallback =
GeocodedResultsCallback<NominatimGeocoded>;

export default class NominatimProvider
implements ProviderInterface<NominatimGeocoded> {
implements ProviderInterface<NominatimGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: NominatimProviderOptionsInterface;
Expand Down
6 changes: 4 additions & 2 deletions src/provider/opencage/OpenCageProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ export const defaultOpenCageProviderOptions = {
apiKey: "",
};

type OpenCageGeocodedResultsCallback = GeocodedResultsCallback<OpenCageGeocoded>;
type OpenCageGeocodedResultsCallback =
GeocodedResultsCallback<OpenCageGeocoded>;

export default class OpenCageProvider
implements ProviderInterface<OpenCageGeocoded> {
implements ProviderInterface<OpenCageGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: OpenCageProviderOptionsInterface;
Expand Down
3 changes: 2 additions & 1 deletion src/provider/yandex/YandexProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export const defaultYandexProviderOptions = {
type YandexGeocodedResultsCallback = GeocodedResultsCallback<YandexGeocoded>;

export default class YandexProvider
implements ProviderInterface<YandexGeocoded> {
implements ProviderInterface<YandexGeocoded>
{
private externalLoader: ExternalLoaderInterface;

private options: YandexProviderOptionsInterface;
Expand Down

0 comments on commit d934f78

Please sign in to comment.