Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reverse-iterable-map

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reverse-iterable-map - npm Package Compare versions

Comparing version 4.0.4 to 5.0.0

dist/reverse-iterable-map.js

64

package.json
{
"name": "reverse-iterable-map",
"version": "5.0.0",
"license": "MIT",
"description": "A reverse-iterable map implementation based on the built-in Map object",
"version": "4.0.4",
"repository": "kleinfreund/reverse-iterable-map",
"author": {

@@ -10,28 +10,9 @@ "name": "Philipp Rudloff",

},
"license": "MIT",
"main": "dist/cjs/reverse-iterable-map",
"module": "dist/esm/reverse-iterable-map.mjs",
"sideEffects": false,
"files": [
"src",
"dist"
],
"scripts": {
"prepublishOnly": "npm test",
"prepare": "npm run build",
"test": "nyc ava tests/*.js",
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc --module es2015 --outDir dist/esm && npm run rename-to-mjs",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"rename-to-mjs": "mv dist/esm/reverse-iterable-map.js dist/esm/reverse-iterable-map.mjs",
"examples": "http-server"
"homepage": "https://github.com/kleinfreund/reverse-iterable-map",
"repository": {
"type": "git",
"url": "https://github.com/kleinfreund/reverse-iterable-map.git"
},
"ava": {
"compileEnhancements": false,
"extensions": [
"ts"
],
"require": [
"ts-node/register"
]
"bugs": {
"url": "https://github.com/kleinfreund/reverse-iterable-map/issues"
},

@@ -45,12 +26,27 @@ "keywords": [

],
"bugs": {
"url": "https://github.com/kleinfreund/reverse-iterable-map/issues"
"exports": "./dist/reverse-iterable-map.js",
"main": "./dist/reverse-iterable-map.js",
"module": "./dist/reverse-iterable-map.js",
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build": "NODE_ENV=production rollup --config",
"prebuild": "npm run test",
"test": "jest",
"start": "http-server",
"prestart": "npm run build",
"prepack": "npm run build",
"prepublishOnly": "npm run test"
},
"devDependencies": {
"ava": "^1.1.0",
"http-server": "^0.11.1",
"nyc": "^13.1.0",
"ts-node": "^8.0.2",
"typescript": "^3.2.4"
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^26.0.22",
"http-server": "^0.12.3",
"jest": "^26.6.3",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^26.5.4",
"typescript": "^4.2.3"
}
}

@@ -10,2 +10,3 @@ # reverse-iterable-map

- [**npmjs.com**/package/reverse-iterable-map](https://www.npmjs.com/package/reverse-iterable-map)
- [on BundlePhobia](https://bundlephobia.com/result?p=reverse-iterable-map)
- [**github.com**/kleinfreund/reverse-iterable-map](https://github.com/kleinfreund/reverse-iterable-map)

@@ -28,2 +29,3 @@

- [`size`](#size)
- [`[Symbol.toStringTag]`](#symboltostringtag)
- [`clear()`](#clear)

@@ -52,12 +54,12 @@ - [`delete()`](#delete)

Download the ES module file …
Download the UMD bundle file …
```sh
curl -O https://raw.githubusercontent.com/kleinfreund/reverse-iterable-map/main/dist/esm/reverse-iterable-map.mjs
curl -O https://raw.githubusercontent.com/kleinfreund/reverse-iterable-map/main/dist/reverse-iterable-map.js
```
… and import it like this:
… and use it like this:
```js
import ReverseIterableMap from 'reverse-iterable-map.mjs';
const ReverseIterableMap = window.ReverseIterableMap.default

@@ -77,28 +79,10 @@ const map = new ReverseIterableMap();

- CommonJS module
```node
const ReverseIterableMap = require('reverse-iterable-map').default;
```node
const ReverseIterableMap = require('reverse-iterable-map').default;
const map = new ReverseIterableMap();
```
const map = new ReverseIterableMap();
```
- ES module
```js
import ReverseIterableMap from 'reverse-iterable-map/dist/esm/reverse-iterable-map';
const map = new ReverseIterableMap();
```
- TypeScript module
```ts
import ReverseIterableMap from 'reverse-iterable-map/src/reverse-iterable-map';
const map = new ReverseIterableMap();
```
## Examples

@@ -109,3 +93,4 @@

```sh
npm install && npm run examples
npm install
npm start
```

@@ -122,3 +107,4 @@

```sh
npm install && npm test
npm install
npm test
```

@@ -208,3 +194,9 @@

### `[Symbol.toStringTag]`
The `ReverseIterableMap[@@toStringTag]` property has an initial value of “ReverseIterableMap”.
### `clear()`

@@ -281,4 +273,24 @@

#### Usage
```js
const map = new ReverseIterableMap([1, 2, 4].entries());
const iterator = map.entries();
iterator.next().value;
//> [0, 1]
iterator.next().value;
//> [1, 2]
iterator.next().value;
//> [2, 4]
iterator.next().value;
//> undefined
```
### `forEach()`

@@ -743,3 +755,3 @@

Let’s assume a *minor* update was made. First of all, the working directory needs to cleaned up; all changes need to be comitted. It’s important to run the `build` script to make sure new CommonJS and ES modules are compiled from the TypeScript source module.
Let’s assume a *minor* update was made. First of all, the working directory needs to be cleaned up; all changes need to be committed. It’s important to run the `build` script to make sure new CommonJS and ES modules are compiled from the TypeScript source module.

@@ -746,0 +758,0 @@ ```sh

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc