Socket
Socket
Sign inDemoInstall

fs-copy-file

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-copy-file - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

23

lib/fs-copy-file.js

@@ -10,5 +10,3 @@ 'use strict';

module.exports = fs.copyFile ? fs.copyFile : copyFile;
module.exports.constants = {
const constants = {
COPYFILE_EXCL,

@@ -19,6 +17,17 @@ COPYFILE_FICLONE,

const isExcl = (flags) => {
return flags & COPYFILE_EXCL;
};
module.exports = fs.copyFile ? fs.copyFile : copyFile;
module.exports.constants = constants;
const isNumber = (a) => typeof a === 'number';
const or = (a, b) => a | b;
const getValue = (obj) => (key) => obj[key];
const getMaxMask = (obj) => Object
.keys(obj)
.map(getValue(obj))
.reduce(or);
const MAX_MASK = getMaxMask(constants);
const isExcl = (flags) => flags & COPYFILE_EXCL;
function copyFile(src, dest, flags, callback) {

@@ -59,3 +68,3 @@ if (!callback) {

if (typeof flags === 'number' && flags && flags !== COPYFILE_EXCL)
if (flags && isNumber(flags) && (flags > MAX_MASK || flags < 0))
throw Error(`EINVAL: invalid argument, copyfile -> '${dest}'`);

@@ -62,0 +71,0 @@ }

{
"name": "fs-copy-file",
"version": "2.1.0",
"version": "2.1.1",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -5,0 +5,0 @@ "description": "fs.copyFile ponyfill",

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