@clipmx/lambda-utils
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -17,2 +17,3 @@ /** | ||
static objectMap: (obj: object, fn: (currentItem: string, key: string, obj: object) => any) => object; | ||
static parseDate: (data: string) => string; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const validator_1 = require("validator"); | ||
const TypeGuards_1 = require("../TypeGuards"); | ||
@@ -40,3 +41,10 @@ /** | ||
}; | ||
Helpers.parseDate = (data) => { | ||
if (!TypeGuards_1.default.isDefined(data) | ||
|| !validator_1.isISO8601(data)) { | ||
return null; | ||
} | ||
return new Date(data).toISOString(); | ||
}; | ||
exports.default = Helpers; | ||
//# sourceMappingURL=index.js.map |
@@ -11,5 +11,5 @@ export * from './models'; | ||
export { default as TypeGuards } from './core/TypeGuards'; | ||
export { default as Logger } from './core/logger'; | ||
export { default as Logger } from './core/Logger'; | ||
export { KinesisStreamEvent, KinesisStreamRecord, KinesisStreamRecordPayload } from 'aws-lambda'; | ||
export { DynamoDB } from 'aws-sdk/clients/all'; | ||
export { DocumentClient } from 'aws-sdk/lib/dynamodb/document_client'; |
@@ -25,4 +25,4 @@ "use strict"; | ||
exports.TypeGuards = TypeGuards_1.default; | ||
var logger_1 = require("./core/logger"); | ||
exports.Logger = logger_1.default; | ||
var Logger_1 = require("./core/Logger"); | ||
exports.Logger = Logger_1.default; | ||
var all_1 = require("aws-sdk/clients/all"); | ||
@@ -29,0 +29,0 @@ exports.DynamoDB = all_1.DynamoDB; |
{ | ||
"name": "@clipmx/lambda-utils", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Common helpers for Node Lambdas", | ||
@@ -23,2 +23,5 @@ "main": "dist/index.js", | ||
], | ||
"engines": { | ||
"node": "^8.10.0" | ||
}, | ||
"devDependencies": { | ||
@@ -56,4 +59,5 @@ "@types/amqplib": "^0.5.7", | ||
"uuid": "^3.2.1", | ||
"validator": "^10.8.0", | ||
"winston": "^3.0.0-rc5" | ||
} | ||
} |
@@ -11,10 +11,10 @@ # Node Lambda Utils | ||
Refer to the [API docs](http://github.clip.mx/node.lambda-utils/) for usage examples | ||
Refer to the [API docs](https://lambda-utils.payclip.com) for usage examples | ||
## Technologies Used | ||
* [TypeScript](https://www.typescriptlang.org/docs/home.html) | ||
* [Jest](https://facebook.github.io/jest/) for testing | ||
* [Sinon](http://sinonjs.org/) for test mocks | ||
* [TypeDoc](http://typedoc.org/) for auto-generated documentation | ||
- [TypeScript](https://www.typescriptlang.org/docs/home.html) | ||
- [Jest](https://facebook.github.io/jest/) for testing | ||
- [Sinon](http://sinonjs.org/) for test mocks | ||
- [TypeDoc](http://typedoc.org/) for auto-generated documentation | ||
@@ -44,12 +44,12 @@ ## Contributing | ||
* [TypeScript Deep Dive](https://basarat.gitbooks.io/typescript/content/docs/getting-started.html) | ||
* [TypeScript Docs](https://www.typescriptlang.org/docs/home.html) | ||
- [TypeScript Deep Dive](https://basarat.gitbooks.io/typescript/content/docs/getting-started.html) | ||
- [TypeScript Docs](https://www.typescriptlang.org/docs/home.html) | ||
## Publishing | ||
1. Create a release branch off of master. | ||
2. Rebuild docs `npm run build:docs` | ||
3. Commit all changes | ||
4. `npm version [major|minor|patch]` | ||
5. Create a pull request for release branch | ||
6. `npm publish --access public` | ||
1. Create a release branch off of master. | ||
2. Rebuild docs `npm run build:docs` | ||
3. Commit all changes | ||
4. `npm version [major|minor|patch]` | ||
5. Create a pull request for release branch | ||
6. `npm publish --access public` |
@@ -1,8 +0,5 @@ | ||
import * as winston from 'winston'; | ||
import { default as Logger } from '.'; | ||
describe('core/logger', () => { | ||
describe('core/Logger', () => { | ||
describe('create', () => { | ||
it('creates a silly level logger when using and invalid parameter', () => { | ||
@@ -34,5 +31,3 @@ expect(Logger.create('')).toMatchObject({ level: 'silly' }); | ||
}); | ||
}); | ||
}); |
@@ -11,3 +11,3 @@ export * from './models'; | ||
export { default as TypeGuards } from './core/TypeGuards'; | ||
export { default as Logger } from './core/logger'; | ||
export { default as Logger } from './core/Logger'; | ||
@@ -14,0 +14,0 @@ // external library types |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
158151
3466
5
1
+ Addedvalidator@^10.8.0
+ Addedpossible-typed-array-names@1.1.0(transitive)
+ Addedvalidator@10.11.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)