Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firestore-rest

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firestore-rest - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

index.js
const { google } = require('googleapis')
const { convert } = require('firestore-adapter')
const firestore = google.firestore('v1')

@@ -7,6 +8,14 @@

/**
* Processes the item for compatibility with the existing Firestore API
*
* @param {Object} item - the item to be processed, which is a single document
*/
const processItem = (item) => {
// we need to inject the `id` and the `data()` method to make it compatible with existing API
const id = item.name.match(regex)[0]
const data = () => item.fields
// normalize data from typed values into usable values
// https://cloud.google.com/firestore/docs/reference/rest/v1/Value
const data = () => convert(item.fields)
return {

@@ -47,5 +56,2 @@ id,

// reset path state
this.path = ''
let result

@@ -52,0 +58,0 @@ try {

{
"name": "firestore-rest",
"version": "1.0.1",
"version": "1.0.2",
"description": "Makes firestore requests using the Google REST API to avoid the gRPC cold start issue.",

@@ -27,4 +27,5 @@ "main": "index.js",

"dependencies": {
"firestore-adapter": "^1.0.6",
"googleapis": "^37.2.0"
}
}

@@ -75,3 +75,3 @@ # Firestore REST

const response = await db.collection('users').doc('12312312421321').get()
console.log(response)
console.info(response)
} catch (err) {

@@ -78,0 +78,0 @@ console.error(err)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc