I think if there's one thing I'd say to #ActivityPub developers, it's this: it seems like it's going to be easier to just parse Activity Streams 2.0 data as plain JSON, but it's not. You have to keep track of too many variations. Use a JSON-LD library instead. For JavaScript, try activitystrea.ms:
in the most basic case, expanding the document should make it unambiguous:
- all keys are normalized to full identifiers with exactly 1 possible representation instead of infinitely many - all values are normalized to JSON arrays of JSON objects - those JSON objects explicitly say whether they have an id (Reference) or a value (Literal)
The code is long-term but it was built by one author of AS2 and maintained by the other. It works well, and I use it in production systems all the time.
I'm pretty sure @hongminhee has made a similar package, although I'm not sure it's distributed independently.
@evan@trwnh@hongminhee I think he was referring to the GitHub project description: "Activity Streams 2.0 for Node.js (this package is not actively maintained..."
@evan James archived the repo today, assumably in response to this question. I'm going to keep working from my personal fork, and I'll use that to push to npm. I think I can update the info in package.json on the topic, too. A change that's been waiting too long.