Comparing version 0.2.0-beta.8 to 0.2.0-beta.9
@@ -9,3 +9,3 @@ "use strict"; | ||
var ctx = react_1.useContext(exports.FormContext); | ||
if (!ctx) { | ||
if (ctx === null) { | ||
throw new Error(); | ||
@@ -12,0 +12,0 @@ } |
@@ -1,6 +0,2 @@ | ||
/** | ||
* same algorithm as lodash.isPlainObject | ||
*/ | ||
export declare function isPlainObject(value: unknown): boolean; | ||
export declare function isPromise<T>(maybePromise: any): maybePromise is Promise<T>; | ||
export declare function withLeft<A, B>(b: B): (a: A) => [B, A]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* same algorithm as lodash.isPlainObject | ||
*/ | ||
function isPlainObject(value) { | ||
if (value === null || value === undefined) { | ||
return false; | ||
} | ||
if (typeof value !== 'object') { | ||
return false; | ||
} | ||
if (Object.prototype.toString.call(value) !== '[object Object]') { | ||
return false; | ||
} | ||
if (Object.getPrototypeOf(value) === null) { | ||
return true; | ||
} | ||
var proto = value; | ||
while (Object.getPrototypeOf(proto) !== null) { | ||
proto = Object.getPrototypeOf(proto); | ||
} | ||
return Object.getPrototypeOf(value) === proto; | ||
} | ||
exports.isPlainObject = isPlainObject; | ||
function isPromise(maybePromise) { | ||
@@ -27,0 +4,0 @@ return typeof maybePromise.then === 'function'; |
@@ -12,3 +12,3 @@ import { RefObject } from 'react'; | ||
export declare type IMaybeErrors<T> = { | ||
[key: string]: ValidatorResult<T>; | ||
[key: string]: IValidateResult<T>; | ||
} | null; | ||
@@ -15,0 +15,0 @@ export declare enum ValidateStrategy { |
@@ -7,3 +7,3 @@ import { createContext, useContext } from 'react'; | ||
var ctx = useContext(FormContext); | ||
if (!ctx) { | ||
if (ctx === null) { | ||
throw new Error(); | ||
@@ -10,0 +10,0 @@ } |
@@ -1,6 +0,2 @@ | ||
/** | ||
* same algorithm as lodash.isPlainObject | ||
*/ | ||
export declare function isPlainObject(value: unknown): boolean; | ||
export declare function isPromise<T>(maybePromise: any): maybePromise is Promise<T>; | ||
export declare function withLeft<A, B>(b: B): (a: A) => [B, A]; |
@@ -1,23 +0,1 @@ | ||
/** | ||
* same algorithm as lodash.isPlainObject | ||
*/ | ||
export function isPlainObject(value) { | ||
if (value === null || value === undefined) { | ||
return false; | ||
} | ||
if (typeof value !== 'object') { | ||
return false; | ||
} | ||
if (Object.prototype.toString.call(value) !== '[object Object]') { | ||
return false; | ||
} | ||
if (Object.getPrototypeOf(value) === null) { | ||
return true; | ||
} | ||
var proto = value; | ||
while (Object.getPrototypeOf(proto) !== null) { | ||
proto = Object.getPrototypeOf(proto); | ||
} | ||
return Object.getPrototypeOf(value) === proto; | ||
} | ||
export function isPromise(maybePromise) { | ||
@@ -24,0 +2,0 @@ return typeof maybePromise.then === 'function'; |
@@ -12,3 +12,3 @@ import { RefObject } from 'react'; | ||
export declare type IMaybeErrors<T> = { | ||
[key: string]: ValidatorResult<T>; | ||
[key: string]: IValidateResult<T>; | ||
} | null; | ||
@@ -15,0 +15,0 @@ export declare enum ValidateStrategy { |
{ | ||
"name": "formulr", | ||
"version": "0.2.0-beta.8", | ||
"version": "0.2.0-beta.9", | ||
"description": "Form toolkit for React", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -21,3 +21,3 @@ import { createContext, useContext } from 'react'; | ||
const ctx = useContext(FormContext); | ||
if (!ctx) { | ||
if (ctx === null) { | ||
throw new Error(); | ||
@@ -24,0 +24,0 @@ } |
@@ -1,24 +0,1 @@ | ||
/** | ||
* same algorithm as lodash.isPlainObject | ||
*/ | ||
export function isPlainObject(value: unknown): boolean { | ||
if (value === null || value === undefined) { | ||
return false; | ||
} | ||
if (typeof value !== 'object') { | ||
return false; | ||
} | ||
if (Object.prototype.toString.call(value) !== '[object Object]') { | ||
return false; | ||
} | ||
if (Object.getPrototypeOf(value) === null) { | ||
return true; | ||
} | ||
let proto = value; | ||
while (Object.getPrototypeOf(proto) !== null) { | ||
proto = Object.getPrototypeOf(proto); | ||
} | ||
return Object.getPrototypeOf(value) === proto; | ||
} | ||
export function isPromise<T>(maybePromise: any): maybePromise is Promise<T> { | ||
@@ -25,0 +2,0 @@ return typeof maybePromise.then === 'function'; |
@@ -26,3 +26,3 @@ import { RefObject } from 'react'; | ||
export type IMaybeErrors<T> = { | ||
[key: string]: ValidatorResult<T>; | ||
[key: string]: IValidateResult<T>; | ||
} | null; | ||
@@ -29,0 +29,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101304
2895