|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | # identity-obj-proxy [](https://travis-ci.org/keyanzhang/identity-obj-proxy) [](https://www.npmjs.com/package/identity-obj-proxy) [](https://coveralls.io/github/keyanzhang/identity-obj-proxy?branch=master)
|
|---|
| 2 | An identity object using ES6 proxies. Useful for testing trivial webpack imports. For instance, you can tell Jest to mock this object as imported [CSS modules](https://github.com/css-modules/css-modules); then all your `className` lookups on the imported `styles` object will be returned as-is.
|
|---|
| 3 |
|
|---|
| 4 | ```
|
|---|
| 5 | npm install identity-obj-proxy
|
|---|
| 6 | ```
|
|---|
| 7 |
|
|---|
| 8 | ## Requirement
|
|---|
| 9 | No flag is required for Node.js `v6.*`; use `node --harmony_proxies` flag for `v5.*` and `v4.*`.
|
|---|
| 10 |
|
|---|
| 11 | ## Example
|
|---|
| 12 | ``` javascript
|
|---|
| 13 | import idObj from 'identity-obj-proxy';
|
|---|
| 14 | console.log(idObj.foo); // 'foo'
|
|---|
| 15 | console.log(idObj.bar); // 'bar'
|
|---|
| 16 | console.log(idObj[1]); // '1'
|
|---|
| 17 | ```
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.