Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@11ty/recursive-copy

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@11ty/recursive-copy - npm Package Compare versions

Comparing version
4.0.3
to
5.0.0
+69
lib/maximatch.js
var minimatch = require("minimatch");
// via https://github.com/sindresorhus/array-union (MIT license)
function arrayUnion(...args) {
return [...new Set(args.flat())];
}
// via https://github.com/sindresorhus/array-differ/blob/main/index.js (MIT license)
function arrayDiffer(array, ...values) {
const rest = new Set(values.flat());
return array.filter(element => !rest.has(element));
}
// via https://github.com/sindresorhus/arrify/blob/main/index.js (MIT license)
function arrify(value) {
if (value === null || value === undefined) {
return [];
}
if (Array.isArray(value)) {
return value;
}
if (typeof value === 'string') {
return [value];
}
if (typeof value[Symbol.iterator] === 'function') {
return [...value];
}
return [value];
}
// via https://www.npmjs.com/package/maximatch (MIT license)
module.exports = function (list, patterns, options) {
list = arrify(list);
patterns = arrify(patterns);
if (list.length === 0 || patterns.length === 0) {
return [];
}
options = options || {};
return patterns.reduce(function (ret, pattern) {
if (typeof pattern === "function") {
return arrayUnion(ret, list.filter(pattern));
} else if (pattern instanceof RegExp) {
return arrayUnion(
ret,
list.filter(function (item) {
return pattern.test(item);
}),
);
} else {
var process = arrayUnion;
if (pattern[0] === "!") {
pattern = pattern.slice(1);
process = arrayDiffer;
}
return process(ret, minimatch.match(list, pattern, options));
}
}, []);
};
// via https://github.com/sindresorhus/slash/blob/main/index.js (MIT license)
module.exports = function slash(path) {
const isExtendedLengthPath = path.startsWith('\\\\?\\');
if (isExtendedLengthPath) {
return path;
}
return path.replace(/\\/g, '/');
}
+2
-2

@@ -9,4 +9,4 @@ 'use strict';

var errno = require('errno');
var maximatch = require('maximatch');
var slash = require('slash');
var slash = require('./slash.js');
var maximatch = require('./maximatch.js');

@@ -13,0 +13,0 @@ var CopyError = errno.custom.createError('CopyError');

{
"name": "@11ty/recursive-copy",
"version": "4.0.3",
"version": "5.0.0",
"description": "A fork of `recursive-copy`: Simple, flexible file copy utility",

@@ -57,4 +57,3 @@ "engines": {

"junk": "^3.1.0",
"maximatch": "^0.1.0",
"slash": "^3.0.0"
"minimatch": "^10.1.1"
},

@@ -61,0 +60,0 @@ "devDependencies": {