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.3.0 to 0.3.1

6

dist/hyperapplicable.d.ts
import { Action, MaybeVNode, CustomPayloads, Dispatch, Effect, Unsubscribe, ClassProp, VNode, Dispatchable } from 'hyperapp';
declare type ActionWithPayload<S, P = any> = [action: Action<S, P>, payload: P];
declare type Content<S> = number | string | MaybeVNode<S> | readonly MaybeVNode<S>[];
declare type Content<S> = number | string | MaybeVNode<S>;
declare type CustomProps<T, S, P> = CustomPayloads<S, P> & T;

@@ -15,5 +15,5 @@ declare type Effecter<S, P> = (dispatch: Dispatch<S>, payload: P) => void | Promise<void>;

declare const box: <S>(classes: ClassProp, content: Content<S>) => VNode<S>;
declare const box: <S>(classProp: ClassProp, content: Content<S>) => VNode<S>;
declare const contentNode: <S>(x: Content<S>) => MaybeVNode<S> | readonly MaybeVNode<S>[];
declare const contentNode: <S>(x: Content<S>) => MaybeVNode<S>;
declare const isContent: <S>(x: unknown) => x is Content<S>;

@@ -20,0 +20,0 @@ declare const isVNode: <S>(x: unknown) => x is VNode<S>;

import { text, h } from "hyperapp";
const contentNode = (x) => typeof x === "number" || typeof x === "string" ? text(x) : x;
const isContent = (x) => typeof x === "number" || typeof x === "string" || x == null || Array.isArray(x) || typeof x === "boolean" || isVNode(x);
const isContent = (x) => typeof x === "number" || typeof x === "string" || x == null || typeof x === "boolean" || isVNode(x);
const isVNode = (x) => x != null && typeof x === "object" && "node" in x;
const box = (classes, content) => h("div", { class: classes }, contentNode(content));
const box = (classProp, content) => h("div", { class: classProp }, contentNode(content));
const unite = (transform, stateForm, payload) => {

@@ -7,0 +7,0 @@ if (!Array.isArray(stateForm)) {

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

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

@@ -5,0 +5,0 @@ "keywords": [

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