Neatly Packaged Magic

    http-form-urlencoded
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.24 • Public • Published

    README

    a x-www-form-urlencoded & URLSearchParams class
    
    import LazyURLSearchParams from '../index';
    import assert from 'assert';
    
    let u = new LazyURLSearchParams({
    	nickname: 'xxxxxxx',
    	passwd: {k:'xxxxxxx'}
    });
    
    console.dir(u.toString());
    
    assert.deepStrictEqual(u.toString(), 'nickname=xxxxxxx&passwd=%7B%22k%22%3A%22xxxxxxx%22%7D');
    
    u = new LazyURLSearchParams();
    
    u.push(...Object.entries({
    	nickname: 'xxxxxxx',
    	passwd: {k:'xxxxxxx'}
    }));
    
    console.dir(u.toString());
    
    assert.deepStrictEqual(u.toString(), 'nickname=xxxxxxx&passwd=%7B%22k%22%3A%22xxxxxxx%22%7D');
    
    u = new LazyURLSearchParams();
    
    u.extend({
    	nickname: 'xxxxxxx',
    	passwd: {k:'xxxxxxx'}
    });
    
    console.dir(u.toString());
    
    assert.deepStrictEqual(u.toString(), 'nickname=xxxxxxx&passwd=%7B%22k%22%3A%22xxxxxxx%22%7D');
    

    Install

    npm i http-form-urlencoded

    DownloadsWeekly Downloads

    106

    Version

    1.0.24

    License

    ISC

    Unpacked Size

    253 kB

    Total Files

    7

    Last publish

    Collaborators

    • bluelovers