Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
hof-behaviour-address-lookup
Advanced tools
A HOF Behaviour for controlling a multi-step address lookup.
// steps.js
const AddressLookup = require('hof-behaviour-address-lookup');
module.exports = {
'/step-1' {
behaviours: AddressLookup({
addressKey: 'address-field'
})
}
}
addressKey
- REQUIRED - the key used to store the formatted address after lookuprequired
- if set to a truthy value then the address is required. By default a user can pass through without entering an address.hostname
, authorization
, paths.lookup
and paths.validate
Model
- a custom Model which exposes a fetch
method (and validate
if using api validation). Both fetch
and validate
are expected to return a Promise
validate
- a map of validators to pass to the Model's validate method. The default implementation supports allowedCountries
which is an Array of accepted countries. - for only English addresses use:AddressLookup({
addressKey: 'address',
validate: {
allowedCountries: ['England']
}
});
If you provide a custom model, you should provide a fetch
method which returns a Promise
and resolves
with the data on a successful lookup, and rejects with an Error
if the service is unavailable. In the case of the service being unavailable a message is shown and a textarea is shown for the address to be input manually.
When providing a custom validate
function, this should also return a Promise
which resolves on a success validation, and rejects with an error with status 418
if validation fails.
The following keys are expected to be defined in your translations file.
pages.address-lookup.edit
- text to change the postcode once entered. Defaults to 'Change'
;pages.address-lookup.cantfind
- link text for manual entry if you cant find your address in the lookup. Defaults to 'I can\'t find the address in the list'
fields.{key}-postcode.label
- Label for the postcode field when shown on the lookup and manual steps. Defaults to 'Postcode'
pages.address-lookup.postcode-api.not-found
- Message to show if postcode not found. Defaults to 'Sorry – we couldn’t find any addresses for that postcode, enter your address manually'
pages.address-lookup.postcode-api.cant-connect
- Message to show if unable to connect to the lookup service. Defaults to 'Sorry – we couldn’t connect to the postcode lookup service at this time, enter your address manually'
buttons.find-address
- Postcode submit button text. Required.FAQs
A HOF Behaviour for a multi-step postcode lookup
The npm package hof-behaviour-address-lookup receives a total of 12 weekly downloads. As such, hof-behaviour-address-lookup popularity was classified as not popular.
We found that hof-behaviour-address-lookup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.