3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Answer prose round 2: item 80 says what it names, the comment names its writer

This commit is contained in:
2026-10-05 01:04:50 +02:00
committed by Lillem4n
parent db5d6c0e46
commit 51b9272350
3 changed files with 11 additions and 10 deletions
+3 -2
View File
@@ -4,8 +4,9 @@
- **Breaking:** an attribute value that is not a plain object, array or JSON primitive, such as a
`Date`, `Map`, typed array or class instance, makes `isAdfDocument` return `false` and the
converters refuse it as `not-an-adf-document`, where it was written as `{}` or its own keys.
Build it as JSON holds it: `date.toISOString()`, `Object.fromEntries(map)`, `{ ...instance }`.
converters refuse it as `not-an-adf-document`. Before, the converters wrote it as `{}` or its own
keys. Build it as JSON holds it: `date.toISOString()`, `Object.fromEntries(map)`,
`Array.from(bytes)`, `{ ...instance }`.
- The README opens with what the package does and for whom, and `package.json` carries search
keywords.
- The source moves to [github.com/larvit/adf-codec](https://github.com/larvit/adf-codec), where
+1 -1
View File
@@ -19,7 +19,7 @@ export function isJsonValue(value: unknown): value is JsonValue {
return true
}
// Any realm's Object.prototype has a null prototype; a Date, Map or typed array would serialize as {} or a key per element.
// Any realm's Object.prototype has a null prototype; serializeCanonicalJson writes a Date or Map as {}.
function isPlainObject(value: unknown): value is object {
if (typeof value !== 'object' || value === null) return false
const prototype: unknown = Object.getPrototypeOf(value)
+7 -7
View File
@@ -74,8 +74,8 @@ Lands after items 6, 59, 60, 61 and 62. The CommonMark spec suite also runs agai
Today `null` and `undefined` throw a `TypeError` reading `length`, and `42` reads as an empty
document. A JavaScript caller, or a TypeScript one past an untyped boundary, can pass any of these.
No existing code reads true of a non-string input (`docs/decisions.md` §The code list), so the chunk
first asks the maintainer for one, proposing `not-a-string`. Found while checking the other ADF converters
for item 71, 2026-10-05.
first asks the maintainer for one, proposing `not-a-string`. Found while checking the other ADF
converters for item 71, 2026-10-05.
### 45. Replace `isAdfDocument` with a reader returning `Result<AdfDocument>`.
@@ -134,11 +134,11 @@ read as `spec/flavour.md` says. Breaking: `MIGRATION.md` says which call a calle
### 80. Name the node's path and the attribute key when `not-an-adf-document` refuses a node inside the document.
Lands with items 45 and 77, whose reader walks every node. Today any refused node, a `Date` in one
attribute among them, reads `an ADF document's content holds ADF nodes: one of them is not` with an
empty `path`, so an export tool refusing one document in thousands searches the whole tree. Name
the key and the value's kind as the nesting message does. Found by the product-owner review of
items 66 and 67, 2026-10-05.
Lands with items 45 and 77, whose reader walks every node. Today every refused node, such as one
with a `Date` in an attribute, reads `an ADF document's content holds ADF nodes: one of them is not`
with an empty `path`. An export tool told this about one document in thousands then searches that
document's whole tree. Give the node's path, and name its type and the attribute key as
`attributeNestingMessage` does. Found by the product-owner review of items 66 and 67, 2026-10-05.
### 68. Carry a non-text inline node holding `content` or `text`, a block holding `text`, and a leaf block holding `content`.