UNPKG

@forge42/seo-tools

Version:

Framework agnostic set of helpers designed to help you create, maintain and develop your SEO

1 lines 1.06 kB
{"version":3,"sources":["../../src/structured-data/organization.ts"],"sourcesContent":["import type { Organization, WithContext } from \"schema-dts\"\n\n/**\n * This helper is used to generate an organization ld+json structured data object.\n *\n *\n * Find more information about the organization schema here:\n *\n *\n * @see https://developers.google.com/search/docs/appearance/structured-data/organization\n * @param organization Organization data object configuration to be used in the structured data\n * @returns Organization object to be used in head via json-ld script tag\n */\nexport const organization = (organization: Organization): WithContext<Organization> => {\n\tif (typeof organization === \"string\") {\n\t\tthrow new Error(\"Organization must be an object\")\n\t}\n\treturn {\n\t\t\"@context\": \"https://schema.org\",\n\t\t...organization,\n\t}\n}\n\nexport type { Organization }\n"],"mappings":"AAaO,IAAMA,EAAgBA,GAA0D,CACtF,GAAI,OAAOA,GAAiB,SAC3B,MAAM,IAAI,MAAM,gCAAgC,EAEjD,MAAO,CACN,WAAY,qBACZ,GAAGA,CACJ,CACD","names":["organization"]}