Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Apr 8, 2024
1 parent 575d6c4 commit 7dba9c1
Show file tree
Hide file tree
Showing 14 changed files with 405 additions and 386 deletions.
8 changes: 4 additions & 4 deletions .codeclimate.yml
@@ -1,13 +1,13 @@
engines:
eslint:
enabled: true
channel: "eslint-8"
channel: 'eslint-8'
config:
config: ".eslintrc.yaml"
config: '.eslintrc.yaml'

ratings:
paths:
- "**.js"
paths:
- '**.js'

checks:
method-complexity:
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.yaml
Expand Up @@ -2,6 +2,6 @@ env:
node: true
es6: true
mocha: true
es2023: true
es2022: true

extends: ["@haraka"]
extends: ['@haraka']
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Expand Up @@ -3,7 +3,7 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
@@ -1,6 +1,6 @@
name: CI

on: [ pull_request, push ]
on: [pull_request, push]

env:
CI: true
Expand All @@ -14,9 +14,9 @@ jobs:
secrets: inherit

test:
needs: [ lint ]
needs: [lint]
uses: haraka/.github/.github/workflows/ubuntu.yml@master

windows:
needs: [ lint ]
needs: [lint]
uses: haraka/.github/.github/workflows/windows.yml@master
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Expand Up @@ -2,10 +2,10 @@ name: CodeQL

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '18 7 * * 4'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -13,4 +13,4 @@ env:
jobs:
publish:
uses: haraka/.github/.github/workflows/publish.yml@master
secrets: inherit
secrets: inherit
2 changes: 2 additions & 0 deletions .prettierrc.yml
@@ -0,0 +1,2 @@
singleQuote: true
semi: false
12 changes: 1 addition & 11 deletions Changes.md → CHANGELOG.md
Expand Up @@ -2,7 +2,6 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/).


### Unreleased

### [2.2.1] - 2024-04-08
Expand All @@ -11,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- populate `[files]` in package.json. Delete .npmignore.
- updated scripts{} in package.json
- lint: remove duplicate / stale rules from .eslintrc
- prettier (except index)

### [2.2.0] - 2024-02-23

Expand All @@ -27,61 +27,51 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- doc(README): add links to RFC 2822, 5322 #53
- doc(README): enabled syntax highlighting with code fences #51


### 2.1.0 - 2021-02-26

- make parse accept an options object as second argument
- allow comma (,) in display name, default off [#52](https://github.com/haraka/node-address-rfc2822/pull/52)


### 2.0.6 - 2020-11-17

- replace travis/appveyor CI tests with Github Actions [#48](https://github.com/haraka/node-address-rfc2822/pull/48)
- test: when splitting lines, use os.EOL
- allow @ symbol in display name [#47](https://github.com/haraka/node-address-rfc2822/pull/47)


### 2.0.5 - 2020-06-02

- update email-addresses to 3.1.0 [#46](https://github.com/haraka/node-address-rfc2822/pull/46)
- test framework: nodeunit -> mocha


### 2.0.4 - 2018-06-29

- throw a proper error object, not a string.


### 2.0.3 - 2018-03-01

- use es6 classes
- export the Address class [#29](https://github.com/haraka/node-address-rfc2822/pull/29)


### 2.0.2 - 2018-02-24

- Fix a possible regexp backtracking DoS [#28](https://github.com/haraka/node-address-rfc2822/pull/28)


### 2.0.1 - 2017-06-26

- trim the line in parse() [#24](https://github.com/haraka/node-address-rfc2822/pull/24)


### 1.0.2 - 2016-06-16

- updated for eslint 4 compat [#23](https://github.com/haraka/node-address-rfc2822/pull/23)
- use email-addresses for parser [#20](https://github.com/haraka/node-address-rfc2822/pull/20)


### 1.0.1 - 2016-09-23

- use native to[lower|upper]Case functions vs regex
- remove node 0.12 testing
- remove node 0.10, 5, add node 6
- throw error on nothing to parse


### 1.0.0 - 2016-02-23

- Initial implementation
Expand Down
18 changes: 8 additions & 10 deletions README.md
Expand Up @@ -2,7 +2,6 @@
[![Code Climate][clim-img]][clim-url]
[![Coverage Status][cov-img]][cov-url]


# address-rfc2822

Parser for RFC 2822 & 5322 (Header) format email addresses.
Expand All @@ -18,24 +17,23 @@ It is almost a direct port of the perl module Mail::Address and I'm grateful to
## Usage

```js
const addrparser = require('address-rfc2822');
const addrparser = require('address-rfc2822')

const addresses = addrparser.parse("Matt Sergeant <helpme+npm@gmail.com>");
const address = addresses[0];
const addresses = addrparser.parse('Matt Sergeant <helpme+npm@gmail.com>')
const address = addresses[0]

console.log(`Email address: ${address.address}`); // helpme+npm@gmail.com
console.log(`Email name: ${address.name()}`); // Matt Sergeant
console.log(`Reformatted: ${address.format()}`); // Matt Sergeant <helpme+npm@gmail.com>
console.log(`User part: ${address.user()}`); // helpme+npm
console.log(`Host part: ${address.host()}`); // gmail.com
console.log(`Email address: ${address.address}`) // helpme+npm@gmail.com
console.log(`Email name: ${address.name()}`) // Matt Sergeant
console.log(`Reformatted: ${address.format()}`) // Matt Sergeant <helpme+npm@gmail.com>
console.log(`User part: ${address.user()}`) // helpme+npm
console.log(`Host part: ${address.host()}`) // gmail.com
```

## More Info

- [RFC 2822](https://tools.ietf.org/html/rfc2822)
- [RFC 5322](https://tools.ietf.org/html/rfc5322)


## License

This module is MIT licensed.
Expand Down

0 comments on commit 7dba9c1

Please sign in to comment.