Socket
Socket
Sign inDemoInstall

dynamoose

Package Overview
Dependencies
Maintainers
2
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamoose - npm Package Compare versions

Comparing version 3.0.0-beta.5 to 3.0.0-beta.6

README.md

2

dist/aws/ddb/index.d.ts

@@ -6,4 +6,4 @@ import * as DynamoDB from "@aws-sdk/client-dynamodb";

revert: () => void;
local: (endpoint: string) => void;
local: (endpoint?: string) => void;
}
export default function (): DDBInterface;

@@ -12,3 +12,3 @@ import { Model } from "./Model";

overwrite?: boolean;
return?: "request" | "Item";
return?: "request" | "item";
condition?: Condition;

@@ -83,2 +83,20 @@ }

toJSON(): ObjectType;
/**
* This method will return a promise containing an object of the item that includes default values for any undefined values in the item.
*
* ```js
* const schema = new Schema({
* "id": String,
* "data": {
* "type": String,
* "default": "Hello World"
* }
* });
* const User = dynamoose.model("User", schema);
* const user = new User({"id": 1});
* console.log(await user.withDefaults()); // {"id": 1, "data": "Hello World"}
* ```
* @returns Promise<Object>
*/
withDefaults(): Promise<ObjectType>;
serialize(nameOrOptions?: SerializerOptions | string): ObjectType;

@@ -85,0 +103,0 @@ /**

@@ -112,2 +112,26 @@ "use strict";

}
/**
* This method will return a promise containing an object of the item that includes default values for any undefined values in the item.
*
* ```js
* const schema = new Schema({
* "id": String,
* "data": {
* "type": String,
* "default": "Hello World"
* }
* });
* const User = dynamoose.model("User", schema);
* const user = new User({"id": 1});
* console.log(await user.withDefaults()); // {"id": 1, "data": "Hello World"}
* ```
* @returns Promise<Object>
*/
async withDefaults() {
return Item.objectFromSchema(utils_1.default.deep_copy(this.toJSON()), this.getInternalProperties(internalProperties).model, {
"typeCheck": false,
"defaults": true,
"type": "toDynamo"
});
}
// Serializer

@@ -114,0 +138,0 @@ serialize(nameOrOptions) {

@@ -7,3 +7,3 @@ import * as DynamoDB from "@aws-sdk/client-dynamodb";

revert: () => void;
local: (endpoint: string) => void;
local: (endpoint?: string) => void;
}

@@ -10,0 +10,0 @@

@@ -25,3 +25,3 @@ import awsConverter from "./aws/converter";

overwrite?: boolean;
return?: "request" | "Item";
return?: "request" | "item";
condition?: Condition;

@@ -155,2 +155,27 @@ }

/**
* This method will return a promise containing an object of the item that includes default values for any undefined values in the item.
*
* ```js
* const schema = new Schema({
* "id": String,
* "data": {
* "type": String,
* "default": "Hello World"
* }
* });
* const User = dynamoose.model("User", schema);
* const user = new User({"id": 1});
* console.log(await user.withDefaults()); // {"id": 1, "data": "Hello World"}
* ```
* @returns Promise<Object>
*/
async withDefaults (): Promise<ObjectType> {
return Item.objectFromSchema(utils.deep_copy(this.toJSON()), this.getInternalProperties(internalProperties).model, {
"typeCheck": false,
"defaults": true,
"type": "toDynamo"
});
}
// Serializer

@@ -157,0 +182,0 @@ serialize (nameOrOptions?: SerializerOptions | string): ObjectType {

{
"name": "dynamoose",
"version": "3.0.0-beta.5",
"version": "3.0.0-beta.6",
"description": "Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)",

@@ -28,9 +28,9 @@ "homepage": "https://dynamoosejs.com",

"dependencies": {
"@aws-sdk/client-dynamodb": "^3.49.0",
"@aws-sdk/util-dynamodb": "^3.49.0",
"dynamoose-utils": "^3.0.0-beta.5",
"@aws-sdk/client-dynamodb": "^3.105.0",
"@aws-sdk/util-dynamodb": "^3.105.0",
"dynamoose-utils": "^3.0.0-beta.6",
"js-object-utilities": "^2.1.0"
},
"devDependencies": {
"dynamoose-logger": "^3.0.0-beta.5"
"dynamoose-logger": "^3.0.0-beta.6"
},

@@ -48,3 +48,3 @@ "license": "Unlicense",

],
"gitHead": "cb548e4c2581483ceeef95c86cfc2d75475db527"
"gitHead": "ff510fc881ddf3b4127e29d0f05b6628f5615acc"
}

@@ -25,2 +25,4 @@ /* eslint @typescript-eslint/no-unused-vars: 0 */

const shouldPassCreateWithNoReturnSetting = model.create({"id": 1}, {"overwrite": true});
const shouldPassCreateWithReturnRequest = model.create({"id": 1}, {"return": "request"});
const shouldPassCreateWithReturnItem = model.create({"id": 1}, {"return": "item"});
const shouldPassGetWithNoReturnSetting = model.get({"id": 1}, {"attributes": ["something"]});

@@ -50,2 +52,5 @@ const shouldPassDeleteWithNoReturnSetting = model.delete({"id": 1}, {"condition": new dynamoose.Condition("name").eq("Charlie")});

// @ts-expect-error
const shouldFailWithInvalidReturnType = model.create({"id": 1}, {"return": "invalid-return-type"});
// @ts-expect-error
const shouldFailWithInvalidTransaction = model.transaction.notValid();

@@ -52,0 +57,0 @@

Sorry, the diff of this file is too big to display

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