@datalith/util
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1,6 +0,9 @@ | ||
export function isDatumdatalith(datum) { | ||
return (datum.hasOwnProperty('v') || | ||
datum.hasOwnProperty('y') || | ||
datum.hasOwnProperty('z')); | ||
import { isFunction } from 'lodash'; | ||
export function callOrGetValue(funcOrValue) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
return isFunction(funcOrValue) ? funcOrValue.apply(void 0, args) : funcOrValue; | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -1,8 +0,9 @@ | ||
export interface Datumdatalith { | ||
v?: any; | ||
y?: number; | ||
z?: string; | ||
} | ||
export declare type DatumContinuous = Datumdatalith | number; | ||
export declare type DatumDiscrete = Datumdatalith | string; | ||
export declare function isDatumdatalith(datum: DatumContinuous | DatumDiscrete): datum is Datumdatalith; | ||
export declare type Datum = any; | ||
declare type ContinuousAccessor = (d: Datum, i: number) => number; | ||
declare type DiscreteAccessor = (d: Datum, i: number) => string; | ||
declare type CoordsAccessor = (d: Datum, i: number) => [number, number]; | ||
export declare type Value = ContinuousAccessor | number; | ||
export declare type Color = DiscreteAccessor | string; | ||
export declare type Coords = CoordsAccessor | [number, number]; | ||
export declare function callOrGetValue<T>(funcOrValue: ((...args: any) => T) | T, ...args: any): T; | ||
export {}; |
{ | ||
"name": "@datalith/util", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "datalith util", | ||
@@ -30,2 +30,5 @@ "main": "dist/index.js", | ||
"homepage": "https://github.com/lucafalasco/datalith#readme", | ||
"dependencies": { | ||
"lodash": "^4.17.11" | ||
}, | ||
"devDependencies": { | ||
@@ -37,3 +40,3 @@ "typescript": "^3.5.1" | ||
}, | ||
"gitHead": "07098e2da1dcddb3b6b03dd8e8b1bf00c4a1bdc4" | ||
"gitHead": "0105e6e2ec377fea191acb01fa842d7758ce200f" | ||
} |
@@ -5,4 +5,4 @@ # @datalith/util | ||
``` | ||
```sh | ||
yarn add @datalith/util | ||
``` |
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
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
3203
17
1
+ Addedlodash@^4.17.11
+ Addedlodash@4.17.21(transitive)