@jsplumb/util
Advanced tools
Comparing version 5.0.0-RC48 to 5.0.0-RC49
@@ -37,5 +37,2 @@ 'use strict'; | ||
} | ||
function isNull(s) { | ||
return s == null; | ||
} | ||
function isObject(o) { | ||
@@ -492,5 +489,2 @@ return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
} | ||
function sortHelper(_array, _fn) { | ||
return _array.sort(_fn); | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -998,3 +992,2 @@ if (!map.has(key)) { | ||
exports.isNamedFunction = isNamedFunction; | ||
exports.isNull = isNull; | ||
exports.isNumber = isNumber; | ||
@@ -1023,3 +1016,2 @@ exports.isObject = isObject; | ||
exports.snapToGrid = snapToGrid; | ||
exports.sortHelper = sortHelper; | ||
exports.subtract = subtract; | ||
@@ -1026,0 +1018,0 @@ exports.suggest = suggest; |
@@ -33,5 +33,2 @@ function filterList(list, value, missingIsFalse) { | ||
} | ||
function isNull(s) { | ||
return s == null; | ||
} | ||
function isObject(o) { | ||
@@ -488,5 +485,2 @@ return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
} | ||
function sortHelper(_array, _fn) { | ||
return _array.sort(_fn); | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -961,2 +955,2 @@ if (!map.has(key)) { | ||
export { EventGenerator, OptimisticEventGenerator, TWO_PI, add, addToDictionary, addToList, addWithFunction, arraysEqual, clone, each, encloses, extend, fastTrim, filterList, filterNull, findAllWithFunction, findWithFunction, forEach, fromArray, functionChain, getAllWithFunction, getFromSetWithFunction, getWithFunction, getsert, gradient, insertSorted, intersects, isAssignableFrom, isBoolean, isDate, isEmpty, isFunction, isNamedFunction, isNull, isNumber, isObject, isString, lineIntersection, lineLength, lineRectangleIntersection, log, logEnabled, map, merge, normal, objectsEqual, perpendicularLineTo, pointOnLine, populate, quadrant, remove, removeWithFunction, replace, rotateAnchorOrientation, rotatePoint, setToArray, snapToGrid, sortHelper, subtract, suggest, theta, uuid, wrap }; | ||
export { EventGenerator, OptimisticEventGenerator, TWO_PI, add, addToDictionary, addToList, addWithFunction, arraysEqual, clone, each, encloses, extend, fastTrim, filterList, filterNull, findAllWithFunction, findWithFunction, forEach, fromArray, functionChain, getAllWithFunction, getFromSetWithFunction, getWithFunction, getsert, gradient, insertSorted, intersects, isAssignableFrom, isBoolean, isDate, isEmpty, isFunction, isNamedFunction, isNumber, isObject, isString, lineIntersection, lineLength, lineRectangleIntersection, log, logEnabled, map, merge, normal, objectsEqual, perpendicularLineTo, pointOnLine, populate, quadrant, remove, removeWithFunction, replace, rotateAnchorOrientation, rotatePoint, setToArray, snapToGrid, subtract, suggest, theta, uuid, wrap }; |
@@ -39,5 +39,2 @@ (function (global, factory) { | ||
} | ||
function isNull(s) { | ||
return s == null; | ||
} | ||
function isObject(o) { | ||
@@ -494,5 +491,2 @@ return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
} | ||
function sortHelper(_array, _fn) { | ||
return _array.sort(_fn); | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -1000,3 +994,2 @@ if (!map.has(key)) { | ||
exports.isNamedFunction = isNamedFunction; | ||
exports.isNull = isNull; | ||
exports.isNumber = isNumber; | ||
@@ -1025,3 +1018,2 @@ exports.isObject = isObject; | ||
exports.snapToGrid = snapToGrid; | ||
exports.sortHelper = sortHelper; | ||
exports.subtract = subtract; | ||
@@ -1028,0 +1020,0 @@ exports.suggest = suggest; |
{ | ||
"name": "@jsplumb/util", | ||
"version": "5.0.0-RC48", | ||
"version": "5.0.0-RC49", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "js/jsplumb.util.cjs.js", |
@@ -22,2 +22,3 @@ /** | ||
* @param insertAtStart | ||
* @internal | ||
*/ | ||
@@ -32,2 +33,3 @@ export declare function addToDictionary<T>(map: Dictionary<Array<T>>, key: string, value: any, insertAtStart?: boolean): Array<any>; | ||
* @param insertAtStart If true, inserts the new item at the head of the list. Defaults to false. | ||
* @internal | ||
*/ | ||
@@ -41,2 +43,3 @@ export declare function addToList<T>(map: Map<string, Array<T>>, key: string, value: any, insertAtStart?: boolean): Array<any>; | ||
* @param hashFunction Function to use to check the current items of the list; if this function returns true for any current list item, the insertion does not proceed. | ||
* @internal | ||
*/ | ||
@@ -57,2 +60,3 @@ export declare function addWithFunction<T>(list: Array<T>, item: T, hashFunction: (_a: T) => boolean): void; | ||
* it here. | ||
* @public | ||
*/ | ||
@@ -70,2 +74,3 @@ export declare type BoundingBox = { | ||
* @param a | ||
* @internal | ||
*/ | ||
@@ -76,2 +81,4 @@ export declare function clone(a: any): any; | ||
* Defines an object that has a constructor. Used internally to create endpoints/connectors/overlays from their names. | ||
* Exposed as public for people to create their own endpoints/connectors/overlays. | ||
* @public | ||
*/ | ||
@@ -84,2 +91,3 @@ export declare type Constructable<T> = { | ||
* Simple definition of a map. This construct is being replaced across the codebase with `Record<string, T>` and also `Map<..>` | ||
* @public | ||
* @deprecated | ||
@@ -96,2 +104,3 @@ */ | ||
* @param fn | ||
* @internal | ||
*/ | ||
@@ -185,2 +194,3 @@ export declare function each(obj: any, fn: Function): void; | ||
* @param keys Optional list of keys to use to copy values from `o2` to `o1`. If this is not provided, all values are copied. | ||
* @public | ||
*/ | ||
@@ -191,2 +201,3 @@ export declare function extend<T>(o1: T, o2: T, keys?: string[]): T; | ||
* Definition of the extends of some set of elements: the min/max values in each axis. | ||
* @internal | ||
*/ | ||
@@ -203,2 +214,3 @@ export declare interface Extents { | ||
* @param s | ||
* @public | ||
*/ | ||
@@ -212,2 +224,3 @@ export declare function fastTrim(s: string): string; | ||
* @param missingIsFalse | ||
* @internal | ||
*/ | ||
@@ -219,2 +232,3 @@ export declare function filterList(list: Array<any> | string, value: any, missingIsFalse?: boolean): boolean; | ||
* @param obj | ||
* @internal | ||
*/ | ||
@@ -227,2 +241,3 @@ export declare function filterNull(obj: Record<string, any>): Record<string, any>; | ||
* @param predicate | ||
* @internal | ||
*/ | ||
@@ -237,2 +252,3 @@ export declare function findAllWithFunction<T>(a: ArrayLike<T>, predicate: (_a: T) => boolean): Array<number>; | ||
* @returns The index of the entry for which the predicate returned true, -1 if not found. | ||
* @internal | ||
*/ | ||
@@ -245,2 +261,3 @@ export declare function findWithFunction<T>(a: ArrayLike<T>, f: (_a: T) => boolean): number; | ||
* @param f | ||
* @internal | ||
*/ | ||
@@ -253,2 +270,3 @@ export declare function forEach<T>(a: ArrayLike<T>, f: (_a: T) => any): void; | ||
* @returns An Array | ||
* @internal | ||
*/ | ||
@@ -272,2 +290,3 @@ export declare function fromArray<T>(a: ArrayLike<T>): Array<T>; | ||
* @returns The entries for which the predicate returned true, empty array if not found. | ||
* @internal | ||
*/ | ||
@@ -280,2 +299,3 @@ export declare function getAllWithFunction<T>(a: ArrayLike<T>, f: (_a: T) => boolean): Array<T>; | ||
* @param f | ||
* @internal | ||
*/ | ||
@@ -289,2 +309,3 @@ export declare function getFromSetWithFunction<T>(s: Set<T>, f: (_a: T) => boolean): T; | ||
* @param valueGenerator Method used to generate a value for the key if it is not currently in the map. | ||
* @public | ||
*/ | ||
@@ -299,2 +320,3 @@ export declare function getsert<K, V>(map: Map<K, V>, key: K, valueGenerator: () => V): V; | ||
* @returns The entry for which the predicate returned true, null if not found. | ||
* @internal | ||
*/ | ||
@@ -315,2 +337,3 @@ export declare function getWithFunction<T>(a: ArrayLike<T>, f: (_a: T) => boolean): T; | ||
* trying to snap some coordinate to the grid. | ||
* @public | ||
*/ | ||
@@ -328,2 +351,3 @@ export declare interface Grid extends Size { | ||
* @param sortDescending Defaults to false; if true, the insertion is sorted in reverse order. | ||
* @public | ||
*/ | ||
@@ -346,2 +370,3 @@ export declare function insertSorted<T>(value: T, array: Array<T>, comparator: (v1: T, v2: T) => number, sortDescending?: boolean): void; | ||
* @param cls Class to test for. | ||
* @public | ||
*/ | ||
@@ -353,2 +378,3 @@ export declare function isAssignableFrom(object: any, cls: any): boolean; | ||
* @param s | ||
* @public | ||
*/ | ||
@@ -360,2 +386,3 @@ export declare function isBoolean(s: any): boolean; | ||
* @param o | ||
* @public | ||
*/ | ||
@@ -367,2 +394,3 @@ export declare function isDate(o: any): o is Date; | ||
* @param o | ||
* @public | ||
*/ | ||
@@ -374,2 +402,3 @@ export declare function isEmpty(o: any): boolean; | ||
* @param o | ||
* @public | ||
*/ | ||
@@ -381,2 +410,3 @@ export declare function isFunction(o: any): o is Function; | ||
* @param o | ||
* @public | ||
*/ | ||
@@ -386,10 +416,5 @@ export declare function isNamedFunction(o: any): boolean; | ||
/** | ||
* Returns whether or not the given value is null. | ||
* @param s | ||
*/ | ||
export declare function isNull(s: any): boolean; | ||
/** | ||
* Returns whether or not the given value is of `number` type. | ||
* @param n | ||
* @public | ||
*/ | ||
@@ -401,2 +426,3 @@ export declare function isNumber(n: any): boolean; | ||
* @param o | ||
* @public | ||
*/ | ||
@@ -408,2 +434,3 @@ export declare function isObject(o: any): boolean; | ||
* @param s | ||
* @public | ||
*/ | ||
@@ -441,2 +468,3 @@ export declare function isString(s: any): boolean; | ||
* Defines a line from some point to another. | ||
* @public | ||
*/ | ||
@@ -448,2 +476,3 @@ export declare type LineXY = [PointXY, PointXY]; | ||
* @param args | ||
* @internal | ||
*/ | ||
@@ -454,2 +483,3 @@ export declare function log(...args: string[]): void; | ||
* Determines whether or not logging is currently enabled. | ||
* @public | ||
*/ | ||
@@ -462,2 +492,3 @@ export declare const logEnabled: boolean; | ||
* @param fn | ||
* @internal | ||
*/ | ||
@@ -468,2 +499,3 @@ export declare function map(obj: any, fn: Function): any[]; | ||
* A copy of a concept from a later version of Typescript than jsPlumb can currently use. | ||
* @internal | ||
*/ | ||
@@ -542,2 +574,3 @@ export declare type Merge<M, N> = Omit_2<M, Extract<keyof M, keyof N>> & N; | ||
* @param overwrites Optional list of parameters to overwrite, rather than merging. | ||
* @internal | ||
*/ | ||
@@ -565,2 +598,3 @@ export declare function merge(a: Record<string, any>, b: Record<string, any>, collations?: Array<string>, overwrites?: Array<string>): any; | ||
* A copy of a concept from a later version of Typescript than jsPlumb can currently use. | ||
* @internal | ||
*/ | ||
@@ -600,2 +634,3 @@ declare type Omit_2<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | ||
* Defines an x/y location. | ||
* @public | ||
*/ | ||
@@ -620,2 +655,3 @@ export declare interface PointXY { | ||
* @returns | ||
* @internal | ||
*/ | ||
@@ -640,2 +676,3 @@ export declare function populate(model: any, values: any, functionPrefix?: string, doNotExpandFunctions?: boolean): any; | ||
* This is an alias for BoundingBox. | ||
* @public | ||
*/ | ||
@@ -649,2 +686,3 @@ export declare type RectangleXY = BoundingBox; | ||
* @returns true if the item was removed, false otherwise. | ||
* @internal | ||
*/ | ||
@@ -658,2 +696,3 @@ export declare function remove<T>(l: Array<T>, v: T): boolean; | ||
* @returns true if an element was removed, false if not. | ||
* @internal | ||
*/ | ||
@@ -700,2 +739,3 @@ export declare function removeWithFunction<T>(a: Array<T>, f: (_a: T) => boolean): boolean; | ||
* Defines the current rotation of some element - its rotation (in degrees) and the center point around which it is rotated. | ||
* @internal | ||
*/ | ||
@@ -709,2 +749,3 @@ export declare interface Rotation { | ||
* A set of compound rotations - used when nesting elements/groups inside other groups. | ||
* @internal | ||
*/ | ||
@@ -716,2 +757,3 @@ export declare type Rotations = Array<Rotation>; | ||
* @param s | ||
* @internal | ||
*/ | ||
@@ -722,2 +764,3 @@ export declare function setToArray<T>(s: Set<T>): Array<T>; | ||
* Defines the width and height of some element. | ||
* @public | ||
*/ | ||
@@ -742,2 +785,3 @@ export declare interface Size { | ||
* Defines a function that can be used to sort an array. | ||
* @internal | ||
*/ | ||
@@ -747,9 +791,2 @@ export declare type SortFunction<T> = (a: T, b: T) => number; | ||
/** | ||
* Sorts an array. Seems quite unnecessary. Only used in one place in the codebase. Marking deprecated. | ||
* @param _array | ||
* @param _fn | ||
*/ | ||
export declare function sortHelper<T>(_array: Array<T>, _fn: SortFunction<T>): Array<T>; | ||
/** | ||
* Subtracts p2 from p1, returning a new point. | ||
@@ -765,5 +802,6 @@ * @param p1 | ||
* Add the given item to the given list if it does not exist on the list already. | ||
* @param list List to add to | ||
* @param item Item to add | ||
* @param insertAtHead If true, insert new item at head. Defaults to false. | ||
* @param list - List to add to | ||
* @param item - Item to add | ||
* @param insertAtHead - If true, insert new item at head. Defaults to false. | ||
* @internal | ||
*/ | ||
@@ -790,2 +828,3 @@ export declare function suggest(list: Array<any>, item: any, insertAtHead?: boolean): boolean; | ||
* @returns String representation of a UUID | ||
* @public | ||
*/ | ||
@@ -800,7 +839,8 @@ export declare function uuid(): string; | ||
* drag/drop functionality. | ||
* @param wrappedFunction original function to wrap; may be null. | ||
* @param newFunction function to wrap the original with. | ||
* @param [returnOnThisValue] Optional. Indicates that the wrappedFunction should | ||
* @param wrappedFunction - original function to wrap; may be null. | ||
* @param newFunction - function to wrap the original with. | ||
* @param returnOnThisValue - Optional. Indicates that the wrappedFunction should | ||
* not be executed if the newFunction returns a value matching 'returnOnThisValue'. | ||
* note that this is a simple comparison and only works for primitives right now. | ||
* @internal | ||
*/ | ||
@@ -807,0 +847,0 @@ export declare function wrap(wrappedFunction: Function, newFunction: Function, returnOnThisValue?: any): () => any; |
3642
110083