@atproto/api
Advanced tools
Comparing version 0.12.25-next.0 to 0.12.25
# @atproto/api | ||
## 0.12.25 | ||
### Patch Changes | ||
- [#2570](https://github.com/bluesky-social/atproto/pull/2570) [`12dcdb668`](https://github.com/bluesky-social/atproto/commit/12dcdb668c8ec0f8a89689c326ab3e9dbc6d2f3c) Thanks [@sugyan](https://github.com/sugyan)! - Fix `hasMutedWord` for facets with multiple features | ||
- [#2648](https://github.com/bluesky-social/atproto/pull/2648) [`76c91f832`](https://github.com/bluesky-social/atproto/commit/76c91f8325363c95e25349e8e236aa2f70e63d5b) Thanks [@dholms](https://github.com/dholms)! - Support for priority notifications | ||
## 0.12.24 | ||
@@ -4,0 +12,0 @@ |
@@ -28,7 +28,3 @@ "use strict"; | ||
.concat(outlineTags || []) | ||
.concat(facets | ||
?.filter((facet) => { | ||
return facet.features.find((feature) => client_1.AppBskyRichtextFacet.isTag(feature)); | ||
}) | ||
.map((t) => t.features[0].tag) || []) | ||
.concat((facets || []).flatMap((facet) => facet.features.filter(client_1.AppBskyRichtextFacet.isTag).map((tag) => tag.tag))) | ||
.map((t) => t.toLowerCase()); | ||
@@ -35,0 +31,0 @@ for (const mute of mutedWords) { |
{ | ||
"name": "@atproto/api", | ||
"version": "0.12.25-next.0", | ||
"version": "0.12.25", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Client library for atproto and Bluesky", |
@@ -41,9 +41,5 @@ import { AppBskyActorDefs, AppBskyRichtextFacet } from '../client' | ||
.concat( | ||
facets | ||
?.filter((facet) => { | ||
return facet.features.find((feature) => | ||
AppBskyRichtextFacet.isTag(feature), | ||
) | ||
}) | ||
.map((t) => t.features[0].tag as string) || [], | ||
(facets || []).flatMap((facet) => | ||
facet.features.filter(AppBskyRichtextFacet.isTag).map((tag) => tag.tag), | ||
), | ||
) | ||
@@ -50,0 +46,0 @@ .map((t) => t.toLowerCase()) |
@@ -683,2 +683,56 @@ import { RichText, mock, moderatePost } from '../src/' | ||
describe(`facet with multiple features`, () => { | ||
it(`multiple tags`, () => { | ||
const match = hasMutedWord({ | ||
mutedWords: [{ value: 'bad', targets: ['content'] }], | ||
text: 'tags', | ||
facets: [ | ||
{ | ||
features: [ | ||
{ | ||
$type: 'app.bsky.richtext.facet#tag', | ||
tag: 'good', | ||
}, | ||
{ | ||
$type: 'app.bsky.richtext.facet#tag', | ||
tag: 'bad', | ||
}, | ||
], | ||
index: { | ||
byteEnd: 4, | ||
byteStart: 0, | ||
}, | ||
}, | ||
], | ||
}) | ||
expect(match).toBe(true) | ||
}) | ||
it(`other features`, () => { | ||
const match = hasMutedWord({ | ||
mutedWords: [{ value: 'bad', targets: ['content'] }], | ||
text: 'test', | ||
facets: [ | ||
{ | ||
features: [ | ||
{ | ||
$type: 'com.example.richtext.facet#other', | ||
foo: 'bar', | ||
}, | ||
{ | ||
$type: 'app.bsky.richtext.facet#tag', | ||
tag: 'bad', | ||
}, | ||
], | ||
index: { | ||
byteEnd: 4, | ||
byteStart: 0, | ||
}, | ||
}, | ||
], | ||
}) | ||
expect(match).toBe(true) | ||
}) | ||
}) | ||
describe(`doesn't mute own post`, () => { | ||
@@ -685,0 +739,0 @@ it(`does mute if it isn't own post`, () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3451188
78629