@remirror/core-helpers
Advanced tools
Comparing version 1.0.0-pr706.d0b3ea524 to 1.0.0
@@ -0,16 +1,6 @@ | ||
import type { ClassName } from '@linaria/core/types/cx'; | ||
import omit from 'object.omit'; | ||
import pick from 'object.pick'; | ||
import type { ConditionalExcept, Primitive } from 'type-fest'; | ||
interface Shape { | ||
[key: string]: any; | ||
} | ||
declare type UnknownShape<Type = unknown> = Record<string, Type>; | ||
declare type Nullable<Type> = Type | null | undefined; | ||
declare type AnyConstructor<Type = any> = new (...args: any[]) => Type; | ||
declare type AnyFunction<Type = any> = (...args: any[]) => Type; | ||
declare type GetRecursivePath<Type, Key extends keyof Type> = Key extends string ? Type[Key] extends Record<string, any> ? `${Key}.${GetRecursivePath<Type[Key], Exclude<keyof Type[Key], keyof any[]>> & string}` | `${Key}.${Exclude<keyof Type[Key], keyof any[]> & string}` : never : never; | ||
declare type GetJoinedPath<Type> = GetRecursivePath<Type, keyof Type> | keyof Type; | ||
export declare type GetPath<Type> = GetJoinedPath<Type> extends string | keyof Type ? GetJoinedPath<Type> : keyof Type; | ||
export declare type GetPathValue<Type, Path extends GetPath<Type>> = Path extends `${infer Key}.${infer Rest}` ? Key extends keyof Type ? Rest extends GetPath<Type[Key]> ? GetPathValue<Type[Key], Rest> : never : never : Path extends keyof Type ? Type[Path] : never; | ||
export declare type TupleRange<Size extends number> = Size extends Size ? number extends Size ? number[] : _NumberRangeTuple<[], Size> : never; | ||
import type { AnyConstructor, AnyFunction, ConditionalExcept, Nullable, Primitive, Shape, UnknownShape } from '@remirror/types'; | ||
declare type TupleRange<Size extends number> = Size extends Size ? number extends Size ? number[] : _NumberRangeTuple<[], Size> : never; | ||
declare type _NumberRangeTuple<Tuple extends readonly unknown[], Length extends number> = Tuple['length'] extends Length ? Tuple : _NumberRangeTuple<[...Tuple, Tuple['length']], Length>; | ||
@@ -454,3 +444,3 @@ /** | ||
*/ | ||
export declare function uniqueBy<Item = any>(array: Item[], getValue: ((item: Item) => unknown) | GetPath<Item>, fromStart?: boolean): Item[]; | ||
export declare function uniqueBy<Item = any>(array: Item[], getValue: ((item: Item) => unknown) | string | string[], fromStart?: boolean): Item[]; | ||
/** | ||
@@ -496,4 +486,5 @@ * Create a range from start to end. | ||
export declare function getLazyArray<Type>(value: Type[] | (() => Type[])): Type[]; | ||
export declare function cx(...classes: ClassName[]): string; | ||
export { camelCase, capitalCase, constantCase, kebabCase, pascalCase, pathCase, snakeCase, spaceCase, } from 'case-anything'; | ||
export { debounce, throttle } from 'throttle-debounce'; | ||
export { omit, pick }; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var _defineProperty = require('@babel/runtime/helpers/defineProperty'); | ||
var core = require('@linaria/core'); | ||
var deepmerge = require('deepmerge'); | ||
@@ -189,3 +190,3 @@ var fastDeepEqual = require('fast-deep-equal'); | ||
var isUndefined = /*#__PURE__*/isOfType('undefined'); | ||
var isUndefined = isOfType('undefined'); | ||
/** | ||
@@ -198,3 +199,3 @@ * Predicate check that value is a string | ||
var isString = /*#__PURE__*/isOfType('string'); | ||
var isString = isOfType('string'); | ||
/** | ||
@@ -209,3 +210,3 @@ * Predicate check that value is a number. | ||
var isNumber = /*#__PURE__*/isOfType('number', value => { | ||
var isNumber = isOfType('number', value => { | ||
return !Number.isNaN(value); | ||
@@ -220,3 +221,3 @@ }); | ||
var isFunction = /*#__PURE__*/isOfType('function'); | ||
var isFunction = isOfType('function'); | ||
/** | ||
@@ -261,3 +262,3 @@ * Predicate check that value is null | ||
var isSymbol = /*#__PURE__*/isOfType('symbol'); | ||
var isSymbol = isOfType('symbol'); | ||
/** | ||
@@ -371,3 +372,3 @@ * Helper function for Number.isInteger check allowing non numbers to be tested | ||
var isRegExp = /*#__PURE__*/isObjectOfType(TypeName.RegExp); | ||
var isRegExp = isObjectOfType(TypeName.RegExp); | ||
/** | ||
@@ -380,3 +381,3 @@ * Predicate check that value is a date | ||
var isDate = /*#__PURE__*/isObjectOfType(TypeName.Date); | ||
var isDate = isObjectOfType(TypeName.Date); | ||
/** | ||
@@ -389,3 +390,3 @@ * Predicate check that value is an error | ||
var isError = /*#__PURE__*/isObjectOfType(TypeName.Error); | ||
var isError = isObjectOfType(TypeName.Error); | ||
/** | ||
@@ -776,3 +777,3 @@ * Predicate check that value is a `Map` | ||
index | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map((_ref2) => { | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map(_ref2 => { | ||
var value = _ref2.value; | ||
@@ -859,10 +860,10 @@ return value; | ||
index = _step2$value[0], | ||
_key3 = _step2$value[1]; | ||
key = _step2$value[1]; | ||
var shouldDelete = index >= path.length - 1; | ||
var _item2 = value[_key3]; | ||
var _item2 = value[key]; | ||
if (shouldDelete) { | ||
if (isArray(value)) { | ||
var indexKey = Number.parseInt(_key3.toString(), 10); | ||
var indexKey = Number.parseInt(key.toString(), 10); | ||
@@ -873,3 +874,3 @@ if (isNumber(indexKey)) { | ||
} else { | ||
Reflect.deleteProperty(value, _key3); | ||
Reflect.deleteProperty(value, key); | ||
} | ||
@@ -885,3 +886,3 @@ | ||
_item2 = isArray(_item2) ? [..._item2] : _objectSpread({}, _item2); | ||
value[_key3] = _item2; | ||
value[key] = _item2; | ||
value = _item2; | ||
@@ -991,4 +992,4 @@ } | ||
function within(value) { | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) { | ||
rest[_key4 - 1] = arguments[_key4]; | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
rest[_key3 - 1] = arguments[_key3]; | ||
} | ||
@@ -1026,2 +1027,5 @@ | ||
return value; | ||
} | ||
function cx() { | ||
return uniqueArray(core.cx(...arguments).split(' ')).join(' '); | ||
} // The following are forward exports for other libraries. I've structured it | ||
@@ -1204,3 +1208,3 @@ | ||
set: (_, prop) => { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
message: "It seems you're trying to set the value of the property (".concat(String(prop), ") on a frozen object. For your protection this object does not allow direct mutation."), | ||
@@ -1294,2 +1298,3 @@ code: coreConstants.ErrorConstant.MUTATION | ||
exports.clone = clone; | ||
exports.cx = cx; | ||
exports.deepMerge = deepMerge; | ||
@@ -1296,0 +1301,0 @@ exports.entries = entries; |
@@ -7,2 +7,3 @@ import { BaseError } from 'make-error'; | ||
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import { cx as cx$1 } from '@linaria/core'; | ||
import deepmerge from 'deepmerge'; | ||
@@ -179,3 +180,3 @@ import fastDeepEqual from 'fast-deep-equal'; | ||
var isUndefined = /*#__PURE__*/isOfType('undefined'); | ||
var isUndefined = isOfType('undefined'); | ||
/** | ||
@@ -188,3 +189,3 @@ * Predicate check that value is a string | ||
var isString = /*#__PURE__*/isOfType('string'); | ||
var isString = isOfType('string'); | ||
/** | ||
@@ -199,3 +200,3 @@ * Predicate check that value is a number. | ||
var isNumber = /*#__PURE__*/isOfType('number', value => { | ||
var isNumber = isOfType('number', value => { | ||
return !Number.isNaN(value); | ||
@@ -210,3 +211,3 @@ }); | ||
var isFunction = /*#__PURE__*/isOfType('function'); | ||
var isFunction = isOfType('function'); | ||
/** | ||
@@ -251,3 +252,3 @@ * Predicate check that value is null | ||
var isSymbol = /*#__PURE__*/isOfType('symbol'); | ||
var isSymbol = isOfType('symbol'); | ||
/** | ||
@@ -361,3 +362,3 @@ * Helper function for Number.isInteger check allowing non numbers to be tested | ||
var isRegExp = /*#__PURE__*/isObjectOfType(TypeName.RegExp); | ||
var isRegExp = isObjectOfType(TypeName.RegExp); | ||
/** | ||
@@ -370,3 +371,3 @@ * Predicate check that value is a date | ||
var isDate = /*#__PURE__*/isObjectOfType(TypeName.Date); | ||
var isDate = isObjectOfType(TypeName.Date); | ||
/** | ||
@@ -379,3 +380,3 @@ * Predicate check that value is an error | ||
var isError = /*#__PURE__*/isObjectOfType(TypeName.Error); | ||
var isError = isObjectOfType(TypeName.Error); | ||
/** | ||
@@ -766,3 +767,3 @@ * Predicate check that value is a `Map` | ||
index | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map((_ref2) => { | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map(_ref2 => { | ||
var value = _ref2.value; | ||
@@ -849,10 +850,10 @@ return value; | ||
index = _step2$value[0], | ||
_key3 = _step2$value[1]; | ||
key = _step2$value[1]; | ||
var shouldDelete = index >= path.length - 1; | ||
var _item2 = value[_key3]; | ||
var _item2 = value[key]; | ||
if (shouldDelete) { | ||
if (isArray(value)) { | ||
var indexKey = Number.parseInt(_key3.toString(), 10); | ||
var indexKey = Number.parseInt(key.toString(), 10); | ||
@@ -863,3 +864,3 @@ if (isNumber(indexKey)) { | ||
} else { | ||
Reflect.deleteProperty(value, _key3); | ||
Reflect.deleteProperty(value, key); | ||
} | ||
@@ -875,3 +876,3 @@ | ||
_item2 = isArray(_item2) ? [..._item2] : _objectSpread({}, _item2); | ||
value[_key3] = _item2; | ||
value[key] = _item2; | ||
value = _item2; | ||
@@ -981,4 +982,4 @@ } | ||
function within(value) { | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) { | ||
rest[_key4 - 1] = arguments[_key4]; | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
rest[_key3 - 1] = arguments[_key3]; | ||
} | ||
@@ -1016,2 +1017,5 @@ | ||
return value; | ||
} | ||
function cx() { | ||
return uniqueArray(cx$1(...arguments).split(' ')).join(' '); | ||
} // The following are forward exports for other libraries. I've structured it | ||
@@ -1194,3 +1198,3 @@ | ||
set: (_, prop) => { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
message: "It seems you're trying to set the value of the property (".concat(String(prop), ") on a frozen object. For your protection this object does not allow direct mutation."), | ||
@@ -1203,2 +1207,2 @@ code: ErrorConstant.MUTATION | ||
export { Cast, RemirrorError, assert, assertGet, callIfDefined, capitalize, clamp, cleanupOS, clone, deepMerge, entries, findMatches, flattenArray, format, freeze, get, getLazyArray, hasOwnProperty, includes, invariant, isAndroidOS, isArray, isBoolean, isClass, isDate, isDirectInstanceOf, isEmptyArray, isEmptyObject, isEqual, isError, isFunction, isInstanceOf, isInteger, isMap, isNativePromise, isNonEmptyArray, isNull, isNullOrUndefined, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isUndefined, keys, last, noop, object, omitUndefined, randomFloat, randomInt, range, set, shallowClone, sort, startCase, take, toString, uniqueArray, uniqueBy, uniqueId, unset, values, within }; | ||
export { Cast, RemirrorError, assert, assertGet, callIfDefined, capitalize, clamp, cleanupOS, clone, cx, deepMerge, entries, findMatches, flattenArray, format, freeze, get, getLazyArray, hasOwnProperty, includes, invariant, isAndroidOS, isArray, isBoolean, isClass, isDate, isDirectInstanceOf, isEmptyArray, isEmptyObject, isEqual, isError, isFunction, isInstanceOf, isInteger, isMap, isNativePromise, isNonEmptyArray, isNull, isNullOrUndefined, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isUndefined, keys, last, noop, object, omitUndefined, randomFloat, randomInt, range, set, shallowClone, sort, startCase, take, toString, uniqueArray, uniqueBy, uniqueId, unset, values, within }; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var _defineProperty = require('@babel/runtime/helpers/defineProperty'); | ||
var core = require('@linaria/core'); | ||
var deepmerge = require('deepmerge'); | ||
@@ -189,3 +190,3 @@ var fastDeepEqual = require('fast-deep-equal'); | ||
var isUndefined = /*#__PURE__*/isOfType('undefined'); | ||
var isUndefined = isOfType('undefined'); | ||
/** | ||
@@ -198,3 +199,3 @@ * Predicate check that value is a string | ||
var isString = /*#__PURE__*/isOfType('string'); | ||
var isString = isOfType('string'); | ||
/** | ||
@@ -209,3 +210,3 @@ * Predicate check that value is a number. | ||
var isNumber = /*#__PURE__*/isOfType('number', value => { | ||
var isNumber = isOfType('number', value => { | ||
return !Number.isNaN(value); | ||
@@ -220,3 +221,3 @@ }); | ||
var isFunction = /*#__PURE__*/isOfType('function'); | ||
var isFunction = isOfType('function'); | ||
/** | ||
@@ -261,3 +262,3 @@ * Predicate check that value is null | ||
var isSymbol = /*#__PURE__*/isOfType('symbol'); | ||
var isSymbol = isOfType('symbol'); | ||
/** | ||
@@ -371,3 +372,3 @@ * Helper function for Number.isInteger check allowing non numbers to be tested | ||
var isRegExp = /*#__PURE__*/isObjectOfType(TypeName.RegExp); | ||
var isRegExp = isObjectOfType(TypeName.RegExp); | ||
/** | ||
@@ -380,3 +381,3 @@ * Predicate check that value is a date | ||
var isDate = /*#__PURE__*/isObjectOfType(TypeName.Date); | ||
var isDate = isObjectOfType(TypeName.Date); | ||
/** | ||
@@ -389,3 +390,3 @@ * Predicate check that value is an error | ||
var isError = /*#__PURE__*/isObjectOfType(TypeName.Error); | ||
var isError = isObjectOfType(TypeName.Error); | ||
/** | ||
@@ -776,3 +777,3 @@ * Predicate check that value is a `Map` | ||
index | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map((_ref2) => { | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map(_ref2 => { | ||
var value = _ref2.value; | ||
@@ -859,10 +860,10 @@ return value; | ||
index = _step2$value[0], | ||
_key3 = _step2$value[1]; | ||
key = _step2$value[1]; | ||
var shouldDelete = index >= path.length - 1; | ||
var _item2 = value[_key3]; | ||
var _item2 = value[key]; | ||
if (shouldDelete) { | ||
if (isArray(value)) { | ||
var indexKey = Number.parseInt(_key3.toString(), 10); | ||
var indexKey = Number.parseInt(key.toString(), 10); | ||
@@ -873,3 +874,3 @@ if (isNumber(indexKey)) { | ||
} else { | ||
Reflect.deleteProperty(value, _key3); | ||
Reflect.deleteProperty(value, key); | ||
} | ||
@@ -885,3 +886,3 @@ | ||
_item2 = isArray(_item2) ? [..._item2] : _objectSpread({}, _item2); | ||
value[_key3] = _item2; | ||
value[key] = _item2; | ||
value = _item2; | ||
@@ -991,4 +992,4 @@ } | ||
function within(value) { | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) { | ||
rest[_key4 - 1] = arguments[_key4]; | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
rest[_key3 - 1] = arguments[_key3]; | ||
} | ||
@@ -1026,2 +1027,5 @@ | ||
return value; | ||
} | ||
function cx() { | ||
return uniqueArray(core.cx(...arguments).split(' ')).join(' '); | ||
} // The following are forward exports for other libraries. I've structured it | ||
@@ -1204,3 +1208,3 @@ | ||
set: (_, prop) => { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
message: "It seems you're trying to set the value of the property (".concat(String(prop), ") on a frozen object. For your protection this object does not allow direct mutation."), | ||
@@ -1294,2 +1298,3 @@ code: coreConstants.ErrorConstant.MUTATION | ||
exports.clone = clone; | ||
exports.cx = cx; | ||
exports.deepMerge = deepMerge; | ||
@@ -1296,0 +1301,0 @@ exports.entries = entries; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var _defineProperty = require('@babel/runtime/helpers/defineProperty'); | ||
var core = require('@linaria/core'); | ||
var deepmerge = require('deepmerge'); | ||
@@ -189,3 +190,3 @@ var fastDeepEqual = require('fast-deep-equal'); | ||
var isUndefined = /*#__PURE__*/isOfType('undefined'); | ||
var isUndefined = isOfType('undefined'); | ||
/** | ||
@@ -198,3 +199,3 @@ * Predicate check that value is a string | ||
var isString = /*#__PURE__*/isOfType('string'); | ||
var isString = isOfType('string'); | ||
/** | ||
@@ -209,3 +210,3 @@ * Predicate check that value is a number. | ||
var isNumber = /*#__PURE__*/isOfType('number', value => { | ||
var isNumber = isOfType('number', value => { | ||
return !Number.isNaN(value); | ||
@@ -220,3 +221,3 @@ }); | ||
var isFunction = /*#__PURE__*/isOfType('function'); | ||
var isFunction = isOfType('function'); | ||
/** | ||
@@ -261,3 +262,3 @@ * Predicate check that value is null | ||
var isSymbol = /*#__PURE__*/isOfType('symbol'); | ||
var isSymbol = isOfType('symbol'); | ||
/** | ||
@@ -371,3 +372,3 @@ * Helper function for Number.isInteger check allowing non numbers to be tested | ||
var isRegExp = /*#__PURE__*/isObjectOfType(TypeName.RegExp); | ||
var isRegExp = isObjectOfType(TypeName.RegExp); | ||
/** | ||
@@ -380,3 +381,3 @@ * Predicate check that value is a date | ||
var isDate = /*#__PURE__*/isObjectOfType(TypeName.Date); | ||
var isDate = isObjectOfType(TypeName.Date); | ||
/** | ||
@@ -389,3 +390,3 @@ * Predicate check that value is an error | ||
var isError = /*#__PURE__*/isObjectOfType(TypeName.Error); | ||
var isError = isObjectOfType(TypeName.Error); | ||
/** | ||
@@ -776,3 +777,3 @@ * Predicate check that value is a `Map` | ||
index | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map((_ref2) => { | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map(_ref2 => { | ||
var value = _ref2.value; | ||
@@ -859,10 +860,10 @@ return value; | ||
index = _step2$value[0], | ||
_key3 = _step2$value[1]; | ||
key = _step2$value[1]; | ||
var shouldDelete = index >= path.length - 1; | ||
var _item2 = value[_key3]; | ||
var _item2 = value[key]; | ||
if (shouldDelete) { | ||
if (isArray(value)) { | ||
var indexKey = Number.parseInt(_key3.toString(), 10); | ||
var indexKey = Number.parseInt(key.toString(), 10); | ||
@@ -873,3 +874,3 @@ if (isNumber(indexKey)) { | ||
} else { | ||
Reflect.deleteProperty(value, _key3); | ||
Reflect.deleteProperty(value, key); | ||
} | ||
@@ -885,3 +886,3 @@ | ||
_item2 = isArray(_item2) ? [..._item2] : _objectSpread({}, _item2); | ||
value[_key3] = _item2; | ||
value[key] = _item2; | ||
value = _item2; | ||
@@ -991,4 +992,4 @@ } | ||
function within(value) { | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) { | ||
rest[_key4 - 1] = arguments[_key4]; | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
rest[_key3 - 1] = arguments[_key3]; | ||
} | ||
@@ -1026,2 +1027,5 @@ | ||
return value; | ||
} | ||
function cx() { | ||
return uniqueArray(core.cx(...arguments).split(' ')).join(' '); | ||
} // The following are forward exports for other libraries. I've structured it | ||
@@ -1231,2 +1235,3 @@ | ||
exports.clone = clone; | ||
exports.cx = cx; | ||
exports.deepMerge = deepMerge; | ||
@@ -1233,0 +1238,0 @@ exports.entries = entries; |
@@ -7,2 +7,3 @@ import { BaseError } from 'make-error'; | ||
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import { cx as cx$1 } from '@linaria/core'; | ||
import deepmerge from 'deepmerge'; | ||
@@ -179,3 +180,3 @@ import fastDeepEqual from 'fast-deep-equal'; | ||
var isUndefined = /*#__PURE__*/isOfType('undefined'); | ||
var isUndefined = isOfType('undefined'); | ||
/** | ||
@@ -188,3 +189,3 @@ * Predicate check that value is a string | ||
var isString = /*#__PURE__*/isOfType('string'); | ||
var isString = isOfType('string'); | ||
/** | ||
@@ -199,3 +200,3 @@ * Predicate check that value is a number. | ||
var isNumber = /*#__PURE__*/isOfType('number', value => { | ||
var isNumber = isOfType('number', value => { | ||
return !Number.isNaN(value); | ||
@@ -210,3 +211,3 @@ }); | ||
var isFunction = /*#__PURE__*/isOfType('function'); | ||
var isFunction = isOfType('function'); | ||
/** | ||
@@ -251,3 +252,3 @@ * Predicate check that value is null | ||
var isSymbol = /*#__PURE__*/isOfType('symbol'); | ||
var isSymbol = isOfType('symbol'); | ||
/** | ||
@@ -361,3 +362,3 @@ * Helper function for Number.isInteger check allowing non numbers to be tested | ||
var isRegExp = /*#__PURE__*/isObjectOfType(TypeName.RegExp); | ||
var isRegExp = isObjectOfType(TypeName.RegExp); | ||
/** | ||
@@ -370,3 +371,3 @@ * Predicate check that value is a date | ||
var isDate = /*#__PURE__*/isObjectOfType(TypeName.Date); | ||
var isDate = isObjectOfType(TypeName.Date); | ||
/** | ||
@@ -379,3 +380,3 @@ * Predicate check that value is an error | ||
var isError = /*#__PURE__*/isObjectOfType(TypeName.Error); | ||
var isError = isObjectOfType(TypeName.Error); | ||
/** | ||
@@ -766,3 +767,3 @@ * Predicate check that value is a `Map` | ||
index | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map((_ref2) => { | ||
})).sort((a, z) => compareFn(a.value, z.value) || a.index - z.index).map(_ref2 => { | ||
var value = _ref2.value; | ||
@@ -849,10 +850,10 @@ return value; | ||
index = _step2$value[0], | ||
_key3 = _step2$value[1]; | ||
key = _step2$value[1]; | ||
var shouldDelete = index >= path.length - 1; | ||
var _item2 = value[_key3]; | ||
var _item2 = value[key]; | ||
if (shouldDelete) { | ||
if (isArray(value)) { | ||
var indexKey = Number.parseInt(_key3.toString(), 10); | ||
var indexKey = Number.parseInt(key.toString(), 10); | ||
@@ -863,3 +864,3 @@ if (isNumber(indexKey)) { | ||
} else { | ||
Reflect.deleteProperty(value, _key3); | ||
Reflect.deleteProperty(value, key); | ||
} | ||
@@ -875,3 +876,3 @@ | ||
_item2 = isArray(_item2) ? [..._item2] : _objectSpread({}, _item2); | ||
value[_key3] = _item2; | ||
value[key] = _item2; | ||
value = _item2; | ||
@@ -981,4 +982,4 @@ } | ||
function within(value) { | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) { | ||
rest[_key4 - 1] = arguments[_key4]; | ||
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
rest[_key3 - 1] = arguments[_key3]; | ||
} | ||
@@ -1016,2 +1017,5 @@ | ||
return value; | ||
} | ||
function cx() { | ||
return uniqueArray(cx$1(...arguments).split(' ')).join(' '); | ||
} // The following are forward exports for other libraries. I've structured it | ||
@@ -1194,3 +1198,3 @@ | ||
set: (_, prop) => { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
process.env.NODE_ENV !== "production" ? invariant(false, { | ||
message: "It seems you're trying to set the value of the property (".concat(String(prop), ") on a frozen object. For your protection this object does not allow direct mutation."), | ||
@@ -1203,2 +1207,2 @@ code: ErrorConstant.MUTATION | ||
export { Cast, RemirrorError, assert, assertGet, callIfDefined, capitalize, clamp, cleanupOS, clone, deepMerge, entries, findMatches, flattenArray, format, freeze, get, getLazyArray, hasOwnProperty, includes, invariant, isAndroidOS, isArray, isBoolean, isClass, isDate, isDirectInstanceOf, isEmptyArray, isEmptyObject, isEqual, isError, isFunction, isInstanceOf, isInteger, isMap, isNativePromise, isNonEmptyArray, isNull, isNullOrUndefined, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isUndefined, keys, last, noop, object, omitUndefined, randomFloat, randomInt, range, set, shallowClone, sort, startCase, take, toString, uniqueArray, uniqueBy, uniqueId, unset, values, within }; | ||
export { Cast, RemirrorError, assert, assertGet, callIfDefined, capitalize, clamp, cleanupOS, clone, cx, deepMerge, entries, findMatches, flattenArray, format, freeze, get, getLazyArray, hasOwnProperty, includes, invariant, isAndroidOS, isArray, isBoolean, isClass, isDate, isDirectInstanceOf, isEmptyArray, isEmptyObject, isEqual, isError, isFunction, isInstanceOf, isInteger, isMap, isNativePromise, isNonEmptyArray, isNull, isNullOrUndefined, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSafeInteger, isSet, isString, isSymbol, isUndefined, keys, last, noop, object, omitUndefined, randomFloat, randomInt, range, set, shallowClone, sort, startCase, take, toString, uniqueArray, uniqueBy, uniqueId, unset, values, within }; |
{ | ||
"name": "@remirror/core-helpers", | ||
"version": "1.0.0-pr706.d0b3ea524", | ||
"version": "1.0.0", | ||
"description": "Provide helper functions for the remirror codebase, kinda like a tiny lodash", | ||
@@ -34,8 +34,10 @@ "homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__core-helpers", | ||
"dependencies": { | ||
"@babel/runtime": "^7.12.13", | ||
"@remirror/core-constants": "1.0.0-pr706.d0b3ea524", | ||
"@babel/runtime": "^7.13.10", | ||
"@linaria/core": "3.0.0-beta.4", | ||
"@remirror/core-constants": "1.0.0", | ||
"@remirror/types": "0.1.0", | ||
"@types/object.omit": "^3.0.0", | ||
"@types/object.pick": "^1.3.0", | ||
"@types/object.pick": "^1.3.1", | ||
"@types/throttle-debounce": "^2.1.0", | ||
"case-anything": "^1.1.2", | ||
"case-anything": "^1.1.3", | ||
"dash-get": "^1.0.2", | ||
@@ -47,4 +49,3 @@ "deepmerge": "^4.2.2", | ||
"object.pick": "^1.3.0", | ||
"throttle-debounce": "^3.0.1", | ||
"type-fest": "^0.20.2" | ||
"throttle-debounce": "^3.0.1" | ||
}, | ||
@@ -51,0 +52,0 @@ "publishConfig": { |
@@ -7,4 +7,4 @@ # @remirror/core-helpers | ||
[version]: https://flat.badgen.net/npm/v/@remirror/core-helpers/next | ||
[npm]: https://npmjs.com/package/@remirror/core-helpers/v/next | ||
[version]: https://flat.badgen.net/npm/v/@remirror/core-helpers | ||
[npm]: https://npmjs.com/package/@remirror/core-helpers | ||
[license]: https://flat.badgen.net/badge/license/MIT/purple | ||
@@ -11,0 +11,0 @@ [size]: https://bundlephobia.com/result?p=@remirror/core-helpers |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6128
0
0
196387
15
14
+ Added@linaria/core@3.0.0-beta.4
+ Added@remirror/types@0.1.0
+ Added@linaria/core@3.0.0-beta.4(transitive)
+ Added@remirror/core-constants@1.0.0(transitive)
+ Added@remirror/types@0.1.0(transitive)
+ Addedtype-fest@1.4.0(transitive)
- Removedtype-fest@^0.20.2
- Removed@linaria/core@3.0.0-beta.22(transitive)
- Removed@linaria/logger@3.0.0-beta.20(transitive)
- Removed@linaria/utils@3.0.0-beta.20(transitive)
- Removed@remirror/core-constants@1.0.0-pr706.d0b3ea524(transitive)
- Removeddebug@4.4.0(transitive)
- Removedms@2.1.3(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedtype-fest@0.20.2(transitive)
Updated@babel/runtime@^7.13.10
Updated@types/object.pick@^1.3.1
Updatedcase-anything@^1.1.3