applesauce-content 0.0.0-next-20250610175335 → 0.0.0-next-20250723224513
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.
|
@@ -92,17 +92,6 @@ describe("Regular Expressions", () => {
|
|
|
92
92
|
expect(matches).toHaveLength(1);
|
|
93
93
|
expect(matches[0][1]).toBe("npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6");
|
|
94
94
|
});
|
|
95
|
-
it("should match nostr links in URLs", () => {
|
|
96
|
-
const text = "https://npub1wyuh3scfgzqmxn709a2fzuemps389rxnk7nfgege6s847zze3tuqfl87ez.nsite.lol/n/nevent1qvzqqqqqqypzp022u0n8u2vkf4y5zu3xrhz989wgna4a9em5vshrvcf8zuwlhq04qyghwumn8ghj7mn0wd68ytnhd9hx2tcppemhxue69uhkummn9ekx7mp0qqsz7ck33xzlpcf2338ufrarks2cxqzk2rp925qe38wvlevhxv9pg6syy7gc7";
|
|
97
|
-
const matches = Array.from(text.matchAll(Expressions.nostrLink));
|
|
98
|
-
expect(matches).toHaveLength(2);
|
|
99
|
-
expect(matches).toEqual([
|
|
100
|
-
expect.arrayContaining(["npub1wyuh3scfgzqmxn709a2fzuemps389rxnk7nfgege6s847zze3tuqfl87ez"]),
|
|
101
|
-
expect.arrayContaining([
|
|
102
|
-
"nevent1qvzqqqqqqypzp022u0n8u2vkf4y5zu3xrhz989wgna4a9em5vshrvcf8zuwlhq04qyghwumn8ghj7mn0wd68ytnhd9hx2tcppemhxue69uhkummn9ekx7mp0qqsz7ck33xzlpcf2338ufrarks2cxqzk2rp925qe38wvlevhxv9pg6syy7gc7",
|
|
103
|
-
]),
|
|
104
|
-
]);
|
|
105
|
-
});
|
|
106
95
|
});
|
|
107
96
|
describe("Expressions.emoji", () => {
|
|
108
97
|
it("should match emoji shortcodes", () => {
|
|
@@ -160,11 +149,6 @@ describe("Regular Expressions", () => {
|
|
|
160
149
|
expect(matches[0][1]).toBe("世界");
|
|
161
150
|
expect(matches[1][1]).toBe("привет");
|
|
162
151
|
});
|
|
163
|
-
it("should not match hashtags in URLs", () => {
|
|
164
|
-
const text = "testing urls wss://relay.damus.io ircs://irc.zeronode.net:6697/#nostr https://github.com/hzrd149/applesauce?tab=readme-ov-file#running-tests";
|
|
165
|
-
const matches = Array.from(text.matchAll(Expressions.hashtag));
|
|
166
|
-
expect(matches).toHaveLength(0);
|
|
167
|
-
});
|
|
168
152
|
});
|
|
169
153
|
describe("Expressions.lightning", () => {
|
|
170
154
|
it("should match lightning invoices", () => {
|
|
@@ -229,11 +213,6 @@ describe("Token Regular Expressions", () => {
|
|
|
229
213
|
expect(matches).toHaveLength(1);
|
|
230
214
|
expect(matches[0][0].trim()).toBe(npub);
|
|
231
215
|
});
|
|
232
|
-
it("should not match links in URLs", async () => {
|
|
233
|
-
const text = "Checkout my app https://zap.stream/naddr1qqjx2wtzx93rycmz94nrqvf3956rqep3943xgvec956xxvnxxucxze33v93rvq3qeaz6dwsnvwkha5sn5puwwyxjgy26uusundrm684lg3vw4ma5c2jsxpqqqpmxw6td7rf";
|
|
234
|
-
const matches = Array.from(text.matchAll(Tokens.nostrLink));
|
|
235
|
-
expect(matches).toHaveLength(0);
|
|
236
|
-
});
|
|
237
216
|
});
|
|
238
217
|
describe("Tokens.emoji", () => {
|
|
239
218
|
it("should match emoji shortcodes surrounded by whitespace", () => {
|
package/dist/helpers/regexp.js
CHANGED
|
@@ -6,7 +6,7 @@ export const Expressions = {
|
|
|
6
6
|
return /https?:\/\/([a-zA-Z0-9\.\-]+\.[a-zA-Z]+(?::\d+)?)([\/\?#][\p{L}\p{N}\p{M}&\.-\/\?=#\-@%\+_,:!~*]*)?/gu;
|
|
7
7
|
},
|
|
8
8
|
get cashu() {
|
|
9
|
-
return /(?:cashu:\/{0,2})?(cashu(?:A|B)[A-Za-z0-9_-]{100,
|
|
9
|
+
return /(?:cashu:\/{0,2})?(cashu(?:A|B)[A-Za-z0-9_-]{100,}={0,3})/gi;
|
|
10
10
|
},
|
|
11
11
|
get nostrLink() {
|
|
12
12
|
return /(?:nostr:)?((npub|note|nprofile|nevent|naddr)1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58,})/gi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-content",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250723224513",
|
|
4
4
|
"description": "Unified plugins for processing event content",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/hast": "^3.0.4",
|
|
53
53
|
"@types/mdast": "^4.0.4",
|
|
54
54
|
"@types/unist": "^3.0.3",
|
|
55
|
-
"applesauce-core": "0.0.0-next-
|
|
55
|
+
"applesauce-core": "0.0.0-next-20250723224513",
|
|
56
56
|
"mdast-util-find-and-replace": "^3.0.2",
|
|
57
57
|
"nostr-tools": "^2.13",
|
|
58
58
|
"remark": "^15.0.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"typescript": "^5.8.3",
|
|
65
|
-
"applesauce-signers": "0.0.0-next-
|
|
65
|
+
"applesauce-signers": "0.0.0-next-20250723224513",
|
|
66
66
|
"vitest": "^3.2.3"
|
|
67
67
|
},
|
|
68
68
|
"funding": {
|