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'
}
])
}
)
-
Notifications
You must be signed in to change notification settings - Fork 0
check for updates to components in Common Forms
commonform/commonform-component-updates
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
check for updates to components in Common Forms
Resources
Stars
Watchers
Forks
Packages 0
No packages published