node-red-node-email
Advanced tools
Comparing version
@@ -58,2 +58,13 @@ import { AnyNode, Element } from "domhandler"; | ||
/** | ||
* Returns all nodes with the supplied `className`. | ||
* | ||
* @category Legacy Query Functions | ||
* @param className Class name to search for. | ||
* @param nodes Nodes to search through. | ||
* @param recurse Also consider child nodes. | ||
* @param limit Maximum number of nodes to return. | ||
* @returns All nodes with the supplied `className`. | ||
*/ | ||
export declare function getElementsByClassName(className: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[]; | ||
/** | ||
* Returns all nodes with the supplied `type`. | ||
@@ -60,0 +71,0 @@ * |
@@ -127,2 +127,15 @@ import { isTag, isText } from "domhandler"; | ||
/** | ||
* Returns all nodes with the supplied `className`. | ||
* | ||
* @category Legacy Query Functions | ||
* @param className Class name to search for. | ||
* @param nodes Nodes to search through. | ||
* @param recurse Also consider child nodes. | ||
* @param limit Maximum number of nodes to return. | ||
* @returns All nodes with the supplied `className`. | ||
*/ | ||
export function getElementsByClassName(className, nodes, recurse = true, limit = Infinity) { | ||
return filter(getAttribCheck("class", className), nodes, recurse, limit); | ||
} | ||
/** | ||
* Returns all nodes with the supplied `type`. | ||
@@ -129,0 +142,0 @@ * |
@@ -1,2 +0,2 @@ | ||
import { Element, AnyNode } from "domhandler"; | ||
import { Element, AnyNode, ParentNode } from "domhandler"; | ||
/** | ||
@@ -23,3 +23,3 @@ * Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one. | ||
*/ | ||
export declare function find(test: (elem: AnyNode) => boolean, nodes: AnyNode[], recurse: boolean, limit: number): AnyNode[]; | ||
export declare function find(test: (elem: AnyNode) => boolean, nodes: AnyNode[] | ParentNode, recurse: boolean, limit: number): AnyNode[]; | ||
/** | ||
@@ -44,3 +44,3 @@ * Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`. | ||
*/ | ||
export declare function findOne(test: (elem: Element) => boolean, nodes: AnyNode[], recurse?: boolean): Element | null; | ||
export declare function findOne(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode, recurse?: boolean): Element | null; | ||
/** | ||
@@ -54,3 +54,3 @@ * Checks if a tree of nodes contains at least one node passing a test. | ||
*/ | ||
export declare function existsOne(test: (elem: Element) => boolean, nodes: AnyNode[]): boolean; | ||
export declare function existsOne(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode): boolean; | ||
/** | ||
@@ -66,3 +66,3 @@ * Search an array of nodes and their children for elements passing a test function. | ||
*/ | ||
export declare function findAll(test: (elem: Element) => boolean, nodes: AnyNode[]): Element[]; | ||
export declare function findAll(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode): Element[]; | ||
//# sourceMappingURL=querying.d.ts.map |
@@ -28,3 +28,3 @@ import { isTag, hasChildren } from "domhandler"; | ||
/** Stack of the arrays we are looking at. */ | ||
const nodeStack = [nodes]; | ||
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]]; | ||
/** Stack of the indices within the arrays. */ | ||
@@ -83,16 +83,15 @@ const indexStack = [0]; | ||
export function findOne(test, nodes, recurse = true) { | ||
let elem = null; | ||
for (let i = 0; i < nodes.length && !elem; i++) { | ||
const node = nodes[i]; | ||
if (!isTag(node)) { | ||
continue; | ||
const searchedNodes = Array.isArray(nodes) ? nodes : [nodes]; | ||
for (let i = 0; i < searchedNodes.length; i++) { | ||
const node = searchedNodes[i]; | ||
if (isTag(node) && test(node)) { | ||
return node; | ||
} | ||
else if (test(node)) { | ||
elem = node; | ||
if (recurse && hasChildren(node) && node.children.length > 0) { | ||
const found = findOne(test, node.children, true); | ||
if (found) | ||
return found; | ||
} | ||
else if (recurse && node.children.length > 0) { | ||
elem = findOne(test, node.children, true); | ||
} | ||
} | ||
return elem; | ||
return null; | ||
} | ||
@@ -108,4 +107,4 @@ /** | ||
export function existsOne(test, nodes) { | ||
return nodes.some((checked) => isTag(checked) && | ||
(test(checked) || existsOne(test, checked.children))); | ||
return (Array.isArray(nodes) ? nodes : [nodes]).some((node) => (isTag(node) && test(node)) || | ||
(hasChildren(node) && existsOne(test, node.children))); | ||
} | ||
@@ -124,3 +123,3 @@ /** | ||
const result = []; | ||
const nodeStack = [nodes]; | ||
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]]; | ||
const indexStack = [0]; | ||
@@ -139,7 +138,5 @@ for (;;) { | ||
const elem = nodeStack[0][indexStack[0]++]; | ||
if (!isTag(elem)) | ||
continue; | ||
if (test(elem)) | ||
if (isTag(elem) && test(elem)) | ||
result.push(elem); | ||
if (elem.children.length > 0) { | ||
if (hasChildren(elem) && elem.children.length > 0) { | ||
indexStack.unshift(0); | ||
@@ -146,0 +143,0 @@ nodeStack.unshift(elem.children); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFeed = void 0; | ||
exports.getFeed = getFeed; | ||
var stringify_js_1 = require("./stringify.js"); | ||
@@ -21,3 +21,2 @@ var legacy_js_1 = require("./legacy.js"); | ||
} | ||
exports.getFeed = getFeed; | ||
/** | ||
@@ -24,0 +23,0 @@ * Parse an Atom feed. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.uniqueSort = exports.compareDocumentPosition = exports.DocumentPosition = exports.removeSubsets = void 0; | ||
exports.DocumentPosition = void 0; | ||
exports.removeSubsets = removeSubsets; | ||
exports.compareDocumentPosition = compareDocumentPosition; | ||
exports.uniqueSort = uniqueSort; | ||
var domhandler_1 = require("domhandler"); | ||
@@ -39,3 +42,2 @@ /** | ||
} | ||
exports.removeSubsets = removeSubsets; | ||
/** | ||
@@ -52,3 +54,3 @@ * @category Helpers | ||
DocumentPosition[DocumentPosition["CONTAINED_BY"] = 16] = "CONTAINED_BY"; | ||
})(DocumentPosition = exports.DocumentPosition || (exports.DocumentPosition = {})); | ||
})(DocumentPosition || (exports.DocumentPosition = DocumentPosition = {})); | ||
/** | ||
@@ -119,3 +121,2 @@ * Compare the position of one node against another node in any other document, | ||
} | ||
exports.compareDocumentPosition = compareDocumentPosition; | ||
/** | ||
@@ -144,3 +145,2 @@ * Sort an array of nodes based on their relative position in the document, | ||
} | ||
exports.uniqueSort = uniqueSort; | ||
//# sourceMappingURL=helpers.js.map |
@@ -58,2 +58,13 @@ import { AnyNode, Element } from "domhandler"; | ||
/** | ||
* Returns all nodes with the supplied `className`. | ||
* | ||
* @category Legacy Query Functions | ||
* @param className Class name to search for. | ||
* @param nodes Nodes to search through. | ||
* @param recurse Also consider child nodes. | ||
* @param limit Maximum number of nodes to return. | ||
* @returns All nodes with the supplied `className`. | ||
*/ | ||
export declare function getElementsByClassName(className: string | ((name: string) => boolean), nodes: AnyNode | AnyNode[], recurse?: boolean, limit?: number): Element[]; | ||
/** | ||
* Returns all nodes with the supplied `type`. | ||
@@ -60,0 +71,0 @@ * |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0; | ||
exports.testElement = testElement; | ||
exports.getElements = getElements; | ||
exports.getElementById = getElementById; | ||
exports.getElementsByTagName = getElementsByTagName; | ||
exports.getElementsByClassName = getElementsByClassName; | ||
exports.getElementsByTagType = getElementsByTagType; | ||
var domhandler_1 = require("domhandler"); | ||
@@ -88,3 +93,2 @@ var querying_js_1 = require("./querying.js"); | ||
} | ||
exports.testElement = testElement; | ||
/** | ||
@@ -105,3 +109,2 @@ * Returns all nodes that match `options`. | ||
} | ||
exports.getElements = getElements; | ||
/** | ||
@@ -122,3 +125,2 @@ * Returns the node with the supplied ID. | ||
} | ||
exports.getElementById = getElementById; | ||
/** | ||
@@ -139,4 +141,18 @@ * Returns all nodes with the supplied `tagName`. | ||
} | ||
exports.getElementsByTagName = getElementsByTagName; | ||
/** | ||
* Returns all nodes with the supplied `className`. | ||
* | ||
* @category Legacy Query Functions | ||
* @param className Class name to search for. | ||
* @param nodes Nodes to search through. | ||
* @param recurse Also consider child nodes. | ||
* @param limit Maximum number of nodes to return. | ||
* @returns All nodes with the supplied `className`. | ||
*/ | ||
function getElementsByClassName(className, nodes, recurse, limit) { | ||
if (recurse === void 0) { recurse = true; } | ||
if (limit === void 0) { limit = Infinity; } | ||
return (0, querying_js_1.filter)(getAttribCheck("class", className), nodes, recurse, limit); | ||
} | ||
/** | ||
* Returns all nodes with the supplied `type`. | ||
@@ -156,3 +172,2 @@ * | ||
} | ||
exports.getElementsByTagType = getElementsByTagType; | ||
//# sourceMappingURL=legacy.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.prepend = exports.prependChild = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0; | ||
exports.removeElement = removeElement; | ||
exports.replaceElement = replaceElement; | ||
exports.appendChild = appendChild; | ||
exports.append = append; | ||
exports.prependChild = prependChild; | ||
exports.prepend = prepend; | ||
/** | ||
@@ -26,3 +31,2 @@ * Remove an element from the dom | ||
} | ||
exports.removeElement = removeElement; | ||
/** | ||
@@ -51,3 +55,2 @@ * Replace an element in the dom | ||
} | ||
exports.replaceElement = replaceElement; | ||
/** | ||
@@ -73,3 +76,2 @@ * Append a child to an element. | ||
} | ||
exports.appendChild = appendChild; | ||
/** | ||
@@ -101,3 +103,2 @@ * Append an element after another. | ||
} | ||
exports.append = append; | ||
/** | ||
@@ -123,3 +124,2 @@ * Prepend a child to an element. | ||
} | ||
exports.prependChild = prependChild; | ||
/** | ||
@@ -147,3 +147,2 @@ * Prepend an element before another. | ||
} | ||
exports.prepend = prepend; | ||
//# sourceMappingURL=manipulation.js.map |
@@ -1,2 +0,2 @@ | ||
import { Element, AnyNode } from "domhandler"; | ||
import { Element, AnyNode, ParentNode } from "domhandler"; | ||
/** | ||
@@ -23,3 +23,3 @@ * Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one. | ||
*/ | ||
export declare function find(test: (elem: AnyNode) => boolean, nodes: AnyNode[], recurse: boolean, limit: number): AnyNode[]; | ||
export declare function find(test: (elem: AnyNode) => boolean, nodes: AnyNode[] | ParentNode, recurse: boolean, limit: number): AnyNode[]; | ||
/** | ||
@@ -44,3 +44,3 @@ * Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`. | ||
*/ | ||
export declare function findOne(test: (elem: Element) => boolean, nodes: AnyNode[], recurse?: boolean): Element | null; | ||
export declare function findOne(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode, recurse?: boolean): Element | null; | ||
/** | ||
@@ -54,3 +54,3 @@ * Checks if a tree of nodes contains at least one node passing a test. | ||
*/ | ||
export declare function existsOne(test: (elem: Element) => boolean, nodes: AnyNode[]): boolean; | ||
export declare function existsOne(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode): boolean; | ||
/** | ||
@@ -66,3 +66,3 @@ * Search an array of nodes and their children for elements passing a test function. | ||
*/ | ||
export declare function findAll(test: (elem: Element) => boolean, nodes: AnyNode[]): Element[]; | ||
export declare function findAll(test: (elem: Element) => boolean, nodes: AnyNode[] | ParentNode): Element[]; | ||
//# sourceMappingURL=querying.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0; | ||
exports.filter = filter; | ||
exports.find = find; | ||
exports.findOneChild = findOneChild; | ||
exports.findOne = findOne; | ||
exports.existsOne = existsOne; | ||
exports.findAll = findAll; | ||
var domhandler_1 = require("domhandler"); | ||
@@ -20,3 +25,2 @@ /** | ||
} | ||
exports.filter = filter; | ||
/** | ||
@@ -35,3 +39,3 @@ * Search an array of nodes and their children for nodes passing a test function. | ||
/** Stack of the arrays we are looking at. */ | ||
var nodeStack = [nodes]; | ||
var nodeStack = [Array.isArray(nodes) ? nodes : [nodes]]; | ||
/** Stack of the indices within the arrays. */ | ||
@@ -68,3 +72,2 @@ var indexStack = [0]; | ||
} | ||
exports.find = find; | ||
/** | ||
@@ -82,3 +85,2 @@ * Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`. | ||
} | ||
exports.findOneChild = findOneChild; | ||
/** | ||
@@ -95,18 +97,16 @@ * Finds one element in a tree that passes a test. | ||
if (recurse === void 0) { recurse = true; } | ||
var elem = null; | ||
for (var i = 0; i < nodes.length && !elem; i++) { | ||
var node = nodes[i]; | ||
if (!(0, domhandler_1.isTag)(node)) { | ||
continue; | ||
var searchedNodes = Array.isArray(nodes) ? nodes : [nodes]; | ||
for (var i = 0; i < searchedNodes.length; i++) { | ||
var node = searchedNodes[i]; | ||
if ((0, domhandler_1.isTag)(node) && test(node)) { | ||
return node; | ||
} | ||
else if (test(node)) { | ||
elem = node; | ||
if (recurse && (0, domhandler_1.hasChildren)(node) && node.children.length > 0) { | ||
var found = findOne(test, node.children, true); | ||
if (found) | ||
return found; | ||
} | ||
else if (recurse && node.children.length > 0) { | ||
elem = findOne(test, node.children, true); | ||
} | ||
} | ||
return elem; | ||
return null; | ||
} | ||
exports.findOne = findOne; | ||
/** | ||
@@ -121,8 +121,7 @@ * Checks if a tree of nodes contains at least one node passing a test. | ||
function existsOne(test, nodes) { | ||
return nodes.some(function (checked) { | ||
return (0, domhandler_1.isTag)(checked) && | ||
(test(checked) || existsOne(test, checked.children)); | ||
return (Array.isArray(nodes) ? nodes : [nodes]).some(function (node) { | ||
return ((0, domhandler_1.isTag)(node) && test(node)) || | ||
((0, domhandler_1.hasChildren)(node) && existsOne(test, node.children)); | ||
}); | ||
} | ||
exports.existsOne = existsOne; | ||
/** | ||
@@ -140,3 +139,3 @@ * Search an array of nodes and their children for elements passing a test function. | ||
var result = []; | ||
var nodeStack = [nodes]; | ||
var nodeStack = [Array.isArray(nodes) ? nodes : [nodes]]; | ||
var indexStack = [0]; | ||
@@ -155,7 +154,5 @@ for (;;) { | ||
var elem = nodeStack[0][indexStack[0]++]; | ||
if (!(0, domhandler_1.isTag)(elem)) | ||
continue; | ||
if (test(elem)) | ||
if ((0, domhandler_1.isTag)(elem) && test(elem)) | ||
result.push(elem); | ||
if (elem.children.length > 0) { | ||
if ((0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) { | ||
indexStack.unshift(0); | ||
@@ -166,3 +163,2 @@ nodeStack.unshift(elem.children); | ||
} | ||
exports.findAll = findAll; | ||
//# sourceMappingURL=querying.js.map |
@@ -6,3 +6,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.innerText = exports.textContent = exports.getText = exports.getInnerHTML = exports.getOuterHTML = void 0; | ||
exports.getOuterHTML = getOuterHTML; | ||
exports.getInnerHTML = getInnerHTML; | ||
exports.getText = getText; | ||
exports.textContent = textContent; | ||
exports.innerText = innerText; | ||
var domhandler_1 = require("domhandler"); | ||
@@ -21,3 +25,2 @@ var dom_serializer_1 = __importDefault(require("dom-serializer")); | ||
} | ||
exports.getOuterHTML = getOuterHTML; | ||
/** | ||
@@ -35,3 +38,2 @@ * @category Stringify | ||
} | ||
exports.getInnerHTML = getInnerHTML; | ||
/** | ||
@@ -56,3 +58,2 @@ * Get a node's inner text. Same as `textContent`, but inserts newlines for `<br>` tags. Ignores comments. | ||
} | ||
exports.getText = getText; | ||
/** | ||
@@ -76,3 +77,2 @@ * Get a node's text content. Ignores comments. | ||
} | ||
exports.textContent = textContent; | ||
/** | ||
@@ -96,3 +96,2 @@ * Get a node's inner text, ignoring `<script>` and `<style>` tags. Ignores comments. | ||
} | ||
exports.innerText = innerText; | ||
//# sourceMappingURL=stringify.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.prevElementSibling = exports.nextElementSibling = exports.getName = exports.hasAttrib = exports.getAttributeValue = exports.getSiblings = exports.getParent = exports.getChildren = void 0; | ||
exports.getChildren = getChildren; | ||
exports.getParent = getParent; | ||
exports.getSiblings = getSiblings; | ||
exports.getAttributeValue = getAttributeValue; | ||
exports.hasAttrib = hasAttrib; | ||
exports.getName = getName; | ||
exports.nextElementSibling = nextElementSibling; | ||
exports.prevElementSibling = prevElementSibling; | ||
var domhandler_1 = require("domhandler"); | ||
@@ -15,3 +22,2 @@ /** | ||
} | ||
exports.getChildren = getChildren; | ||
/** | ||
@@ -27,3 +33,2 @@ * Get a node's parent. | ||
} | ||
exports.getParent = getParent; | ||
/** | ||
@@ -57,3 +62,2 @@ * Gets an elements siblings, including the element itself. | ||
} | ||
exports.getSiblings = getSiblings; | ||
/** | ||
@@ -71,3 +75,2 @@ * Gets an attribute from an element. | ||
} | ||
exports.getAttributeValue = getAttributeValue; | ||
/** | ||
@@ -86,3 +89,2 @@ * Checks whether an element has an attribute. | ||
} | ||
exports.hasAttrib = hasAttrib; | ||
/** | ||
@@ -98,3 +100,2 @@ * Get the tag name of an element. | ||
} | ||
exports.getName = getName; | ||
/** | ||
@@ -115,3 +116,2 @@ * Returns the next element sibling of a node. | ||
} | ||
exports.nextElementSibling = nextElementSibling; | ||
/** | ||
@@ -132,3 +132,2 @@ * Returns the previous element sibling of a node. | ||
} | ||
exports.prevElementSibling = prevElementSibling; | ||
//# sourceMappingURL=traversal.js.map |
{ | ||
"name": "domutils", | ||
"version": "3.1.0", | ||
"version": "3.2.2", | ||
"description": "Utilities for working with htmlparser2's dom", | ||
@@ -34,3 +34,3 @@ "author": "Felix Boehm <me@feedic.com>", | ||
"build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json", | ||
"build:docs": "typedoc --hideGenerator --exclude \"**/*+(index|.spec).ts\" --categorizeByGroup false --sort enum-value-ascending --sort alphabetical src", | ||
"build:docs": "typedoc src", | ||
"prepare": "npm run build" | ||
@@ -52,15 +52,15 @@ }, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.1", | ||
"@types/node": "^18.16.2", | ||
"@typescript-eslint/eslint-plugin": "^5.59.1", | ||
"@typescript-eslint/parser": "^5.59.1", | ||
"eslint": "^8.39.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-jsdoc": "^43.1.1", | ||
"htmlparser2": "~8.0.2", | ||
"jest": "^29.5.0", | ||
"prettier": "^2.8.8", | ||
"ts-jest": "^29.1.0", | ||
"typedoc": "^0.24.6", | ||
"typescript": "^5.0.4" | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.10.5", | ||
"@typescript-eslint/eslint-plugin": "^8.19.0", | ||
"@typescript-eslint/parser": "^8.19.0", | ||
"eslint": "^8.57.1", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-jsdoc": "^50.6.1", | ||
"htmlparser2": "~9.1.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.4.2", | ||
"ts-jest": "^29.2.5", | ||
"typedoc": "^0.27.6", | ||
"typescript": "^5.7.2" | ||
}, | ||
@@ -67,0 +67,0 @@ "jest": { |
{ | ||
"name": "encoding-japanese", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Convert and detect character encoding in JavaScript", | ||
@@ -57,3 +57,3 @@ "main": "src/index.js", | ||
"eslint": "^8.57.0", | ||
"mocha": "^10.3.0", | ||
"mocha": "^10.4.0", | ||
"package-json-versionify": "^1.0.4", | ||
@@ -60,0 +60,0 @@ "power-assert": "^1.6.1", |
@@ -30,3 +30,6 @@ encoding.js | ||
+ [Specify the return type by the `type` option](#specify-the-return-type-by-the-type-option) | ||
+ [Specify handling for unrepresentable characters](#specify-handling-for-unrepresentable-characters) | ||
+ [Replacing characters with HTML entities when they cannot be represented](#replacing-characters-with-html-entities-when-they-cannot-be-represented) | ||
+ [Ignoring characters when they cannot be represented](#ignoring-characters-when-they-cannot-be-represented) | ||
+ [Throwing an Error when they cannot be represented](#throwing-an-error-when-they-cannot-be-represented) | ||
+ [Specify BOM in UTF-16](#specify-bom-in-utf-16) | ||
@@ -122,3 +125,3 @@ * [urlEncode : Encodes to percent-encoded string](#encodingurlencode-data) | ||
```html | ||
<script src="https://unpkg.com/encoding-japanese@2.1.0/encoding.min.js"></script> | ||
<script src="https://unpkg.com/encoding-japanese@2.2.0/encoding.min.js"></script> | ||
``` | ||
@@ -368,12 +371,17 @@ | ||
#### Specify handling for unrepresentable characters | ||
With the `fallback` option, you can specify how to handle characters that cannot be represented in the target encoding. | ||
The `fallback` option supports the following values: | ||
* **html-entity**: Replace characters with HTML entities (decimal HTML numeric character references). | ||
* **html-entity-hex**: Replace characters with HTML entities (hexadecimal HTML numeric character references). | ||
* **ignore**: Ignore characters that cannot be represented. | ||
* **error**: Throw an error if any character cannot be represented. | ||
#### Replacing characters with HTML entities when they cannot be represented | ||
Characters that cannot be represented in the target character set are replaced with '?' (U+003F) by default, | ||
but by specifying the `fallback` option, you can replace them with HTML entities (Numeric character references), such as `🍣`. | ||
but by specifying `html-entity` as the `fallback` option, you can replace them with HTML entities (Numeric character references), such as `🍣`. | ||
The `fallback` option supports the following values. | ||
* **html-entity** : Replace to HTML entity (decimal HTML numeric character reference). | ||
* **html-entity-hex** : Replace to HTML entity (hexadecimal HTML numeric character reference). | ||
Example of specifying `{ fallback: 'html-entity' }` option: | ||
@@ -411,2 +419,46 @@ | ||
#### Ignoring characters when they cannot be represented | ||
By specifying `ignore` as a `fallback` option, characters that cannot be represented in the target encoding format can be ignored. | ||
Example of specifying `{ fallback: 'ignore' }` option: | ||
```javascript | ||
const unicodeArray = Encoding.stringToCode('寿司🍣ビール🍺'); | ||
// No fallback specified | ||
let sjisArray = Encoding.convert(unicodeArray, { | ||
to: 'SJIS', | ||
from: 'UNICODE' | ||
}); | ||
console.log(sjisArray); // Converted to a code array of '寿司?ビール?' | ||
// Specify `fallback: ignore` | ||
sjisArray = Encoding.convert(unicodeArray, { | ||
to: 'SJIS', | ||
from: 'UNICODE', | ||
fallback: 'ignore' | ||
}); | ||
console.log(sjisArray); // Converted to a code array of '寿司ビール' | ||
``` | ||
#### Throwing an Error when they cannot be represented | ||
If you need to throw an error when a character cannot be represented in the target character encoding, | ||
specify `error` as a `fallback` option. This will cause an exception to be thrown. | ||
Example of specifying `{ fallback: 'error' }` option: | ||
```javascript | ||
const unicodeArray = Encoding.stringToCode('おにぎり🍙ラーメン🍜'); | ||
try { | ||
const sjisArray = Encoding.convert(unicodeArray, { | ||
to: 'SJIS', | ||
from: 'UNICODE', | ||
fallback: 'error' // Specify 'error' to throw an exception | ||
}); | ||
} catch (e) { | ||
console.error(e); // Error: Character cannot be represented: [240, 159, 141, 153] | ||
} | ||
``` | ||
#### Specify BOM in UTF-16 | ||
@@ -419,5 +471,5 @@ | ||
const utf16Array = Encoding.convert(utf8Array, { | ||
to: 'UTF16', // to_encoding | ||
from: 'UTF8', // from_encoding | ||
bom: true // Add BOM | ||
to: 'UTF16', | ||
from: 'UTF8', | ||
bom: true // Specify to add the BOM | ||
}); | ||
@@ -431,5 +483,5 @@ ``` | ||
const utf16leArray = Encoding.convert(utf8Array, { | ||
to: 'UTF16', // to_encoding | ||
from: 'UTF8', // from_encoding | ||
bom: 'LE' // With BOM (little-endian) | ||
to: 'UTF16', | ||
from: 'UTF8', | ||
bom: 'LE' // Specify to add the BOM as little-endian | ||
}); | ||
@@ -436,0 +488,0 @@ ``` |
@@ -1675,3 +1675,8 @@ var config = require('./config'); | ||
} | ||
break; | ||
case 'error': | ||
throw new Error('Character cannot be represented: [' + bytes.join(', ') + ']'); | ||
case 'ignore': | ||
break; | ||
} | ||
} |
# Changelog | ||
## [5.3.6](https://github.com/nodemailer/libmime/compare/v5.3.5...v5.3.6) (2024-11-29) | ||
### Bug Fixes | ||
* **deps:** Bumped libqp to fix issue with missing whitespace ([1137a9f](https://github.com/nodemailer/libmime/commit/1137a9f2222ed21926e69ba8855e93e5a421fecc)) | ||
## [5.3.5](https://github.com/nodemailer/libmime/compare/v5.3.4...v5.3.5) (2024-04-12) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "libmime", | ||
"description": "Encode and decode quoted printable and base64 strings", | ||
"version": "5.3.5", | ||
"version": "5.3.6", | ||
"main": "lib/libmime.js", | ||
@@ -23,6 +23,6 @@ "homepage": "https://github.com/nodemailer/libmime", | ||
"dependencies": { | ||
"encoding-japanese": "2.1.0", | ||
"encoding-japanese": "2.2.0", | ||
"iconv-lite": "0.6.3", | ||
"libbase64": "1.3.0", | ||
"libqp": "2.1.0" | ||
"libqp": "2.1.1" | ||
}, | ||
@@ -34,7 +34,7 @@ "devDependencies": { | ||
"grunt": "1.6.1", | ||
"grunt-cli": "1.4.3", | ||
"grunt-cli": "1.5.0", | ||
"grunt-eslint": "24.3.0", | ||
"grunt-mocha-test": "0.13.3", | ||
"mocha": "10.4.0" | ||
"mocha": "10.8.2" | ||
} | ||
} |
# Changelog | ||
## [2.1.1](https://github.com/nodemailer/libqp/compare/v2.1.0...v2.1.1) (2024-11-29) | ||
### Bug Fixes | ||
* **decode-stream:** Fix issue where some whitespace characters were lost ([2231159](https://github.com/nodemailer/libqp/commit/2231159f38e865ef8cf4f7f8bf28cabc00217ffe)) | ||
## [2.1.0](https://github.com/nodemailer/libqp/compare/v2.0.1...v2.1.0) (2024-02-23) | ||
@@ -4,0 +11,0 @@ |
@@ -258,2 +258,3 @@ /* eslint no-useless-escape: 0 */ | ||
* Creates a transform stream for decoding Quoted-Printable encoded strings | ||
* The input is not actually processed as a stream but concatted and processed as a single input | ||
* | ||
@@ -274,9 +275,7 @@ * @constructor | ||
this.outputBytes = 0; | ||
this.qpChunks = []; | ||
} | ||
_transform(chunk, encoding, done) { | ||
let qp, buf; | ||
chunk = chunk.toString('ascii'); | ||
if (!chunk || !chunk.length) { | ||
@@ -286,17 +285,9 @@ return done(); | ||
if (typeof chunk === 'string') { | ||
chunk = Buffer.from(chunk, encoding); | ||
} | ||
this.qpChunks.push(chunk); | ||
this.inputBytes += chunk.length; | ||
qp = this._curLine + chunk; | ||
this._curLine = ''; | ||
qp = qp.replace(/\=[^\n]?$/, lastLine => { | ||
this._curLine = lastLine; | ||
return ''; | ||
}); | ||
if (qp) { | ||
buf = decode(qp); | ||
this.outputBytes += buf.length; | ||
this.push(buf); | ||
} | ||
done(); | ||
@@ -306,8 +297,8 @@ } | ||
_flush(done) { | ||
let buf; | ||
if (this._curLine) { | ||
buf = decode(this._curLine); | ||
if (this.inputBytes) { | ||
let buf = decode(Buffer.concat(this.qpChunks, this.inputBytes).toString()); | ||
this.outputBytes += buf.length; | ||
this.push(buf); | ||
} | ||
done(); | ||
@@ -314,0 +305,0 @@ } |
{ | ||
"name": "libqp", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Encode and decode quoted-printable strings according to rfc2045", | ||
@@ -5,0 +5,0 @@ "main": "lib/libqp.js", |
@@ -42,1 +42,161 @@ 'use strict'; | ||
}); | ||
test('Decoding tests', async t => { | ||
// Example taken from RFC2045 section 6.7 | ||
const encoded = | ||
"Now's the time =\r\n" + | ||
"for all folk to come=\r\n" + | ||
" to the aid of their country." | ||
const expectedDecoded = | ||
"Now's the time for all folk to come to the aid of their country." | ||
await t.test('simple string', async () => { | ||
const decoded = libqp.decode(encoded).toString(); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
await t.test('stream', async () => { | ||
const decoder = new libqp.Decoder(); | ||
const decoded = await new Promise((resolve, reject) => { | ||
const chunks = []; | ||
decoder.on('readable', () => { | ||
let chunk; | ||
while ((chunk = decoder.read()) !== null) { | ||
chunks.push(chunk); | ||
} | ||
}); | ||
decoder.on('end', () => { | ||
resolve(Buffer.concat(chunks).toString()); | ||
}); | ||
decoder.on('Error', err => { | ||
reject(err); | ||
}); | ||
decoder.end(Buffer.from(encoded)); | ||
}); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
await t.test('stream, multiple chunks', async () => { | ||
const encodedChunk1Length = 3; | ||
const encodedChunk1 = encoded.substring(0, encodedChunk1Length) | ||
const encodedChunk2 = encoded.substring(encodedChunk1Length) | ||
const decoder = new libqp.Decoder(); | ||
const decoded = await new Promise((resolve, reject) => { | ||
const chunks = []; | ||
decoder.on('readable', () => { | ||
let chunk; | ||
while ((chunk = decoder.read()) !== null) { | ||
chunks.push(chunk); | ||
} | ||
}); | ||
decoder.on('end', () => { | ||
resolve(Buffer.concat(chunks).toString()); | ||
}); | ||
decoder.on('Error', err => { | ||
reject(err); | ||
}); | ||
decoder.write(Buffer.from(encodedChunk1)); | ||
decoder.end(Buffer.from(encodedChunk2)); | ||
}); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
await t.test('stream, space at end of chunk', async () => { | ||
const encodedChunk1Length = encoded.indexOf(' ') + 1; | ||
const encodedChunk1 = encoded.substring(0, encodedChunk1Length) | ||
const encodedChunk2 = encoded.substring(encodedChunk1Length) | ||
const decoder = new libqp.Decoder(); | ||
const decoded = await new Promise((resolve, reject) => { | ||
const chunks = []; | ||
decoder.on('readable', () => { | ||
let chunk; | ||
while ((chunk = decoder.read()) !== null) { | ||
chunks.push(chunk); | ||
} | ||
}); | ||
decoder.on('end', () => { | ||
resolve(Buffer.concat(chunks).toString()); | ||
}); | ||
decoder.on('Error', err => { | ||
reject(err); | ||
}); | ||
decoder.write(Buffer.from(encodedChunk1)); | ||
decoder.end(Buffer.from(encodedChunk2)); | ||
}); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
await t.test('stream, soft line break equals sign at end of chunk', async () => { | ||
const encodedChunk1Length = encoded.indexOf('=') + 1; | ||
const encodedChunk1 = encoded.substring(0, encodedChunk1Length) | ||
const encodedChunk2 = encoded.substring(encodedChunk1Length) | ||
const decoder = new libqp.Decoder(); | ||
const decoded = await new Promise((resolve, reject) => { | ||
const chunks = []; | ||
decoder.on('readable', () => { | ||
let chunk; | ||
while ((chunk = decoder.read()) !== null) { | ||
chunks.push(chunk); | ||
} | ||
}); | ||
decoder.on('end', () => { | ||
resolve(Buffer.concat(chunks).toString()); | ||
}); | ||
decoder.on('Error', err => { | ||
reject(err); | ||
}); | ||
decoder.write(Buffer.from(encodedChunk1)); | ||
decoder.end(Buffer.from(encodedChunk2)); | ||
}); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
await t.test('stream, CR at end of chunk', async () => { | ||
const encodedChunk1Length = encoded.indexOf('\r') + 1; | ||
const encodedChunk1 = encoded.substring(0, encodedChunk1Length) | ||
const encodedChunk2 = encoded.substring(encodedChunk1Length) | ||
const decoder = new libqp.Decoder(); | ||
const decoded = await new Promise((resolve, reject) => { | ||
const chunks = []; | ||
decoder.on('readable', () => { | ||
let chunk; | ||
while ((chunk = decoder.read()) !== null) { | ||
chunks.push(chunk); | ||
} | ||
}); | ||
decoder.on('end', () => { | ||
resolve(Buffer.concat(chunks).toString()); | ||
}); | ||
decoder.on('Error', err => { | ||
reject(err); | ||
}); | ||
decoder.write(Buffer.from(encodedChunk1)); | ||
decoder.end(Buffer.from(encodedChunk2)); | ||
}); | ||
assert.strictEqual(decoded, expectedDecoded); | ||
}); | ||
}); |
# Changelog | ||
## [3.7.2](https://github.com/nodemailer/mailparser/compare/v3.7.1...v3.7.2) (2024-11-29) | ||
### Bug Fixes | ||
* **deps:** Bumped deps to fix issue with missing whitespace ([92884d0](https://github.com/nodemailer/mailparser/commit/92884d0619efa77042ecc35fbc887e93a59e5a93)) | ||
## [3.7.1](https://github.com/nodemailer/mailparser/compare/v3.7.0...v3.7.1) (2024-04-25) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "mailparser", | ||
"version": "3.7.1", | ||
"version": "3.7.2", | ||
"description": "Parse e-mails", | ||
@@ -20,15 +20,15 @@ "main": "index.js", | ||
"dependencies": { | ||
"encoding-japanese": "2.1.0", | ||
"encoding-japanese": "2.2.0", | ||
"he": "1.2.0", | ||
"html-to-text": "9.0.5", | ||
"iconv-lite": "0.6.3", | ||
"libmime": "5.3.5", | ||
"libmime": "5.3.6", | ||
"linkify-it": "5.0.0", | ||
"mailsplit": "5.4.0", | ||
"nodemailer": "6.9.13", | ||
"mailsplit": "5.4.2", | ||
"nodemailer": "6.9.16", | ||
"punycode.js": "2.3.1", | ||
"tlds": "1.252.0" | ||
"tlds": "1.255.0" | ||
}, | ||
"devDependencies": { | ||
"ajv": "8.12.0", | ||
"ajv": "8.17.1", | ||
"eslint": "8.57.0", | ||
@@ -38,3 +38,3 @@ "eslint-config-nodemailer": "1.2.0", | ||
"grunt": "1.6.1", | ||
"grunt-cli": "1.4.3", | ||
"grunt-cli": "1.5.0", | ||
"grunt-contrib-nodeunit": "5.0.0", | ||
@@ -41,0 +41,0 @@ "grunt-eslint": "24.3.0", |
@@ -158,3 +158,7 @@ 'use strict'; | ||
} | ||
if (relativeIndex && !relativeMatchFound) return; | ||
if (relativeIndex && !relativeMatchFound) { | ||
return; | ||
} | ||
this.add(keyName, value, index); | ||
@@ -161,0 +165,0 @@ } |
{ | ||
"name": "mailsplit", | ||
"version": "5.4.0", | ||
"version": "5.4.2", | ||
"description": "Split email messages into an object stream", | ||
@@ -10,3 +10,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "grunt" | ||
"test": "grunt", | ||
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install" | ||
}, | ||
@@ -16,5 +17,5 @@ "author": "Andris Reinman", | ||
"dependencies": { | ||
"libbase64": "1.2.1", | ||
"libmime": "5.2.0", | ||
"libqp": "2.0.1" | ||
"libbase64": "1.3.0", | ||
"libmime": "5.3.6", | ||
"libqp": "2.1.1" | ||
}, | ||
@@ -24,6 +25,6 @@ "devDependencies": { | ||
"eslint-config-nodemailer": "1.2.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"grunt": "1.5.3", | ||
"grunt-cli": "1.4.3", | ||
"grunt-contrib-nodeunit": "4.0.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"grunt": "1.6.1", | ||
"grunt-cli": "1.5.0", | ||
"grunt-contrib-nodeunit": "5.0.0", | ||
"grunt-eslint": "24.0.1", | ||
@@ -30,0 +31,0 @@ "random-message": "1.1.0" |
@@ -213,1 +213,3 @@ # mailsplit | ||
Dual licensed under **MIT** or **EUPLv1.1+** | ||
> `mailsplit` is part of the Zone Mail Suite (ZMS). Suite of programs and modules for an efficient, fast and modern email server. |
# CHANGELOG | ||
## [6.9.16](https://github.com/nodemailer/nodemailer/compare/v6.9.15...v6.9.16) (2024-10-28) | ||
### Bug Fixes | ||
* **addressparser:** Correctly detect if user local part is attached to domain part ([f2096c5](https://github.com/nodemailer/nodemailer/commit/f2096c51b92a69ecfbcc15884c28cb2c2f00b826)) | ||
## [6.9.15](https://github.com/nodemailer/nodemailer/compare/v6.9.14...v6.9.15) (2024-08-08) | ||
### Bug Fixes | ||
* Fix memory leak ([#1667](https://github.com/nodemailer/nodemailer/issues/1667)) ([baa28f6](https://github.com/nodemailer/nodemailer/commit/baa28f659641a4bc30360633673d851618f8e8bd)) | ||
* **mime:** Added GeoJSON closes [#1637](https://github.com/nodemailer/nodemailer/issues/1637) ([#1665](https://github.com/nodemailer/nodemailer/issues/1665)) ([79b8293](https://github.com/nodemailer/nodemailer/commit/79b8293ad557d36f066b4675e649dd80362fd45b)) | ||
## [6.9.14](https://github.com/nodemailer/nodemailer/compare/v6.9.13...v6.9.14) (2024-06-19) | ||
@@ -4,0 +19,0 @@ |
@@ -10,3 +10,2 @@ 'use strict'; | ||
function _handleAddress(tokens) { | ||
let token; | ||
let isGroup = false; | ||
@@ -27,3 +26,4 @@ let state = 'text'; | ||
for (i = 0, len = tokens.length; i < len; i++) { | ||
token = tokens[i]; | ||
let token = tokens[i]; | ||
let prevToken = i ? tokens[i - 1] : null; | ||
if (token.type === 'operator') { | ||
@@ -43,2 +43,3 @@ switch (token.value) { | ||
state = 'text'; | ||
break; | ||
} | ||
@@ -52,3 +53,9 @@ } else if (token.value) { | ||
} | ||
data[state].push(token.value); | ||
if (prevToken && prevToken.noBreak && data[state].length) { | ||
// join values | ||
data[state][data[state].length - 1] += token.value; | ||
} else { | ||
data[state].push(token.value); | ||
} | ||
} | ||
@@ -179,7 +186,8 @@ } | ||
tokenize() { | ||
let chr, | ||
list = []; | ||
let list = []; | ||
for (let i = 0, len = this.str.length; i < len; i++) { | ||
chr = this.str.charAt(i); | ||
this.checkChar(chr); | ||
let chr = this.str.charAt(i); | ||
let nextChr = i < len - 1 ? this.str.charAt(i + 1) : null; | ||
this.checkChar(chr, nextChr); | ||
} | ||
@@ -202,3 +210,3 @@ | ||
*/ | ||
checkChar(chr) { | ||
checkChar(chr, nextChr) { | ||
if (this.escaped) { | ||
@@ -211,2 +219,7 @@ // ignore next condition blocks | ||
}; | ||
if (nextChr && ![' ', '\t', '\r', '\n', ',', ';'].includes(nextChr)) { | ||
this.node.noBreak = true; | ||
} | ||
this.list.push(this.node); | ||
@@ -216,2 +229,3 @@ this.node = null; | ||
this.escaped = false; | ||
return; | ||
@@ -218,0 +232,0 @@ } else if (!this.operatorExpecting && chr in this.operators) { |
@@ -631,2 +631,11 @@ 'use strict'; | ||
if (err) { | ||
// create passthrough stream to consume to prevent OOM | ||
let stream = new PassThrough(); | ||
if (typeof message.pipe === 'function') { | ||
message.pipe(stream); | ||
} else { | ||
stream.write(message); | ||
stream.end(); | ||
} | ||
return callback(err); | ||
@@ -633,0 +642,0 @@ } |
{ | ||
"name": "nodemailer", | ||
"version": "6.9.14", | ||
"version": "6.9.16", | ||
"description": "Easy as cake e-mail sending from your Node.js applications", | ||
@@ -26,3 +26,3 @@ "main": "lib/nodemailer.js", | ||
"devDependencies": { | ||
"@aws-sdk/client-ses": "3.600.0", | ||
"@aws-sdk/client-ses": "3.679.0", | ||
"bunyan": "1.8.15", | ||
@@ -39,3 +39,3 @@ "c8": "10.1.2", | ||
"proxy-test-server": "1.0.0", | ||
"smtp-server": "3.13.4" | ||
"smtp-server": "3.13.6" | ||
}, | ||
@@ -42,0 +42,0 @@ "engines": { |
# Changelog | ||
## [3.13.6](https://github.com/nodemailer/smtp-server/compare/v3.13.5...v3.13.6) (2024-10-21) | ||
### Bug Fixes | ||
* **XFORWARD:** Fixed client hostname processing. Fixes [#147](https://github.com/nodemailer/smtp-server/issues/147) ([d518417](https://github.com/nodemailer/smtp-server/commit/d518417d0b9274cc45a5fde597142f79867d3eeb)) | ||
## [3.13.5](https://github.com/nodemailer/smtp-server/compare/v3.13.4...v3.13.5) (2024-09-08) | ||
### Bug Fixes | ||
* Replaced punycode with punycode.js ([4ccbcf2](https://github.com/nodemailer/smtp-server/commit/4ccbcf2f7d0daee0554c416be03d0eda7e2999f5)) | ||
## [3.13.4](https://github.com/nodemailer/smtp-server/compare/v3.13.3...v3.13.4) (2024-04-12) | ||
@@ -4,0 +18,0 @@ |
@@ -11,3 +11,3 @@ 'use strict'; | ||
const os = require('os'); | ||
const punycode = require('punycode/'); | ||
const punycode = require('punycode.js'); | ||
const EventEmitter = require('events'); | ||
@@ -1111,3 +1111,3 @@ const base32 = require('base32.js'); | ||
case 'HELO': | ||
value = Number(value) || 0; | ||
value = (value || '').toString().toLowerCase(); | ||
this._server.logger.info( | ||
@@ -1466,3 +1466,3 @@ { | ||
}, | ||
'Connection upgraded to TLS using ', | ||
'Connection upgraded to TLS using', | ||
cipher || 'N/A' | ||
@@ -1469,0 +1469,0 @@ ); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
const shared = require('nodemailer/lib/shared'); | ||
const punycode = require('punycode/'); | ||
const punycode = require('punycode.js'); | ||
const crypto = require('crypto'); | ||
@@ -12,0 +12,0 @@ const base32 = require('base32.js'); |
@@ -5,4 +5,7 @@ module.exports = { | ||
// API changes break existing tests | ||
'proxy' | ||
'proxy', | ||
// API changes | ||
'eslint' | ||
] | ||
}; |
# CHANGELOG | ||
## [6.9.15](https://github.com/nodemailer/nodemailer/compare/v6.9.14...v6.9.15) (2024-08-08) | ||
### Bug Fixes | ||
* Fix memory leak ([#1667](https://github.com/nodemailer/nodemailer/issues/1667)) ([baa28f6](https://github.com/nodemailer/nodemailer/commit/baa28f659641a4bc30360633673d851618f8e8bd)) | ||
* **mime:** Added GeoJSON closes [#1637](https://github.com/nodemailer/nodemailer/issues/1637) ([#1665](https://github.com/nodemailer/nodemailer/issues/1665)) ([79b8293](https://github.com/nodemailer/nodemailer/commit/79b8293ad557d36f066b4675e649dd80362fd45b)) | ||
## [6.9.14](https://github.com/nodemailer/nodemailer/compare/v6.9.13...v6.9.14) (2024-06-19) | ||
### Bug Fixes | ||
* **api:** Added support for Ethereal authentication ([56b2205](https://github.com/nodemailer/nodemailer/commit/56b22052a98de9e363f6c4d26d1512925349c3f3)) | ||
* **services.json:** Add Email Services Provider Feishu Mail (CN) ([#1648](https://github.com/nodemailer/nodemailer/issues/1648)) ([e9e9ecc](https://github.com/nodemailer/nodemailer/commit/e9e9ecc99b352948a912868c7912b280a05178c6)) | ||
* **services.json:** update Mailtrap host and port in well known ([#1652](https://github.com/nodemailer/nodemailer/issues/1652)) ([fc2c9ea](https://github.com/nodemailer/nodemailer/commit/fc2c9ea0b4c4f4e514143d2a138c9a23095fc827)) | ||
* **well-known-services:** Add Loopia in well known services ([#1655](https://github.com/nodemailer/nodemailer/issues/1655)) ([21a28a1](https://github.com/nodemailer/nodemailer/commit/21a28a18fc9fdf8e0e86ddd846e54641395b2cb6)) | ||
## [6.9.13](https://github.com/nodemailer/nodemailer/compare/v6.9.12...v6.9.13) (2024-03-20) | ||
@@ -4,0 +22,0 @@ |
@@ -16,2 +16,3 @@ 'use strict'; | ||
const ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\/+$/, ''); | ||
const ETHEREAL_API_KEY = (process.env.ETHEREAL_API_KEY || '').replace(/\s*/g, '') || null; | ||
const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase()); | ||
@@ -83,11 +84,17 @@ | ||
let requestHeaders = {}; | ||
let requestBody = { | ||
requestor: packageData.name, | ||
version: packageData.version | ||
}; | ||
if (ETHEREAL_API_KEY) { | ||
requestHeaders.Authorization = 'Bearer ' + ETHEREAL_API_KEY; | ||
} | ||
let req = nmfetch(apiUrl + '/user', { | ||
contentType: 'application/json', | ||
method: 'POST', | ||
body: Buffer.from( | ||
JSON.stringify({ | ||
requestor: packageData.name, | ||
version: packageData.version | ||
}) | ||
) | ||
headers: requestHeaders, | ||
body: Buffer.from(JSON.stringify(requestBody)) | ||
}); | ||
@@ -94,0 +101,0 @@ |
@@ -631,2 +631,11 @@ 'use strict'; | ||
if (err) { | ||
// create passthrough stream to consume to prevent OOM | ||
let stream = new PassThrough(); | ||
if (typeof message.pipe === 'function') { | ||
message.pipe(stream); | ||
} else { | ||
stream.write(message); | ||
stream.end(); | ||
} | ||
return callback(err); | ||
@@ -633,0 +642,0 @@ } |
@@ -60,2 +60,10 @@ { | ||
"Feishu Mail": { | ||
"aliases": ["Feishu", "FeishuMail"], | ||
"domains": ["www.feishu.cn"], | ||
"host": "smtp.feishu.cn", | ||
"port": 465, | ||
"secure": true | ||
}, | ||
"GandiMail": { | ||
@@ -113,3 +121,6 @@ "aliases": ["Gandi", "Gandi Mail"], | ||
}, | ||
"Loopia": { | ||
"host": "mailcluster.loopia.se", | ||
"port": 465 | ||
}, | ||
"mail.ee": { | ||
@@ -152,4 +163,4 @@ "host": "smtp.mail.ee" | ||
"Mailtrap": { | ||
"host": "smtp.mailtrap.io", | ||
"port": 2525 | ||
"host": "live.smtp.mailtrap.io", | ||
"port": 587 | ||
}, | ||
@@ -156,0 +167,0 @@ |
{ | ||
"name": "nodemailer", | ||
"version": "6.9.13", | ||
"version": "6.9.15", | ||
"description": "Easy as cake e-mail sending from your Node.js applications", | ||
@@ -26,5 +26,5 @@ "main": "lib/nodemailer.js", | ||
"devDependencies": { | ||
"@aws-sdk/client-ses": "3.529.1", | ||
"@aws-sdk/client-ses": "3.600.0", | ||
"bunyan": "1.8.15", | ||
"c8": "9.1.0", | ||
"c8": "10.1.2", | ||
"eslint": "8.57.0", | ||
@@ -34,3 +34,3 @@ "eslint-config-nodemailer": "1.2.0", | ||
"libbase64": "1.3.0", | ||
"libmime": "5.3.4", | ||
"libmime": "5.3.5", | ||
"libqp": "2.1.0", | ||
@@ -40,3 +40,3 @@ "nodemailer-ntlm-auth": "1.0.4", | ||
"proxy-test-server": "1.0.0", | ||
"smtp-server": "3.13.3" | ||
"smtp-server": "3.13.4" | ||
}, | ||
@@ -43,0 +43,0 @@ "engines": { |
{ | ||
"name": "smtp-server", | ||
"version": "3.13.4", | ||
"version": "3.13.6", | ||
"description": "Create custom SMTP servers on the fly", | ||
@@ -15,4 +15,4 @@ "main": "lib/smtp-server.js", | ||
"ipv6-normalize": "1.0.1", | ||
"nodemailer": "6.9.13", | ||
"punycode": "2.3.1" | ||
"nodemailer": "6.9.15", | ||
"punycode.js": "2.3.1" | ||
}, | ||
@@ -24,6 +24,6 @@ "devDependencies": { | ||
"grunt": "1.6.1", | ||
"grunt-cli": "1.4.3", | ||
"grunt-cli": "1.5.0", | ||
"grunt-eslint": "24.3.0", | ||
"grunt-mocha-test": "0.13.3", | ||
"mocha": "10.4.0", | ||
"mocha": "10.7.3", | ||
"pem": "1.14.8" | ||
@@ -30,0 +30,0 @@ }, |
@@ -300,3 +300,2 @@ [ | ||
"cz", | ||
"dabur", | ||
"dad", | ||
@@ -806,3 +805,2 @@ "dance", | ||
"name", | ||
"natura", | ||
"navy", | ||
@@ -1044,3 +1042,2 @@ "nba", | ||
"sharp", | ||
"shaw", | ||
"shell", | ||
@@ -1047,0 +1044,0 @@ "shia", |
{ | ||
"name": "tlds", | ||
"version": "1.252.0", | ||
"version": "1.255.0", | ||
"description": "A list of TLDs.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/stephenmathieson/node-tlds.git", |
{ | ||
"name": "node-red-node-email", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Node-RED nodes to send and receive simple emails.", | ||
@@ -8,5 +8,5 @@ "dependencies": { | ||
"node-pop3": "^0.9.0", | ||
"mailparser": "^3.7.1", | ||
"nodemailer": "^6.9.14", | ||
"smtp-server": "^3.13.4" | ||
"mailparser": "^3.7.2", | ||
"nodemailer": "^6.9.16", | ||
"smtp-server": "^3.13.6" | ||
}, | ||
@@ -13,0 +13,0 @@ "bundledDependencies": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2
-33.33%31
-22.5%61
-16.44%5595555
-25.13%674
-12.13%91709
-23.75%Updated
Updated
Updated