@xapp/dynamo-service
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -5,2 +5,11 @@ # Changelog | ||
### [0.2.3](https://github.com/XappMedia/dynamo-service/compare/v0.2.2...v0.2.3) (2019-06-11) | ||
### Bug Fixes | ||
* Adding DateFormat ([056d542](https://github.com/XappMedia/dynamo-service/commit/056d542)) | ||
### [0.2.2](https://github.com/XappMedia/dynamo-service/compare/v0.2.1...v0.2.2) (2019-06-07) | ||
@@ -7,0 +16,0 @@ |
@@ -36,6 +36,11 @@ export declare type DynamoType = "S" | "N" | "M" | "L" | "BOOL"; | ||
export interface NormalMapAttribute<DataType = unknown> { | ||
type: DynamoType; | ||
type: DynamoType | StentorType; | ||
required?: boolean; | ||
constant?: boolean; | ||
process?: Processor<DataType>; | ||
} | ||
export interface DateMapAttribute extends NormalMapAttribute { | ||
type: "Date"; | ||
dateFormat?: DateFormat; | ||
} | ||
export interface StringMapAttribute extends NormalMapAttribute<string> { | ||
@@ -46,2 +51,3 @@ type: "S"; | ||
enum?: string[]; | ||
slugify?: boolean | SlugifyParams; | ||
} | ||
@@ -53,3 +59,3 @@ export interface MapMapAttribute extends NormalMapAttribute { | ||
} | ||
export declare type MapAttribute = NormalMapAttribute; | ||
export declare type MapAttribute = NormalMapAttribute | DateMapAttribute | StringMapAttribute | MapMapAttribute; | ||
export interface MapAttributes { | ||
@@ -66,4 +72,6 @@ [attribute: string]: MapAttribute; | ||
export declare function isDynamoStringSchema(v: KeySchema): v is DynamoStringSchema; | ||
export declare function isDateSchema(v: KeySchema): v is DateSchema; | ||
export declare function isMapSchema(v: KeySchema): v is MapSchema; | ||
export declare function isStringMapAttribute(v: MapAttribute): v is StringMapAttribute; | ||
export declare function isMapMapAttribute(v: MapAttribute): v is MapMapAttribute; | ||
export declare function isDateMapAttribute(v: MapAttribute): v is DateMapAttribute; |
@@ -7,2 +7,6 @@ "use strict"; | ||
exports.isDynamoStringSchema = isDynamoStringSchema; | ||
function isDateSchema(v) { | ||
return v.type === "Date"; | ||
} | ||
exports.isDateSchema = isDateSchema; | ||
function isMapSchema(v) { | ||
@@ -20,1 +24,5 @@ return v.type === "M"; | ||
exports.isMapMapAttribute = isMapMapAttribute; | ||
function isDateMapAttribute(v) { | ||
return v.type === "Date"; | ||
} | ||
exports.isDateMapAttribute = isDateMapAttribute; |
@@ -18,3 +18,3 @@ "use strict"; | ||
function getConverter(schema) { | ||
if (schema.type === "Date") { | ||
if (KeySchema_1.isDateSchema(schema) || KeySchema_1.isDateMapAttribute(schema)) { | ||
return schema.dateFormat === "Timestamp" ? Converters_1.toTimestamp : Converters_1.toIso; | ||
@@ -73,3 +73,3 @@ } | ||
} | ||
if (KeySchema_1.isDynamoStringSchema(v)) { | ||
if (KeySchema_1.isStringMapAttribute(v)) { | ||
if (v.slugify) { | ||
@@ -76,0 +76,0 @@ this.slugKeys[key] = v.slugify; |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
252196
6195