kamsi/i18n2-scanner — pull request #2 by kamsi (2014-08-14 16:12:40+00:00)
Title: Merge maps script

`merge-maps`, should merge maps that scanner produces.

We'll receive following input:

```json
{
"/path/to/filename/foo.js": {
"context": "fooContext",
"messages": {
"Normal message": [{ "point": 17, "column": 17, "line": 2 },
{ "point": 37, "column": 17, "line": 4 }],
"n\0One Apple\0Many apples": [{ "point": 17, "column": 17, "line": 2 }]
}
},
"/path/to/filename/bar.js": {
"context": "default",
"messages": {
"Normal message": [{ "point": 17, "column": 17, "line": 2 },
{ "point": 37, "column": 17, "line": 4 }],
"n\0One Apple\0Many apples": [{ "point": 17, "column": 17, "line": 2 }]
}
}
}
```

On base of it ,we should resolve following map

```json
{
"Normal message": {
"fooContext": [
{ "fileName": "/path/to/filename/foo.js", "point": 17, "column": 17, "line": 2 },
{ "filename": "/path/to/filename/foo.js", "point": 37, "column": 17, "line": 4 }
],
"default": [
{ "fileName": "/path/to/filename/bar.js", "point": 17, "column": 17, "line": 2 }
]
}
"n\0One Apple\0Many apples": {
"fooContext": [
{ "fileName": "/path/to/filename/foo.js", "point": 17, "column": 17, "line": 2 },
{ "filename": "/path/to/filename/foo.js", "point": 37, "column": 17, "line": 4 }
],
"default": [
{ "fileName": "/path/to/filename/bar.js", "point": 17, "column": 17, "line": 2 }
]
}
}
```