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

@proem/variant

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@proem/variant - npm Package Compare versions

Comparing version 0.0.19 to 0.0.21

lib/index.cjs.js

39

lib/index.js

@@ -1,15 +0,3 @@

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var array = __importStar(require("@proem/array"));
/**
* Returns the provided tags in an tuple.
*/
function tags() {
import * as array from '@proem/array';
export function tags() {
var tags = [];

@@ -21,13 +9,6 @@ for (var _i = 0; _i < arguments.length; _i++) {

}
exports.tags = tags;
/**
* Type guard that refine the union type to a more specific one.
*
* Returns true if the variant has one of the provided tags.
*/
function oneOf(variant, tags) {
export function oneOf(variant, tags) {
return array.includes(tags, variant.type);
}
exports.oneOf = oneOf;
function map(cases, or) {
export function map(cases, or) {
return function (variant) {

@@ -44,12 +25,3 @@ var caseFn = cases[variant.type];

}
exports.map = map;
/**
* Create a reducer function that takes a state value as first
* argument, and a Variant as a second argument.
*
* Returns the provided state if no case is found.
*
* Works well with React's useReducer hook.
*/
function reducer(caseReducers) {
export function reducer(caseReducers) {
return function (state, variant) {

@@ -63,3 +35,2 @@ var arm = caseReducers[variant.type];

}
exports.reducer = reducer;
//# sourceMappingURL=index.js.map
{
"name": "@proem/variant",
"version": "0.0.19",
"version": "0.0.21",
"description": "proem package for handling algebraic data types",

@@ -16,13 +16,8 @@ "keywords": [

"license": "MIT",
"main": "lib/index.js",
"module": "esm/index.js",
"types": "types/index.d.ts",
"main": "lib/index.cjs.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"directories": {
"lib": "lib"
},
"files": [
"types",
"lib",
"esm"
],
"publishConfig": {

@@ -36,5 +31,2 @@ "access": "public"

"scripts": {
"build:commonjs": "tsc -b .",
"build:esm": "tsc -b ./tsconfig.esm.json",
"prepublishOnly": "yarn build:commonjs && yarn build:esm",
"test": "echo \"Error: run tests from root\" && exit 1"

@@ -46,5 +38,5 @@ },

"dependencies": {
"@proem/array": "^0.0.19"
"@proem/array": "^0.0.21"
},
"gitHead": "f8d7a1a8ceca2ba2c39ce289e1938ba1e0aa94f1"
"gitHead": "36346032a36b4dc1f2098297ada24b5501c5134b"
}
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