Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Update Node versions #1124

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ on:
env:
CI: true
FORCE_COLOR: 2
NODE_COV: 16 # The Node.js version to run coveralls on
NODE_COV: "lts/*" # The Node.js version to run coveralls on

permissions:
contents: read

jobs:
lint:
Expand All @@ -18,23 +21,26 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: lts/*
cache: npm
- run: npm ci
- run: npm run lint

test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
name: Node ${{ matrix.node }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node:
- 10
- 12
- 14
- 16
- 18
- 20
- "lts/*"

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function formatAttributes(
const encode =
(opts.encodeEntities ?? opts.decodeEntities) === false
? replaceQuotes
: opts.xmlMode || opts.encodeEntities !== "utf8"
: !!opts.xmlMode || opts.encodeEntities !== "utf8"
? encodeXML
: escapeAttribute;

Expand Down Expand Up @@ -237,7 +237,7 @@ function renderTag(elem: Element, opts: DomSerializerOptions) {
tag += render(elem.children, opts);
}

if (opts.xmlMode || !singleTag.has(elem.name)) {
if (!!opts.xmlMode || !singleTag.has(elem.name)) {
tag += `</${elem.name}>`;
}
}
Expand All @@ -262,7 +262,7 @@ function renderText(elem: Text, opts: DomSerializerOptions) {
)
) {
data =
opts.xmlMode || opts.encodeEntities !== "utf8"
!!opts.xmlMode || opts.encodeEntities !== "utf8"
? encodeXML(data)
: escapeText(data);
}
Expand Down