Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/rich-text-links

Package Overview
Dependencies
Maintainers
0
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/rich-text-links

Entity (entry and asset) link extraction utilities for the Contentful rich text field type.

  • 17.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Entity (entry and asset) link extraction utilities for the Contentful rich text field type.

Installation

Using npm:

npm install @contentful/rich-text-links

Using yarn:

yarn add @contentful/rich-text-links

Usage

import { getRichTextEntityLinks } from '@contentful/rich-text-links';

const document = {
  nodeType: 'document',
  data: {},
  content: [
    {
      nodeType: 'paragraph',
      data: {},
      content: [
        {
          nodeType: 'embedded-entry-block',
          data: {
            target: {
              sys: {
                linkType: 'Entry',
                type: 'Link',
                id: 'yXmVKmaDBm8tRfQMwA0e',
              },
            },
          },
          content: [],
        },
        {
          nodeType: 'embedded-asset-block',
          data: {
            target: {
              sys: {
                linkType: 'Asset',
                type: 'Link',
                id: 'jNhaW0aSc6Hu74SHVMtq',
              },
            },
          },
          content: [],
        },
      ],
    },
  ],
};

getRichTextEntityLinks(document);
/**
 * ->
 * {
 *   Entry: [
 *     { linkType: 'Entry', type: 'Link', id: 'yXmVKmaDBm8tRfQMwA0e' }
 *   ],
 *   Asset: [
 *     { linkType: 'Asset', type: 'Link', id: 'jNhaW0aSc6Hu74SHVMtq' }
 *   ]
 * }
 */

FAQs

Package last updated on 29 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc