normalize_nested_params

0.0.1 • Public • Published

normalize_nested_params.js

Original idea comes from Rack::Utils#normalize_nested_params, see it at http://rack.rubyforge.org/doc/Rack/Utils.html

This function is binding to underscore.js's namespace.

e.g.

_.normalize_nested_params(obj, "contents[][style]", 'bold') #=> {"contents":[{"style":"bold"}]}
_.normalize_nested_params(obj, "contents[][style]")         #=> 'bold'

See more examples in Test Cases.

Run tests, add "debug_normalize_nested_params" to location search string

Copyright

MIT. David Chen at 17zuoye.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    7
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    7

Package Sidebar

Install

npm i normalize_nested_params

Weekly Downloads

4

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mvj3