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

csvnorm

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvnorm - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

binary/tests/dates.d.ts

12

binary/source/formatDate.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const formatToPattern = new Map([
['yyyy-mm-dd', {
regex: /^[0-9]{4}-[01][0-9]-[0-3][0-9]$/,
replacement: '',
}],
['mm/dd/yyyy', {

@@ -30,5 +34,2 @@ regex: /^([01][0-9])\/([0-3][0-9])\/([0-9]{4})$/,

exports.default = (value, dateFormat, isoDatetime = false) => {
if (typeof value !== 'string') {
return undefined;
}
const emptyPattern = { regex: / /, replacement: '' };

@@ -57,2 +58,7 @@ let pattern;

}
// Don't change formatting if it is already formatted as ISO8601
pattern = formatToPattern.get('yyyy-mm-dd') || emptyPattern;
if (pattern.regex.test(value)) {
return value;
}
if (isoDatetime) {

@@ -59,0 +65,0 @@ const isoRegex = new RegExp([

{
"name": "csvnorm",
"version": "0.9.0",
"version": "0.9.1",
"description": "Command line tool to normalize CSV and *SV files.",

@@ -5,0 +5,0 @@ "main": "binary/source/index.js",

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