Skip to content

Commit

Permalink
Fix #30; remove focus meta as requirement for image media
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebremer committed Sep 18, 2023
1 parent e651395 commit 7a7aba8
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 14 deletions.
3 changes: 0 additions & 3 deletions lib/JSON/MediaAttachment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/JSON/MediaAttachment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/Utilities.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Utilities.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/JSON/MediaAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,6 @@ export function isImageAttachmentMeta (
): json is ImageAttachmentMeta {
return (
typeof json === 'object' &&
typeof json.focus === 'object' &&
typeof json.focus.x === 'number' &&
typeof json.focus.y === 'number' &&
typeof json.original === 'object' &&
typeof json.original.aspect === 'number' &&
typeof json.original.height === 'number' &&
Expand Down
1 change: 0 additions & 1 deletion src/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export namespace Utilities {
params?: Params,
target: FormData = new Bridge.FormData()
): FormData {
let value: unknown;

if ( params ) {
transferParams( params, target );
Expand Down
4 changes: 0 additions & 4 deletions tst-data/v1-post/media
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"remote_url": null,
"text_url": "http://127.0.0.1:8000/files/1x1.png",
"meta": {
"focus": {
"x": 0.5,
"y": 0.5
},
"original": {
"width": 1,
"height": 1,
Expand Down

0 comments on commit 7a7aba8

Please sign in to comment.