Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcollina/marry.js
Unification for JS
https://github.com/mcollina/marry.js
Last synced: 13 days ago
JSON representation
Unification for JS
- Host: GitHub
- URL: https://github.com/mcollina/marry.js
- Owner: mcollina
- License: mit
- Created: 2014-06-27T16:30:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-27T18:41:31.000Z (over 10 years ago)
- Last Synced: 2024-12-17T15:42:27.878Z (23 days ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Marry
=====Unification for JS: extract variables from your JS objects.
```js
var marry = require('marry')
console.log('first, basic marrying')
console.log(marry({
long: {
object: 42
}
, answer: 42
, something: 'else'
, beep: 'bop'
}, {
long: {
object: marry.v('long')
}
, answer: marry.v('answer')
, something: 'else'
}))
// outputs
// { bindings: { long: 42, answer: 42 },
// marriage: { long: { object: 42 }, answer: 42, something: 'else' },
// equalVariables: {} }console.log('second, variables marrying')
console.log(marry({
another: marry.v('another')
, answer: 42
, something: 'else'
, beep: 'bop'
}, {
another: marry.v('var')
, answer: marry.v('answer')
, something: 'else'
}))
// outputs
// { bindings: { answer: 42 },
// marriage: { another: { name: 'var' }, answer: 42, something: 'else' },
// equalVariables: { var: [ 'another' ], another: [ 'var' ] } }
```License
-------MIT