Skip to content

Commit

Permalink
flatten as default export.
Browse files Browse the repository at this point in the history
  • Loading branch information
timoxley committed Jul 9, 2014
1 parent d856544 commit 9ff2125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ $ npm install flat

## Methods

### flat.flatten(original, options)
### flatten(original, options)

Flattens the object - it'll return an object one level deep, regardless of how
nested the original object was:

``` javascript
var flatten = require('flat').flatten
var flatten = require('flat')

flatten({
key1: {
Expand All @@ -36,9 +36,9 @@ flatten({
// }
```

### flat.unflatten(original, options)
### unflatten(original, options)

Flattening is reversible too, you can call `flat.unflatten()` on an object:
Flattening is reversible too, you can call `flatten.unflatten()` on an object:

``` javascript
var unflatten = require('flat').unflatten
Expand Down Expand Up @@ -72,7 +72,7 @@ When enabled, both `flat` and `unflatten` will preserve arrays and their
contents. This is disabled by default.

``` javascript
var flatten = require('flat').flatten
var flatten = require('flat')

flatten({
this: [
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var flat = module.exports = {
flatten: flatten
, unflatten: unflatten
}
var flat = module.exports = flatten
flatten.flatten = flatten
flatten.unflatten = unflatten

function flatten(target, opts) {
opts = opts || {}
Expand Down

0 comments on commit 9ff2125

Please sign in to comment.