UNPKG

@forge42/seo-tools

Version:

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

1 lines 1.11 kB
{"version":3,"sources":["../../src/structured-data/organization.ts"],"sourcesContent":["import type { Organization, WithContext } from \"schema-dts\"\r\n\r\n/**\r\n * This helper is used to generate an organization ld+json structured data object.\r\n *\r\n *\r\n * Find more information about the organization schema here:\r\n *\r\n *\r\n * @see https://developers.google.com/search/docs/appearance/structured-data/organization\r\n * @param organization Organization data object configuration to be used in the structured data\r\n * @returns Organization object to be used in head via json-ld script tag\r\n */\r\nexport const organization = (organization: Organization): WithContext<Organization> => {\r\n\tif (typeof organization === \"string\") {\r\n\t\tthrow new Error(\"Organization must be an object\")\r\n\t}\r\n\treturn {\r\n\t\t\"@context\": \"https://schema.org\",\r\n\t\t...organization,\r\n\t}\r\n}\r\n\r\nexport type { Organization }\r\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"]}