JSPM

  • Created
  • Published
  • Downloads 50
  • Score
    100M100P100Q85538F
  • License Apache-2.0

schema.org in JS (wip)

Package Exports

  • schema.org

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (schema.org) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

schema.org

WIP, nothing to see yet.

API

SchemaOrg.prototype.is(value, type)

returns true if value (or list of thereof) is a type

schemaOrg.is('MedicalScholarlyArticle', 'Article') === true

SchemaOrg.prototype.getType(obj[, minType])

Infer the type of the object obj and returns undefined when no type can be safely inferred (multiple options). If minType is specified the returning type must be at least as specific or more specific than minType.

schemaOrg.getType({
  "name": "a name",
  "videoQuality": "video quality",
  "transcript": "a transcript"
}) ===  'VideoObject'

Tests

npm test

License

Apache 2.0