Syntax corrections for Lint

This commit is contained in:
mykulh 2024-06-14 11:31:48 +01:00
parent 7cb1f1ff87
commit 66e35156cc
11 changed files with 25 additions and 25 deletions

View file

@ -35,7 +35,7 @@ class FromChromeBrowserTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const d = moment.unix((input /1000000) - 11644473600);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
} catch {
@ -43,4 +43,4 @@ class FromChromeBrowserTimestamp extends Operation {
}
}
}
export default FromChromeBrowserTimestamp;
export default FromChromeBrowserTimestamp;

View file

@ -33,13 +33,13 @@ class FromHFSPlusTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
const h = parseInt(input, 16);
const d = moment.unix(h - 2082844800);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
} catch{
try {
const h = parseInt(input, 16);
const d = moment.unix(h - 2082844800);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
} catch {
throw new OperationError("Unrecognised format");
}
}
}
export default FromHFSPlusTimestamp;
export default FromHFSPlusTimestamp;

View file

@ -33,7 +33,7 @@ class FromMacAbsoluteTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const d = moment.unix(input + 978307200);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
} catch {
@ -41,4 +41,4 @@ class FromMacAbsoluteTimestamp extends Operation {
}
}
}
export default FromMacAbsoluteTimestamp;
export default FromMacAbsoluteTimestamp;

View file

@ -35,7 +35,7 @@ class FromUNIX32bitTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const h = parseInt(input, 16);
const d = moment.unix(h);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
@ -44,4 +44,4 @@ class FromUNIX32bitTimestamp extends Operation {
}
}
}
export default FromUNIX32bitTimestamp;
export default FromUNIX32bitTimestamp;

View file

@ -33,11 +33,11 @@ class FromWindows64bitTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
const h = parseInt(input, 16);
const secs = h/10000000;
const d = moment.unix(secs - 11644473600);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
try {
const h = parseInt(input, 16);
const secs = h/10000000;
const d = moment.unix(secs - 11644473600);
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
} catch {
throw new OperationError("Unrecognised format");
}

View file

@ -41,7 +41,7 @@ class ToChromeBrowserTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = ((d.unix()+11644473600) * 1000000);
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();

View file

@ -42,7 +42,7 @@ class ToFirefoxBrowserTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = (d.unix() * 1000000);
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();

View file

@ -40,7 +40,7 @@ class ToHFSPlusTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = d.unix();
const hexString = (result + 2082844800).toString(16);

View file

@ -40,10 +40,10 @@ class ToMacAbsoluteTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = (d.unix()-978307200);
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
} catch {
throw new OperationError("Unrecognised format");
}

View file

@ -40,7 +40,7 @@ class ToUNIX32bitTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = d.unix();
const hexString = result.toString(16);

View file

@ -40,12 +40,12 @@ class ToWindows64bitTimestamp extends Operation {
* @throws {OperationError} if invalid unit
*/
run(input, args) {
try{
try {
const [showDateTime] = args,d = moment.utc(input);
let result = d.unix();
const step1 = result + 11644473600;
const hexString = (step1 * 10000000).toString(16);
eturn showDateTime ? `${hexString.toUpperCase()} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : hexString.toUpperCase();
return showDateTime ? `${hexString.toUpperCase()} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : hexString.toUpperCase();
} catch {
throw new OperationError("Unrecognised format");
}