applesauce-content 0.0.0-next-20250505205231 → 0.0.0-next-20250522030625

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "Expressions",
8
+ "Tokens",
9
+ "getMediaAttachmentURLsFromContent",
10
+ ]
11
+ `);
12
+ });
13
+ });
@@ -21,13 +21,13 @@ export const Expressions = {
21
21
  /** A list of Regular Expressions that match tokens surrounded by whitespace to avoid matching in URLs */
22
22
  export const Tokens = {
23
23
  get link() {
24
- return new RegExp(`(?<=\\s|^)${Expressions.link.source}(?=\\s|$)`, "gu");
24
+ return new RegExp(`\\b${Expressions.link.source}\\b`, "gu");
25
25
  },
26
26
  get cashu() {
27
- return new RegExp(`(?<=\\s|^)${Expressions.cashu.source}(?=\\s|$)`, "gi");
27
+ return new RegExp(`\\b${Expressions.cashu.source}\\b`, "gi");
28
28
  },
29
29
  get nostrLink() {
30
- return new RegExp(`(?<=\\s|^)${Expressions.nostrLink.source}(?=\\s|$)`, "gi");
30
+ return new RegExp(`\\b${Expressions.nostrLink.source}\\b`, "gi");
31
31
  },
32
32
  get emoji() {
33
33
  return Expressions.emoji;
@@ -36,6 +36,6 @@ export const Tokens = {
36
36
  return Expressions.hashtag;
37
37
  },
38
38
  get lightning() {
39
- return new RegExp(`(?<=\\s|^)${Expressions.lightning.source}(?=\\s|$)`, "gim");
39
+ return new RegExp(`\\b${Expressions.lightning.source}\\b`, "gim");
40
40
  },
41
41
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "remarkNostrMentions",
8
+ ]
9
+ `);
10
+ });
11
+ });
@@ -1,6 +1,6 @@
1
- import { Transformer } from "unified";
1
+ import { DecodeResult } from "applesauce-core/helpers";
2
2
  import { Link, Nodes } from "mdast";
3
- import { DecodeResult } from "nostr-tools/nip19";
3
+ import { Transformer } from "unified";
4
4
  export interface NostrMention extends Link {
5
5
  type: "link";
6
6
  data: DecodeResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "eolMetadata",
8
+ "findAndReplace",
9
+ "truncateContent",
10
+ ]
11
+ `);
12
+ });
13
+ });
@@ -1,8 +1,8 @@
1
- import { EventTemplate, NostrEvent } from "nostr-tools";
2
- import { DecodeResult } from "nostr-tools/nip19";
3
- import { Node as UnistNode, Parent } from "unist";
4
1
  import { type Token } from "@cashu/cashu-ts";
2
+ import { type DecodeResult } from "applesauce-core/helpers";
5
3
  import { type ParsedInvoice } from "applesauce-core/helpers/bolt11";
4
+ import { type EventTemplate, type NostrEvent } from "nostr-tools";
5
+ import { type Parent, type Node as UnistNode } from "unist";
6
6
  export interface CommonData {
7
7
  eol?: boolean;
8
8
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "TextNoteContentSymbol",
8
+ "cashuTokens",
9
+ "createTextNoteATS",
10
+ "emojis",
11
+ "galleries",
12
+ "getParsedContent",
13
+ "hashtags",
14
+ "lightningInvoices",
15
+ "links",
16
+ "nostrMentions",
17
+ "removeParsedTextContent",
18
+ "textNoteTransformers",
19
+ ]
20
+ `);
21
+ });
22
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-content",
3
- "version": "0.0.0-next-20250505205231",
3
+ "version": "0.0.0-next-20250522030625",
4
4
  "description": "Unified plugins for processing event content",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,9 +52,9 @@
52
52
  "@types/hast": "^3.0.4",
53
53
  "@types/mdast": "^4.0.4",
54
54
  "@types/unist": "^3.0.3",
55
- "applesauce-core": "^1.0.0",
55
+ "applesauce-core": "0.0.0-next-20250522030625",
56
56
  "mdast-util-find-and-replace": "^3.0.2",
57
- "nostr-tools": "^2.10.4",
57
+ "nostr-tools": "^2.13",
58
58
  "remark": "^15.0.1",
59
59
  "remark-parse": "^11.0.0",
60
60
  "unified": "^11.0.5",