Comparing version 7.1.0 to 7.1.1
@@ -21,2 +21,11 @@ 'use strict'; | ||
const pad = number => number < 10 ? '0' + number : number; | ||
const getDeletionDate = date => date.getFullYear() + | ||
'-' + pad(date.getMonth() + 1) + | ||
'-' + pad(date.getDate()) + | ||
'T' + pad(date.getHours()) + | ||
':' + pad(date.getMinutes()) + | ||
':' + pad(date.getSeconds()); | ||
const trash = async (filePath, trashPaths) => { | ||
@@ -27,8 +36,6 @@ const name = uuid.v4(); | ||
const trashInfoData = `[Trash Info]\nPath=${filePath.replace(/\s/g, '%20')}\nDeletionDate=${(new Date()).toISOString()}`; | ||
const trashInfoData = `[Trash Info]\nPath=${filePath.replace(/\s/g, '%20')}\nDeletionDate=${getDeletionDate(new Date())}`; | ||
await Promise.all([ | ||
moveFile(filePath, destination), | ||
writeFile(trashInfoPath, trashInfoData) | ||
]); | ||
await writeFile(trashInfoPath, trashInfoData); | ||
await moveFile(filePath, destination); | ||
@@ -35,0 +42,0 @@ return { |
{ | ||
"name": "trash", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "Move files and folders to the trash", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54132
168