Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@24hr/seqcryptor

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@24hr/seqcryptor - npm Package Compare versions

Comparing version
0.8.10
to
0.8.11
+1
-1
package.json
{
"name": "@24hr/seqcryptor",
"version": "0.8.10",
"version": "0.8.11",
"description": "",

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

@@ -66,3 +66,3 @@ import { DataTypes, Model, Sequelize } from 'sequelize';

it('Can set null to a jsonb even if a default value but allownull is true', async () => {
it('Can set null to a jsonb if allownull is true', async () => {

@@ -72,3 +72,4 @@ const encryptor = seqCryptor('_SUPER_SECRET_KEY_WITH_32_BYTES_');

class User extends Model {
public info!: any;
public info!: any | null;
public info2!: any | null;
public data!: any;

@@ -86,6 +87,10 @@ public guid!: string;

info: encryptor({
allowNull: true,
type: DataTypes.JSONB,
field: 'info',
defaultValue: {},
}),
info2: encryptor({
allowNull: true,
type: DataTypes.JSONB,
field: 'info2',
}),

@@ -105,6 +110,18 @@ data: encryptor({

const user = await User.create({ info: null, data: { foo: 1 }, name: 'bar' });
const userParsed = await User.findOne({ where: { guid: user.guid } });
expect(userParsed!.info).toEqual(null);
const data: any = {};
const payload = {
data: {
foo: 1,
},
name: 'bar',
info: data.info,
};
const user2 = await User.create(payload);
const userParsed2 = await User.findOne({ where: { guid: user2.guid } });
expect(userParsed2!.info).toEqual(null);
expect(userParsed2!.info2).toEqual(null);
});

@@ -111,0 +128,0 @@