Socket
Socket
Sign inDemoInstall

nedb-async

Package Overview
Dependencies
106
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

6

dist/index.d.ts
import * as Nedb from "nedb";
export default class AsyncNedb extends Nedb {
constructor(pathOrOptions?: string | Nedb.DataStoreOptions | undefined);
asyncFind<T>(query: any, projection?: T): Promise<{}>;
asyncCount(): Promise<{}>;
asyncFindOne<T>(query: any, projection?: T): Promise<{}>;
asyncFind<T>(query: any, projection?: T): Promise<T[]>;
asyncCount(): Promise<{} | {}[]>;
asyncFindOne<T>(query: any, projection?: T): Promise<T>;
asyncInsert(): Promise<{}>;

@@ -8,0 +8,0 @@ asyncUpdate(query: any, updateQuery: any, options?: Nedb.UpdateOptions): Promise<{}>;

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

export declare const promisefy: (name: string, _arg: IArguments) => Promise<{}>;
export declare function promisefy<T>(name: string, _arg: IArguments): Promise<T[] | T>;
export declare function justPromise(name: string, arg: IArguments): Promise<{}>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.promisefy = function (name, _arg) {
function promisefy(name, _arg) {
return new Promise((rs, rj) => {

@@ -65,3 +65,4 @@ /**

});
};
}
exports.promisefy = promisefy;
function justPromise(name, arg) {

@@ -68,0 +69,0 @@ return new Promise((rs, rj) => {

@@ -9,3 +9,3 @@ import * as Nedb from "nedb";

public asyncFind<T>(query: any, projection?: T) {
return promisefy.call(this, 'find', arguments)
return promisefy.call(this, 'find', arguments) as Promise<T[]>
}

@@ -16,3 +16,3 @@ asyncCount() {

asyncFindOne<T>(query: any, projection?: T) {
return promisefy.call(this, 'findOne', arguments)
return promisefy.call(this, 'findOne', arguments) as Promise<T>
}

@@ -26,3 +26,3 @@ asyncInsert() {

asyncRemove() {
return justPromise.call(this, 'remove', arguments)
return justPromise.call(this, 'remove', arguments)
}

@@ -29,0 +29,0 @@ asyncEnsureIndex() {

{
"name": "nedb-async",
"version": "0.0.6",
"version": "0.0.7",
"description": "Promise wrapper for Nedb that makes it possible to use all Nedb all cursor modifiers.",

@@ -5,0 +5,0 @@ "repository": {

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

export const promisefy = function (name: string, _arg:IArguments) {
export function promisefy<T>(name: string, _arg:IArguments):Promise<T[]|T> {
return new Promise((rs, rj) => {

@@ -3,0 +3,0 @@ /**

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc