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

attain

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

attain - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

2

dist/attain.min.js

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).data={})}(this,function(t){"use strict";const n=(t,...n)=>{if(0==n.length)throw new Error("You must provide an initial value and a non-empty spread of functions.");return n.reduce((t,n)=>n(t),t)},e=t=>n=>t.reduce((t,e)=>Object.assign(t,{[e]:n}),{}),r=(t,n)=>t>0?((t,n)=>Array(t).fill(n))(t,n).join(""):"";function o(t,n){const e=Object(n)===n,r=null==n,o=e&&Array.isArray(n),i=e&&!o,a=e&&"function"==typeof n,u=!e,c=i&&n.type&&n.tag,s=c&&"value"in n,f=c&&!s;return t({notPrimative:e,isPrimative:u,isString:"string"==typeof n,isNil:r,isArray:o,isObject:i,isPojo:i&&"Object"==n.constructor.name,isDate:i&&n instanceof Date,isError:i&&n instanceof Error,value:n,isFunction:a,isStag:c,valueStag:s,emptyStag:f})}const i=t=>o(function t(e){return i=>{const{value:a,isPojo:u,isObject:c,isArray:s,isDate:f,isError:l,valueStag:p,emptyStag:g,isString:h,isFunction:y}=i,v=r(e,""),m=r(e-1,""),d=r(e+1,"");return p?a.type+"."+a.tag+"("+(void 0===a.value?"":o(t(e+1),a.value))+(e>0?""+m:"")+v+")":g?a.type+"."+a.tag+"()":u?0==Object.keys(a).length?"{}":n(a,Object.entries,n=>n.map(([n,r])=>d+'"'+n+'":'+o(t(e+1),r).replace(""+d,"")),t=>v+"{"+t+v+"}"):s?"0"==a.length?"[]":v+"["+v+v+a.map(n=>o(t(e+1),n)).join(", ")+v+"]":f?"new "+a.constructor.name+'("'+a.toISOString()+'")':l?"new "+a.constructor.name+'("'+a.message+'")':y?a+"":c?"new "+a.constructor.name+"()":h?JSON.stringify(a):""+a}}(0),t),a=t=>o(function t({value:n,isPojo:e,isArray:r,valueStag:i,emptyStag:a}){return i?o(t,n.value):a?null:e?g(Object.entries(n).map(n=>o(t,n))):r?n.map(n=>o(t,n)):n},t);function u(){return i(this)}function c(t){return t.type}function s(t){return t.tag}const f={toString:u,inspect:u,[Symbol.for("nodejs.util.inspect.custom")]:u,toJSON:function(){return a(this)}};function l(t,n,e){return Object.assign(Object.create(f),{type:t,tag:n,value:e})}function p(t,n){return Object.assign(Object.create(f),{type:t,tag:n})}const g=t=>t.reduce((t,[n,e])=>({...t,[n]:e}),{}),h=["ExtraTags","MissingTags","InstanceNull","InstanceWrongType","InstanceShapeInvalid","VisitorNotAFunction","NotAType","TagsShapeInvalid"].reduce((t,n)=>(t[n]=(e=>l(t.type,n,e)),t.tags.push(n),t),{type:"StaticSumTypeError",tags:[],specs:{}});function y(t){return t.tags}const v={ExtraTags:function(t){return["Your tag function must have exactly the same"," keys as the type: "+t.T.type+". ","The following tags should not have been present:",t.extraKeys.join(", ")].join(" ")},MissingTags:function(t){return["Your tag function must have exactly the same","keys as the type: "+t.T.type+". The following keys were","missing:",t.missingKeys.join(", ")].join(" ")},InstanceNull:function(t){return"Null is not a valid member of the type "+t.T.type},InstanceWrongType:function(t){return[i(t.x)+" is not a valid member of the type",t.T.type,"which expects the following tags",y(t.T).join(" | ")].join(" ")},InstanceShapeInvalid:function(t){return[i(t.x),"is not a valid Member of the type:",t.T.type+". ","Please review the definition of "+t.T.type].join(" ")},VisitorNotAFunction:function(t){return t.context+" expected a visitor function but instead received "+i(t.visitor)},NotAType:function(t){return t.context+" expected a Type ({ type: string, tags: string[] }) but received "+i(t.T)},TagsShapeInvalid:(t,n)=>"fold("+c(t)+") tags provided were not the right shape. Expected { [tag]: f } but received "+i(n)};function m(t){const n=t();return j("fold",n),function(t){!function(t,n){if(null==n||Array.isArray(n)||"object"!=typeof n){const e=O.TagsShapeInvalid(t,n);return b(e)}}(n,t);const e=Object.keys(t),r=y(n),o=[[e,n],[r,t]].map(function(t){const n=t[0],e=t[1];return n.filter(function(t){return!(t in e)})}),i=o[0],a=o[1];return a.length>0?b(O.MissingTags({T:n,tags:t,missingKeys:a})):i.length>0?b(O.ExtraTags({T:n,tags:t,extraKeys:i})):function(e){return w(n,t,e)&&t[s(e)](e.value)}}}const d=t=>(t=>n=>t[n.tag](n.value))(v)(t);function b(t){throw new Error(s(t)+": "+d(t))}const O=h;function j(t,n){if(null==n||!(null!=n&&"string"==typeof n.type&&Array.isArray(n.tags)&&"specs"in n))return b(O.NotAType({context:t,T:n}))}function S(t){if("function"!=typeof t.visitor)return b(O.VisitorNotAFunction({context:t.context,visitor:t.visitor}))}function T(t,n){if(null==n||c(n)!=t.type||!y(t).includes(s(n)))return b(O.InstanceShapeInvalid({x:n,T:t}))}function w(t,n,e){return null==e?b(O.InstanceNull({T:t,tags:n,x:e})):c(e)!==t.type?b(O.InstanceWrongType({T:t,tags:n,x:e})):!!y(t).includes(s(e))||b(O.InstanceShapeInvalid({T:t,tags:n,x:e}))}function x(t){return m(()=>t)}const A=t=>{const n=x(t);return e=>{const r=n(e);return n=>{T(t,n);const e=r(n);return t[s(n)](e)}}},I=t=>{const n=x(t);return e=>{const r=n(e);return n=>{if(w(t,e,n),"value"in n){const o=r(n);return w(t,e,o)&&o}return n}}},E=(t,n)=>({type:t,specs:{},tags:n,...g(n.map(n=>[n,(...e)=>e.length?l(t,n,e[0]):p(t,n)]))});function P(t){return E(t,["Y","N"])}const Y=P("stags.Either"),W=t=>{const n=x(t),{left:e,right:r}=t.specs["stags/bifunctor"];return(t,o)=>n({[e]:t,[r]:o})},K=t=>(j("bifold",t),W(t)),B=t=>(j("bimap",t),(t=>{const n=A(t),{left:e,right:r}=t.specs["stags/bifunctor"];return(t,o)=>n({[e]:t,[r]:o})})(t)),D=t=>(j("getOr",t),n=>e=>(T(t,e),(t=>n=>W(t)(()=>n,t=>t))(t)(n)(e))),k=t=>(j("concatWith",t),n=>(S({context:"concatWith",visitor:n}),e=>(T(t,e),r=>(T(t,r),(t=>n=>e=>r=>{const{left:o,right:i}=t.specs["stags/bifunctor"];return s(e)==o?e:s(r)==o?r:t[i](n(e.value)(r.value))})(t)(n)(e)(r))))),M=({left:t,right:n})=>e=>(e.specs["stags/bifunctor"]={left:t,right:n},e.left=(n=>e[t](n)),e.right=(t=>e[n](t)),e.bifold=K(e),e.bimap=B(e),e.getOr=D(e),e.getWith=(t=>(n,e)=>K(t)(()=>n,t=>e(t)))(e),e.tagBy=(t=>(x(t),(n,e)=>r=>(S({context:"tagBy",visitor:e}),e(r)?t.right(r):t.left(n))))(e),e.encase=(t=>n=>e=>{try{return t.right(n(e))}catch(n){return t.left(n)}})(e),e.toBoolean=(t=>t.bifold(()=>!1,()=>!0))(e),e.fromNullable=(t=>n=>null==n?t.left(n):t.right(n))(e),e.all=(t=>n=>{const e=n.filter(n=>!t.toBoolean(n));return e.length>0?t.left(e.map(t=>t.value)):t.right(n.map(t.getOr(null)))})(e),e.any=(t=>n=>n.some(t.toBoolean)?t.right(n.filter(t.toBoolean).map(t.getOr(null))):n.find(n=>!t.toBoolean(n)))(e),e.concatWith=k(e),e);function $(t){if(t.specs["stags/decorated"])return t;{const n=e(y(t)),r=A(t),o=I(t),i=x(t);return y(t).forEach(e=>{t["is"+e]=t["is"+e]||(n=>(T(t,n),s(n)===e)),t["map"+e]=t["map"+e]||(t=>r({...n(t=>t),[e]:t})),t["get"+e+"Or"]=t["get"+e+"Or"]||(t=>i({...n(()=>t),[e]:t=>t})),t["get"+e+"With"]=t["get"+e+"With"]||((t,r)=>i({...n(()=>t),[e]:t=>r(t)})),t["chain"+e]=t["chain"+e]||(t=>r=>o({...n(()=>r),[e]:t})(r)),t["assert"+e]=t["assert"+e]||i({...n(Y.N),[e]:Y.Y}),t[e.toLowerCase()+"s"]=t[e+"s"]||(n=>n.reduce((n,r)=>n.concat(t["is"+e](r)?[r.value]:[]),[]))}),t.fold=t.fold||i,t.mapAll=t.mapAll||r,t.chainAll=t.chainAll||o,t.specs["stags/decorated"]=!0,t}}const _=t=>n(P(t),$,M({left:"N",right:"Y"}),(t=>n=>(n.specs["stags/functor"]=t,n.of=n[t],n.map=(r=>(S({context:"map",visitor:r}),A(n)({...e(n.tags)(t=>t),[t]:r}))),n))("Y"),(t=>n=>{n.specs["stags/monad"]=t,n.of=n[t];const r=I(n);return n.chain=(o=>(S({context:"chain",visitor:o}),i=>r({...e(n.tags)(t=>n[s(i)](t)),[t]:t=>o(t)})(i))),n})("Y")),J=_("stags.Either"),{Y:F,N:L,bifold:C,getOr:R,getWith:V,bimap:H,map:Q,mapY:z,mapN:Z,assertY:q,assertN:G,chainN:U,chainY:X,tagBy:tt,chain:nt,toBoolean:et,encase:rt,fromNullable:ot,all:it,any:at,isY:ut,isN:ct,ys:st,ns:ft,concatWith:lt}=J;function pt(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function gt(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,r)}return e}function ht(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?gt(Object(e),!0).forEach(function(n){pt(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):gt(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function yt(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}mt.SKIP={},mt.lift=function(){var t=arguments[0];return bt(Array.prototype.slice.call(arguments,1)).map(function(n){return t.apply(void 0,n)})},mt.scan=function(t,n,e){var r=e.map(function(e){var r=t(n,e);return r!==mt.SKIP&&(n=r),r});return r(n),r},mt.merge=bt,mt.combine=dt,mt.scanMerge=function(t,n){var e=t.map(function(t){return t[0]}),r=dt(function(){var r=arguments[arguments.length-1];return e.forEach(function(e,o){r.indexOf(e)>-1&&(n=t[o][1](n,e()))}),n},e);return r(n),r},mt["fantasy-land/of"]=mt;var vt=!1;function mt(t){var n,e=[],r=[];function o(n){return arguments.length&&n!==mt.SKIP&&(t=n,Ot(o)&&(o.changing(),o.state="active",e.forEach(function(n,e){n(r[e](t))}))),t}return o.constructor=mt,o.state=arguments.length&&t!==mt.SKIP?"active":"pending",o.parents=[],o.changing=function(){Ot(o)&&(o.state="changing"),e.forEach(function(t){t.changing()})},o.map=function(n,i){var a="active"===o.state&&i!==mt.SKIP?mt(n(t)):mt();return a.parents.push(o),e.push(a),r.push(n),a},o.toJSON=function(){return null!=t&&"function"==typeof t.toJSON?t.toJSON():t},o["fantasy-land/map"]=o.map,o["fantasy-land/ap"]=function(t){return dt(function(t,n){return t()(n())},[t,o])},o.unregisterChild=function(t){var n=e.indexOf(t);-1!==n&&(e.splice(n,1),r.splice(n,1))},Object.defineProperty(o,"end",{get:function(){return n||((n=mt()).map(function(t){return!0===t&&(o.parents.forEach(function(t){t.unregisterChild(o)}),o.state="ended",o.parents.length=e.length=r.length=0),t}),n)}}),o}function dt(t,n){var e=n.every(function(t){if(t.constructor!==mt)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream");return"active"===t.state}),r=e?mt(t.apply(null,n.concat([n]))):mt(),o=[],i=n.map(function(i){return i.map(function(a){return o.push(i),(e||n.every(function(t){return"pending"!==t.state}))&&(e=!0,r(t.apply(null,n.concat([o]))),o=[]),a},mt.SKIP)}),a=r.end.map(function(t){!0===t&&(i.forEach(function(t){t.end(!0)}),a.end(!0))});return r}function bt(t){return dt(function(){return t.map(function(t){return t()})},t)}function Ot(t){return"pending"===t.state||"active"===t.state||"changing"===t.state}Object.defineProperty(mt,"HALT",{get:function(){return vt||console.log("HALT is deprecated and has been renamed to SKIP"),vt=!0,mt.SKIP}});var jt=function(t){return function(n){var e={},r=e,o=mt();return n.map(function(n){return r!==e&&t(n,r)||(r=n,o(n)),null}),o}},St=function(t){return function(n){var e,r=mt();return n.map(function(n){return clearTimeout(e),e=setTimeout(function(){return r(n)},t),null}),r}},Tt=function(t){return jt(function(t,n){return t===n})(t)},wt=mt,Nt=Object.freeze({__proto__:null,dropRepeatsWith:jt,interval:function(t){var n=mt(),e=setInterval(function(){return n(Date.now())},t);return n.end.map(function(){return clearInterval(e)}),n(Date.now()),n},afterSilence:St,dropRepeats:Tt,watch:function(t){return function(n){return Tt(n.map(t))}},filter:function(t){return function(n){var e=mt();return n.map(function(n){return t(n)?e(n):null}),e}},map:function(t){return function(n){return n.map(t)}},decide:function(t){return function(n){var e=mt();return n.map(t(e)),e}},decideLatest:function(t){return function(n){var e,r=mt();return n.map(function(n){var o=e={};return t(function(t){o==e&&r(t)})(n),null}),r}},funnel:function(t){var n=mt();return t.map(function(t){return t.map(function(t){return setTimeout(n,0,t)})}),n},sink:function(t){var n=mt();return n.map(t),n},source:function(t){var n=mt();return t.map(n),n},scan:function(t){return function(n){return function(e){return mt.scan(n,t,e)}}},of:wt,merge:function(t){return mt.merge(t)},log:function(t){return Object.entries(t).forEach(function(t){var n=yt(t,2),e=n[0];return n[1].map(function(t){return console.log(e,t)})})},session:function(){var t=[];return{of:function(){var n=mt.apply(void 0,arguments);return t.push(n),n},end:function(){t.map(function(t){return t.end(!0)})}}},default:mt}),xt=function(t){return function(n){var e=[];return t(function(t){return e.push(t),t})(n),e}},At=function(t){return function(n){return function(e){return t(e)?n(e):e}}},It=function(t){return function(n){return function(e){return t(e)(n)(e)}}},Et=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return function(t){return function(e){var r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){e=(0,a.value)(t)(e)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return e}}},Pt=function(t){return function(n){return Array.isArray(n)?n.map(function(n){return t(n)}):Object.keys(n).reduce(function(e,r){return ht({},e,pt({},r,t(n[r])))},{})}},Yt=function(t){return function(n){return function(e){return function(r){var o=null==r?re_integer.test(n)?[]:{}:Array.isArray(r)?r.slice():ht({},r),i=null==r[n]?t:r[n];return o[n]=e(i),o}}}}(void 0),Wt=function(t){return function(n){var e=!0,r=!1,o=void 0;try{for(var i,a=t.slice().reverse()[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){n=(0,i.value)(n)}}catch(t){r=!0,o=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw o}}return n}};var Kt=function t(n){var e,r=n.path,o=void 0===r?[]:r;function i(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e=e||Wt(o);var i=0==n.length,a=!i&&"function"==typeof n[0];return i?xt(e):e(a?n[0]:function(){return n[0]})}i.path=o,i.filter=function(n){return t({path:o.concat(At(n))})},i.values=function(){return t({path:o.concat(Pt)})},i.union=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return t({path:o.concat(Et(e))})},i.insertQuery=function(n){return t({path:o.concat(n)})},i.flatMap=function(n){return t({path:o.concat(It(n))})};var a=new Proxy(i,{get:function(t,n){var e=/^\$\d+$/.test(n)?n.slice(1):n;return"string"==typeof e?"$"==e?i.insertQuery:e.startsWith("$")?i[e.slice(1)]:a.$(Yt(e)):i[e]}});return a}({path:[],select:xt});t.$=Kt,t.Either=J,t.N=L,t.StaticSumTypeError=h,t.Y=F,t.Z=function(t){var e,r=t.stream,o=t.$,i=t.getWith,a=void 0===i?V:i,u=wt(),c=wt();u.removed=c;var s=function(t){var e;return n(r(),o(function(n){return e=t(n)})(xs),map(r),map(function(){return u(e)})),e};u.throttled=n(u,Tt,St(1e3));var f=function(t){return s(function(){return t})},l=function(){return n(r(),a(null,function(t){var n=o()(t);return e=R(e)(n)}))};function p(){return arguments.length?"function"==typeof(arguments.length<=0?void 0:arguments[0])?s.apply(void 0,arguments):f.apply(void 0,arguments):l()}return Object.assign(p,{get:l,set:f,over:s,remove:function(){var t=l();n(r(),map(o.$remove),r),c(t)},stream:u,removed:c}),p},t.all=it,t.any=at,t.assertN=G,t.assertY=q,t.bifold=C,t.bimap=H,t.boundToString=u,t.chain=nt,t.chainAll=I,t.chainN=U,t.chainY=X,t.concatWith=lt,t.decorate=$,t.either=_,t.emptyInstance=p,t.encase=rt,t.encaseNil=function(t){return function(){try{var n=t.apply(void 0,arguments);if(null==n)throw new TypeError("Nil Result in encased function:"+t.toString());return l("stags.Either","Y",n)}catch(n){return l("stags.Either",N,n)}}},t.errMessage=d,t.fold=x,t.fromNullable=ot,t.getOr=R,t.getTags=y,t.getWith=V,t.isN=ct,t.isY=ut,t.map=Q,t.mapAll=A,t.mapN=Z,t.mapY=z,t.maybe=(t=>n(t,_,t=>{const n=t.N;return t.N=(()=>n()),t.specs["stags/maybe"]=!0,t})),t.ns=ft,t.otherwise=e,t.pipe=((...t)=>{if(0==t.length)throw new Error("You must provide a non-empty spread of functions.");return e=>n(e,...t)}),t.run=n,t.stream=Nt,t.tagBy=tt,t.tagName=s,t.tags=((t,n)=>$(E(t,n))),t.toBoolean=et,t.toJSON=a,t.toString=i,t.typeName=c,t.valueInstance=l,t.ys=st,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).data={})}(this,function(t){"use strict";const n=(t,...n)=>{if(0==n.length)throw new Error("You must provide an initial value and a non-empty spread of functions.");return n.reduce((t,n)=>n(t),t)},e=t=>n=>t.reduce((t,e)=>Object.assign(t,{[e]:n}),{}),r=(t,n)=>t>0?((t,n)=>Array(t).fill(n))(t,n).join(""):"";function o(t,n){const e=Object(n)===n,r=null==n,o=e&&Array.isArray(n),i=e&&!o,a=e&&"function"==typeof n,u=!e,c=i&&n.type&&n.tag,s=c&&"value"in n,f=c&&!s;return t({notPrimative:e,isPrimative:u,isString:"string"==typeof n,isNil:r,isArray:o,isObject:i,isPojo:i&&"Object"==n.constructor.name,isDate:i&&n instanceof Date,isError:i&&n instanceof Error,value:n,isFunction:a,isStag:c,valueStag:s,emptyStag:f})}const i=t=>o(function t(e){return i=>{const{value:a,isPojo:u,isObject:c,isArray:s,isDate:f,isError:l,valueStag:p,emptyStag:g,isString:y,isFunction:h}=i,v=r(e,""),m=r(e-1,""),d=r(e+1,"");return p?a.type+"."+a.tag+"("+(void 0===a.value?"":o(t(e+1),a.value))+(e>0?""+m:"")+v+")":g?a.type+"."+a.tag+"()":u?0==Object.keys(a).length?"{}":n(a,Object.entries,n=>n.map(([n,r])=>d+'"'+n+'":'+o(t(e+1),r).replace(""+d,"")),t=>v+"{"+t+v+"}"):s?"0"==a.length?"[]":v+"["+v+v+a.map(n=>o(t(e+1),n)).join(", ")+v+"]":f?"new "+a.constructor.name+'("'+a.toISOString()+'")':l?"new "+a.constructor.name+'("'+a.message+'")':h?a+"":c?"new "+a.constructor.name+"()":y?JSON.stringify(a):""+a}}(0),t),a=t=>o(function t({value:n,isPojo:e,isArray:r,valueStag:i,emptyStag:a}){return i?o(t,n.value):a?null:e?g(Object.entries(n).map(n=>o(t,n))):r?n.map(n=>o(t,n)):n},t);function u(){return i(this)}function c(t){return t.type}function s(t){return t.tag}const f={toString:u,inspect:u,[Symbol.for("nodejs.util.inspect.custom")]:u,toJSON:function(){return a(this)}};function l(t,n,e){return Object.assign(Object.create(f),{type:t,tag:n,value:e})}function p(t,n){return Object.assign(Object.create(f),{type:t,tag:n})}const g=t=>t.reduce((t,[n,e])=>({...t,[n]:e}),{}),y=["ExtraTags","MissingTags","InstanceNull","InstanceWrongType","InstanceShapeInvalid","VisitorNotAFunction","NotAType","TagsShapeInvalid"].reduce((t,n)=>(t[n]=(e=>l(t.type,n,e)),t.tags.push(n),t),{type:"StaticSumTypeError",tags:[],specs:{}});function h(t){return t.tags}const v={ExtraTags:function(t){return["Your tag function must have exactly the same"," keys as the type: "+t.T.type+". ","The following tags should not have been present:",t.extraKeys.join(", ")].join(" ")},MissingTags:function(t){return["Your tag function must have exactly the same","keys as the type: "+t.T.type+". The following keys were","missing:",t.missingKeys.join(", ")].join(" ")},InstanceNull:function(t){return"Null is not a valid member of the type "+t.T.type},InstanceWrongType:function(t){return[i(t.x)+" is not a valid member of the type",t.T.type,"which expects the following tags",h(t.T).join(" | ")].join(" ")},InstanceShapeInvalid:function(t){return[i(t.x),"is not a valid Member of the type:",t.T.type+". ","Please review the definition of "+t.T.type].join(" ")},VisitorNotAFunction:function(t){return t.context+" expected a visitor function but instead received "+i(t.visitor)},NotAType:function(t){return t.context+" expected a Type ({ type: string, tags: string[] }) but received "+i(t.T)},TagsShapeInvalid:(t,n)=>"fold("+c(t)+") tags provided were not the right shape. Expected { [tag]: f } but received "+i(n)};function m(t){const n=t();return j("fold",n),function(t){!function(t,n){if(null==n||Array.isArray(n)||"object"!=typeof n){const e=O.TagsShapeInvalid(t,n);return b(e)}}(n,t);const e=Object.keys(t),r=h(n),o=[[e,n],[r,t]].map(function(t){const n=t[0],e=t[1];return n.filter(function(t){return!(t in e)})}),i=o[0],a=o[1];return a.length>0?b(O.MissingTags({T:n,tags:t,missingKeys:a})):i.length>0?b(O.ExtraTags({T:n,tags:t,extraKeys:i})):function(e){return w(n,t,e)&&t[s(e)](e.value)}}}const d=t=>(t=>n=>t[n.tag](n.value))(v)(t);function b(t){throw new Error(s(t)+": "+d(t))}const O=y;function j(t,n){if(null==n||!(null!=n&&"string"==typeof n.type&&Array.isArray(n.tags)&&"specs"in n))return b(O.NotAType({context:t,T:n}))}function S(t){if("function"!=typeof t.visitor)return b(O.VisitorNotAFunction({context:t.context,visitor:t.visitor}))}function T(t,n){if(null==n||c(n)!=t.type||!h(t).includes(s(n)))return b(O.InstanceShapeInvalid({x:n,T:t}))}function w(t,n,e){return null==e?b(O.InstanceNull({T:t,tags:n,x:e})):c(e)!==t.type?b(O.InstanceWrongType({T:t,tags:n,x:e})):!!h(t).includes(s(e))||b(O.InstanceShapeInvalid({T:t,tags:n,x:e}))}function x(t){return m(()=>t)}const A=t=>{const n=x(t);return e=>{const r=n(e);return n=>{T(t,n);const e=r(n);return t[s(n)](e)}}},I=t=>{const n=x(t);return e=>{const r=n(e);return n=>{if(w(t,e,n),"value"in n){const o=r(n);return w(t,e,o)&&o}return n}}},E=(t,n)=>({type:t,specs:{},tags:n,...g(n.map(n=>[n,(...e)=>e.length?l(t,n,e[0]):p(t,n)]))});function P(t){return E(t,["Y","N"])}const Y=P("stags.Either"),W=t=>{const n=x(t),{left:e,right:r}=t.specs["stags/bifunctor"];return(t,o)=>n({[e]:t,[r]:o})},K=t=>(j("bifold",t),W(t)),B=t=>(j("bimap",t),(t=>{const n=A(t),{left:e,right:r}=t.specs["stags/bifunctor"];return(t,o)=>n({[e]:t,[r]:o})})(t)),D=t=>(j("getOr",t),n=>e=>(T(t,e),(t=>n=>W(t)(()=>n,t=>t))(t)(n)(e))),k=t=>(j("concatWith",t),n=>(S({context:"concatWith",visitor:n}),e=>(T(t,e),r=>(T(t,r),(t=>n=>e=>r=>{const{left:o,right:i}=t.specs["stags/bifunctor"];return s(e)==o?e:s(r)==o?r:t[i](n(e.value)(r.value))})(t)(n)(e)(r))))),M=({left:t,right:n})=>e=>(e.specs["stags/bifunctor"]={left:t,right:n},e.left=(n=>e[t](n)),e.right=(t=>e[n](t)),e.bifold=K(e),e.bimap=B(e),e.getOr=D(e),e.getWith=(t=>(n,e)=>K(t)(()=>n,t=>e(t)))(e),e.tagBy=(t=>(x(t),(n,e)=>r=>(S({context:"tagBy",visitor:e}),e(r)?t.right(r):t.left(n))))(e),e.encase=(t=>n=>e=>{try{return t.right(n(e))}catch(n){return t.left(n)}})(e),e.toBoolean=(t=>t.bifold(()=>!1,()=>!0))(e),e.fromNullable=(t=>n=>null==n?t.left(n):t.right(n))(e),e.all=(t=>n=>{const e=n.filter(n=>!t.toBoolean(n));return e.length>0?t.left(e.map(t=>t.value)):t.right(n.map(t.getOr(null)))})(e),e.any=(t=>n=>n.some(t.toBoolean)?t.right(n.filter(t.toBoolean).map(t.getOr(null))):n.find(n=>!t.toBoolean(n)))(e),e.concatWith=k(e),e);function $(t){if(t.specs["stags/decorated"])return t;{const n=e(h(t)),r=A(t),o=I(t),i=x(t);return h(t).forEach(e=>{t["is"+e]=t["is"+e]||(n=>(T(t,n),s(n)===e)),t["map"+e]=t["map"+e]||(t=>r({...n(t=>t),[e]:t})),t["get"+e+"Or"]=t["get"+e+"Or"]||(t=>i({...n(()=>t),[e]:t=>t})),t["get"+e+"With"]=t["get"+e+"With"]||((t,r)=>i({...n(()=>t),[e]:t=>r(t)})),t["chain"+e]=t["chain"+e]||(t=>r=>o({...n(()=>r),[e]:t})(r)),t["assert"+e]=t["assert"+e]||i({...n(Y.N),[e]:Y.Y}),t[e.toLowerCase()+"s"]=t[e+"s"]||(n=>n.reduce((n,r)=>n.concat(t["is"+e](r)?[r.value]:[]),[]))}),t.fold=t.fold||i,t.mapAll=t.mapAll||r,t.chainAll=t.chainAll||o,t.specs["stags/decorated"]=!0,t}}const _=t=>n(P(t),$,M({left:"N",right:"Y"}),(t=>n=>(n.specs["stags/functor"]=t,n.of=n[t],n.map=(r=>(S({context:"map",visitor:r}),A(n)({...e(n.tags)(t=>t),[t]:r}))),n))("Y"),(t=>n=>{n.specs["stags/monad"]=t,n.of=n[t];const r=I(n);return n.chain=(o=>(S({context:"chain",visitor:o}),i=>r({...e(n.tags)(t=>n[s(i)](t)),[t]:t=>o(t)})(i))),n})("Y")),J=(t,n)=>$(E(t,n)),F=_("stags.Either"),{Y:L,N:C,bifold:R,getOr:V,getWith:H,bimap:Q,map:q,mapY:z,mapN:Z,assertY:G,assertN:U,chainN:X,chainY:tt,tagBy:nt,chain:et,toBoolean:rt,encase:ot,fromNullable:it,all:at,any:ut,isY:ct,isN:st,ys:ft,ns:lt,concatWith:pt}=F;function gt(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function yt(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,r)}return e}function ht(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?yt(Object(e),!0).forEach(function(n){gt(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yt(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function vt(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}dt.SKIP={},dt.lift=function(){var t=arguments[0];return Ot(Array.prototype.slice.call(arguments,1)).map(function(n){return t.apply(void 0,n)})},dt.scan=function(t,n,e){var r=e.map(function(e){var r=t(n,e);return r!==dt.SKIP&&(n=r),r});return r(n),r},dt.merge=Ot,dt.combine=bt,dt.scanMerge=function(t,n){var e=t.map(function(t){return t[0]}),r=bt(function(){var r=arguments[arguments.length-1];return e.forEach(function(e,o){r.indexOf(e)>-1&&(n=t[o][1](n,e()))}),n},e);return r(n),r},dt["fantasy-land/of"]=dt;var mt=!1;function dt(t){var n,e=[],r=[];function o(n){return arguments.length&&n!==dt.SKIP&&(t=n,jt(o)&&(o.changing(),o.state="active",e.forEach(function(n,e){n(r[e](t))}))),t}return o.constructor=dt,o.state=arguments.length&&t!==dt.SKIP?"active":"pending",o.parents=[],o.changing=function(){jt(o)&&(o.state="changing"),e.forEach(function(t){t.changing()})},o.map=function(n,i){var a="active"===o.state&&i!==dt.SKIP?dt(n(t)):dt();return a.parents.push(o),e.push(a),r.push(n),a},o.toJSON=function(){return null!=t&&"function"==typeof t.toJSON?t.toJSON():t},o["fantasy-land/map"]=o.map,o["fantasy-land/ap"]=function(t){return bt(function(t,n){return t()(n())},[t,o])},o.unregisterChild=function(t){var n=e.indexOf(t);-1!==n&&(e.splice(n,1),r.splice(n,1))},Object.defineProperty(o,"end",{get:function(){return n||((n=dt()).map(function(t){return!0===t&&(o.parents.forEach(function(t){t.unregisterChild(o)}),o.state="ended",o.parents.length=e.length=r.length=0),t}),n)}}),o}function bt(t,n){var e=n.every(function(t){if(t.constructor!==dt)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream");return"active"===t.state}),r=e?dt(t.apply(null,n.concat([n]))):dt(),o=[],i=n.map(function(i){return i.map(function(a){return o.push(i),(e||n.every(function(t){return"pending"!==t.state}))&&(e=!0,r(t.apply(null,n.concat([o]))),o=[]),a},dt.SKIP)}),a=r.end.map(function(t){!0===t&&(i.forEach(function(t){t.end(!0)}),a.end(!0))});return r}function Ot(t){return bt(function(){return t.map(function(t){return t()})},t)}function jt(t){return"pending"===t.state||"active"===t.state||"changing"===t.state}Object.defineProperty(dt,"HALT",{get:function(){return mt||console.log("HALT is deprecated and has been renamed to SKIP"),mt=!0,dt.SKIP}});var St=function(t){return function(n){var e={},r=e,o=dt();return n.map(function(n){return r!==e&&t(n,r)||(r=n,o(n)),null}),o}},Tt=function(t){return function(n){var e,r=dt();return n.map(function(n){return clearTimeout(e),e=setTimeout(function(){return r(n)},t),null}),r}},wt=function(t){return St(function(t,n){return t===n})(t)},Nt=dt,xt=Object.freeze({__proto__:null,dropRepeatsWith:St,interval:function(t){var n=dt(),e=setInterval(function(){return n(Date.now())},t);return n.end.map(function(){return clearInterval(e)}),n(Date.now()),n},afterSilence:Tt,dropRepeats:wt,watch:function(t){return function(n){return wt(n.map(t))}},filter:function(t){return function(n){var e=dt();return n.map(function(n){return t(n)?e(n):null}),e}},map:function(t){return function(n){return n.map(t)}},decide:function(t){return function(n){var e=dt();return n.map(t(e)),e}},decideLatest:function(t){return function(n){var e,r=dt();return n.map(function(n){var o=e={};return t(function(t){o==e&&r(t)})(n),null}),r}},funnel:function(t){var n=dt();return t.map(function(t){return t.map(function(t){return setTimeout(n,0,t)})}),n},sink:function(t){var n=dt();return n.map(t),n},source:function(t){var n=dt();return t.map(n),n},scan:function(t){return function(n){return function(e){return dt.scan(n,t,e)}}},of:Nt,merge:function(t){return dt.merge(t)},log:function(t){return Object.entries(t).forEach(function(t){var n=vt(t,2),e=n[0];return n[1].map(function(t){return console.log(e,t)})})},session:function(){var t=[];return{of:function(){var n=dt.apply(void 0,arguments);return t.push(n),n},end:function(){t.map(function(t){return t.end(!0)})}}},default:dt}),At=function(t){return function(n){var e=[];return t(function(t){return e.push(t),t})(n),e}},It=function(t){return function(n){return function(e){return t(e)?n(e):e}}},Et=function(t){return function(n){return function(e){return t(e)(n)(e)}}},Pt=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return function(t){return function(e){var r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){e=(0,a.value)(t)(e)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return e}}},Yt=function(t){return function(n){return Array.isArray(n)?n.map(function(n){return t(n)}):Object.keys(n).reduce(function(e,r){return ht({},e,gt({},r,t(n[r])))},{})}},Wt=function(t){return function(n){return function(e){return function(r){var o=null==r?re_integer.test(n)?[]:{}:Array.isArray(r)?r.slice():ht({},r),i=null==r[n]?t:r[n];return o[n]=e(i),o}}}}(void 0),Kt=function(t){return function(n){var e=!0,r=!1,o=void 0;try{for(var i,a=t.slice().reverse()[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){n=(0,i.value)(n)}}catch(t){r=!0,o=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw o}}return n}};var Bt=function t(n){var e,r=n.path,o=void 0===r?[]:r;function i(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e=e||Kt(o);var i=0==n.length,a=!i&&"function"==typeof n[0];return i?At(e):e(a?n[0]:function(){return n[0]})}i.path=o,i.filter=function(n){return t({path:o.concat(It(n))})},i.values=function(){return t({path:o.concat(Yt)})},i.union=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return t({path:o.concat(Pt(e))})},i.insertQuery=function(n){return t({path:o.concat(n)})},i.flatMap=function(n){return t({path:o.concat(Et(n))})};var a=new Proxy(i,{get:function(t,n){var e=/^\$\d+$/.test(n)?n.slice(1):n;return"string"==typeof e?"$"==e?i.insertQuery:e.startsWith("$")?i[e.slice(1)]:a.$(Wt(e)):i[e]}});return a}({path:[],select:At});t.$=Bt,t.Either=F,t.N=C,t.StaticSumTypeError=y,t.Y=L,t.Z=function(t){var e,r=t.stream,o=t.$,i=t.getWith,a=void 0===i?H:i,u=Nt(),c=Nt();u.removed=c;var s=function(t){var e;return n(r(),o(function(n){return e=t(n)})(xs),map(r),map(function(){return u(e)})),e};u.throttled=n(u,wt,Tt(1e3));var f=function(t){return s(function(){return t})},l=function(){return n(r(),a(null,function(t){var n=o()(t);return e=V(e)(n)}))};function p(){return arguments.length?"function"==typeof(arguments.length<=0?void 0:arguments[0])?s.apply(void 0,arguments):f.apply(void 0,arguments):l()}return Object.assign(p,{get:l,set:f,over:s,remove:function(){var t=l();n(r(),map(o.$remove),r),c(t)},stream:u,removed:c}),p},t.all=at,t.any=ut,t.assertN=U,t.assertY=G,t.bifold=R,t.bimap=Q,t.boundToString=u,t.chain=et,t.chainAll=I,t.chainN=X,t.chainY=tt,t.concatWith=pt,t.decorate=$,t.either=_,t.emptyInstance=p,t.encase=ot,t.encaseNil=function(t){return function(){try{var n=t.apply(void 0,arguments);if(null==n)throw new TypeError("Nil Result in encased function:"+t.toString());return l("stags.Either","Y",n)}catch(n){return l("stags.Either",N,n)}}},t.errMessage=d,t.fold=x,t.fromNullable=it,t.getOr=V,t.getTags=h,t.getWith=H,t.isN=st,t.isY=ct,t.map=q,t.mapAll=A,t.mapN=Z,t.mapY=z,t.maybe=(t=>n(t,_,t=>{const n=t.N;return t.N=(()=>n()),t.specs["stags/maybe"]=!0,t})),t.ns=lt,t.otherwise=e,t.pipe=((...t)=>{if(0==t.length)throw new Error("You must provide a non-empty spread of functions.");return e=>n(e,...t)}),t.query=Bt,t.run=n,t.stream=xt,t.tagBy=nt,t.tagName=s,t.tags=J,t.toBoolean=rt,t.toJSON=a,t.toString=i,t.type=J,t.typeName=c,t.valueInstance=l,t.ys=ft,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=attain.min.js.map
export default () => {
const data = require ('harth-data')
const data = require ('attain')

@@ -4,0 +4,0 @@ const User =

@@ -1,3 +0,14 @@

# Sum Types
Sum types are types that are the _sum_ of multiple structures.
## Are Cool
Sum Types are _everyhere_ in programming, we often just don't notice it because the underlying language does not give us the tools out of the box to explore them.
If your using booleans to track if some data has a particular type or shape
you probably need sum types instead.
The sum types we offer are based on an extremely simple data structure that is serializable and easy to understand.
```js
{ type:string, tag:string, value?:any }
```
You can extend the base functionality as much or as little as you want using the `spec` system. We use this system to implement helpers _and_ type classes like `functor`, `monad` and `bifunctor`.

@@ -27,6 +27,9 @@

`)
.css('h1,h2,h3,h4,h5,h6', `
margin: 0px;
`)
const header =
css
.$nest('h1,h2,h3,h4,h5,h6', `
margin: 0px;
`)
const link =

@@ -75,2 +78,3 @@ css`

`
+ header
,m('h1'

@@ -86,3 +90,3 @@ + css`

`
, 'data.js'
, 'attain'
)

@@ -94,2 +98,3 @@ ,m('p'

,m('.links'
+ header
+ css`

@@ -138,5 +143,3 @@ text-align: right;

justify-items: start;
align-content: center;
gap: 1em;
align-items: center;
`)

@@ -184,10 +187,12 @@ ,m('.tabs'

+ css`
display: grid;
width: 100%;
padding: 1em;
padding: 0em 1em;
box-sizing: border-box;
color: #ffffff;
border-radius: 0.25em;
align-self: start;
`
.$nest('code', `
font-size: 1.2em;
color: #66c7ff;
`)
,

@@ -211,2 +216,5 @@ { oncreate: async ({ dom }) => {

overflow-y: auto;
align-content: center;
align-items: center;
`

@@ -213,0 +221,0 @@ ,m('script', { id: 'runkitScript', src: "https://embed.runkit.com" })

import encaseNil from './encaseNil'
import * as stream from './stream'
import { tags } from 'stags'
import Z from './z'

@@ -7,5 +8,5 @@

export { $, encaseNil, stream }
export { $, encaseNil, stream, $ as query }
export { Z }
export { Z, tags as type }
export * from 'stags'
{
"name": "attain",
"version": "0.0.19",
"version": "0.0.20",
"description": "A library for modelling and accessing data.",

@@ -5,0 +5,0 @@ "main": "dist/attain.min.js",

attain
======
<img src="https://media.giphy.com/media/PVlhrJrrcHLNu/giphy.gif"/>
- Streams 🐍

@@ -39,3 +37,3 @@ - Data Modelling and Persistence 💾

const User = A.tags('User', ['LoggedIn', 'LoggedOut'])
const User = A.type('User', ['LoggedIn', 'LoggedOut'])

@@ -127,3 +125,3 @@ const message =

Eventually, if/when `|>` lands, `run` will likely be deprecated and replaced and all examples will use `|>` insteaA.
Eventually, if/when `|>` lands, `run` will likely be deprecated and replaced and all examples will use `|>` instead.

@@ -140,3 +138,3 @@ > 🎁 If you're a adventurous you can try `|>` today via the babel [plugin](https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator)

Lenses can be a little tricky to learn, so think of queries as `jquery` but for your traversing your normal JS object A.
Lenses can be a little tricky to learn, so think of queries as `jquery` but for your traversing your normal JS object.

@@ -193,3 +191,3 @@ #### Quick Start

`$` lets you get/set and transform a value that you've querieA.
`$` lets you get/set and transform a value that you've queries.

@@ -490,3 +488,3 @@ ```js

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -513,3 +511,3 @@ const pending = Promise.Pending()

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -540,3 +538,3 @@

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -558,3 +556,3 @@ // Only logs for rejected promises

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -576,3 +574,3 @@ // Only logs for rejected promises

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -606,3 +604,3 @@ // Only logs for rejected promises

> 🤔 Extension to the base functionality of `A.tags` is via `specs`. You can read about a standard way to extend functionality [here](https://gitlab.com/harth/stags/-/blob/master/docs/spec.md)
> 🤔 Extension to the base functionality of `A.type` is via `specs`. You can read about a standard way to extend functionality [here](https://gitlab.com/harth/stags/-/blob/master/docs/spec.md)

@@ -625,3 +623,3 @@ You'll see Either pop up as you use `attain`, but just know, it's just another sum type with all the same functionality as our Promise examples.

const Promise =
A.tags('Promise', ['Pending', 'Resolved', 'Rejected'])
A.type('Promise', ['Pending', 'Resolved', 'Rejected'])

@@ -628,0 +626,0 @@ Promise.isRejected(JSON.parse(JSON.stringify(rejected)))

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