Skip to content
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
name: CI

on:
push:
pull_request:
types: [opened, synchronize, reopened]

env:
CI: true

jobs:
lint:
uses: NicTool/.github/.github/workflows/lint.yml@main
permissions:
contents: read

coverage:
uses: NicTool/.github/.github/workflows/coverage.yml@main
secrets: inherit
permissions:
contents: read

test:
needs: lint
uses: NicTool/.github/.github/workflows/test.yml@main
secrets: inherit
permissions:
contents: read
14 changes: 0 additions & 14 deletions .github/workflows/codeql.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ dist/*-grammar.js
dist/*.js
package-lock.json
src/mara-moo.ne
.release/
2 changes: 1 addition & 1 deletion .release
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### Unreleased

### [1.1.8] - 2026-04-07

- style: replace str.substring (deprecated) with slice

### [1.1.7] - 2026-03-13

- dep(eslint): update to v10
Expand Down Expand Up @@ -192,3 +196,4 @@
[1.1.5]: https://github.com/NicTool/dns-zone/releases/tag/1.1.5
[1.1.6]: https://github.com/NicTool/dns-zone/releases/tag/v1.1.6
[1.1.7]: https://github.com/NicTool/dns-zone/releases/tag/v1.1.7
[1.1.8]: https://github.com/NicTool/dns-zone/releases/tag/v1.1.8
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This handcrafted artisanal 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/NicTool/dns-zone/commits?author=msimerson">27</a>) |
| <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/NicTool/dns-zone/commits?author=msimerson">28</a>) |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is generated by [.release](https://github.com/msimerson/.release).
Expand Down
2 changes: 1 addition & 1 deletion bin/dns-zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ function toHuman(zoneArray) {
.getRdataFields()
.map((f) => r.get(f))
.join(' ')
process.stdout.write(rdata.substring(0, rdataWidth))
process.stdout.write(rdata.slice(0, rdataWidth))
if (rdata.length > rdataWidth) process.stdout.write('...')

process.stdout.write('\n')
Expand Down
28 changes: 14 additions & 14 deletions lib/tinydns.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function parseTinyDot(str) {
* an A (``address'') record showing ip as the IP address of x.ns.fqdn; and
* an SOA (``start of authority'') record for fqdn listing x.ns.fqdn as the primary name server and hostmaster@fqdn as the contact address.
*/
const [fqdn, ip, mname, ttl, ts, loc] = str.substring(1).split(':')
const [fqdn, ip, mname, ttl, ts, loc] = str.slice(1).split(':')
const rrs = []

rrs.push(
Expand All @@ -100,7 +100,7 @@ function parseTinyDot(str) {
expire: 1048576,
minimum: 2560,
timestamp: parseInt(ts) || '',
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)

Expand All @@ -111,7 +111,7 @@ function parseTinyDot(str) {
type: 'NS',
dname: rr.fullyQualify(/\./.test(mname) ? mname : `${mname}.ns.${fqdn}`),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)

Expand All @@ -123,7 +123,7 @@ function parseTinyDot(str) {
address: ip,
ttl: parseInt(ttl, 10),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)
}
Expand All @@ -133,7 +133,7 @@ function parseTinyDot(str) {
function parseTinyAmpersand(str) {
// &fqdn:ip:x:ttl:timestamp:lo

const [fqdn, ip, dname, ttl, ts, loc] = str.substring(1).split(':')
const [fqdn, ip, dname, ttl, ts, loc] = str.slice(1).split(':')
const rrs = []

rrs.push(
Expand All @@ -143,7 +143,7 @@ function parseTinyAmpersand(str) {
dname: rr.fullyQualify(/\./.test(dname) ? dname : `${dname}.ns.${fqdn}`),
ttl: parseInt(ttl, 10),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)

Expand All @@ -155,7 +155,7 @@ function parseTinyAmpersand(str) {
address: ip,
ttl: parseInt(ttl, 10),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)
}
Expand All @@ -167,15 +167,15 @@ function parseTinyEquals(str) {
// =fqdn:ip:ttl:timestamp:lo
const rrs = [new RR.A({ tinyline: str })]

const [fqdn, ip, ttl, ts, loc] = str.substring(1).split(':')
const [fqdn, ip, ttl, ts, loc] = str.slice(1).split(':')
rrs.push(
new RR.PTR({
owner: `${ip.split('.').reverse().join('.')}.in-addr.arpa`,
ttl: parseInt(ttl, 10),
type: 'PTR',
dname: rr.fullyQualify(fqdn),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)

Expand All @@ -187,7 +187,7 @@ function parseTinyAt(str) {
const rrs = [new RR.MX({ tinyline: str })]

// eslint-disable-next-line no-unused-vars
const [fqdn, ip, x, preference, ttl, ts, loc] = str.substring(1).split(':')
const [fqdn, ip, x, preference, ttl, ts, loc] = str.slice(1).split(':')
if (ip) {
rrs.push(
new RR.A({
Expand All @@ -196,7 +196,7 @@ function parseTinyAt(str) {
address: ip,
ttl: parseInt(ttl, 10),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)
}
Expand All @@ -208,7 +208,7 @@ function parseTinySix(str) {
// AAAA,PTR => 6 fqdn:ip:x:ttl:timestamp:lo
const rrs = [new RR.AAAA({ tinyline: str })]

const [fqdn, rdata, , ttl, ts, loc] = str.substring(1).split(':')
const [fqdn, rdata, , ttl, ts, loc] = str.slice(1).split(':')

rrs.push(
new RR.PTR({
Expand All @@ -217,7 +217,7 @@ function parseTinySix(str) {
dname: rr.fullyQualify(fqdn),
ttl: parseInt(ttl, 10),
timestamp: ts,
location: loc !== '' && loc !== '\n' ? loc : '',
location: loc?.trim() || '',
}),
)
return rrs
Expand All @@ -226,7 +226,7 @@ function parseTinySix(str) {
function parseTinyGeneric(str) {
// generic, :fqdn:n:rdata:ttl:timestamp:lo

const [, n, , , ,] = str.substring(1).split(':')
const [, n, , , ,] = str.slice(1).split(':')

switch (parseInt(n, 10)) {
case 13:
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nictool/dns-zone",
"version": "1.1.7",
"version": "1.1.8",
"description": "DNS Zone",
"main": "index.js",
"type": "module",
Expand All @@ -18,9 +18,10 @@
"prettier": "npx prettier --ignore-path .gitignore --check .",
"prettier:fix": "npx prettier --ignore-path .gitignore --write .",
"test": "npx mocha",
"versions": "npx dependency-version-checker check",
"versions:fix": "npx dependency-version-checker update",
"format": "npm run prettier:fix && npm run lint:fix"
"versions": "npx npm-dep-mgr check",
"versions:fix": "npx npm-dep-mgr update",
"format": "npm run prettier:fix && npm run lint:fix",
"test:coverage": "npx c8 --reporter=text --reporter=text-summary npm test"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,4 +60,4 @@
"singleQuote": true,
"trailingComma": "all"
}
}
}
Loading