Skip to content

Commit

Permalink
Merge pull request #52 from dalenguyen/dev
Browse files Browse the repository at this point in the history
Added support for nested geo #47
  • Loading branch information
Dale Nguyen authored May 26, 2020
2 parents 233fa7e + 32e2089 commit b973580
Show file tree
Hide file tree
Showing 18 changed files with 350 additions and 202 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ typings/
.env

# test folder
test/serviceAccountKey.json
test/serviceAccountKey.json
.idea
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
---

## [0.6.0] - 2020-05-26

#### - :nail_care: [Polish]

- Updated new pacakges
- Added support for nested geo #47

## [0.5.0] - 2020-04-05

#### - :nail_care: [Polish]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ firebase firestore:delete [options] <<path>>
#### For local JSON
Usually the date, location & reference is not converted correctly when you backup the Firestore database. In order to import correctly, you have to pass to parameters for the options:
Usually the date, location & reference are not converted correctly when you backup the Firestore database. In order to import correctly, you have to pass to parameters for the options:
```javascript
// Import options
const options = {
dates: ['date1', 'date1.date2', 'date1.date2.date3'],
geos: ['location', 'locations'],
refs: ['refKey'],
nested: true // look up the data keys also in nested maps
};
```
Expand Down
20 changes: 20 additions & 0 deletions dist/helper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface IImportOptions {
dates?: string[];
geos?: string[];
refs?: string[];
}
/**
* Convert time array in a Date object
* @param firebaseTimestamp
*/
export declare const makeTime: (firebaseTimestamp: {
_seconds: number;
_nanoseconds: number;
}) => Date;
/**
* Traverse given data, until there is no sub node anymore
* Executes the callback function for every sub node found
* @param data
* @param callback
*/
export declare const traverseObjects: (data: any, callback: Function) => void;
40 changes: 40 additions & 0 deletions dist/helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions dist/import.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export interface IImportOptions {
dates?: string[];
geos?: string[];
refs?: string[];
}
import { IImportOptions } from './helper';
/**
* Restore data to firestore
*
Expand Down
20 changes: 12 additions & 8 deletions dist/import.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b973580

Please sign in to comment.