Socket
Socket
Sign inDemoInstall

luxon

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luxon - npm Package Compare versions

Comparing version 1.22.2 to 1.23.0

12

changelog.md
# Changelog
## 1.23.0
* Allow minus sign prefix when creating Duration from ISO
# 1.22.2
* Added more details to error messages for type errors
# 1.22.1
* Added support for ISO basic format to DateTime#toISO
## 1.22.0

@@ -4,0 +16,0 @@

2

package.json
{
"name": "luxon",
"version": "1.22.2",
"version": "1.23.0",
"description": "Immutable date wrapper",

@@ -5,0 +5,0 @@ "author": "Isaac Cambron",

@@ -123,7 +123,7 @@ import {

const isoDuration = /^P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
function extractISODuration(match) {
const [
,
s,
yearStr,

@@ -139,12 +139,16 @@ monthStr,

const hasNegativePrefix = s[0] === "-";
const maybeNegate = num => (num && hasNegativePrefix ? -num : num);
return [
{
years: parseInteger(yearStr),
months: parseInteger(monthStr),
weeks: parseInteger(weekStr),
days: parseInteger(dayStr),
hours: parseInteger(hourStr),
minutes: parseInteger(minuteStr),
seconds: parseInteger(secondStr),
milliseconds: parseMillis(millisecondsStr)
years: maybeNegate(parseInteger(yearStr)),
months: maybeNegate(parseInteger(monthStr)),
weeks: maybeNegate(parseInteger(weekStr)),
days: maybeNegate(parseInteger(dayStr)),
hours: maybeNegate(parseInteger(hourStr)),
minutes: maybeNegate(parseInteger(minuteStr)),
seconds: maybeNegate(parseInteger(secondStr)),
milliseconds: maybeNegate(parseMillis(millisecondsStr))
}

@@ -151,0 +155,0 @@ ];

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

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