Socket
Socket
Sign inDemoInstall

hyperapplicable

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperapplicable - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

12

dist/hyperapplicable.d.ts

@@ -19,7 +19,2 @@ import { ClassProp, MaybeVNode, VNode, Action, CustomPayloads, Dispatch, Effect, Unsubscribe, Dispatchable } from 'hyperapp';

declare const contentView: <S>(view: Content<S> | VistaView<S>) => (state: S) => MaybeVNode<S>[];
declare const isContent: <S>(x: unknown) => x is Content<S>;
declare const isVNode: <S>(x: unknown) => x is VNode<S>;
declare const vista: <S>(views: Vista<S>) => (state: S) => MaybeVNode<S>[];
declare const handleWith: <S>(handlers: readonly Transform<S, Event>[]) => (state: StateFormat<S, any>, event: Event) => StateFormat<S, any>;

@@ -35,2 +30,7 @@

export { ActionWithPayload, Content, CustomProps, Effecter, Reaction, StateFormat, StateWithEffects, Subscriber, Transform, View, ViewComponent, Vista, VistaView, box, contentView, handleWith, isAction, isContent, isVNode, next, readout, unite, vista };
declare const contentView: <S>(view: Content<S> | VistaView<S>) => (state: S) => MaybeVNode<S>[];
declare const isVista: <S>(x: unknown) => x is Vista<S>;
declare const isVNode: <S>(x: unknown) => x is VNode<S>;
declare const vista: <S>(views: Vista<S>) => (state: S) => MaybeVNode<S>[];
export { ActionWithPayload, Content, CustomProps, Effecter, Reaction, StateFormat, StateWithEffects, Subscriber, Transform, View, ViewComponent, Vista, VistaView, box, contentView, handleWith, isAction, isVNode, isVista, next, readout, unite, vista };
import { h, text } from "hyperapp";
const box = (classProp, contents) => h("div", { class: classProp }, contents);
const contentView = (view) => (state) => {
if (typeof view === "function") {
const x = view(state);
return Array.isArray(x) ? x : [x];
}
return typeof view === "number" || typeof view === "string" ? [text(view)] : [view];
};
const isContent = (x) => x == null || typeof x === "boolean" || typeof x === "number" || typeof x === "string" || isVNode(x);
const isVNode = (x) => x != null && typeof x === "object" && "node" in x;
const vista = (views) => (state) => !Array.isArray(views) ? contentView(views)(state) : views.reduce((nodes, view) => [
...nodes,
...!Array.isArray(view) ? contentView(view)(state) : vista(view)(state)
], []);
const unite = (transform, stateForm, payload) => {

@@ -36,2 +23,15 @@ if (!Array.isArray(stateForm)) {

const readout = (prop) => (obj) => h("pre", {}, text(`${prop}: ${JSON.stringify(obj[prop], readoutReplacer, 2)}`));
export { box, contentView, handleWith, isAction, isContent, isVNode, next, readout, unite, vista };
const contentView = (view) => (state) => {
if (typeof view === "function") {
const x = view(state);
return Array.isArray(x) ? x : [x];
}
return typeof view === "number" || typeof view === "string" ? [text(view)] : [view];
};
const isVista = (x) => x == null || typeof x === "boolean" || typeof x === "function" || typeof x === "number" || typeof x === "string" || isVNode(x);
const isVNode = (x) => x != null && typeof x === "object" && "node" in x;
const vista = (views) => (state) => !Array.isArray(views) ? contentView(views)(state) : views.reduce((nodes, view) => [
...nodes,
...!Array.isArray(view) ? contentView(view)(state) : vista(view)(state)
], []);
export { box, contentView, handleWith, isAction, isVNode, isVista, next, readout, unite, vista };

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

(function(e,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("hyperapp")):typeof define=="function"&&define.amd?define(["exports","hyperapp"],i):(e=typeof globalThis!="undefined"?globalThis:e||self,i(e.hyperapplicable={},e.Hyperapp))})(this,function(e,i){"use strict";const a=(n,t)=>i.h("div",{class:n},t),u=n=>t=>{if(typeof n=="function"){const o=n(t);return Array.isArray(o)?o:[o]}return typeof n=="number"||typeof n=="string"?[i.text(n)]:[n]},l=n=>n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||f(n),f=n=>n!=null&&typeof n=="object"&&"node"in n,y=n=>t=>Array.isArray(n)?n.reduce((o,r)=>[...o,...Array.isArray(r)?y(r)(t):u(r)(t)],[]):u(n)(t),d=(n,t,o)=>{if(!Array.isArray(t))return n(t,o);const[r,...c]=t,s=n(r,o);if(!Array.isArray(s))return[s,...c];const[S,...N]=s;return[S,...c,...N]},A=n=>(t,o)=>n.reduce((r,c)=>d(c,r,o),t),h=n=>typeof n=="function"||Array.isArray(n)&&n.length>0,b=(n,t)=>{window.requestAnimationFrame(()=>n(t))},p=n=>[b,n],g=(n,t)=>typeof t=="function"?"function":t,m=n=>t=>i.h("pre",{},i.text(`${n}: ${JSON.stringify(t[n],g,2)}`));e.box=a,e.contentView=u,e.handleWith=A,e.isAction=h,e.isContent=l,e.isVNode=f,e.next=p,e.readout=m,e.unite=d,e.vista=y,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("hyperapp")):typeof define=="function"&&define.amd?define(["exports","hyperapp"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e.hyperapplicable={},e.Hyperapp))})(this,function(e,o){"use strict";const d=(t,n)=>o.h("div",{class:t},n),f=(t,n,i)=>{if(!Array.isArray(n))return t(n,i);const[r,...c]=n,u=t(r,i);if(!Array.isArray(u))return[u,...c];const[m,...S]=u;return[m,...c,...S]},l=t=>(n,i)=>t.reduce((r,c)=>f(c,r,i),n),A=t=>typeof t=="function"||Array.isArray(t)&&t.length>0,h=(t,n)=>{window.requestAnimationFrame(()=>t(n))},p=t=>[h,t],b=(t,n)=>typeof n=="function"?"function":n,V=t=>n=>o.h("pre",{},o.text(`${t}: ${JSON.stringify(n[t],b,2)}`)),s=t=>n=>{if(typeof t=="function"){const i=t(n);return Array.isArray(i)?i:[i]}return typeof t=="number"||typeof t=="string"?[o.text(t)]:[t]},g=t=>t==null||typeof t=="boolean"||typeof t=="function"||typeof t=="number"||typeof t=="string"||y(t),y=t=>t!=null&&typeof t=="object"&&"node"in t,a=t=>n=>Array.isArray(t)?t.reduce((i,r)=>[...i,...Array.isArray(r)?a(r)(n):s(r)(n)],[]):s(t)(n);e.box=d,e.contentView=s,e.handleWith=l,e.isAction=A,e.isVNode=y,e.isVista=g,e.next=p,e.readout=V,e.unite=f,e.vista=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
{
"name": "hyperapplicable",
"version": "0.5.1",
"version": "0.5.2",
"description": "A utility library for Hyperapp.",

@@ -50,14 +50,14 @@ "keywords": [

"devDependencies": {
"@types/jest": "^27.4.1",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@types/jest": "^27.5.0",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"eslint": "^8.14.0",
"fast-check": "^2.24.0",
"jest": "^27.5.1",
"rollup": "^2.70.2",
"terser": "^5.12.1",
"ts-jest": "^27.1.4",
"tsup": "^5.12.6",
"typescript": "^4.6.3",
"vite": "^2.9.5"
"fast-check": "^2.25.0",
"jest": "^28.0.3",
"rollup": "^2.72.0",
"terser": "^5.13.1",
"ts-jest": "^28.0.1",
"tsup": "^5.12.7",
"typescript": "^4.6.4",
"vite": "^2.9.8"
},

@@ -64,0 +64,0 @@ "dependencies": {

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