🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fire-entity

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fire-entity - npm Package Compare versions

Comparing version

to
0.5.0

1

dist/entity.d.ts

@@ -14,1 +14,2 @@ export interface EntitySystemProps {

}
export declare const EntityAttributes: string[];

@@ -0,1 +1,7 @@

export const EntityAttributes = [
'id',
'type',
'path',
'parentPath'
];
//# sourceMappingURL=entity.js.map

@@ -0,2 +1,3 @@

export * from './entity';
export * from './store';
//# sourceMappingURL=index.js.map

@@ -22,2 +22,3 @@ import * as firebase from 'firebase/app';

delete<T extends Entity>(entity: T): Promise<void>;
update<T extends Entity>(entity: T): Promise<void>;
}
import * as tslib_1 from "tslib";
import 'firebase/firestore';
import { Subject } from 'rxjs';
import { EntityAttributes } from './entity';
import { convertFirestoreTimestamps } from './util';

@@ -32,4 +33,8 @@ function extractEntity(snap) {

}
function prepareDocumentInsert(data) {
return Object.assign({}, data, { lastUpdated: new Date() });
function prepareDocumentData(data) {
data = Object.assign({}, data, { lastUpdated: new Date() });
for (const attr of EntityAttributes) {
delete data[attr];
}
return data;
}

@@ -45,3 +50,3 @@ export class EntityStore {

const collectionPath = getCollectionPath(insert);
const preparedData = prepareDocumentInsert(data);
const preparedData = prepareDocumentData(data);
yield this.collection(collectionPath).add(preparedData);

@@ -74,3 +79,8 @@ return undefined;

}
update(entity) {
const path = entity.path;
const data = prepareDocumentData(entity);
return this.doc(path).update(data);
}
}
//# sourceMappingURL=store.js.map

2

package.json
{
"name": "fire-entity",
"version": "0.4.0",
"version": "0.5.0",
"description": "Allows for storing and retrieving documents in a standardized format from Firestore.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet