@aws-lambda-powertools/parser
Advanced tools
Comparing version
@@ -70,8 +70,7 @@ "use strict"; | ||
return (_target, _propertyKey, descriptor) => { | ||
// biome-ignore lint/style/noNonNullAssertion: The descriptor.value is the method this decorator decorates, it cannot be undefined. | ||
const original = descriptor.value; | ||
const { schema, envelope, safeParse } = options; | ||
descriptor.value = async function (event, context, callback) { | ||
const parsedEvent = (0, parser_js_1.parse)(event, envelope, schema, safeParse); | ||
return original.call(this, parsedEvent, context, callback); | ||
descriptor.value = async function (...args) { | ||
const parsedEvent = (0, parser_js_1.parse)(args[0], envelope, schema, safeParse); | ||
return original.apply(this, [parsedEvent, ...args.slice(1)]); | ||
}; | ||
@@ -78,0 +77,0 @@ return descriptor; |
@@ -67,8 +67,7 @@ import { parse } from './parser.js'; | ||
return (_target, _propertyKey, descriptor) => { | ||
// biome-ignore lint/style/noNonNullAssertion: The descriptor.value is the method this decorator decorates, it cannot be undefined. | ||
const original = descriptor.value; | ||
const { schema, envelope, safeParse } = options; | ||
descriptor.value = async function (event, context, callback) { | ||
const parsedEvent = parse(event, envelope, schema, safeParse); | ||
return original.call(this, parsedEvent, context, callback); | ||
descriptor.value = async function (...args) { | ||
const parsedEvent = parse(args[0], envelope, schema, safeParse); | ||
return original.apply(this, [parsedEvent, ...args.slice(1)]); | ||
}; | ||
@@ -75,0 +74,0 @@ return descriptor; |
{ | ||
"name": "@aws-lambda-powertools/parser", | ||
"version": "2.25.1", | ||
"version": "2.25.2", | ||
"description": "The parser package for the Powertools for AWS Lambda (TypeScript) library.", | ||
@@ -35,3 +35,3 @@ "author": { | ||
"dependencies": { | ||
"@aws-lambda-powertools/commons": "2.25.1", | ||
"@aws-lambda-powertools/commons": "2.25.2", | ||
"@standard-schema/spec": "^1.0.0" | ||
@@ -38,0 +38,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
871254
-0.04%20366
-0.01%+ Added
- Removed