Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-lambda-powertools/metrics

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-lambda-powertools/metrics - npm Package Compare versions

Comparing version 2.12.0 to 2.13.0

8

lib/cjs/Metrics.js

@@ -5,3 +5,2 @@ "use strict";

const node_console_1 = require("node:console");
const types_1 = require("node:util/types");
const commons_1 = require("@aws-lambda-powertools/commons");

@@ -903,6 +902,7 @@ const EnvironmentVariablesService_js_1 = require("./config/EnvironmentVariablesService.js");

#validateEmfTimestamp(timestamp) {
if (!(0, types_1.isDate)(timestamp) && !(0, commons_1.isIntegerNumber)(timestamp)) {
const isDate = timestamp instanceof Date;
if (!isDate && !(0, commons_1.isIntegerNumber)(timestamp)) {
return false;
}
const timestampMs = (0, types_1.isDate)(timestamp) ? timestamp.getTime() : timestamp;
const timestampMs = isDate ? timestamp.getTime() : timestamp;
const currentTime = new Date().getTime();

@@ -923,3 +923,3 @@ const minValidTimestamp = currentTime - constants_js_1.EMF_MAX_TIMESTAMP_PAST_AGE;

}
if ((0, types_1.isDate)(timestamp)) {
if (timestamp instanceof Date) {
return timestamp.getTime();

@@ -926,0 +926,0 @@ }

import { Console } from 'node:console';
import { isDate } from 'node:util/types';
import { Utility, isIntegerNumber } from '@aws-lambda-powertools/commons';

@@ -899,6 +898,7 @@ import { EnvironmentVariablesService } from './config/EnvironmentVariablesService.js';

#validateEmfTimestamp(timestamp) {
if (!isDate(timestamp) && !isIntegerNumber(timestamp)) {
const isDate = timestamp instanceof Date;
if (!isDate && !isIntegerNumber(timestamp)) {
return false;
}
const timestampMs = isDate(timestamp) ? timestamp.getTime() : timestamp;
const timestampMs = isDate ? timestamp.getTime() : timestamp;
const currentTime = new Date().getTime();

@@ -919,3 +919,3 @@ const minValidTimestamp = currentTime - EMF_MAX_TIMESTAMP_PAST_AGE;

}
if (isDate(timestamp)) {
if (timestamp instanceof Date) {
return timestamp.getTime();

@@ -922,0 +922,0 @@ }

{
"name": "@aws-lambda-powertools/metrics",
"version": "2.12.0",
"version": "2.13.0",
"description": "The metrics package for the Powertools for AWS Lambda (TypeScript) library",

@@ -27,3 +27,3 @@ "author": {

"dependencies": {
"@aws-lambda-powertools/commons": "^2.12.0"
"@aws-lambda-powertools/commons": "^2.13.0"
},

@@ -30,0 +30,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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