UNPKG

@stencila/schema

Version:

Stencila schema and other specifications

3 lines (2 loc) 11.1 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).schema={})}(this,function(t){function e(){return(e=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 r=function(t){return Object.entries(t).reduce(function(t,r){var n,o=r[1];return void 0===o?t:e({},t,((n={})[r[0]]=o,n))},{})},n={Code:"Code",CodeBlock:"CodeBlock",CodeChunk:"CodeChunk",CodeExpression:"CodeExpression",CodeFragment:"CodeFragment"},o={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"},a={CodeBlock:"CodeBlock",CodeChunk:"CodeChunk",Heading:"Heading",List:"List",ListItem:"ListItem",MathBlock:"MathBlock",Paragraph:"Paragraph",QuoteBlock:"QuoteBlock",Table:"Table",ThematicBreak:"ThematicBreak"},i={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"},u=function(t){return function(e){return Object.keys(t).includes(e)}},c=function(t){return function(e){return!!s(e)&&u(t)(e.type)}},l=function(t){var e,r=((e={})[t]=t,e);return c(r)},d=function(t,e){return s(e)&&e.type===t},p=function(t){var e=typeof t;return null===t||"boolean"===e||"number"===e||"string"===e},s=function(t){return null!=t&&Object.prototype.hasOwnProperty.call(t,"type")},y=function(t){return!("object"!=typeof t||!s(t))&&u(i)(t.type)},f=c(a),b=c(o),m=c(n),C=l("Article"),g=l("Paragraph"),V=l("ListItem");t.arrayValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"ArrayValidator"})},t.article=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Article"})},t.audioObject=function(t){return e({},r(t),{type:"AudioObject"})},t.blockContentTypes=a,t.booleanValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"BooleanValidator"})},t.brand=function(t){return e({},r(t),{type:"Brand"})},t.cite=function(t){return e({},r(t),{type:"Cite"})},t.citeGroup=function(t){return e({},r(t),{type:"CiteGroup"})},t.code=function(t){return e({},r(t),{type:"Code"})},t.codeBlock=function(t){return e({},r(t),{type:"CodeBlock"})},t.codeBlockTypes={CodeBlock:"CodeBlock",CodeChunk:"CodeChunk"},t.codeChunk=function(t){return e({},r(t),{type:"CodeChunk"})},t.codeError=function(t){return void 0===t&&(t={}),e({},r(t),{type:"CodeError"})},t.codeExpression=function(t){return e({},r(t),{type:"CodeExpression"})},t.codeFragment=function(t){return e({},r(t),{type:"CodeFragment"})},t.codeFragmentTypes={CodeFragment:"CodeFragment",CodeExpression:"CodeExpression"},t.codeTypes=n,t.collection=function(t){return e({},r(t),{type:"Collection"})},t.constantValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"ConstantValidator"})},t.contactPoint=function(t){return void 0===t&&(t={}),e({},r(t),{type:"ContactPoint"})},t.creativeWork=function(t){return void 0===t&&(t={}),e({},r(t),{type:"CreativeWork"})},t.creativeWorkTypes=o,t.datatable=function(t){return e({},r(t),{type:"Datatable"})},t.datatableColumn=function(t){return e({},r(t),{type:"DatatableColumn"})},t.date=function(t){return e({},r(t),{type:"Date"})},t.del=function(t){return e({},r(t),{type:"Delete"})},t.emphasis=function(t){return e({},r(t),{type:"Emphasis"})},t.entity=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Entity"})},t.entityTypes={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"},t.enumValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"EnumValidator"})},t.figure=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Figure"})},t.function_=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Function"})},t.grant=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Grant"})},t.grantTypes={Grant:"Grant",MonetaryGrant:"MonetaryGrant"},t.heading=function(t){return e({},r(t),{type:"Heading"})},t.imageObject=function(t){return e({},r(t),{type:"ImageObject"})},t.include=function(t){return e({},r(t),{type:"Include"})},t.inlineContentTypes=i,t.integerValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"IntegerValidator"})},t.is=l,t.isA=d,t.isArticle=C,t.isBlockContent=f,t.isCode=m,t.isCreativeWork=b,t.isEntity=s,t.isInlineContent=function(t){return p(t)||y(t)},t.isInlineEntity=y,t.isInstanceOf=function(t,e){return s(e)&&Object.keys(t).includes(e.type)},t.isListItem=V,t.isParagraph=g,t.isPrimitive=p,t.isType=function(t){return function(e){return void 0!==e&&d(t,e)}},t.link=function(t){return e({},r(t),{type:"Link"})},t.list=function(t){return e({},r(t),{type:"List"})},t.listItem=function(t){return e({},r(t),{type:"ListItem"})},t.mark=function(t){return e({},r(t),{type:"Mark"})},t.markTypes={Mark:"Mark",Delete:"Delete",Emphasis:"Emphasis",Quote:"Quote",Strong:"Strong",Subscript:"Subscript",Superscript:"Superscript"},t.math=function(t){return e({},r(t),{type:"Math"})},t.mathBlock=function(t){return e({},r(t),{type:"MathBlock"})},t.mathFragment=function(t){return e({},r(t),{type:"MathFragment"})},t.mathTypes={Math:"Math",MathBlock:"MathBlock",MathFragment:"MathFragment"},t.mediaObject=function(t){return e({},r(t),{type:"MediaObject"})},t.mediaObjectTypes={MediaObject:"MediaObject",AudioObject:"AudioObject",ImageObject:"ImageObject",VideoObject:"VideoObject"},t.monetaryGrant=function(t){return void 0===t&&(t={}),e({},r(t),{type:"MonetaryGrant"})},t.nodeIs=c,t.nodeType=function(t){return null===t?"null":"boolean"==typeof t?"boolean":"number"==typeof t?"number":"string"==typeof t?"string":Array.isArray(t)?"array":s(t)?t.type:typeof t},t.numberValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"NumberValidator"})},t.numberValidatorTypes={NumberValidator:"NumberValidator",IntegerValidator:"IntegerValidator"},t.organization=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Organization"})},t.paragraph=function(t){return e({},r(t),{type:"Paragraph"})},t.parameter=function(t){return e({},r(t),{type:"Parameter"})},t.periodical=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Periodical"})},t.person=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Person"})},t.product=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Product"})},t.propertyValue=function(t){return e({},r(t),{type:"PropertyValue"})},t.publicationIssue=function(t){return void 0===t&&(t={}),e({},r(t),{type:"PublicationIssue"})},t.publicationVolume=function(t){return void 0===t&&(t={}),e({},r(t),{type:"PublicationVolume"})},t.quote=function(t){return e({},r(t),{type:"Quote"})},t.quoteBlock=function(t){return e({},r(t),{type:"QuoteBlock"})},t.softwareApplication=function(t){return void 0===t&&(t={}),e({},r(t),{type:"SoftwareApplication"})},t.softwareEnvironment=function(t){return e({},r(t),{type:"SoftwareEnvironment"})},t.softwareSession=function(t){return void 0===t&&(t={}),e({},r(t),{type:"SoftwareSession"})},t.softwareSourceCode=function(t){return void 0===t&&(t={}),e({},r(t),{type:"SoftwareSourceCode"})},t.stringValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"StringValidator"})},t.strong=function(t){return e({},r(t),{type:"Strong"})},t.subscript=function(t){return e({},r(t),{type:"Subscript"})},t.superscript=function(t){return e({},r(t),{type:"Superscript"})},t.table=function(t){return e({},r(t),{type:"Table"})},t.tableCell=function(t){return e({},r(t),{type:"TableCell"})},t.tableRow=function(t){return e({},r(t),{type:"TableRow"})},t.thematicBreak=function(t){return void 0===t&&(t={}),e({},r(t),{type:"ThematicBreak"})},t.thing=function(t){return void 0===t&&(t={}),e({},r(t),{type:"Thing"})},t.thingTypes={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"},t.tupleValidator=function(t){return void 0===t&&(t={}),e({},r(t),{type:"TupleValidator"})},t.typeIs=u,t.validatorTypes={ConstantValidator:"ConstantValidator",EnumValidator:"EnumValidator",BooleanValidator:"BooleanValidator",NumberValidator:"NumberValidator",IntegerValidator:"IntegerValidator",StringValidator:"StringValidator",ArrayValidator:"ArrayValidator",TupleValidator:"TupleValidator"},t.variable=function(t){return e({},r(t),{type:"Variable"})},t.variableTypes={Variable:"Variable",Parameter:"Parameter"},t.videoObject=function(t){return e({},r(t),{type:"VideoObject"})},t.volumeMount=function(t){return e({},r(t),{type:"VolumeMount"})}}); //# sourceMappingURL=index.umd.js.map