UNPKG

@stencila/schema

Version:

Stencila schema and other specifications

3 lines (2 loc) 11.5 kB
function t(){return(t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var e=function(e){return Object.entries(e).reduce(function(e,r){var n,o=r[1];return void 0===o?e:t({},e,((n={})[r[0]]=o,n))},{})},r=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Entity"})},n=function(r){return void 0===r&&(r={}),t({},e(r),{type:"ArrayValidator"})},o=function(r){return void 0===r&&(r={}),t({},e(r),{type:"BooleanValidator"})},a=function(r){return t({},e(r),{type:"Cite"})},i=function(r){return t({},e(r),{type:"CiteGroup"})},u=function(r){return t({},e(r),{type:"Code"})},c=function(r){return t({},e(r),{type:"CodeBlock"})},l=function(r){return t({},e(r),{type:"CodeChunk"})},d=function(r){return t({},e(r),{type:"CodeFragment"})},p=function(r){return t({},e(r),{type:"CodeExpression"})},f=function(r){return void 0===r&&(r={}),t({},e(r),{type:"CodeError"})},b=function(r){return void 0===r&&(r={}),t({},e(r),{type:"ConstantValidator"})},y=function(r){return t({},e(r),{type:"Date"})},s=function(r){return t({},e(r),{type:"Mark"})},C=function(r){return t({},e(r),{type:"Delete"})},m=function(r){return t({},e(r),{type:"Emphasis"})},g=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Thing"})},V=function(r){return t({},e(r),{type:"Brand"})},S=function(r){return void 0===r&&(r={}),t({},e(r),{type:"ContactPoint"})},h=function(r){return void 0===r&&(r={}),t({},e(r),{type:"CreativeWork"})},k=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Article"})},P=function(r){return t({},e(r),{type:"Collection"})},O=function(r){return t({},e(r),{type:"Datatable"})},v=function(r){return t({},e(r),{type:"MediaObject"})},j=function(r){return t({},e(r),{type:"AudioObject"})},M=function(r){return t({},e(r),{type:"DatatableColumn"})},B=function(r){return void 0===r&&(r={}),t({},e(r),{type:"EnumValidator"})},I=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Figure"})},E=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Function"})},A=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Grant"})},T=function(r){return t({},e(r),{type:"Heading"})},w=function(r){return t({},e(r),{type:"ImageObject"})},F=function(r){return t({},e(r),{type:"Include"})},D=function(r){return void 0===r&&(r={}),t({},e(r),{type:"NumberValidator"})},G=function(r){return void 0===r&&(r={}),t({},e(r),{type:"IntegerValidator"})},L=function(r){return t({},e(r),{type:"Link"})},Q=function(r){return t({},e(r),{type:"List"})},x=function(r){return t({},e(r),{type:"ListItem"})},N=function(r){return t({},e(r),{type:"Math"})},W=function(r){return t({},e(r),{type:"MathBlock"})},z=function(r){return t({},e(r),{type:"MathFragment"})},H=function(r){return void 0===r&&(r={}),t({},e(r),{type:"MonetaryGrant"})},R=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Organization"})},q=function(r){return t({},e(r),{type:"Paragraph"})},J=function(r){return t({},e(r),{type:"Variable"})},K=function(r){return t({},e(r),{type:"Parameter"})},U=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Periodical"})},X=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Person"})},Y=function(r){return void 0===r&&(r={}),t({},e(r),{type:"Product"})},Z=function(r){return t({},e(r),{type:"PropertyValue"})},$=function(r){return void 0===r&&(r={}),t({},e(r),{type:"PublicationIssue"})},_=function(r){return void 0===r&&(r={}),t({},e(r),{type:"PublicationVolume"})},tt=function(r){return t({},e(r),{type:"Quote"})},et=function(r){return t({},e(r),{type:"QuoteBlock"})},rt=function(r){return void 0===r&&(r={}),t({},e(r),{type:"SoftwareApplication"})},nt=function(r){return t({},e(r),{type:"SoftwareEnvironment"})},ot=function(r){return void 0===r&&(r={}),t({},e(r),{type:"SoftwareSession"})},at=function(r){return void 0===r&&(r={}),t({},e(r),{type:"SoftwareSourceCode"})},it=function(r){return void 0===r&&(r={}),t({},e(r),{type:"StringValidator"})},ut=function(r){return t({},e(r),{type:"Strong"})},ct=function(r){return t({},e(r),{type:"Subscript"})},lt=function(r){return t({},e(r),{type:"Superscript"})},dt=function(r){return t({},e(r),{type:"Table"})},pt=function(r){return t({},e(r),{type:"TableCell"})},ft=function(r){return t({},e(r),{type:"TableRow"})},bt=function(r){return void 0===r&&(r={}),t({},e(r),{type:"ThematicBreak"})},yt=function(r){return void 0===r&&(r={}),t({},e(r),{type:"TupleValidator"})},st=function(r){return t({},e(r),{type:"VideoObject"})},Ct=function(r){return t({},e(r),{type:"VolumeMount"})},mt={CodeBlock:"CodeBlock",CodeChunk:"CodeChunk"},gt={CodeFragment:"CodeFragment",CodeExpression:"CodeExpression"},Vt={Code:"Code",CodeBlock:"CodeBlock",CodeChunk:"CodeChunk",CodeExpression:"CodeExpression",CodeFragment:"CodeFragment"},St={CreativeWork:"CreativeWork",Article:"Article",AudioObject:"AudioObject",Collection:"Collection",Datatable:"Datatable",Figure:"Figure",ImageObject:"ImageObject",MediaObject:"MediaObject",Periodical:"Periodical",PublicationIssue:"PublicationIssue",PublicationVolume:"PublicationVolume",SoftwareApplication:"SoftwareApplication",SoftwareSourceCode:"SoftwareSourceCode",Table:"Table",VideoObject:"VideoObject"},ht={Entity:"Entity",ArrayValidator:"ArrayValidator",Article:"Article",AudioObject:"AudioObject",BooleanValidator:"BooleanValidator",Brand:"Brand",Cite:"Cite",CiteGroup:"CiteGroup",Code:"Code",CodeBlock:"CodeBlock",CodeChunk:"CodeChunk",CodeError:"CodeError",CodeExpression:"CodeExpression",CodeFragment:"CodeFragment",Collection:"Collection",ConstantValidator:"ConstantValidator",ContactPoint:"ContactPoint",CreativeWork:"CreativeWork",Datatable:"Datatable",DatatableColumn:"DatatableColumn",Date:"Date",Delete:"Delete",Emphasis:"Emphasis",EnumValidator:"EnumValidator",Figure:"Figure",Function:"Function",Grant:"Grant",Heading:"Heading",ImageObject:"ImageObject",Include:"Include",IntegerValidator:"IntegerValidator",Link:"Link",List:"List",ListItem:"ListItem",Mark:"Mark",Math:"Math",MathBlock:"MathBlock",MathFragment:"MathFragment",MediaObject:"MediaObject",MonetaryGrant:"MonetaryGrant",NumberValidator:"NumberValidator",Organization:"Organization",Paragraph:"Paragraph",Parameter:"Parameter",Periodical:"Periodical",Person:"Person",Product:"Product",PropertyValue:"PropertyValue",PublicationIssue:"PublicationIssue",PublicationVolume:"PublicationVolume",Quote:"Quote",QuoteBlock:"QuoteBlock",SoftwareApplication:"SoftwareApplication",SoftwareEnvironment:"SoftwareEnvironment",SoftwareSession:"SoftwareSession",SoftwareSourceCode:"SoftwareSourceCode",StringValidator:"StringValidator",Strong:"Strong",Subscript:"Subscript",Superscript:"Superscript",Table:"Table",TableCell:"TableCell",TableRow:"TableRow",ThematicBreak:"ThematicBreak",Thing:"Thing",TupleValidator:"TupleValidator",Variable:"Variable",VideoObject:"VideoObject",VolumeMount:"VolumeMount"},kt={Grant:"Grant",MonetaryGrant:"MonetaryGrant"},Pt={Mark:"Mark",Delete:"Delete",Emphasis:"Emphasis",Quote:"Quote",Strong:"Strong",Subscript:"Subscript",Superscript:"Superscript"},Ot={Math:"Math",MathBlock:"MathBlock",MathFragment:"MathFragment"},vt={MediaObject:"MediaObject",AudioObject:"AudioObject",ImageObject:"ImageObject",VideoObject:"VideoObject"},jt={NumberValidator:"NumberValidator",IntegerValidator:"IntegerValidator"},Mt={Thing:"Thing",Article:"Article",AudioObject:"AudioObject",Brand:"Brand",Collection:"Collection",ContactPoint:"ContactPoint",CreativeWork:"CreativeWork",Datatable:"Datatable",DatatableColumn:"DatatableColumn",Figure:"Figure",Grant:"Grant",ImageObject:"ImageObject",MediaObject:"MediaObject",MonetaryGrant:"MonetaryGrant",Organization:"Organization",Periodical:"Periodical",Person:"Person",Product:"Product",PropertyValue:"PropertyValue",PublicationIssue:"PublicationIssue",PublicationVolume:"PublicationVolume",SoftwareApplication:"SoftwareApplication",SoftwareEnvironment:"SoftwareEnvironment",SoftwareSession:"SoftwareSession",SoftwareSourceCode:"SoftwareSourceCode",Table:"Table",VideoObject:"VideoObject",VolumeMount:"VolumeMount"},Bt={ConstantValidator:"ConstantValidator",EnumValidator:"EnumValidator",BooleanValidator:"BooleanValidator",NumberValidator:"NumberValidator",IntegerValidator:"IntegerValidator",StringValidator:"StringValidator",ArrayValidator:"ArrayValidator",TupleValidator:"TupleValidator"},It={Variable:"Variable",Parameter:"Parameter"},Et={CodeBlock:"CodeBlock",CodeChunk:"CodeChunk",Heading:"Heading",List:"List",ListItem:"ListItem",MathBlock:"MathBlock",Paragraph:"Paragraph",QuoteBlock:"QuoteBlock",Table:"Table",ThematicBreak:"ThematicBreak"},At={CodeFragment:"CodeFragment",CodeExpression:"CodeExpression",Delete:"Delete",Emphasis:"Emphasis",ImageObject:"ImageObject",Link:"Link",MathFragment:"MathFragment",Quote:"Quote",Strong:"Strong",Subscript:"Subscript",Superscript:"Superscript",Cite:"Cite",CiteGroup:"CiteGroup"},Tt=function(t){return function(e){return Object.keys(t).includes(e)}},wt=function(t){return function(e){return!!xt(e)&&Tt(t)(e.type)}},Ft=function(t){var e,r=((e={})[t]=t,e);return wt(r)},Dt=function(t,e){return xt(e)&&e.type===t},Gt=function(t,e){return xt(e)&&Object.keys(t).includes(e.type)},Lt=function(t){return function(e){return void 0!==e&&Dt(t,e)}},Qt=function(t){var e=typeof t;return null===t||"boolean"===e||"number"===e||"string"===e},xt=function(t){return null!=t&&Object.prototype.hasOwnProperty.call(t,"type")},Nt=function(t){return!("object"!=typeof t||!xt(t))&&Tt(At)(t.type)},Wt=function(t){return Qt(t)||Nt(t)},zt=wt(Et),Ht=wt(St),Rt=wt(Vt),qt=Ft("Article"),Jt=Ft("Paragraph"),Kt=Ft("ListItem"),Ut=function(t){return null===t?"null":"boolean"==typeof t?"boolean":"number"==typeof t?"number":"string"==typeof t?"string":Array.isArray(t)?"array":xt(t)?t.type:typeof t};export{n as arrayValidator,k as article,j as audioObject,Et as blockContentTypes,o as booleanValidator,V as brand,a as cite,i as citeGroup,u as code,c as codeBlock,mt as codeBlockTypes,l as codeChunk,f as codeError,p as codeExpression,d as codeFragment,gt as codeFragmentTypes,Vt as codeTypes,P as collection,b as constantValidator,S as contactPoint,h as creativeWork,St as creativeWorkTypes,O as datatable,M as datatableColumn,y as date,C as del,m as emphasis,r as entity,ht as entityTypes,B as enumValidator,I as figure,E as function_,A as grant,kt as grantTypes,T as heading,w as imageObject,F as include,At as inlineContentTypes,G as integerValidator,Ft as is,Dt as isA,qt as isArticle,zt as isBlockContent,Rt as isCode,Ht as isCreativeWork,xt as isEntity,Wt as isInlineContent,Nt as isInlineEntity,Gt as isInstanceOf,Kt as isListItem,Jt as isParagraph,Qt as isPrimitive,Lt as isType,L as link,Q as list,x as listItem,s as mark,Pt as markTypes,N as math,W as mathBlock,z as mathFragment,Ot as mathTypes,v as mediaObject,vt as mediaObjectTypes,H as monetaryGrant,wt as nodeIs,Ut as nodeType,D as numberValidator,jt as numberValidatorTypes,R as organization,q as paragraph,K as parameter,U as periodical,X as person,Y as product,Z as propertyValue,$ as publicationIssue,_ as publicationVolume,tt as quote,et as quoteBlock,rt as softwareApplication,nt as softwareEnvironment,ot as softwareSession,at as softwareSourceCode,it as stringValidator,ut as strong,ct as subscript,lt as superscript,dt as table,pt as tableCell,ft as tableRow,bt as thematicBreak,g as thing,Mt as thingTypes,yt as tupleValidator,Tt as typeIs,Bt as validatorTypes,J as variable,It as variableTypes,st as videoObject,Ct as volumeMount}; //# sourceMappingURL=index.mjs.map