Skip to content

Commit

Permalink
Release v1.2.3 (#11)
Browse files Browse the repository at this point in the history
- style(es6): replace forEach with for...of
- doc(CONTRIBUTORS): added
  • Loading branch information
msimerson committed Apr 24, 2024
1 parent aada2dc commit cf9fa09
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .release
Submodule .release updated 7 files
+3 −0 CHANGELOG.md
+4 −3 README.md
+19 −0 base.sh
+82 −0 contributors.js
+1 −1 finish.sh
+53 −12 start.sh
+29 −17 submit.sh
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [1.2.3] - 2024-04-24

- style(es6): replace forEach with for...of
- doc(CONTRIBUTORS): added

### [1.2.2] - 2024-04-07

- dep: eslint-plugin-haraka -> @haraka/eslint-config
Expand Down Expand Up @@ -37,3 +42,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
[1.2.0]: https://github.com/haraka/email-message/releases/tag/v1.2.0
[1.2.1]: https://github.com/haraka/email-message/releases/tag/v1.2.1
[1.2.2]: https://github.com/haraka/email-message/releases/tag/v1.2.2
[1.2.3]: https://github.com/haraka/email-message/releases/tag/v1.2.3
8 changes: 8 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributors

This handcrafted artisinal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/email-message/commits?author=msimerson">19</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/82041?v=4"><br><a href="https://github.com/gramakri">gramakri</a> (<a href="https://github.com/haraka/email-message/commits?author=gramakri">1</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>
63 changes: 28 additions & 35 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class Header {
}

parse(lines) {
const self = this;

for (const line of lines) {
if (/^[ \t]/.test(line)) {
// continuation
Expand All @@ -55,11 +53,11 @@ class Header {
}

// Now add decoded versions
Object.keys(this.headers).forEach((key2) => {
self.headers[key2].forEach((val2) => {
self._add_header_decode(key2, val2, 'push');
});
});
for (const key of Object.keys(this.headers)) {
for (const val of this.headers[key]) {
this._add_header_decode(key, val, 'push');
}
}
}

decode_header(val) {
Expand All @@ -76,8 +74,6 @@ class Header {

val = _decode_rfc2231(rfc2231_params, val);

// console.log(rfc2231_params);

// strip 822 comments in the most basic way - does not support nested comments
// val = val.replace(/\([^\)]*\)/, '');

Expand Down Expand Up @@ -383,21 +379,19 @@ class Body extends events.EventEmitter {
} else {
this.emit('mime_boundary', line_string);
const bod = new Body(new Header(), this.options);
this.listeners('attachment_start').forEach((cb) => {
bod.on('attachment_start', cb);
});
this.listeners('attachment_data').forEach((cb) => {
bod.on('attachment_data', cb);
});
this.listeners('attachment_end').forEach((cb) => {
bod.on('attachment_end', cb);
});
this.listeners('mime_boundary').forEach((cb) =>
bod.on('mime_boundary', cb),
);
this.filters.forEach((f) => {
for (const ln of [
'attachment_start',
'attachment_data',
'attachment_end',
'mime_boundary',
]) {
for (const cb of this.listeners(ln)) {
bod.on(ln, cb);
}
}
for (const f of this.filters) {
bod.add_filter(f);
});
}
this.children.push(bod);
bod.state = 'headers';
}
Expand Down Expand Up @@ -468,9 +462,9 @@ class Body extends events.EventEmitter {

_empty_filter(ct, enc, cd) {
let new_buf = Buffer.from('');
this.filters.forEach((filter) => {
for (const filter of this.filters) {
new_buf = filter(ct, enc, new_buf, cd) || new_buf;
});
}

return new_buf;
}
Expand Down Expand Up @@ -534,9 +528,9 @@ class Body extends events.EventEmitter {
// whatever encoding scheme we used to decode it.

let new_buf = buf;
this.filters.forEach((filter) => {
for (const filter of this.filters) {
new_buf = filter(ct, enc, new_buf) || new_buf;
});
}

// convert back to base_64 or QP if required:
if (this.decode_function === this.decode_qp) {
Expand Down Expand Up @@ -634,15 +628,14 @@ class Body extends events.EventEmitter {
// next section
this.emit('mime_boundary', line_string);
const bod = new Body(new Header(), this.options);
this.listeners('attachment_start').forEach((cb) => {
bod.on('attachment_start', cb);
});
this.listeners('mime_boundary').forEach((cb) =>
bod.on('mime_boundary', cb),
);
this.filters.forEach((f) => {
for (const ln of ['attachment_start', 'mime_boundary']) {
for (const cb of this.listeners(ln)) {
bod.on(ln, cb);
}
}
for (const f of this.filters) {
bod.add_filter(f);
});
}
this.children.push(bod);
bod.state = 'headers';
this.state = 'child';
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-email-message",
"version": "1.2.2",
"version": "1.2.3",
"description": "Haraka email message",
"main": "index.js",
"files": [
Expand All @@ -14,8 +14,8 @@
"prettier": "npx prettier . --check",
"prettier:fix": "npx prettier . --write --log-level=warn",
"test": "npx mocha@10",
"versions": "npx @msimerson/dependency-version-checker check",
"versions:fix": "npx @msimerson/dependency-version-checker update && npm run prettier:fix"
"versions": "npx dependency-version-checker check",
"versions:fix": "npx dependency-version-checker update && npm run prettier:fix"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit cf9fa09

Please sign in to comment.