Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mimelib

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mimelib - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

8

lib/mimelib.js

@@ -13,7 +13,7 @@ var convert = require("encoding").convert,

*/
this.foldLine = function(str, maxLength, foldAnywhere, afterSpace){
this.foldLine = function(str, maxLength, foldAnywhere, afterSpace, lineMargin){
if(foldAnywhere){
return addBase64SoftLinebreaks(str, maxLength || 76);
}
return module.exports.mimeFunctions.foldLine(str, maxLength, !!afterSpace);
return module.exports.mimeFunctions.foldLine(str, maxLength, !!afterSpace, lineMargin);
};

@@ -344,7 +344,7 @@

foldLine: function(str, lineLengthMax, afterSpace){
foldLine: function(str, lineLengthMax, afterSpace, lineMargin){
lineLengthMax = lineLengthMax || 76;
str = (str || "").toString().trim();
var pos = 0, len = str.length, result = "", line, match, lineMargin = Math.floor(lineLengthMax/5);
var pos = 0, len = str.length, result = "", line, match, lineMargin = lineMargin || Math.floor(lineLengthMax/5);

@@ -351,0 +351,0 @@ while(pos < len){

{
"name": "mimelib",
"description": "MIME functions to encode/decode e-mails etc.",
"version": "0.2.2",
"version": "0.2.3",
"author" : "Andris Reinman",

@@ -6,0 +6,0 @@ "homepage":"http://github.com/andris9/mimelib",

@@ -110,1 +110,11 @@ var testCase = require('nodeunit').testCase,

exports["Fold long line"] = function(test){
var inputStr = "Subject: Testin command line kirja õkva kakva mõni tõnis kõllas põllas tõllas rõllas jušla kušla tušla musla",
outputStr = "Subject: Testin command line kirja =?UTF-8?Q?=C3=B5kva?= kakva\r\n"+
" =?UTF-8?Q?m=C3=B5ni_t=C3=B5nis_k=C3=B5llas_p=C3=B5?=\r\n"+
" =?UTF-8?Q?llas_t=C3=B5llas_r=C3=B5llas_ju=C5=A1la_?=\r\n"+
" =?UTF-8?Q?ku=C5=A1la_tu=C5=A1la?= musla";
test.equal(outputStr, mimelib.foldLine(mimelib.encodeMimeWords(inputStr, "Q", 52), 76, false, false, 52));
test.done();
}
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