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

filenamify

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filenamify - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

9

index.d.ts

@@ -11,2 +11,11 @@ declare namespace filenamify {

readonly replacement?: string;
/**
Truncate the filename to the given length.
Systems generally allow up to 255 characters, but we default to 100 for usability reasons.
@default 100
*/
readonly maxLength?: number;
}

@@ -13,0 +22,0 @@ }

2

index.js

@@ -34,3 +34,3 @@ 'use strict';

string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string;
string = string.slice(0, MAX_FILENAME_LENGTH);
string = string.slice(0, typeof options.maxLength === 'number' ? options.maxLength : MAX_FILENAME_LENGTH);

@@ -37,0 +37,0 @@ return string;

{
"name": "filenamify",
"version": "4.0.0",
"version": "4.1.0",
"description": "Convert a string to a valid safe filename",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -51,3 +51,12 @@ # filenamify [![Build Status](https://travis-ci.org/sindresorhus/filenamify.svg?branch=master)](https://travis-ci.org/sindresorhus/filenamify)

##### maxLength
Type: `boolean`<br>
Default: `100`
Truncate the filename to the given length.
Systems generally allow up to 255 characters, but we default to 100 for usability reasons.
## Related

@@ -54,0 +63,0 @@

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