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

korok-react

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

korok-react - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

27

dist/korok-react.js
/*!
* Korok React (version 0.0.3) - Configurable Components System
* Korok React (version 0.0.4) - Configurable Components System
*

@@ -126,4 +126,5 @@ * Will Wen Gunn(iwillwen) and other contributors

exports.setupKorok = setupKorok;
function registerKorok(key) {
var decorate = function (component) {
function registerKorok(key, options) {
if (options === void 0) { options = {}; }
function decorate(component) {
if (!Korok) {

@@ -154,12 +155,14 @@ throw new Error('not apply `setupKorok(Korok)` yet');

Korok.register(key, component);
if (options.props && Object.keys(options.props).length > 0) {
for (var propKey in options.props) {
Korok.registerProp(key, propKey, options.props[propKey]);
}
}
if (options.params && Object.keys(options.params).length > 0) {
for (var paramKey in options.params) {
Korok.registerParam(key, paramKey, options.params[paramKey]);
}
}
return component;
};
decorate.registerParam = function (paramKey, options) {
Korok.registerParam(key, paramKey, options);
return decorate;
};
decorate.registerProp = function (propKey, options) {
Korok.registerProp(key, propKey, options);
return decorate;
};
}
return decorate;

@@ -166,0 +169,0 @@ }

{
"name": "korok-react",
"version": "0.0.3",
"version": "0.0.4",
"description": "Korok React Enhancer",

@@ -5,0 +5,0 @@ "main": "dist/korok-react.js",

@@ -14,12 +14,15 @@ import { patch } from './util'

interface IDecorateFunc {
(component: React.ComponentClass): React.ComponentClass
registerParam?(key: string, options?: IKorokParam): IDecorateFunc
registerProp?(key: string, options?: IKorokProp): IDecorateFunc
interface IRegisterOptions {
props?: {
[key: string]: IKorokProp
}
params?: {
[key: string]: IKorokParam
}
}
export function registerKorok(key: string) {
const decorate: IDecorateFunc = function(component: React.ComponentClass): React.ComponentClass {
export function registerKorok(key: string, options: IRegisterOptions = {}) {
function decorate<P>(component: React.StatelessComponent<P>): React.ComponentClass<P>
function decorate<P, TFunction extends React.ComponentClass<P>>(component: TFunction): TFunction
function decorate<P>(component: any) {
if (!Korok) {

@@ -55,19 +58,19 @@ throw new Error('not apply `setupKorok(Korok)` yet')

Korok.register(key, component)
if (options.props && Object.keys(options.props).length > 0) {
for (const propKey in options.props) {
Korok.registerProp(key, propKey, options.props[propKey])
}
}
if (options.params && Object.keys(options.params).length > 0) {
for (const paramKey in options.params) {
Korok.registerParam(key, paramKey, options.params[paramKey])
}
}
return component
}
decorate.registerParam = function(paramKey: string, options?: IKorokParam) {
Korok.registerParam(key, paramKey, options)
return decorate
}
decorate.registerProp = function(propKey: string, options?: IKorokParam) {
Korok.registerProp(key, propKey, options)
return decorate
}
return decorate
}
/// <reference types="react" />
import { default as KorokClass, IKorokParam, IKorokProp } from 'korok-core';
export declare function setupKorok(korok: typeof KorokClass): void;
interface IDecorateFunc {
(component: React.ComponentClass): React.ComponentClass;
registerParam?(key: string, options?: IKorokParam): IDecorateFunc;
registerProp?(key: string, options?: IKorokProp): IDecorateFunc;
interface IRegisterOptions {
props?: {
[key: string]: IKorokProp;
};
params?: {
[key: string]: IKorokParam;
};
}
export declare function registerKorok(key: string): IDecorateFunc;
export declare function registerKorok(key: string, options?: IRegisterOptions): {
<P>(component: import("react").StatelessComponent<P>): import("react").ComponentClass<P, any>;
<P, TFunction extends import("react").ComponentClass<P, any>>(component: TFunction): TFunction;
};
export {};

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