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

hexo-fs

Package Overview
Dependencies
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-fs - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

17

lib/fs.js

@@ -450,10 +450,17 @@ 'use strict';

const base = basename(path, ext);
const regex = new RegExp(`^${escapeRegExp(base)}-(\\d+)${escapeRegExp(ext)}$`);
const regex = new RegExp(`^${escapeRegExp(base)}(?:-(\\d+))?${escapeRegExp(ext)}$`);
let num = -1;
const num = files.reduce((_num, item) => {
const match = regex.exec(item);
for (let i = 0, len = files.length; i < len; i++) {
const item = files[i];
if (!regex.test(item)) continue;
return match != null ? Math.max(parseInt(match[1], 10), _num) : _num;
}, -1);
const match = item.match(regex);
const matchNum = match[1] ? parseInt(match[1], 10) : 0;
if (matchNum > num) {
num = matchNum;
}
}
return join(dirname(path), `${base}-${num + 1}${ext}`);

@@ -460,0 +467,0 @@ }

{
"name": "hexo-fs",
"version": "1.0.1",
"version": "1.0.2",
"description": "File system module for Hexo.",

@@ -5,0 +5,0 @@ "main": "lib/fs",

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