Socket
Socket
Sign inDemoInstall

@commonform/component-updates

Package Overview
Dependencies
11
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @commonform/component-updates

check for updates to components in Common Forms


Version published
Maintainers
2
Created

Readme

Source
const updates = require('@commonform/component-updates')
const assert = require('assert')

const component = 'https://example.com/component'

const versions = ['1.0.0', '2.0.0', '3.0.0']

const reference = {
  component,
  version: versions[0],
  substitutions: { terms: {}, headings: {}, blanks: {}}
}

updates(
  { content: [reference] },
  {
    cache: {
      get: (url, callback) => {
        if (url === component) callback(null, versions)
        else callback(null, false)
      }
    }
  },
  (error, results) => {
    assert.ifError(error)
    assert.deepStrictEqual(results, [
      {
        path: ['content', 0],
        reference,
        version: '1.0.0',
        available: versions,
        latest: '3.0.0'
      }
    ])
  }
)

FAQs

Last updated on 17 Jun 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc