@socketregistry/stop-iteration-iterator
Advanced tools
| declare function getStopIterationIterator<T>( | ||
| origIterator: Iterator<T>, | ||
| ): Iterator<T> | ||
| export = getStopIterationIterator |
+30
| 'use strict' | ||
| const stopIteration = | ||
| typeof globalThis.StopIteration === 'object' ? globalThis.StopIteration : null | ||
| const doneState = new WeakMap() | ||
| module.exports = function getStopIterationIterator(origIterator) { | ||
| if (!stopIteration) { | ||
| throw new SyntaxError('this environment lacks StopIteration') | ||
| } | ||
| doneState.set(origIterator, false) | ||
| return { | ||
| next() { | ||
| const done = !!doneState.get(origIterator) | ||
| try { | ||
| return { | ||
| done, | ||
| value: done ? undefined : origIterator.next(), | ||
| } | ||
| } catch (e) { | ||
| doneState.set(origIterator, true) | ||
| if (e !== stopIteration) { | ||
| throw e | ||
| } | ||
| return { done: true, value: undefined } | ||
| } | ||
| }, | ||
| } | ||
| } |
+21
| MIT License | ||
| Copyright (c) 2024 Socket Inc | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Sorry, the diff of this file is not supported yet
+36
-5
| { | ||
| "name": "@socketregistry/stop-iteration-iterator", | ||
| "version": "0.0.0", | ||
| "private": false, | ||
| "version": "1.0.0", | ||
| "description": "Socket.dev optimized package override for stop-iteration-iterator", | ||
| "keywords": [ | ||
| "Socket.dev", | ||
| "package-overrides" | ||
| ], | ||
| "homepage": "https://github.com/SocketDev/socket-registry/tree/main/packages/npm/stop-iteration-iterator", | ||
| "license": "MIT", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/SocketDev/socket-registry.git", | ||
| "directory": "packages/npm/stop-iteration-iterator" | ||
| }, | ||
| "files": [ | ||
| "*.d.ts", | ||
| "*.js" | ||
| ], | ||
| "sideEffects": false, | ||
| "exports": { | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "default": "./index.js" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| "access": "public", | ||
| "provenance": true | ||
| }, | ||
| "files": [] | ||
| } | ||
| "engines": { | ||
| "node": ">=24" | ||
| }, | ||
| "socket": { | ||
| "categories": [ | ||
| "cleanup" | ||
| ] | ||
| } | ||
| } |
+48
-1
| # @socketregistry/stop-iteration-iterator | ||
| Placeholder to reserve the name for npm trusted publishing. Real releases publish via CI (OIDC/provenance). | ||
| [](https://socket.dev/npm/package/@socketregistry/stop-iteration-iterator) | ||
| [](https://github.com/SocketDev/socket-registry/actions/workflows/ci.yml) | ||
| [](https://twitter.com/SocketSecurity) | ||
| [](https://bsky.app/profile/socket.dev) | ||
| > A tested zero dependency drop-in replacement of [`stop-iteration-iterator`](https://socket.dev/npm/package/stop-iteration-iterator) complete with TypeScript types. | ||
| ## Installation | ||
| ### Install as a package override | ||
| [`socket`](https://socket.dev/npm/package/socket) | ||
| CLI will automagically ✨ populate | ||
| [overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides) | ||
| and [resolutions](https://yarnpkg.com/configuration/manifest#resolutions) | ||
| of your `package.json`. | ||
| ```sh | ||
| pnpm install -g socket@1.1.147 | ||
| socket optimize | ||
| ``` | ||
| Prefer to do it yourself? Add `@socketregistry/stop-iteration-iterator` | ||
| to your `package.json`. | ||
| ```json | ||
| { | ||
| "overrides": { | ||
| "stop-iteration-iterator": "npm:@socketregistry/stop-iteration-iterator@^1" | ||
| }, | ||
| "resolutions": { | ||
| "stop-iteration-iterator": "npm:@socketregistry/stop-iteration-iterator@^1" | ||
| } | ||
| } | ||
| ``` | ||
| ### Install as a plain dependency | ||
| Install with your favorite package manager. | ||
| ```sh | ||
| pnpm install @socketregistry/stop-iteration-iterator | ||
| ``` | ||
| ## Requirements | ||
| Node >= `24` |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
No License Found
LicenseLicense information could not be found.
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
No website
QualityPackage does not have a website.
5629
1698.4%6
200%0
-100%31
Infinity%1
-66.67%51
1175%0
-100%0
-100%