@aws-amplify/geo 3.0.80 → 3.0.81-local-stack.00864ae.0
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/dist/cjs/util.js +8 -9
- package/dist/cjs/util.js.map +1 -1
- package/package.json +89 -90
package/dist/cjs/util.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.validateCoordinates = validateCoordinates;
|
|
5
|
+
exports.validateGeofenceId = validateGeofenceId;
|
|
6
|
+
exports.validateLinearRing = validateLinearRing;
|
|
7
|
+
exports.validatePolygon = validatePolygon;
|
|
8
|
+
exports.validateGeofencesInput = validateGeofencesInput;
|
|
9
|
+
exports.mapSearchOptions = mapSearchOptions;
|
|
10
|
+
exports.getGeoUserAgent = getGeoUserAgent;
|
|
11
|
+
exports.getGeoUserAgentString = getGeoUserAgentString;
|
|
5
12
|
const tslib_1 = require("tslib");
|
|
6
13
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
14
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -18,7 +25,6 @@ function validateCoordinates(lng, lat) {
|
|
|
18
25
|
throw new Error('Longitude must be between -180 and 180 degrees inclusive.');
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
|
-
exports.validateCoordinates = validateCoordinates;
|
|
22
28
|
function validateGeofenceId(geofenceId) {
|
|
23
29
|
const geofenceIdRegex = /^[-._\p{L}\p{N}]+$/iu;
|
|
24
30
|
// Check if geofenceId is valid
|
|
@@ -26,7 +32,6 @@ function validateGeofenceId(geofenceId) {
|
|
|
26
32
|
throw new Error(`Invalid geofenceId: '${geofenceId}' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.`);
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
|
-
exports.validateGeofenceId = validateGeofenceId;
|
|
30
35
|
function validateLinearRing(linearRing, geofenceId) {
|
|
31
36
|
const errorPrefix = geofenceId ? `${geofenceId}: ` : '';
|
|
32
37
|
// Validate LinearRing size, must be at least 4 points
|
|
@@ -56,7 +61,6 @@ function validateLinearRing(linearRing, geofenceId) {
|
|
|
56
61
|
throw new Error(`${errorPrefix}LinearRing coordinates must be wound counterclockwise`);
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
|
-
exports.validateLinearRing = validateLinearRing;
|
|
60
64
|
function validatePolygon(polygon, geofenceId) {
|
|
61
65
|
const errorPrefix = geofenceId ? `${geofenceId}: ` : '';
|
|
62
66
|
if (!Array.isArray(polygon)) {
|
|
@@ -76,7 +80,6 @@ function validatePolygon(polygon, geofenceId) {
|
|
|
76
80
|
validateLinearRing(linearRing, geofenceId);
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
|
-
exports.validatePolygon = validatePolygon;
|
|
80
83
|
function validateGeofencesInput(geofences) {
|
|
81
84
|
const geofenceIds = {};
|
|
82
85
|
geofences.forEach((geofence) => {
|
|
@@ -118,7 +121,6 @@ function validateGeofencesInput(geofences) {
|
|
|
118
121
|
validateLinearRing(linearRing, geofenceId);
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
|
-
exports.validateGeofencesInput = validateGeofencesInput;
|
|
122
124
|
function mapSearchOptions(options, locationServiceInput) {
|
|
123
125
|
const locationServiceModifiedInput = { ...locationServiceInput };
|
|
124
126
|
locationServiceModifiedInput.FilterCountries = options.countries;
|
|
@@ -138,19 +140,16 @@ function mapSearchOptions(options, locationServiceInput) {
|
|
|
138
140
|
}
|
|
139
141
|
return locationServiceModifiedInput;
|
|
140
142
|
}
|
|
141
|
-
exports.mapSearchOptions = mapSearchOptions;
|
|
142
143
|
function getGeoUserAgent(action) {
|
|
143
144
|
return (0, utils_1.getAmplifyUserAgentObject)({
|
|
144
145
|
category: utils_1.Category.Geo,
|
|
145
146
|
action,
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
|
-
exports.getGeoUserAgent = getGeoUserAgent;
|
|
149
149
|
function getGeoUserAgentString(action) {
|
|
150
150
|
return (0, utils_1.getAmplifyUserAgent)({
|
|
151
151
|
category: utils_1.Category.Geo,
|
|
152
152
|
action,
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
exports.getGeoUserAgentString = getGeoUserAgentString;
|
|
156
155
|
//# sourceMappingURL=util.js.map
|
package/dist/cjs/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../src/util.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getGeoUserAgentString = exports.getGeoUserAgent = exports.mapSearchOptions = exports.validateGeofencesInput = exports.validatePolygon = exports.validateLinearRing = exports.validateGeofenceId = exports.validateCoordinates = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst boolean_clockwise_1 = tslib_1.__importDefault(require(\"@turf/boolean-clockwise\"));\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nfunction validateCoordinates(lng, lat) {\n if (!Number.isFinite(lng) || !Number.isFinite(lat)) {\n throw new Error(`Invalid coordinates: [${lng},${lat}]`);\n }\n if (lat < -90 || lat > 90) {\n throw new Error('Latitude must be between -90 and 90 degrees inclusive.');\n }\n else if (lng < -180 || lng > 180) {\n throw new Error('Longitude must be between -180 and 180 degrees inclusive.');\n }\n}\nexports.validateCoordinates = validateCoordinates;\nfunction validateGeofenceId(geofenceId) {\n const geofenceIdRegex = /^[-._\\p{L}\\p{N}]+$/iu;\n // Check if geofenceId is valid\n if (!geofenceIdRegex.test(geofenceId)) {\n throw new Error(`Invalid geofenceId: '${geofenceId}' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.`);\n }\n}\nexports.validateGeofenceId = validateGeofenceId;\nfunction validateLinearRing(linearRing, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n // Validate LinearRing size, must be at least 4 points\n if (linearRing.length < 4) {\n throw new Error(`${errorPrefix}LinearRing must contain 4 or more coordinates.`);\n }\n // Validate all coordinates are valid, error with which ones are bad\n const badCoordinates = [];\n linearRing.forEach(coordinates => {\n try {\n validateCoordinates(coordinates[0], coordinates[1]);\n }\n catch (error) {\n badCoordinates.push({ coordinates, error: error.message });\n }\n });\n if (badCoordinates.length > 0) {\n throw new Error(`${errorPrefix}One or more of the coordinates in the Polygon LinearRing are not valid: ${JSON.stringify(badCoordinates)}`);\n }\n // Validate first and last coordinates are the same\n const [lngA, latA] = linearRing[0];\n const [lngB, latB] = linearRing[linearRing.length - 1];\n if (lngA !== lngB || latA !== latB) {\n throw new Error(`${errorPrefix}LinearRing's first and last coordinates are not the same`);\n }\n if ((0, boolean_clockwise_1.default)(linearRing)) {\n throw new Error(`${errorPrefix}LinearRing coordinates must be wound counterclockwise`);\n }\n}\nexports.validateLinearRing = validateLinearRing;\nfunction validatePolygon(polygon, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n if (!Array.isArray(polygon)) {\n throw new Error(`${errorPrefix}Polygon is of incorrect structure. It should be an array of LinearRings`);\n }\n if (polygon.length < 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array.`);\n }\n if (polygon.length > 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.`);\n }\n const verticesCount = polygon.reduce((prev, linearRing) => prev + linearRing.length, 0);\n if (verticesCount > 1000) {\n throw new Error(`${errorPrefix}Polygon has more than the maximum 1000 vertices.`);\n }\n polygon.forEach(linearRing => {\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validatePolygon = validatePolygon;\nfunction validateGeofencesInput(geofences) {\n const geofenceIds = {};\n geofences.forEach((geofence) => {\n // verify all required properties are present\n // Validate geofenceId exists\n if (!geofence.geofenceId) {\n throw new Error(`Geofence '${geofence}' is missing geofenceId`);\n }\n const { geofenceId } = geofence;\n validateGeofenceId(geofenceId);\n // Validate geofenceId is unique\n if (geofenceIds[geofenceId]) {\n throw new Error(`Duplicate geofenceId: ${geofenceId}`);\n }\n else {\n geofenceIds[geofenceId] = true;\n }\n // Validate geometry exists\n if (!geofence.geometry) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry`);\n }\n const { geometry } = geofence;\n // Validate polygon exists\n if (!geometry.polygon) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry.polygon`);\n }\n const { polygon } = geometry;\n // Validate polygon length and structure\n try {\n validatePolygon(polygon, geofenceId);\n }\n catch (error) {\n if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {\n throw new Error(`Geofence '${geofenceId}' has more than the maximum of 1000 vertices`);\n }\n }\n // Validate LinearRing length, structure, and coordinates\n const [linearRing] = polygon;\n validateLinearRing(linearRing, geofenceId);\n });\n}\nexports.validateGeofencesInput = validateGeofencesInput;\nfunction mapSearchOptions(options, locationServiceInput) {\n const locationServiceModifiedInput = { ...locationServiceInput };\n locationServiceModifiedInput.FilterCountries = options.countries;\n locationServiceModifiedInput.MaxResults = options.maxResults;\n locationServiceModifiedInput.Language = options.language;\n if (options.searchIndexName) {\n locationServiceModifiedInput.IndexName = options.searchIndexName;\n }\n if (options.biasPosition && options.searchAreaConstraints) {\n throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');\n }\n if (options.biasPosition) {\n locationServiceModifiedInput.BiasPosition = options.biasPosition;\n }\n if (options.searchAreaConstraints) {\n locationServiceModifiedInput.FilterBBox = options.searchAreaConstraints;\n }\n return locationServiceModifiedInput;\n}\nexports.mapSearchOptions = mapSearchOptions;\nfunction getGeoUserAgent(action) {\n return (0, utils_1.getAmplifyUserAgentObject)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nexports.getGeoUserAgent = getGeoUserAgent;\nfunction getGeoUserAgentString(action) {\n return (0, utils_1.getAmplifyUserAgent)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D,QAAQ,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;AACtC,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;AACzC,SAAS,qBAAqB,CAAC,MAAM,EAAE;AACvC,IAAI,OAAO,IAAI,OAAO,CAAC,mBAAmB,EAAE;AAC5C,QAAQ,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;AACtC,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;AACA,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../src/util.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateCoordinates = validateCoordinates;\nexports.validateGeofenceId = validateGeofenceId;\nexports.validateLinearRing = validateLinearRing;\nexports.validatePolygon = validatePolygon;\nexports.validateGeofencesInput = validateGeofencesInput;\nexports.mapSearchOptions = mapSearchOptions;\nexports.getGeoUserAgent = getGeoUserAgent;\nexports.getGeoUserAgentString = getGeoUserAgentString;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst boolean_clockwise_1 = tslib_1.__importDefault(require(\"@turf/boolean-clockwise\"));\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nfunction validateCoordinates(lng, lat) {\n if (!Number.isFinite(lng) || !Number.isFinite(lat)) {\n throw new Error(`Invalid coordinates: [${lng},${lat}]`);\n }\n if (lat < -90 || lat > 90) {\n throw new Error('Latitude must be between -90 and 90 degrees inclusive.');\n }\n else if (lng < -180 || lng > 180) {\n throw new Error('Longitude must be between -180 and 180 degrees inclusive.');\n }\n}\nfunction validateGeofenceId(geofenceId) {\n const geofenceIdRegex = /^[-._\\p{L}\\p{N}]+$/iu;\n // Check if geofenceId is valid\n if (!geofenceIdRegex.test(geofenceId)) {\n throw new Error(`Invalid geofenceId: '${geofenceId}' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.`);\n }\n}\nfunction validateLinearRing(linearRing, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n // Validate LinearRing size, must be at least 4 points\n if (linearRing.length < 4) {\n throw new Error(`${errorPrefix}LinearRing must contain 4 or more coordinates.`);\n }\n // Validate all coordinates are valid, error with which ones are bad\n const badCoordinates = [];\n linearRing.forEach(coordinates => {\n try {\n validateCoordinates(coordinates[0], coordinates[1]);\n }\n catch (error) {\n badCoordinates.push({ coordinates, error: error.message });\n }\n });\n if (badCoordinates.length > 0) {\n throw new Error(`${errorPrefix}One or more of the coordinates in the Polygon LinearRing are not valid: ${JSON.stringify(badCoordinates)}`);\n }\n // Validate first and last coordinates are the same\n const [lngA, latA] = linearRing[0];\n const [lngB, latB] = linearRing[linearRing.length - 1];\n if (lngA !== lngB || latA !== latB) {\n throw new Error(`${errorPrefix}LinearRing's first and last coordinates are not the same`);\n }\n if ((0, boolean_clockwise_1.default)(linearRing)) {\n throw new Error(`${errorPrefix}LinearRing coordinates must be wound counterclockwise`);\n }\n}\nfunction validatePolygon(polygon, geofenceId) {\n const errorPrefix = geofenceId ? `${geofenceId}: ` : '';\n if (!Array.isArray(polygon)) {\n throw new Error(`${errorPrefix}Polygon is of incorrect structure. It should be an array of LinearRings`);\n }\n if (polygon.length < 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array.`);\n }\n if (polygon.length > 1) {\n throw new Error(`${errorPrefix}Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.`);\n }\n const verticesCount = polygon.reduce((prev, linearRing) => prev + linearRing.length, 0);\n if (verticesCount > 1000) {\n throw new Error(`${errorPrefix}Polygon has more than the maximum 1000 vertices.`);\n }\n polygon.forEach(linearRing => {\n validateLinearRing(linearRing, geofenceId);\n });\n}\nfunction validateGeofencesInput(geofences) {\n const geofenceIds = {};\n geofences.forEach((geofence) => {\n // verify all required properties are present\n // Validate geofenceId exists\n if (!geofence.geofenceId) {\n throw new Error(`Geofence '${geofence}' is missing geofenceId`);\n }\n const { geofenceId } = geofence;\n validateGeofenceId(geofenceId);\n // Validate geofenceId is unique\n if (geofenceIds[geofenceId]) {\n throw new Error(`Duplicate geofenceId: ${geofenceId}`);\n }\n else {\n geofenceIds[geofenceId] = true;\n }\n // Validate geometry exists\n if (!geofence.geometry) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry`);\n }\n const { geometry } = geofence;\n // Validate polygon exists\n if (!geometry.polygon) {\n throw new Error(`Geofence '${geofenceId}' is missing geometry.polygon`);\n }\n const { polygon } = geometry;\n // Validate polygon length and structure\n try {\n validatePolygon(polygon, geofenceId);\n }\n catch (error) {\n if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {\n throw new Error(`Geofence '${geofenceId}' has more than the maximum of 1000 vertices`);\n }\n }\n // Validate LinearRing length, structure, and coordinates\n const [linearRing] = polygon;\n validateLinearRing(linearRing, geofenceId);\n });\n}\nfunction mapSearchOptions(options, locationServiceInput) {\n const locationServiceModifiedInput = { ...locationServiceInput };\n locationServiceModifiedInput.FilterCountries = options.countries;\n locationServiceModifiedInput.MaxResults = options.maxResults;\n locationServiceModifiedInput.Language = options.language;\n if (options.searchIndexName) {\n locationServiceModifiedInput.IndexName = options.searchIndexName;\n }\n if (options.biasPosition && options.searchAreaConstraints) {\n throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');\n }\n if (options.biasPosition) {\n locationServiceModifiedInput.BiasPosition = options.biasPosition;\n }\n if (options.searchAreaConstraints) {\n locationServiceModifiedInput.FilterBBox = options.searchAreaConstraints;\n }\n return locationServiceModifiedInput;\n}\nfunction getGeoUserAgent(action) {\n return (0, utils_1.getAmplifyUserAgentObject)({\n category: utils_1.Category.Geo,\n action,\n });\n}\nfunction getGeoUserAgentString(action) {\n return (0, utils_1.getAmplifyUserAgent)({\n category: utils_1.Category.Geo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gitHead": "f2ac9929610f7f878f124083ceaf03465113cd44"
|
|
2
|
+
"name": "@aws-amplify/geo",
|
|
3
|
+
"version": "3.0.81-local-stack.00864ae.0+00864ae",
|
|
4
|
+
"description": "Geo category for aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"typings": "./dist/esm/index.d.ts",
|
|
8
|
+
"react-native": "./dist/cjs/index.js",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./dist/cjs/geo/geo.js",
|
|
14
|
+
"./dist/esm/geo/geo.mjs"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "yarn run lint && jest -w 1 --coverage --logHeapUsage",
|
|
18
|
+
"test:size": "size-limit",
|
|
19
|
+
"build-with-test": "npm test && npm run build",
|
|
20
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
21
|
+
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
|
|
22
|
+
"build:watch": "npm run build:esm-cjs -- --watch",
|
|
23
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
24
|
+
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
25
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
26
|
+
"format": "echo \"Not implemented\"",
|
|
27
|
+
"lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
|
|
28
|
+
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
29
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 84.00"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"react-native": "./dist/cjs/index.js",
|
|
34
|
+
"types": "./dist/esm/index.d.ts",
|
|
35
|
+
"import": "./dist/esm/index.mjs",
|
|
36
|
+
"require": "./dist/cjs/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./location-service": {
|
|
39
|
+
"react-native": "./dist/cjs/providers/location-service/AmazonLocationServiceProvider.js",
|
|
40
|
+
"types": "./dist/esm/providers/location-service/AmazonLocationServiceProvider.d.ts",
|
|
41
|
+
"import": "./dist/esm/providers/location-service/AmazonLocationServiceProvider.mjs",
|
|
42
|
+
"require": "./dist/cjs/providers/location-service/AmazonLocationServiceProvider.js"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"typesVersions": {
|
|
47
|
+
">=4.2": {
|
|
48
|
+
"location-service": [
|
|
49
|
+
"./dist/esm/providers/location-service/AmazonLocationServiceProvider.d.ts"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
56
|
+
},
|
|
57
|
+
"author": "Amazon Web Services",
|
|
58
|
+
"license": "Apache-2.0",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
63
|
+
"files": [
|
|
64
|
+
"dist/cjs",
|
|
65
|
+
"dist/esm",
|
|
66
|
+
"location-service",
|
|
67
|
+
"src"
|
|
68
|
+
],
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@aws-sdk/client-location": "3.621.0",
|
|
71
|
+
"@aws-sdk/types": "3.398.0",
|
|
72
|
+
"@turf/boolean-clockwise": "6.5.0",
|
|
73
|
+
"camelcase-keys": "6.2.2",
|
|
74
|
+
"tslib": "^2.5.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"@aws-amplify/core": "6.11.5-local-stack.00864ae.0+00864ae"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@aws-amplify/core": "6.11.5-local-stack.00864ae.0+00864ae"
|
|
81
|
+
},
|
|
82
|
+
"size-limit": [
|
|
83
|
+
{
|
|
84
|
+
"name": "Geo (top-level class)",
|
|
85
|
+
"path": "./dist/esm/index.mjs",
|
|
86
|
+
"import": "{ Amplify, Geo }",
|
|
87
|
+
"limit": "43.9 kB"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"gitHead": "00864aec571d0509655eea0673e896d69d434972"
|
|
92
91
|
}
|