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

f-box-core

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

f-box-core - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

dist/index.js

@@ -1,1 +0,1 @@

(function(a,g){typeof exports=="object"&&typeof module<"u"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(a=typeof globalThis<"u"?globalThis:a||self,g(a["f-box-core"]={}))})(this,function(a){"use strict";const g=t=>{const s=i=>g(i(t)),o=function(i){const h=this.getValue();return i.map(p=>h(p))},c=i=>i(t);return{isBox:!0,map:s,apply:o,flatMap:c,getValue:()=>t,"<$>":s,"<*>":o,">>=":c}},H=t=>(t==null?void 0:t.isBox)===!0,J={pack:g,isBox:H},B=t=>{let s=t;const o=new Map,c=[],V=()=>{o.forEach(n=>n(s))},i=()=>s,h=n=>{s=n(s),V()},p=n=>{const r=B(n(s)),u=b(E=>{r.setValue(()=>n(E))});return r.detachHandlers.push(()=>_(u)),r},e=n=>{let r=n(s);const u=B(r.getValue()),q=b($=>{r.detach(),r=n($),u.setValue(()=>r.getValue());const D=r.subscribe(F=>{u.setValue(()=>F)});u.detachHandlers.push(()=>r.unsubscribe(D))});u.detachHandlers.push(()=>_(q));const z=r.subscribe($=>{u.setValue(()=>$)});return u.detachHandlers.push(()=>r.unsubscribe(z)),u},l=function(n){const r=B(this.getValue()(n.getValue())),u=()=>r.setValue(()=>this.getValue()(n.getValue())),E=[this.subscribe(u),n.subscribe(u)];return r.detachHandlers.push(()=>{this.unsubscribe(E[0]),n.unsubscribe(E[1])}),r},b=n=>{const r=Math.random().toString(36).substr(2,9);return o.set(r,n),r},_=n=>{o.delete(n)};return{isRBox:!0,getValue:i,setValue:h,map:p,flatMap:e,apply:l,"<$>":p,">>=":e,"<*>":l,subscribe:b,unsubscribe:_,unsubscribeAll:()=>{o.clear()},detach:()=>{c.forEach(n=>n()),c.length=0},detachHandlers:c}},P=t=>s=>t.setValue(()=>s),w={pack:B,set:P,isRBox:t=>t&&typeof t=="object"&&t.isRBox===!0},f={isMaybe:!0,map:()=>f,apply:()=>f,flatMap:()=>f,getValue:()=>null,orElse:t=>t,getOrElse:t=>t,match:(t,s)=>s(),"<$>":()=>f,"<*>":()=>f,">>=":()=>f},K=t=>N(t)?m():k(t),m=()=>f,k=t=>{const s=e=>K(e(t)),o=function(e){if(x(this)||x(e))return m();const l=this.getValue();return e.map(b=>l(b))},c=e=>e(t);return{isMaybe:!0,map:s,apply:o,flatMap:c,getValue:()=>t,orElse:e=>k(t),getOrElse:e=>t,match:(e,l)=>e(t),"<$>":s,"<*>":o,">>=":c}},N=t=>t==null,T=t=>t&&typeof t=="object"&&t.isMaybe===!0,x=t=>T(t)&&t===m(),A={pack:K,just:k,nothing:m,isNone:N,isMaybe:T,isNothing:x,isJust:t=>T(t)&&t!==m()},d=t=>({isEither:!0,map:()=>d(t),apply:()=>d(t),flatMap:()=>d(t),getValue:()=>t,orElse:s=>s,getOrElse:s=>s,match:(s,o)=>s(t),"<$>":()=>d(t),"<*>":()=>d(t),">>=":()=>d(t)}),M=t=>{const s=e=>M(e(t)),o=function(e){if(j(this)||j(e))return e;const l=this.getValue();return e.map(b=>l(b))},c=e=>e(t);return{isEither:!0,map:s,apply:o,flatMap:c,getValue:()=>t,orElse:e=>M(t),getOrElse:e=>t,match:(e,l)=>l(t),"<$>":s,"<*>":o,">>=":c}},C=M,O=t=>t==null,R=t=>t&&typeof t=="object"&&t.isEither===!0,j=t=>R(t)&&t.match(s=>!O(s),()=>!1),I={pack:C,right:M,left:d,isNone:O,isEither:R,isLeft:j,isRight:t=>R(t)&&t.match(()=>!1,s=>!O(s))},y=t=>{const s=i=>y(()=>t().then(i)),o=i=>y(()=>t().then(h=>i(h).run())),c=function(i){return y(()=>this.run().then(h=>typeof h!="function"?Promise.reject(new TypeError("fn is not a function")):i.run().then(p=>h(p))))};return{isTask:!0,map:s,flatMap:o,apply:c,run:t,"<$>":s,"<*>":c,">>=":o}},S=(t,s)=>y(()=>Promise.resolve().then(()=>t()).catch(o=>Promise.resolve(s(o)))),L={pack:y,lift:t=>y(()=>Promise.resolve(t)),tryCatch:S,tryTask:t=>S(t,s=>Promise.reject(s)),isTask:t=>(t==null?void 0:t.isTask)===!0};a.Box=J,a.Either=I,a.Maybe=A,a.RBox=w,a.Task=L,a.isBox=H,a.set=P,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
(function(u,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(u=typeof globalThis<"u"?globalThis:u||self,y(u["f-box-core"]={}))})(this,function(u){"use strict";const y=t=>{const s=c=>y(c(t)),o=function(c){const a=this.getValue();return c.map(f=>a(f))},i=c=>c(t);return{isBox:!0,map:s,apply:o,flatMap:i,getValue:()=>t,"<$>":s,"<*>":o,">>=":i}},H=t=>(t==null?void 0:t.isBox)===!0,J={pack:y,isBox:H},E=t=>{let s=t;const o=new Map,i=[],b=()=>{o.forEach(n=>n(s))},c=()=>s,a=n=>{s=n(s),b()},f=n=>{const r=E(n(s)),h=g(B=>{r.setValue(()=>n(B))});return r.detachHandlers.push(()=>$(h)),r},e=n=>{let r=n(s);const h=E(r.getValue()),q=g(O=>{r.detach(),r=n(O),h.setValue(()=>r.getValue());const D=r.subscribe(F=>{h.setValue(()=>F)});h.detachHandlers.push(()=>r.unsubscribe(D))});h.detachHandlers.push(()=>$(q));const z=r.subscribe(O=>{h.setValue(()=>O)});return h.detachHandlers.push(()=>r.unsubscribe(z)),h},p=function(n){const r=E(this.getValue()(n.getValue())),h=()=>r.setValue(()=>this.getValue()(n.getValue())),B=[this.subscribe(h),n.subscribe(h)];return r.detachHandlers.push(()=>{this.unsubscribe(B[0]),n.unsubscribe(B[1])}),r},g=n=>{const r=Math.random().toString(36).substr(2,9);return o.set(r,n),r},$=n=>{o.delete(n)};return{isRBox:!0,getValue:c,setValue:a,map:f,flatMap:e,apply:p,"<$>":f,">>=":e,"<*>":p,subscribe:g,unsubscribe:$,unsubscribeAll:()=>{o.clear()},detach:()=>{i.forEach(n=>n()),i.length=0},detachHandlers:i}},P=t=>s=>t.setValue(()=>s),w={pack:E,set:P,isRBox:t=>t&&typeof t=="object"&&t.isRBox===!0},l={isMaybe:!0,map:()=>l,apply:()=>l,flatMap:()=>l,getValue:()=>null,orElse:t=>t,getOrElse:t=>t,match:(t,s)=>s(),"<$>":()=>l,"<*>":()=>l,">>=":()=>l,"<?>":t=>t,"<|>":t=>t},K=t=>N(t)?V():k(t),V=()=>l,k=t=>{const s=e=>K(e(t)),o=function(e){if(x(this)||x(e))return V();const p=this.getValue();return e.map(g=>p(g))},i=e=>e(t),b=()=>t,c=e=>k(t),a=e=>t;return{isMaybe:!0,map:s,apply:o,flatMap:i,getValue:b,orElse:c,getOrElse:a,match:(e,p)=>e(t),"<$>":s,"<*>":o,">>=":i,"<?>":c,"<|>":a}},N=t=>t==null,T=t=>t&&typeof t=="object"&&t.isMaybe===!0,x=t=>T(t)&&t===V(),A={pack:K,just:k,nothing:V,isNone:N,isMaybe:T,isNothing:x,isJust:t=>T(t)&&t!==V()},d=t=>({isEither:!0,map:()=>d(t),apply:()=>d(t),flatMap:()=>d(t),getValue:()=>t,orElse:s=>s,getOrElse:s=>s,match:(s,o)=>s(t),"<$>":()=>d(t),"<*>":()=>d(t),">>=":()=>d(t),"<?>":s=>s,"<|>":s=>s}),M=t=>{const s=e=>M(e(t)),o=function(e){if(_(this)||_(e))return e;const p=this.getValue();return e.map(g=>p(g))},i=e=>e(t),b=()=>t,c=e=>M(t),a=e=>t;return{isEither:!0,map:s,apply:o,flatMap:i,getValue:b,orElse:c,getOrElse:a,match:(e,p)=>p(t),"<$>":s,"<*>":o,">>=":i,"<?>":c,"<|>":a}},C=M,R=t=>t==null,j=t=>t&&typeof t=="object"&&t.isEither===!0,_=t=>j(t)&&t.match(s=>!R(s),()=>!1),I={pack:C,right:M,left:d,isNone:R,isEither:j,isLeft:_,isRight:t=>j(t)&&t.match(()=>!1,s=>!R(s))},m=t=>{const s=c=>m(()=>t().then(c)),o=c=>m(()=>t().then(a=>c(a).run())),i=function(c){return m(()=>this.run().then(a=>typeof a!="function"?Promise.reject(new TypeError("fn is not a function")):c.run().then(f=>a(f))))};return{isTask:!0,map:s,flatMap:o,apply:i,run:t,"<$>":s,"<*>":i,">>=":o}},S=(t,s)=>m(()=>Promise.resolve().then(()=>t()).catch(o=>Promise.resolve(s(o)))),L={pack:m,lift:t=>m(()=>Promise.resolve(t)),tryCatch:S,tryTask:t=>S(t,s=>Promise.reject(s)),isTask:t=>(t==null?void 0:t.isTask)===!0};u.Box=J,u.Either=I,u.Maybe=A,u.RBox=w,u.Task=L,u.isBox=H,u.set=P,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});

@@ -74,7 +74,23 @@ /**

* Returns the provided default value since this represents an invalid result.
* Alias for `orElse`.
* 無効な結果を表しているため、指定されたデフォルト値を返します。
* `orElse` のエイリアス。
* @param defaultValue - The default value to return. / 返すデフォルト値。
*/
readonly "<?>": <U>(defaultValue: Either<L, U>) => Either<L, U>;
/**
* Returns the provided default value since this represents an invalid result.
* 無効な結果を表しているため、指定されたデフォルト値を返します。
* @param defaultValue - The default value to return. / 返すデフォルト値。
*/
readonly getOrElse: <U>(defaultValue: U) => U;
/**
* Returns the provided default value since this represents an invalid result.
* Alias for `getOrElse`.
* 無効な結果を表しているため、指定されたデフォルト値を返します。
* `getOrElse` のエイリアス。
* @param defaultValue - The default value to return. / 返すデフォルト値。
*/
readonly "<|>": <U>(defaultValue: U) => U;
/**
* Matches the `Left` case and applies the corresponding function.

@@ -147,2 +163,10 @@ * `Left` の場合に対応する関数を適用します。

/**
* Returns the current `Right` since it represents a valid result.
* Alias for `orElse`.
* 有効な結果を表しているため、現在の `Right` を返します。
* `orElse` のエイリアス。
* @param defaultValue - Ignored value. / 無視される値。
*/
readonly "<?>": (defaultValue: Either<L, R>) => Either<L, R>;
/**
* Returns the value inside the `Right`, ignoring the provided default value.

@@ -154,2 +178,10 @@ * `Right` 内の値を返し、指定されたデフォルト値は無視されます。

/**
* Returns the value inside the `Right`, ignoring the provided default value.
* Alias for `getOrElse`.
* `Right` 内の値を返し、指定されたデフォルト値は無視されます。
* `getOrElse` のエイリアス。
* @param defaultValue - Ignored value. / 無視される値。
*/
readonly "<|>": (defaultValue: R) => R;
/**
* Matches the `Right` case and applies the corresponding function.

@@ -156,0 +188,0 @@ * `Right` の場合に対応する関数を適用します。

@@ -73,2 +73,10 @@ /**

/**
* Returns the current `Just` if present, or the given default value.
* Alias for `orElse`.
* 現在の `Just` が存在すればそれを返し、存在しなければ指定されたデフォルト値を返します。
* `orElse` のエイリアス。
* @param defaultValue - The default `Maybe` to return if absent. / 存在しない場合に返すデフォルトの `Maybe`。
*/
readonly "<?>": (defaultValue: Maybe<T>) => Maybe<T>;
/**
* Returns the value inside the `Just`, or a provided default value if absent.

@@ -80,2 +88,10 @@ * `Just` 内の値を返し、存在しなければ指定されたデフォルト値を返します。

/**
* Returns the value inside the `Just`, or a provided default value if absent.
* Alias for `getOrElse`.
* `Just` 内の値を返し、存在しなければ指定されたデフォルト値を返します。
* `getOrElse` のエイリアス。
* @param defaultValue - The default value to return if absent. / 存在しない場合に返すデフォルト値。
*/
readonly "<|>": <U>(defaultValue: U) => T | U;
/**
* Matches the `Just` or `Nothing` case and applies the corresponding function.

@@ -150,2 +166,10 @@ * `Just` または `Nothing` の場合に対応する関数を適用します。

/**
* Returns the provided default value.
* Alias for `orElse`.
* 指定されたデフォルト値を返します。
* `orElse` のエイリアス。
* @param defaultValue - The default value to return. / 返すデフォルト値。
*/
readonly "<?>": <U>(defaultValue: Maybe<U>) => Maybe<U>;
/**
* Returns the provided default value since there is no value.

@@ -157,2 +181,10 @@ * 値が存在しないため、指定されたデフォルト値を返します。

/**
* Returns the provided default value since there is no value.
* Alias for `getOrElse`.
* 値が存在しないため、指定されたデフォルト値を返します。
* `getOrElse` のエイリアス。
* @param defaultValue - The default value to return. / 返すデフォルト値。
*/
readonly "<|>": <U>(defaultValue: U) => U;
/**
* Applies the `onNothing` function since there is no value.

@@ -159,0 +191,0 @@ * 値が存在しないため、`onNothing` 関数を適用します。

{
"name": "f-box-core",
"version": "0.1.8",
"version": "0.1.9",
"description": "Put your data in a box, and suddenly it's easier to handle, transform, and use however you need.",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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