HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/design.system/node_modules/map-or-similar/README.md
# Map Or Similar
Returns a JavaScript Map() or a similar object with the same interface, if Map is not available.
Focuses on performance.
No dependencies.
Made for the browser and nodejs.

## Install
```javascript
npm install map-or-similar --save
```

## Use
```javascript
var MapOrSimilar = require('map-or-similar');

// make a new map or similar object
var myMap = new MapOrSimilar();

// use it like a map
myMap.set('key1', 'value1');
myMap.set({ val: 'complex object as key' }, 'value2');
```

The following methods and properties are supported identically to Map():

```Slim
set(key, val)     : Sets a value to a key. Key can be a complex object, array, etc.
get(key)          : Returns the value of a key.
has(key)          : Returns true if the key exists, otherwise false.
delete(key)       : Deletes a key and its value.
forEach(callback) : Invokes callback(val, key, object) once for each key-value pair in insertion order.
size              : Returns the number of keys-value pairs.
```

Does not support other Map methods or properties.

## Test
```javascript
npm run test
```

## License

Released under an MIT license.

### Other Libs

- [Memoizerific](https://github.com/thinkloop/memoizerific): Fastest, smallest, most-efficient JavaScript memoization lib to memoize JS functions.
- [Multi Key Cache](https://github.com/thinkloop/multi-key-cache): A JavaScript (JS) cache that can have multiple complex values as keys.