New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

inferred-types

Package Overview
Dependencies
Maintainers
1
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inferred-types - npm Package Compare versions

Comparing version 0.24.2 to 0.24.3

2

package.json
{
"name": "inferred-types",
"version": "0.24.2",
"version": "0.24.3",
"description": "Functions which provide useful type inference on TS projects",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -6,14 +6,23 @@ import { MapToWithFiltering } from "src/types/dictionary";

*
* A utility function which maps one dictionary structure `I` to another `O`; where:
* A utility function which maps one dictionary structure `I` to another `O`; which allows
* the transform to:
*
* - `I` maps to `O[ ]` so this allows a cardinality of 0:M
* - In other words ... values from `I` can be filtered, translated 1:1 or split into multiple outputs
* - Type constrains laid out by `I` and `O` will be enforced by type system
* - _split_ inputs into multiple outputs
* - _map_ 1:1 between input and output
* - _filter_ inputs which don't meet certain criteria (by returning `null`)
*
* This higher order function first asks for the mapping criteria:
* ```ts
* type I = { title: string; color: string; products: Product[] };
* type O = { title: string; count: number };
* const summarize: mapTo<I,O>()
* .map();
* const mapper = mapTo<I,O>(i => i.name
* ? [
* { name: i.name, a: "static text", b: i.products.length }
* ]
* : null
* );
* ```
*
* and now you'll have a _mapper_ variable will be assigned as a mapping fn:
* ```ts
* function (source: I | I[]): O[]
* ```
*/

@@ -20,0 +29,0 @@ export const mapTo =

Sorry, the diff of this file is too big to display

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