Comparing version 3.2.0 to 4.0.0
@@ -5,15 +5,4 @@ #!/usr/bin/env node | ||
const path = require("path"); | ||
const moment = require("./moment.min") | ||
const momentTZ = require("./moment-timezone.min") | ||
const hydrateTime = str => str.replace(/tz\(([^}]+)\)/g, (a, match) => { | ||
const result = momentTZ().tz(match).format('LT z').toLowerCase() | ||
const diff = match.length - result.length + 4 | ||
const spaces = (new Array(diff)).fill(' ').join('') | ||
return result + spaces | ||
}); | ||
const output = fs.readFileSync(path.join(__dirname, 'output'), 'utf8'); | ||
const timeEvalOutput = hydrateTime(output) | ||
console.log(timeEvalOutput); | ||
console.log(output); |
{ | ||
"name": "andri", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "Personal npm card for Andri Alexandrou (@_alexandrou)", | ||
@@ -59,3 +59,3 @@ "main": "src/card.js", | ||
"pronouns": "she/her", | ||
"timezone": "tz(Europe/Athens)" | ||
"timezone": "UTC+2" | ||
}, | ||
@@ -75,3 +75,3 @@ "data": [ | ||
{ | ||
"label": "<cyan>time</>", | ||
"label": "<cyan>zone</>", | ||
"text": "<cyan>{{timezone}}</>", | ||
@@ -78,0 +78,0 @@ "when": "{{timezone}}" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
2
13903
6
19
2