1.0.2 • Published 6 years ago

@handout/prefixer v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Prefixer

Handout plugin to automatically prefix field keys

Install

npm install --save @handout/prefixer

Usage

Prefix all fields

import Handout from '@handout/handout';
import Prefixer form '@handout/prefixer';

const form = document.querySelector('form');

const h = new Handout(form, Prefixer('user_'));
h.submit().then(res => {
  // Will submit all fields as user_{key}
});

Prefix only certain fields

import Handout from '@handout/handout';
import Prefixer form '@handout/prefixer';

 // Will prefix all fields except "privacy"
const filter = key => key !== 'privacy';

const form = document.querySelector('form');

const h = new Handout(form, Prefixer('user_', filter));
h.submit().then(res => {
  // Will submit all fields as user_{key} except privacy
});
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago