Skip to content

Commit

Permalink
Fix @context
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Sep 7, 2023
1 parent 6020b99 commit 4ffd1e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/app/data/sampleActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
`,
entities: [
{
'@context': 'https://schema.org/',
'@context': 'https://schema.org',
'@id': 'cite:1',
'@type': 'Claim',
name: 'Sample Citation From File',
Expand Down Expand Up @@ -77,14 +77,14 @@ Configuring Proxy Auto-Discovery (PAD) proxy settings is a vital task for networ
`
},
{
'@context': 'https://schema.org/',
'@context': 'https://schema.org',
'@id': 'cite:2',
'@type': 'Claim',
type: 'https://schema.org/Claim',
text: 'Here is some plain text without any Markdown formatting in it.'
},
{
'@context': 'https://schema.org/',
'@context': 'https://schema.org',
'@type': 'ReplyAction',
type: 'https://schema.org/ReplyAction',

Expand All @@ -97,14 +97,14 @@ Configuring Proxy Auto-Discovery (PAD) proxy settings is a vital task for networ
}
},
{
'@context': 'https://schema.org/',
'@context': 'https://schema.org',
'@type': 'VoteAction',
type: 'https://schema.org/VoteAction',

actionOption: 'upvote'
},
{
'@context': 'https://schema.org/',
'@context': 'https://schema.org',
'@type': 'VoteAction',
type: 'https://schema.org/VoteAction',

Expand Down
4 changes: 2 additions & 2 deletions src/app/types/SchemaOrg/Thing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This is partial type of https://schema.org/Thing.
*/
export type Thing<T extends 'Thing' | string = string> = {
'@context': 'https://schema.org/';
'@context': 'https://schema.org';
'@id'?: string;
'@type': T;
type: `https://schema.org/${T}`;
Expand All @@ -23,6 +23,6 @@ export function isThing(entity: { type: string }): entity is Thing<string> {
export function isThingOf<T extends string>(thing: Thing, type: T): thing is Thing<T> {
return (
thing.type === `https://schema.org/${type}` ||
(thing['@context'] === 'https://schema.org/' && thing['@type'] === type)
(thing['@context'] === 'https://schema.org' && thing['@type'] === type)
);
}

0 comments on commit 4ffd1e9

Please sign in to comment.