Skip to content

Commit 2c99073

Browse files
committed
fix and run snippets
1 parent ceccaf3 commit 2c99073

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"type": "module",
55
"scripts": {
6-
"snippets": "rimraf snippets && ts-node scripts/separate-snippets.ts",
6+
"snippets": "rimraf snippets && node --loader ts-node/esm scripts/separate-snippets.ts",
77
"lint": "git ls-files | grep -v 'snippets/' | grep '.js$' | xargs npx eslint",
88
"format": "npm run lint -- --fix",
99
"bootstrap": "find . -type f -name package.json -not -path '*/node_modules/*' -exec bash -c 'cd $(dirname {}) && npm install' \\;",

scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "scripts",
33
"version": "1.0.0",
4+
"type": "module",
45
"description": "Internal repo scripts",
56
"scripts": {
67
},

snippets/firestore-next/test-firestore/array_contains_any_filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import { query, where } from "firebase/firestore";
99

1010
const q = query(citiesRef,
11-
where('regions', 'array-contains-any', ['west_coast', 'east_coast']));
11+
where('regions', 'array-contains-any', [['west_coast'], ['east_coast']]));
1212
// [END array_contains_any_filter_modular]

snippets/firestore-next/test-firestore/or_query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// 'npm run snippets'.
66

77
// [START or_query_modular]
8-
const query = query(collection(db, "cities"), and(
9-
where('name', '>', 'L'),
8+
const q = query(collection(db, "cities"), and(
9+
where('state', '==', 'CA'),
1010
or(
1111
where('capital', '==', true),
1212
where('population', '>=', 1000000)

snippets/firestore-next/test-solution-geoqueries/fs_geo_query_hashes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const radiusInM = 50 * 1000;
1414
// Each item in 'bounds' represents a startAt/endAt pair. We have to issue
1515
// a separate query for each pair. There can be up to 9 pairs of bounds
1616
// depending on overlap, but in most cases there are 4.
17+
// @ts-ignore
1718
const bounds = geofire.geohashQueryBounds(center, radiusInM);
1819
const promises = [];
1920
for (const b of bounds) {
@@ -37,6 +38,7 @@ for (const snap of snapshots) {
3738

3839
// We have to filter out a few false positives due to GeoHash
3940
// accuracy, but most will match
41+
// @ts-ignore
4042
const distanceInKm = geofire.distanceBetween([lat, lng], center);
4143
const distanceInM = distanceInKm * 1000;
4244
if (distanceInM <= radiusInM) {

0 commit comments

Comments
 (0)