
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@degjs/form-mapper
Advanced tools
A utility to take in an element or array of elements and return an object consisting of their values
formMapper is an ES6 module. Consequently, you'll nee an ES6 transpiler (Babel is an option) as part of your Javascript workflow.
If you are already using NPM for your project, you can install formMapper with the following command:
$ npm install @degjs/form-mapper
import { getValues } from "@degjs/form-mapper";
.
.
.
const formData = getValues(formEl);
import formMapper from "@degjs/form-mapper";
.
.
.
const formData = formMapper.getValues(formEl);
The options represent the default selector names for various input elements. Can be replaced with a string of any selectors that querySelectAll
and matches
supports.
Default: input, select, textarea
Example override: .js-input, .js-checkbox-input, select[multiple], textarea
The getValues method returns an object with key value pairs being { inputName: inputValue }
Type: Element | Element[]
The container element, input element or array of elements to get values from.
Type: Object
Default: {elementSelectors: defaultElementSelectors, shouldStringify: false}
An object to override the default settings. shouldStringify
declares if the returned value should be a string representation of an object or just the object.
The getInputElements method returns an array of input elements as found by the default selectors.
Type: Element
The form element to extract inputs from.
Type: String
Default: defaultElementSelectors
And string representing a comma-separated list of selectors to override any default element selectors.
formMapper depends on the following browser APIs:
As of Febrary 2018, matches is supported in IE9 and up.
To support legacy browsers, you'll need to include polyfills for the above APIs.
FAQs
Get the values of form inputs as one collective object
The npm package @degjs/form-mapper receives a total of 0 weekly downloads. As such, @degjs/form-mapper popularity was classified as not popular.
We found that @degjs/form-mapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.