fixing indent

This commit is contained in:
bwhitn 2018-11-20 22:36:29 -05:00
parent ed17ed2919
commit 13b10a68a2

View file

@ -4,16 +4,17 @@
* @license Apache-2.0 * @license Apache-2.0
*/ */
import Operation from "../Operation"; import Operation from "../Operation";
import OperationError from "../errors/OperationError"; import OperationError from "../errors/OperationError";
import cptable from "../vendor/js-codepage/cptable.js"; import cptable from "../vendor/js-codepage/cptable.js";
import {fromBase64} from "../lib/Base64"; import {fromBase64} from "../lib/Base64";
import {decodeQuotedPrintable} from "../lib/QuotedPrintable" import {decodeQuotedPrintable} from "../lib/QuotedPrintable";
import {MIME_FORMAT} from "../lib/ChrEnc"; import {MIME_FORMAT} from "../lib/ChrEnc";
import Utils from "../Utils";
//TODO: fix function header // TODO: fix function header
/** /**
* Return the conetent encoding for a mime section from a header object. * Return the conetent encoding for a mime section from a header object.
* CONTENT_TYPE returns the content type of a mime header from a header object. * CONTENT_TYPE returns the content type of a mime header from a header object.
* Returns the filename from a mime header object. * Returns the filename from a mime header object.
@ -21,25 +22,25 @@
* @constant * @constant
* @default * @default
*/ */
const FIELD_ITEM = { const FIELD_ITEM = {
FILENAME: [/filename=".*?([^~#%&*\][\\:<>?/|]+)"/, "content-disposition"], FILENAME: [/filename=".*?([^~#%&*\][\\:<>?/|]+)"/, "content-disposition"],
CONTENT_TYPE: [/\s*([^;\s]+)/, "content-type"], CONTENT_TYPE: [/\s*([^;\s]+)/, "content-type"],
BOUNDARY: [/boundary="(.+?)"/, "content-type"], BOUNDARY: [/boundary="(.+?)"/, "content-type"],
CHARSET: [/charset=([a-z0-9-]+)/, "content-type"], CHARSET: [/charset=([a-z0-9-]+)/, "content-type"],
TRANSER_ENCODING: [/\s*([A-Za-z0-9-]+)\s*/, "content-transfer-encoding"], TRANSER_ENCODING: [/\s*([A-Za-z0-9-]+)\s*/, "content-transfer-encoding"],
} }
/** /**
* @constant * @constant
* @default * @default
*/ */
//TODO: should 8 bit and 7 bit be treated the same? // TODO: should 8 bit and 7 bit be treated the same?
const DECODER = { const DECODER = {
"base64": function (input) { "base64": function (input) {
return fromBase64(input, Base64.ALPHABET, "string", true); return fromBase64(input);
}, },
"quoted-printable": function (input) { "quoted-printable": function (input) {
return decodeQuotedPrintable(input); return Utils.byteArrayToUtf8(decodeQuotedPrintable(input));
}, },
"7bit": function (input) { "7bit": function (input) {
return input; return input;
@ -47,10 +48,10 @@
"8bit": function (input) { "8bit": function (input) {
return input; return input;
}, },
} }
class ParseIMF extends Operation { class ParseIMF extends Operation {
/** /**
* Internet MessageFormat constructor * Internet MessageFormat constructor