1. identity-obj-proxy
an identity object using ES6 proxies
identity-obj-proxy
Package: identity-obj-proxy
Created by: keyanzhang
Last modified: Sun, 19 Jun 2022 00:10:14 GMT
Version: 3.0.0
License: MIT
Downloads: 24,264,864
Repository: https://github.com/keyanzhang/identity-obj-proxy

Install

npm install identity-obj-proxy
yarn add identity-obj-proxy

identity-obj-proxy Build Status npm version test coverage

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; then all your className lookups on the imported styles object will be returned as-is.

npm install identity-obj-proxy

Requirement

No flag is required for Node.js v6.*; use node --harmony_proxies flag for v5.* and v4.*.

Example

 import idObj from 'identity-obj-proxy';
console.log(idObj.foo); // 'foo'
console.log(idObj.bar); // 'bar'
console.log(idObj[1]); // '1'

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin