Comparing version 0.1.4 to 0.1.5
@@ -23,5 +23,27 @@ /* ================================================================ | ||
var getLeftOffset = function(text, default_length) { | ||
var length = text.replace(/[^x00-xff]/g, '01').length; | ||
return Math.max(default_length, length); | ||
}; | ||
module.exports = function(data) { | ||
var content = 'render error'; | ||
var values = { | ||
offset_x: 50, | ||
offset_left: 44, | ||
default_length: 6, | ||
default_left_offset: 31 | ||
}; | ||
var length = getLeftOffset(data.left_text, values.default_length); | ||
var offset = values.default_left_offset + values.offset_left / values.default_length * length; | ||
var temp = offset - values.offset_left - values.default_left_offset; | ||
values.offset_left = offset; | ||
values.offset_x += temp / 2; | ||
values.offset_right = values.offset_left + 19; | ||
values.total_width = values.offset_left + 38; | ||
data.values = values; | ||
try { | ||
@@ -28,0 +50,0 @@ content = render(template, data, { |
{ | ||
"name": "badgeboard", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "badgeboard", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances 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
164630
14
98
5