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

@ipbyrne/mongo-encrypted-query

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipbyrne/mongo-encrypted-query - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json

@@ -6,3 +6,3 @@ {

"license": "Apache-2.0",
"version": "0.0.6",
"version": "0.0.7",
"main": "dist/index.js",

@@ -9,0 +9,0 @@ "typings": "dist/index.d.ts",

@@ -6,3 +6,3 @@ import {

} from "./utils";
import { decrypt, generate } from "./cipher/cipher";
import { decrypt, encrypt, generate } from "./cipher/cipher";
import { PrivateKeyJwk, Data } from "./types";

@@ -16,8 +16,22 @@ import * as Types from "./types";

export const encryptData = (data: Data, privateKeyJwk: PrivateKeyJwk) => {
const encryptedData = createEncryptedObject(data, privateKeyJwk);
return encryptedData;
export const encryptData = (
data: Data | any,
privateKeyJwk: PrivateKeyJwk
): any => {
const type = typeof data;
if (Array.isArray(data)) {
return data.map((d: any) => encryptData(d, privateKeyJwk));
}
if (type === "object") {
const encryptedData = createEncryptedObject(data, privateKeyJwk);
return encryptedData;
}
return encrypt(data, privateKeyJwk as PrivateKeyJwk);
};
export const decryptData = (data: any, privateKeyJwk: PrivateKeyJwk): any => {
export const decryptData = (
data: Data | any,
privateKeyJwk: PrivateKeyJwk
): any => {
const type = typeof data;

@@ -24,0 +38,0 @@ if (Array.isArray(data)) {

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