Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
instance.registerVersion(name, version, 'node');
if (isNodeSdk()) {
module.exports = Object.assign({}, namespace, { initStandalone });
}
}
try {
// If @firebase/app is not present, skip registering database.
// It could happen when this package is used in firebase-admin which doesn't depend on @firebase/app.
// Previously firebase-admin depends on @firebase/app, which causes version conflict on
// @firebase/app when used together with the js sdk. More detail:
// https://github.com/firebase/firebase-js-sdk/issues/1696#issuecomment-501546596
// eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
const firebase = require('@firebase/app').default;
registerDatabase(firebase);
} catch (err) {
// catch and ignore 'MODULE_NOT_FOUND' error in firebase-admin context
// we can safely ignore this error because RTDB in firebase-admin works without @firebase/app
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
}
// Types to export for the admin SDK
export { Database, Query, Reference, enableLogging, ServerValue };
export { DataSnapshot } from './src/api/DataSnapshot';
export { OnDisconnect } from './src/api/onDisconnect';
declare module '@firebase/app-types' {
const firebase = require('@firebase/app').default;
require('@firebase/database');
var moment = require('moment');
var extend = require('extend');
var url = require('url');
var he = require('he');
firebase.initializeApp({
databaseURL: 'https://hacker-news.firebaseio.com',
});
var hn = firebase.database().ref('/v0');
var hnRecentItems = hn.child('updates/items');
var typeMapping = {
story: 'link'
};