@react-spring/shared
Advanced tools
Comparing version 9.0.0-beta.13 to 9.0.0-beta.14
@@ -5,8 +5,8 @@ "use strict"; | ||
var G = tslib_1.__importStar(require("./globals")); | ||
var _1 = require("."); | ||
var helpers_1 = require("./helpers"); | ||
exports.createInterpolator = function (range, output, extrapolate) { | ||
if (_1.is.fun(range)) { | ||
if (helpers_1.is.fun(range)) { | ||
return range; | ||
} | ||
if (_1.is.arr(range)) { | ||
if (helpers_1.is.arr(range)) { | ||
return exports.createInterpolator({ | ||
@@ -18,3 +18,3 @@ range: range, | ||
} | ||
if (_1.is.str(range.output[0])) { | ||
if (helpers_1.is.str(range.output[0])) { | ||
return G.createStringInterpolator(range); | ||
@@ -21,0 +21,0 @@ } |
@@ -1,22 +0,5 @@ | ||
/// <reference types="react" /> | ||
import { Indexable } from './types'; | ||
import * as Globals from './globals'; | ||
export { Globals }; | ||
export * from './types'; | ||
export * from './helpers'; | ||
export * from './createInterpolator'; | ||
import * as Globals from './globals'; | ||
export { Globals }; | ||
interface IsArray { | ||
<T>(a: T): a is T & ReadonlyArray<any>; | ||
} | ||
export declare const is: { | ||
arr: IsArray; | ||
obj: <T extends any>(a: T) => a is Exclude<T & Indexable<any>, Function | readonly any[]>; | ||
fun: (a: unknown) => a is Function; | ||
str: (a: unknown) => a is string; | ||
num: (a: unknown) => a is number; | ||
und: (a: unknown) => a is undefined; | ||
boo: (a: unknown) => a is boolean; | ||
}; | ||
export declare function useOnce(effect: React.EffectCallback): void; | ||
export declare function useForceUpdate(): () => void; | ||
/** Use a value from the previous render */ | ||
export declare function usePrev<T>(value: T): T | undefined; |
33
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var react_1 = require("react"); | ||
tslib_1.__exportStar(require("./createInterpolator"), exports); | ||
var Globals = tslib_1.__importStar(require("./globals")); | ||
exports.Globals = Globals; | ||
exports.is = { | ||
arr: Array.isArray, | ||
obj: function (a) { | ||
return !!a && a.constructor.name === 'Object'; | ||
}, | ||
fun: function (a) { return typeof a === 'function'; }, | ||
str: function (a) { return typeof a === 'string'; }, | ||
num: function (a) { return typeof a === 'number'; }, | ||
und: function (a) { return a === void 0; }, | ||
boo: function (a) { return typeof a === 'boolean'; }, | ||
}; | ||
function useOnce(effect) { | ||
react_1.useEffect(effect, []); | ||
} | ||
exports.useOnce = useOnce; | ||
function useForceUpdate() { | ||
var _a = react_1.useState(false), f = _a[1]; | ||
var forceUpdate = react_1.useCallback(function () { return f(function (v) { return !v; }); }, []); | ||
return forceUpdate; | ||
} | ||
exports.useForceUpdate = useForceUpdate; | ||
/** Use a value from the previous render */ | ||
function usePrev(value) { | ||
var prevRef = react_1.useRef(undefined); | ||
var prev = prevRef.current; | ||
prevRef.current = value; | ||
return prev; | ||
} | ||
exports.usePrev = usePrev; | ||
tslib_1.__exportStar(require("./helpers"), exports); | ||
tslib_1.__exportStar(require("./createInterpolator"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@react-spring/shared", | ||
"version": "9.0.0-beta.13", | ||
"version": "9.0.0-beta.14", | ||
"description": "Globals and shared modules", | ||
"keywords": [ | ||
"animated", | ||
"animation", | ||
"hooks", | ||
"motion", | ||
"react", | ||
"react-native", | ||
"spring", | ||
"typescript", | ||
"velocity" | ||
], | ||
"homepage": "https://github.com/react-spring/react-spring/tree/master/packages/shared#readme", | ||
@@ -28,2 +17,5 @@ "bugs": { | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"postinstall": "node postinstall.js" | ||
}, | ||
"dependencies": { | ||
@@ -34,6 +26,9 @@ "@babel/runtime": "^7.3.1", | ||
}, | ||
"devDependencies": { | ||
"typescript": "3.5.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"directory": "dist" | ||
} | ||
"access": "public" | ||
}, | ||
"react-native": "src/index.ts" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
83064
56
1819
1
1
2