@stryke/helpers 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.deepClone = deepClone;
7
- var _isPrimitive = require("@stryke/types/type-checks/is-primitive");
8
- var _isTypedArray = require("@stryke/types/type-checks/is-typed-array");
7
+ var _isPrimitive = require("@stryke/type-checks/is-primitive");
8
+ var _isTypedArray = require("@stryke/type-checks/is-typed-array");
9
9
  function deepClone(e) {
10
10
  if ((0, _isPrimitive.isPrimitive)(e)) return e;
11
11
  if (Array.isArray(e)) return e.map(n => deepClone(n));
@@ -13,7 +13,7 @@ type IsTuple<T extends readonly any[] | {
13
13
  type ValueOf<Instance> = IsValueOf<Instance, boolean> extends true ? boolean : IsValueOf<Instance, number> extends true ? number : IsValueOf<Instance, string> extends true ? string : Instance;
14
14
  type IsValueOf<Instance, O extends IValueOf<any>> = Instance extends O ? O extends IValueOf<infer Primitive> ? Instance extends Primitive ? false : true : false : false;
15
15
  interface IValueOf<T> {
16
- valueOf(): T;
16
+ valueOf: () => T;
17
17
  }
18
18
  /**
19
19
  * Creates a deep clone of the given object.
@@ -1 +1 @@
1
- import{isPrimitive as l}from"@stryke/types/type-checks/is-primitive";import{isTypedArray as i}from"@stryke/types/type-checks/is-typed-array";export function deepClone(e){if(l(e))return e;if(Array.isArray(e))return e.map(n=>deepClone(n));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){const n=new Map;for(const[t,s]of e.entries())n.set(t,deepClone(s));return n}if(e instanceof Set){const n=new Set;for(const t of e.values())n.add(deepClone(t));return n}if(i(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);for(const[t,s]of e.entries())n[t]=deepClone(s);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return[...e];if(e instanceof DataView){const n=new DataView([...e.buffer]);return r(e,n),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return r(e,n),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return r(e,n),n}if(e instanceof Error){const n=new e.constructor;return n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,r(e,n),n}if(typeof e=="object"&&e!==null){const n={};return r(e,n),n}return e}function r(e,n){const t=Object.keys(e);for(const s of t){const a=Object.getOwnPropertyDescriptor(e,s);(a?.writable||a?.set)&&(n[s]=deepClone(e[s]))}}
1
+ import{isPrimitive as l}from"@stryke/type-checks/is-primitive";import{isTypedArray as i}from"@stryke/type-checks/is-typed-array";export function deepClone(e){if(l(e))return e;if(Array.isArray(e))return e.map(n=>deepClone(n));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){const n=new Map;for(const[t,s]of e.entries())n.set(t,deepClone(s));return n}if(e instanceof Set){const n=new Set;for(const t of e.values())n.add(deepClone(t));return n}if(i(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);for(const[t,s]of e.entries())n[t]=deepClone(s);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return[...e];if(e instanceof DataView){const n=new DataView([...e.buffer]);return r(e,n),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return r(e,n),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return r(e,n),n}if(e instanceof Error){const n=new e.constructor;return n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,r(e,n),n}if(typeof e=="object"&&e!==null){const n={};return r(e,n),n}return e}function r(e,n){const t=Object.keys(e);for(const s of t){const a=Object.getOwnPropertyDescriptor(e,s);(a?.writable||a?.set)&&(n[s]=deepClone(e[s]))}}
@@ -58,17 +58,17 @@ function e(r) {
58
58
  if (!n) throw new Error("Unsupported typed array type in `cloneTypedArray`.");
59
59
  return new n(t).subarray(r.byteOffset, r.byteOffset + r.length);
60
60
  }
61
- function b(r, t, n, o, y) {
61
+ function f(r, t, n, o, y) {
62
62
  const a = detectType(r),
63
63
  i = copy(r, a);
64
64
  if (!isCollection(a)) return i;
65
- const f = getKeys(r, a);
66
- for (const s of f) {
65
+ const b = getKeys(r, a);
66
+ for (const s of b) {
67
67
  const c = getValue(r, s, a);
68
68
  if (o.has(c)) setValue(t, s, n.get(c), a);else {
69
69
  const p = detectType(c),
70
70
  l = copy(c, p);
71
- isCollection(p) && (n.set(c, l), o.add(c)), setValue(t, s, b(c, l, n, o, y), a);
71
+ isCollection(p) && (n.set(c, l), o.add(c)), setValue(t, s, f(c, l, n, o, y), a);
72
72
  }
73
73
  }
74
74
  return t;
@@ -82,5 +82,5 @@ function deepCopy(r, t) {
82
82
  const y = copy(r, o, n),
83
83
  a = new WeakMap([[r, y]]),
84
84
  i = new WeakSet([r]);
85
- return b(r, y, a, i, n);
85
+ return f(r, y, a, i, n);
86
86
  }
@@ -1,6 +1,6 @@
1
- export type Options = {
1
+ export interface Options {
2
2
  customizer?: Customizer;
3
- };
3
+ }
4
4
  /**
5
5
  * Deep copy value
6
6
  *
@@ -1 +1 @@
1
- function A(r){const t=new ArrayBuffer(r.byteLength);return new Uint8Array(t).set(new Uint8Array(r)),t}function C(r){const t=A(r.buffer);return new DataView(t,r.byteOffset,r.byteLength)}function g(r){return new Date(r.getTime())}function d(r){const t=new Map;for(const[n,o]of r.entries())t.set(deepCopy(n),deepCopy(o));return t}const u={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},j={"[object Date]":g,"[object ArrayBuffer]":A,"[object DataView]":C,"[object Float32Array]":e,"[object Float64Array]":e,"[object Int8Array]":e,"[object Int16Array]":e,"[object Int32Array]":e,"[object Uint8Array]":e,"[object Uint8ClampedArray]":e,"[object Uint16Array]":e,"[object Uint32Array]":e,"[object BigInt64Array]":e,"[object BigUint64Array]":e,"[object RegExp]":cloneRegExp,"[object Map]":d};function e(r){try{u["[object BigInt64Array]"]=BigInt64Array,u["[object BigUint64Array]"]=BigUint64Array}catch{}const t=A(r.buffer),n=u[Object.prototype.toString.call(r)];if(!n)throw new Error("Unsupported typed array type in `cloneTypedArray`.");return new n(t).subarray(r.byteOffset,r.byteOffset+r.length)}function b(r,t,n,o,y){const a=detectType(r),i=copy(r,a);if(!isCollection(a))return i;const f=getKeys(r,a);for(const s of f){const c=getValue(r,s,a);if(o.has(c))setValue(t,s,n.get(c),a);else{const p=detectType(c),l=copy(c,p);isCollection(p)&&(n.set(c,l),o.add(c)),setValue(t,s,b(c,l,n,o,y),a)}}return t}export function deepCopy(r,t){const{customizer:n=null}=t??{},o=detectType(r);if(!isCollection(o))return copy(r,o,n);const y=copy(r,o,n),a=new WeakMap([[r,y]]),i=new WeakSet([r]);return b(r,y,a,i,n)}
1
+ function A(r){const t=new ArrayBuffer(r.byteLength);return new Uint8Array(t).set(new Uint8Array(r)),t}function C(r){const t=A(r.buffer);return new DataView(t,r.byteOffset,r.byteLength)}function g(r){return new Date(r.getTime())}function d(r){const t=new Map;for(const[n,o]of r.entries())t.set(deepCopy(n),deepCopy(o));return t}const u={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},j={"[object Date]":g,"[object ArrayBuffer]":A,"[object DataView]":C,"[object Float32Array]":e,"[object Float64Array]":e,"[object Int8Array]":e,"[object Int16Array]":e,"[object Int32Array]":e,"[object Uint8Array]":e,"[object Uint8ClampedArray]":e,"[object Uint16Array]":e,"[object Uint32Array]":e,"[object BigInt64Array]":e,"[object BigUint64Array]":e,"[object RegExp]":cloneRegExp,"[object Map]":d};function e(r){try{u["[object BigInt64Array]"]=BigInt64Array,u["[object BigUint64Array]"]=BigUint64Array}catch{}const t=A(r.buffer),n=u[Object.prototype.toString.call(r)];if(!n)throw new Error("Unsupported typed array type in `cloneTypedArray`.");return new n(t).subarray(r.byteOffset,r.byteOffset+r.length)}function f(r,t,n,o,y){const a=detectType(r),i=copy(r,a);if(!isCollection(a))return i;const b=getKeys(r,a);for(const s of b){const c=getValue(r,s,a);if(o.has(c))setValue(t,s,n.get(c),a);else{const p=detectType(c),l=copy(c,p);isCollection(p)&&(n.set(c,l),o.add(c)),setValue(t,s,f(c,l,n,o,y),a)}}return t}export function deepCopy(r,t){const{customizer:n=null}=t??{},o=detectType(r);if(!isCollection(o))return copy(r,o,n);const y=copy(r,o,n),a=new WeakMap([[r,y]]),i=new WeakSet([r]);return f(r,y,a,i,n)}
@@ -4,26 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.deepMerge = void 0;
7
- var _types = require("@stryke/types");
7
+ var _isFunction = require("@stryke/type-checks/is-function");
8
+ var _isMergeableObject = require("@stryke/type-checks/is-mergeable-object");
9
+ var _propertyExists = require("@stryke/type-checks/property-exists");
8
10
  const b = e => Array.isArray(e) ? [] : {},
9
11
  s = (e, r) => r.clone !== !1 && r.isMergeableObject(e) ? deepMerge(b(e), e, r) : e,
10
- l = (e, r, n) => [...e, ...r].map(t => s(t, n)),
11
- f = (e, r) => {
12
+ f = (e, r, n) => [...e, ...r].map(t => s(t, n)),
13
+ l = (e, r) => {
12
14
  if (!r.customMerge) return deepMerge;
13
15
  const n = r.customMerge(e);
14
- return (0, _types.isFunction)(n) ? n : deepMerge;
16
+ return (0, _isFunction.isFunction)(n) ? n : deepMerge;
15
17
  },
16
18
  y = e => [...Object.keys(e), ...(Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(r => Object.propertyIsEnumerable.call(e, r)) : [])],
17
19
  u = (e, r, n) => {
18
20
  const t = {};
19
21
  if (n.isMergeableObject(e)) for (const a of y(e)) t[a] = s(e[a], n);
20
- for (const a of y(r)) t[a] = (0, _types.propertyUnsafe)(e, a) && n.isMergeableObject(r[a]) ? f(a, n)(e[a], r[a], n) : s(r[a], n);
22
+ for (const a of y(r)) t[a] = (0, _propertyExists.propertyUnsafe)(e, a) && n.isMergeableObject(r[a]) ? l(a, n)(e[a], r[a], n) : s(r[a], n);
21
23
  return t;
22
24
  };
23
25
  const deepMerge = (e, r, n = {}) => {
24
26
  if (!e || !r) return e || r;
25
27
  const t = n || {};
26
- t.arrayMerge = n.arrayMerge || l, t.isMergeableObject = t.isMergeableObject || _types.isMergeableObject, t.cloneUnlessOtherwiseSpecified = s;
28
+ t.arrayMerge = n.arrayMerge || f, t.isMergeableObject = t.isMergeableObject || _isMergeableObject.isMergeableObject, t.cloneUnlessOtherwiseSpecified = s;
27
29
  const a = Array.isArray(r),
28
30
  c = Array.isArray(e);
29
31
  return a === c ? a ? t.arrayMerge(e, r, t) : u(e, r, t) : s(r, t);
@@ -1 +1 @@
1
- import{isFunction as i,isMergeableObject as o,propertyUnsafe as g}from"@stryke/types";const b=e=>Array.isArray(e)?[]:{},s=(e,r)=>r.clone!==!1&&r.isMergeableObject(e)?deepMerge(b(e),e,r):e,l=(e,r,n)=>[...e,...r].map(t=>s(t,n)),f=(e,r)=>{if(!r.customMerge)return deepMerge;const n=r.customMerge(e);return i(n)?n:deepMerge},y=e=>[...Object.keys(e),...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(r=>Object.propertyIsEnumerable.call(e,r)):[]],u=(e,r,n)=>{const t={};if(n.isMergeableObject(e))for(const a of y(e))t[a]=s(e[a],n);for(const a of y(r))t[a]=g(e,a)&&n.isMergeableObject(r[a])?f(a,n)(e[a],r[a],n):s(r[a],n);return t};export const deepMerge=(e,r,n={})=>{if(!e||!r)return e||r;const t=n||{};t.arrayMerge=n.arrayMerge||l,t.isMergeableObject=t.isMergeableObject||o,t.cloneUnlessOtherwiseSpecified=s;const a=Array.isArray(r),c=Array.isArray(e);return a===c?a?t.arrayMerge(e,r,t):u(e,r,t):s(r,t)};deepMerge.all=function(r,n){if(!Array.isArray(r))throw new TypeError("first argument should be an array");return r.reduce((t,a)=>deepMerge(t,a,n),{})};
1
+ import{isFunction as i}from"@stryke/type-checks/is-function";import{isMergeableObject as o}from"@stryke/type-checks/is-mergeable-object";import{propertyUnsafe as g}from"@stryke/type-checks/property-exists";const b=e=>Array.isArray(e)?[]:{},s=(e,r)=>r.clone!==!1&&r.isMergeableObject(e)?deepMerge(b(e),e,r):e,f=(e,r,n)=>[...e,...r].map(t=>s(t,n)),l=(e,r)=>{if(!r.customMerge)return deepMerge;const n=r.customMerge(e);return i(n)?n:deepMerge},y=e=>[...Object.keys(e),...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(r=>Object.propertyIsEnumerable.call(e,r)):[]],u=(e,r,n)=>{const t={};if(n.isMergeableObject(e))for(const a of y(e))t[a]=s(e[a],n);for(const a of y(r))t[a]=g(e,a)&&n.isMergeableObject(r[a])?l(a,n)(e[a],r[a],n):s(r[a],n);return t};export const deepMerge=(e,r,n={})=>{if(!e||!r)return e||r;const t=n||{};t.arrayMerge=n.arrayMerge||f,t.isMergeableObject=t.isMergeableObject||o,t.cloneUnlessOtherwiseSpecified=s;const a=Array.isArray(r),c=Array.isArray(e);return a===c?a?t.arrayMerge(e,r,t):u(e,r,t):s(r,t)};deepMerge.all=function(r,n){if(!Array.isArray(r))throw new TypeError("first argument should be an array");return r.reduce((t,a)=>deepMerge(t,a,n),{})};
package/dist/delay.cjs CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.delay = delay;
7
7
  exports.sleep = sleep;
8
8
  var _errors = require("./errors.cjs");
9
- function delay(r, {
9
+ async function delay(r, {
10
10
  signal: e
11
11
  } = {}) {
12
12
  return new Promise((t, n) => {
@@ -23,6 +23,6 @@ function delay(r, {
23
23
  });
24
24
  });
25
25
  }
26
- function sleep(r, e) {
26
+ async function sleep(r, e) {
27
27
  return delay(r, e);
28
28
  }
package/dist/delay.mjs CHANGED
@@ -1 +1 @@
1
- import{AbortError as s}from"./errors";export function delay(r,{signal:e}={}){return new Promise((t,n)=>{const o=()=>{n(new s)},i=()=>{clearTimeout(a),o()};if(e?.aborted)return o();const a=setTimeout(t,r);e?.addEventListener("abort",i,{once:!0})})}export function sleep(r,e){return delay(r,e)}
1
+ import{AbortError as s}from"./errors";export async function delay(r,{signal:e}={}){return new Promise((t,n)=>{const o=()=>{n(new s)},i=()=>{clearTimeout(a),o()};if(e?.aborted)return o();const a=setTimeout(t,r);e?.addEventListener("abort",i,{once:!0})})}export async function sleep(r,e){return delay(r,e)}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.filterEmpty = void 0;
7
+ var _isEmpty = require("@stryke/type-checks/is-empty");
8
+ const filterEmpty = (t = []) => t.filter(e => !(0, _isEmpty.isEmpty)(e));
9
+ exports.filterEmpty = filterEmpty;
@@ -0,0 +1 @@
1
+ export declare const filterEmpty: <T>(values?: (T | null | undefined)[]) => T[];
@@ -0,0 +1 @@
1
+ import{isEmpty as i}from"@stryke/type-checks/is-empty";export const filterEmpty=(t=[])=>t.filter(e=>!i(e));
@@ -4,17 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.flattenObject = flattenObject;
7
- var _types = require("@stryke/types");
7
+ var _isPlainObject = require("@stryke/type-checks/is-plain-object");
8
8
  function flattenObject(t) {
9
9
  return T(t);
10
10
  }
11
11
  function T(t, s = "") {
12
- const n = {},
13
- O = Object.keys(t);
14
- for (const c of O) {
15
- const e = t[c],
16
- y = s ? `${s}.${c}` : c;
17
- if ((0, _types.isPlainObject)(e) && Object.keys(e).length > 0) Object.assign(n, T(e, y));else if (Array.isArray(e)) for (const [a, b] of e.entries()) n[`${y}.${a}`] = b;else n[y] = e;
12
+ const c = {},
13
+ b = Object.keys(t);
14
+ for (const n of b) {
15
+ const e = t[n],
16
+ y = s ? `${s}.${n}` : n;
17
+ if ((0, _isPlainObject.isPlainObject)(e) && Object.keys(e).length > 0) Object.assign(c, T(e, y));else if (Array.isArray(e)) for (const [j, O] of e.entries()) c[`${y}.${j}`] = O;else c[y] = e;
18
18
  }
19
- return n;
19
+ return c;
20
20
  }
@@ -1,4 +1,4 @@
1
- import { type DeepKey, type DeepValue } from "@stryke/types";
1
+ import type { DeepKey, DeepValue } from "@stryke/types/object";
2
2
  /**
3
3
  * Flattens a nested object into a single level object with dot-separated keys.
4
4
  *
@@ -1 +1 @@
1
- import{isPlainObject as j}from"@stryke/types";export function flattenObject(t){return T(t)}function T(t,s=""){const n={},O=Object.keys(t);for(const c of O){const e=t[c],y=s?`${s}.${c}`:c;if(j(e)&&Object.keys(e).length>0)Object.assign(n,T(e,y));else if(Array.isArray(e))for(const[a,b]of e.entries())n[`${y}.${a}`]=b;else n[y]=e}return n}
1
+ import{isPlainObject as a}from"@stryke/type-checks/is-plain-object";export function flattenObject(t){return T(t)}function T(t,s=""){const c={},b=Object.keys(t);for(const n of b){const e=t[n],y=s?`${s}.${n}`:n;if(a(e)&&Object.keys(e).length>0)Object.assign(c,T(e,y));else if(Array.isArray(e))for(const[j,O]of e.entries())c[`${y}.${j}`]=O;else c[y]=e}return c}
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getField = getField;
7
- var _types = require("@stryke/types");
7
+ var _toStringKey = require("@stryke/convert/to-string-key");
8
+ var _isDeepKey = require("@stryke/type-checks/is-deep-key");
9
+ var _isNumber = require("@stryke/type-checks/is-number");
8
10
  var _toPath = require("./to-path.cjs");
9
11
  function getField(t, e, d) {
10
12
  if (t === null) return d;
@@ -12,12 +14,12 @@ function getField(t, e, d) {
12
14
  case "string":
13
15
  {
14
16
  const n = t[e];
15
- return n === void 0 ? (0, _types.isDeepKey)(e) ? getField(t, (0, _toPath.toPath)(e), d) : d : n;
17
+ return n === void 0 ? (0, _isDeepKey.isDeepKey)(e) ? getField(t, (0, _toPath.toPath)(e), d) : d : n;
16
18
  }
17
19
  case "number":
18
20
  case "symbol":
19
21
  {
20
- (0, _types.isNumber)(e) && (e = (0, _types.toStringKey)(e));
22
+ (0, _isNumber.isNumber)(e) && (e = (0, _toStringKey.toStringKey)(e));
21
23
  const n = Array.isArray(e) ? void 0 : t[e];
22
24
  return n === void 0 ? d : n;
23
25
  }
@@ -1 +1 @@
1
- import{isDeepKey as o,isNumber as K,toStringKey as f}from"@stryke/types";import{toPath as r}from"./to-path";export function getField(t,e,d){if(t===null)return d;switch(typeof e){case"string":{const n=t[e];return n===void 0?o(e)?getField(t,r(e),d):d:n}case"number":case"symbol":{K(e)&&(e=f(e));const n=Array.isArray(e)?void 0:t[e];return n===void 0?d:n}default:{if(Array.isArray(e))return u(t,e,d);e=Object.is(e?.valueOf(),-0)?"-0":String(e);const n=t[e];return n===void 0?d:n}}}function u(t,e,d){if(e.length===0)return d;let n=t;for(const i of e){if(n===null)return d;n=n[i]}return n===void 0?d:n}
1
+ import{toStringKey as o}from"@stryke/convert/to-string-key";import{isDeepKey as K}from"@stryke/type-checks/is-deep-key";import{isNumber as f}from"@stryke/type-checks/is-number";import{toPath as r}from"./to-path";export function getField(t,e,d){if(t===null)return d;switch(typeof e){case"string":{const n=t[e];return n===void 0?K(e)?getField(t,r(e),d):d:n}case"number":case"symbol":{f(e)&&(e=o(e));const n=Array.isArray(e)?void 0:t[e];return n===void 0?d:n}default:{if(Array.isArray(e))return u(t,e,d);e=Object.is(e?.valueOf(),-0)?"-0":String(e);const n=t[e];return n===void 0?d:n}}}function u(t,e,d){if(e.length===0)return d;let n=t;for(const i of e){if(n===null)return d;n=n[i]}return n===void 0?d:n}
@@ -8,7 +8,6 @@
8
8
  * identity({ key: 'value' }); // Returns { key: 'value' }
9
9
  * ```
10
10
  *
11
- * @template T - The type of the input value.
12
11
  * @param x - The value to be returned.
13
12
  * @returns The input value.
14
13
  */
package/dist/index.cjs CHANGED
@@ -69,6 +69,17 @@ Object.keys(_delay).forEach(function (key) {
69
69
  }
70
70
  });
71
71
  });
72
+ var _filterEmpty = require("./filter-empty.cjs");
73
+ Object.keys(_filterEmpty).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _filterEmpty[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _filterEmpty[key];
80
+ }
81
+ });
82
+ });
72
83
  var _flattenObject = require("./flatten-object.cjs");
73
84
  Object.keys(_flattenObject).forEach(function (key) {
74
85
  if (key === "default" || key === "__esModule") return;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from "./deep-clone";
4
4
  export * from "./deep-copy";
5
5
  export * from "./deep-merge";
6
6
  export * from "./delay";
7
+ export * from "./filter-empty";
7
8
  export * from "./flatten-object";
8
9
  export * from "./get-field";
9
10
  export * from "./get-ordered-by";
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-copy";export*from"./deep-merge";export*from"./delay";export*from"./flatten-object";export*from"./get-field";export*from"./get-ordered-by";export*from"./get-unique";export*from"./identity";export*from"./is-equal";export*from"./match-sorter";export*from"./noop";export*from"./remove-accents";export*from"./remove-empty-items";export*from"./set-field";export*from"./throttle";export*from"./timeout";export*from"./to-deep-key";export*from"./to-path";export*from"./unflatten-object";export*from"./union";export*from"./with-timeout";
1
+ export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-copy";export*from"./deep-merge";export*from"./delay";export*from"./filter-empty";export*from"./flatten-object";export*from"./get-field";export*from"./get-ordered-by";export*from"./get-unique";export*from"./identity";export*from"./is-equal";export*from"./match-sorter";export*from"./noop";export*from"./remove-accents";export*from"./remove-empty-items";export*from"./set-field";export*from"./throttle";export*from"./timeout";export*from"./to-deep-key";export*from"./to-path";export*from"./unflatten-object";export*from"./union";export*from"./with-timeout";
package/dist/is-equal.cjs CHANGED
@@ -4,55 +4,56 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isEqual = isEqual;
7
- var _types = require("@stryke/types");
7
+ var _isSet = require("@stryke/type-checks/is-set");
8
+ var _isSetString = require("@stryke/type-checks/is-set-string");
8
9
  const l = typeof Map == "function",
9
10
  a = typeof Set == "function",
10
11
  c = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
11
- function o(e, t) {
12
- if (e === t) return !0;
13
- if (e && t && typeof e == "object" && typeof t == "object") {
14
- if (e.constructor !== t.constructor) return !1;
12
+ function o(e, r) {
13
+ if (e === r) return !0;
14
+ if (e && r && typeof e == "object" && typeof r == "object") {
15
+ if (e.constructor !== r.constructor) return !1;
15
16
  let n;
16
17
  if (Array.isArray(e)) {
17
- if (n = e.length, n != t.length) return !1;
18
- for (let r = n; r-- !== 0;) if (!o(e[r], t[r])) return !1;
18
+ if (n = e.length, n != r.length) return !1;
19
+ for (let t = n; t-- !== 0;) if (!o(e[t], r[t])) return !1;
19
20
  return !0;
20
21
  }
21
22
  let i;
22
- if (l && e instanceof Map && t instanceof Map) {
23
- if (e.size !== t.size) return !1;
23
+ if (l && e instanceof Map && r instanceof Map) {
24
+ if (e.size !== r.size) return !1;
24
25
  i = e.entries();
25
- let r;
26
- for (; !(r = i.next()).done;) if (!t.has(r.value[0])) return !1;
27
- for (i = e.entries(); !(r = i.next()).done;) if (!o(r.value[1], t.get(r.value[0]))) return !1;
26
+ let t;
27
+ for (; !(t = i.next()).done;) if (!r.has(t.value[0])) return !1;
28
+ for (i = e.entries(); !(t = i.next()).done;) if (!o(t.value[1], r.get(t.value[0]))) return !1;
28
29
  return !0;
29
30
  }
30
- if (a && e instanceof Set && t instanceof Set) {
31
- if (e.size !== t.size) return !1;
31
+ if (a && e instanceof Set && r instanceof Set) {
32
+ if (e.size !== r.size) return !1;
32
33
  i = e.entries();
33
- let r;
34
- for (; !(r = i.next()).done;) if (!t.has(r.value[0])) return !1;
34
+ let t;
35
+ for (; !(t = i.next()).done;) if (!r.has(t.value[0])) return !1;
35
36
  return !0;
36
37
  }
37
- if (Array.isArray(e) && Array.isArray(t) && c && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
38
- if (n = e.length, n != t.length) return !1;
39
- for (let r = n; r-- !== 0;) if (e[r] !== t[r]) return !1;
38
+ if (Array.isArray(e) && Array.isArray(r) && c && ArrayBuffer.isView(e) && ArrayBuffer.isView(r)) {
39
+ if (n = e.length, n != r.length) return !1;
40
+ for (let t = n; t-- !== 0;) if (e[t] !== r[t]) return !1;
40
41
  return !0;
41
42
  }
42
- if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
43
- if (e.valueOf !== Object.prototype.valueOf && typeof e.valueOf == "function" && typeof t.valueOf == "function") return e.valueOf() === t.valueOf();
44
- if (e.toString !== Object.prototype.toString && typeof e.toString == "function" && typeof t.toString == "function") return e.toString() === t.toString();
43
+ if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags;
44
+ if (e.valueOf !== Object.prototype.valueOf && typeof e.valueOf == "function" && typeof r.valueOf == "function") return e.valueOf() === r.valueOf();
45
+ if (e.toString !== Object.prototype.toString && typeof e.toString == "function" && typeof r.toString == "function") return e.toString() === r.toString();
45
46
  const f = Object.keys(e);
46
- if (n = f.length, n !== Object.keys(t).length) return !1;
47
- for (let r = n; r-- !== 0;) if (!(0, _types.isSet)(r) || !(0, _types.isSetString)(f[r]) || !Object.prototype.hasOwnProperty.call(t, f[r])) return !1;
48
- for (let r = n; r-- !== 0;) if (!(Array.isArray(f) && (f[r] === "_owner" || f[r] === "__v" || f[r] === "__o") && e.$$typeof) && (!(0, _types.isSet)(r) || !(0, _types.isSetString)(f[r]) || !o(e[f[r]], t[f[r]]))) return !1;
47
+ if (n = f.length, n !== Object.keys(r).length) return !1;
48
+ for (let t = n; t-- !== 0;) if (!(0, _isSet.isSet)(t) || !(0, _isSetString.isSetString)(f[t]) || !Object.prototype.hasOwnProperty.call(r, f[t])) return !1;
49
+ for (let t = n; t-- !== 0;) if (!(Array.isArray(f) && (f[t] === "_owner" || f[t] === "__v" || f[t] === "__o") && e.$$typeof) && (!(0, _isSet.isSet)(t) || !(0, _isSetString.isSetString)(f[t]) || !o(e[f[t]], r[f[t]]))) return !1;
49
50
  return !0;
50
51
  }
51
- return e !== e && t !== t;
52
+ return e !== e && r !== r;
52
53
  }
53
- function isEqual(e, t) {
54
+ function isEqual(e, r) {
54
55
  try {
55
- return o(e, t);
56
+ return o(e, r);
56
57
  } catch (n) {
57
58
  if (/stack|recursion/i.test(n?.message || "")) return console.warn("isEqual cannot handle circular refs"), !1;
58
59
  throw n;
package/dist/is-equal.mjs CHANGED
@@ -1 +1 @@
1
- import{isSet as s,isSetString as u}from"@stryke/types";const l=typeof Map=="function",a=typeof Set=="function",c=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(let r=n;r--!==0;)if(!o(e[r],t[r]))return!1;return!0}let i;if(l&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;i=e.entries();let r;for(;!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!o(r.value[1],t.get(r.value[0])))return!1;return!0}if(a&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;i=e.entries();let r;for(;!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Array.isArray(e)&&Array.isArray(t)&&c&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(let r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(let r=n;r--!==0;)if(!s(r)||!u(f[r])||!Object.prototype.hasOwnProperty.call(t,f[r]))return!1;for(let r=n;r--!==0;)if(!(Array.isArray(f)&&(f[r]==="_owner"||f[r]==="__v"||f[r]==="__o")&&e.$$typeof)&&(!s(r)||!u(f[r])||!o(e[f[r]],t[f[r]])))return!1;return!0}return e!==e&&t!==t}export function isEqual(e,t){try{return o(e,t)}catch(n){if(/stack|recursion/i.test(n?.message||""))return console.warn("isEqual cannot handle circular refs"),!1;throw n}}
1
+ import{isSet as s}from"@stryke/type-checks/is-set";import{isSetString as u}from"@stryke/type-checks/is-set-string";const l=typeof Map=="function",a=typeof Set=="function",c=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;let n;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(let t=n;t--!==0;)if(!o(e[t],r[t]))return!1;return!0}let i;if(l&&e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;i=e.entries();let t;for(;!(t=i.next()).done;)if(!r.has(t.value[0]))return!1;for(i=e.entries();!(t=i.next()).done;)if(!o(t.value[1],r.get(t.value[0])))return!1;return!0}if(a&&e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;i=e.entries();let t;for(;!(t=i.next()).done;)if(!r.has(t.value[0]))return!1;return!0}if(Array.isArray(e)&&Array.isArray(r)&&c&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(let t=n;t--!==0;)if(e[t]!==r[t])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof r.valueOf=="function")return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof r.toString=="function")return e.toString()===r.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(r).length)return!1;for(let t=n;t--!==0;)if(!s(t)||!u(f[t])||!Object.prototype.hasOwnProperty.call(r,f[t]))return!1;for(let t=n;t--!==0;)if(!(Array.isArray(f)&&(f[t]==="_owner"||f[t]==="__v"||f[t]==="__o")&&e.$$typeof)&&(!s(t)||!u(f[t])||!o(e[f[t]],r[f[t]])))return!1;return!0}return e!==e&&r!==r}export function isEqual(e,r){try{return o(e,r)}catch(n){if(/stack|recursion/i.test(n?.message||""))return console.warn("isEqual cannot handle circular refs"),!1;throw n}}
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Forked from match-sorter by Kent C. Dodds
3
3
  */
4
- type KeyAttributes = {
4
+ interface KeyAttributes {
5
5
  threshold?: Ranking;
6
6
  maxRanking: Ranking;
7
7
  minRanking: Ranking;
8
- };
8
+ }
9
9
  interface RankingInfo {
10
10
  rankedValue: string;
11
11
  rank: Ranking;
@@ -74,4 +74,4 @@ declare namespace matchSorter {
74
74
  };
75
75
  }
76
76
  export { defaultBaseSortFn, matchSorter, rankings };
77
- export type { KeyAttributes, KeyAttributesOptions, KeyOption, MatchSorterOptions, RankingInfo, ValueGetterKey, };
77
+ export type { KeyAttributes, KeyAttributesOptions, KeyOption, MatchSorterOptions, RankingInfo, ValueGetterKey };
@@ -4,17 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.setField = setField;
7
- var _types = require("@stryke/types");
7
+ var _isObjectIndex = require("@stryke/type-checks/is-object-index");
8
+ var _isString = require("@stryke/type-checks/is-string");
8
9
  var _toPath = require("./to-path.cjs");
9
- function setField(i, t, s) {
10
- const r = Array.isArray(t) ? t : (0, _types.isString)(t) ? (0, _toPath.toPath)(t) : [t];
11
- for (const e of r) if (e === "__proto__" || e === "constructor" || e === "prototype") throw new Error("Invalid key in path: " + e);
12
- let n = i;
13
- for (let e = 0; e < r.length - 1; e++) {
14
- const o = r[e],
15
- y = r[e + 1];
16
- n[o] === null && (n[o] = (0, _types.isObjectIndex)(y) ? [] : {}), n = n[o];
10
+ function setField(i, e, c) {
11
+ const r = Array.isArray(e) ? e : (0, _isString.isString)(e) ? (0, _toPath.toPath)(e) : [e];
12
+ for (const t of r) if (t === "__proto__" || t === "constructor" || t === "prototype") throw new Error(`Invalid key in path: ${t}`);
13
+ let o = i;
14
+ for (let t = 0; t < r.length - 1; t++) {
15
+ const n = r[t],
16
+ y = r[t + 1];
17
+ o[n] === null && (o[n] = (0, _isObjectIndex.isObjectIndex)(y) ? [] : {}), o = o[n];
17
18
  }
18
- const c = r.at(-1);
19
- return c && (n[c] = s), i;
19
+ const s = r.at(-1);
20
+ return s && (o[s] = c), i;
20
21
  }
@@ -1,4 +1,4 @@
1
- import { type DeepKey } from "@stryke/types";
1
+ import type { DeepKey } from "@stryke/types/object";
2
2
  /**
3
3
  * Sets a value at a given deep path in an object.
4
4
  *
@@ -1 +1 @@
1
- import{isObjectIndex as f,isString as l}from"@stryke/types";import{toPath as a}from"./to-path";export function setField(i,t,s){const r=Array.isArray(t)?t:l(t)?a(t):[t];for(const e of r)if(e==="__proto__"||e==="constructor"||e==="prototype")throw new Error("Invalid key in path: "+e);let n=i;for(let e=0;e<r.length-1;e++){const o=r[e],y=r[e+1];n[o]===null&&(n[o]=f(y)?[]:{}),n=n[o]}const c=r.at(-1);return c&&(n[c]=s),i}
1
+ import{isObjectIndex as f}from"@stryke/type-checks/is-object-index";import{isString as l}from"@stryke/type-checks/is-string";import{toPath as p}from"./to-path";export function setField(i,e,c){const r=Array.isArray(e)?e:l(e)?p(e):[e];for(const t of r)if(t==="__proto__"||t==="constructor"||t==="prototype")throw new Error(`Invalid key in path: ${t}`);let o=i;for(let t=0;t<r.length-1;t++){const n=r[t],y=r[t+1];o[n]===null&&(o[n]=f(y)?[]:{}),o=o[n]}const s=r.at(-1);return s&&(o[s]=c),i}
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.addPathToDeepKey = addPathToDeepKey;
7
7
  exports.toDeepKey = toDeepKey;
8
- var _types = require("@stryke/types");
8
+ var _isNumber = require("@stryke/type-checks/is-number");
9
+ var _isSetString = require("@stryke/type-checks/is-set-string");
9
10
  function toDeepKey(n) {
10
11
  return n.reduce((r, t) => addPathToDeepKey(r, t));
11
12
  }
12
13
  function addPathToDeepKey(n, r) {
13
- return (0, _types.isNumber)(r) || Number.isInteger(r) ? n + `[${r}]` : (0, _types.isSetString)(r) ? n + `.${r}` : n;
14
+ return (0, _isNumber.isNumber)(r) || Number.isInteger(r) ? `${n}[${r}]` : (0, _isSetString.isSetString)(r) ? `${n}.${r}` : n;
14
15
  }
@@ -18,18 +18,21 @@ export declare function toDeepKey(path: string[]): string;
18
18
  /**
19
19
  * Adds a path segment to a deep key string.
20
20
  *
21
+ * @remarks
21
22
  * This function takes a deep key string and a path segment and combines them into a new deep key string.
22
23
  *
23
- * @param deepKey - The deep key string to add the path segment to.
24
- * @param path - The path segment to add to the deep key string.
25
- * @returns A new deep key string.
26
- *
27
24
  * @example
25
+ * ```ts
28
26
  * addPathToDeepKey('a.b', 'c') // Returns 'a.b.c'
29
27
  * addPathToDeepKey('a[0]', 'c') // Returns 'a[0].c'
30
28
  * addPathToDeepKey('.a.b', 'c') // Returns '.a.b.c'
31
29
  * addPathToDeepKey('a.b', 'b.c') // Returns 'a.b.b.c'
32
30
  * addPathToDeepKey('', 'a') // Returns 'a'
33
31
  * addPathToDeepKey('.a.b', 'c.d') // Returns '.a.b.c.d'
32
+ * ```
33
+ *
34
+ * @param deepKey - The deep key string to add the path segment to.
35
+ * @param path - The path segment to add to the deep key string.
36
+ * @returns A new deep key string.
34
37
  */
35
38
  export declare function addPathToDeepKey(deepKey: string, path: string | number): string;
@@ -1 +1 @@
1
- import{isNumber as e,isSetString as i}from"@stryke/types";export function toDeepKey(n){return n.reduce((r,t)=>addPathToDeepKey(r,t))}export function addPathToDeepKey(n,r){return e(r)||Number.isInteger(r)?n+`[${r}]`:i(r)?n+`.${r}`:n}
1
+ import{isNumber as e}from"@stryke/type-checks/is-number";import{isSetString as i}from"@stryke/type-checks/is-set-string";export function toDeepKey(n){return n.reduce((r,t)=>addPathToDeepKey(r,t))}export function addPathToDeepKey(n,r){return e(r)||Number.isInteger(r)?`${n}[${r}]`:i(r)?`${n}.${r}`:n}
package/dist/to-path.cjs CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.toPath = toPath;
7
7
  const a = /^[\w.]+$/g,
8
8
  E = /\\(?<temp1>\\)?/g,
9
- e = new RegExp(String.raw`[^.[\]]+` + "|" + String.raw`\[(?:` + `([^"'][^[]*)|` + String.raw`(["'])((?:(?!\2)[^\\]|\\.)*?)\2` + String.raw`)\]` + "|" + String.raw`(?=(?:\.|\[\])(?:\.|\[\]|$))`, "g");
9
+ e = new RegExp(`${String.raw`[^.[\]]+`}|${String.raw`\[(?:`}([^"'][^[]*)|${String.raw`(["'])((?:(?!\2)[^\\]|\\.)*?)\2`}${String.raw`)\]`}|${String.raw`(?=(?:\.|\[\])(?:\.|\[\]|$))`}`, "g");
10
10
  function toPath(t) {
11
11
  if (a.test(t)) return t.split(".");
12
12
  const n = [];
package/dist/to-path.d.ts CHANGED
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Converts a deep key string into an array of path segments.
3
3
  *
4
+ * @remarks
4
5
  * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.
5
6
  *
6
- * @param {string} deepKey - The deep key string to convert.
7
- * @returns {string[]} An array of strings, each representing a segment of the path.
8
- *
9
- * Examples:
10
- *
7
+ * @example
8
+ * ```ts
11
9
  * toPath('a.b.c') // Returns ['a', 'b', 'c']
12
10
  * toPath('a[b][c]') // Returns ['a', 'b', 'c']
13
11
  * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']
14
12
  * toPath('a["b.c"].d') // Returns ['a', 'b.c', 'd']
15
13
  * toPath('') // Returns []
16
14
  * toPath('.a[b].c.d[e]["f.g"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']
15
+ * ```
16
+ *
17
+ * @param deepKey - The deep key string to convert.
18
+ * @returns An array of strings, each representing a segment of the path.
17
19
  */
18
20
  export declare function toPath(deepKey: string): string[];
package/dist/to-path.mjs CHANGED
@@ -1 +1 @@
1
- const a=/^[\w.]+$/g,E=/\\(?<temp1>\\)?/g,e=new RegExp(String.raw`[^.[\]]+`+"|"+String.raw`\[(?:`+`([^"'][^[]*)|`+String.raw`(["'])((?:(?!\2)[^\\]|\\.)*?)\2`+String.raw`)\]`+"|"+String.raw`(?=(?:\.|\[\])(?:\.|\[\]|$))`,"g");export function toPath(t){if(a.test(t))return t.split(".");const n=[];t[0]==="."&&n.push("");const i=t.matchAll(e);for(const r of i){let s=r[0];const o=r[1],g=r[2],c=r[3];g&&c?s=c.replace(E,"$1"):o&&(s=o),n.push(s)}return n}
1
+ const a=/^[\w.]+$/g,E=/\\(?<temp1>\\)?/g,e=new RegExp(`${String.raw`[^.[\]]+`}|${String.raw`\[(?:`}([^"'][^[]*)|${String.raw`(["'])((?:(?!\2)[^\\]|\\.)*?)\2`}${String.raw`)\]`}|${String.raw`(?=(?:\.|\[\])(?:\.|\[\]|$))`}`,"g");export function toPath(t){if(a.test(t))return t.split(".");const n=[];t[0]==="."&&n.push("");const i=t.matchAll(e);for(const r of i){let s=r[0];const o=r[1],g=r[2],c=r[3];g&&c?s=c.replace(E,"$1"):o&&(s=o),n.push(s)}return n}
@@ -1,4 +1,4 @@
1
- import type { DeepKey, DeepValue } from "@stryke/types";
1
+ import type { DeepKey, DeepValue } from "@stryke/types/object";
2
2
  /**
3
3
  * Flattens a nested object into a single level object with dot-separated keys.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/helpers",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "A package containing miscellaneous helper functions that are used across many different Storm Software projects.",
6
6
  "repository": {
@@ -10,7 +10,11 @@
10
10
  },
11
11
  "private": false,
12
12
  "publishConfig": { "access": "public" },
13
- "dependencies": { "@stryke/types": ">=0.4.0" },
13
+ "dependencies": {
14
+ "@stryke/convert": ">=0.1.0",
15
+ "@stryke/type-checks": ">=0.1.0",
16
+ "@stryke/types": ">=0.6.0"
17
+ },
14
18
  "devDependencies": {},
15
19
  "sideEffects": false,
16
20
  "files": ["dist/**/*"],
@@ -24,7 +28,6 @@
24
28
  "stryke",
25
29
  "typescript",
26
30
  "utilities",
27
- "storm-stack",
28
31
  "storm-software",
29
32
  "storm",
30
33
  "storm-ops",
@@ -301,6 +304,20 @@
301
304
  "default": "./dist/flatten-object.mjs"
302
305
  }
303
306
  },
307
+ "./filter-empty": {
308
+ "import": {
309
+ "types": "./dist/filter-empty.d.ts",
310
+ "default": "./dist/filter-empty.mjs"
311
+ },
312
+ "require": {
313
+ "types": "./dist/filter-empty.d.ts",
314
+ "default": "./dist/filter-empty.cjs"
315
+ },
316
+ "default": {
317
+ "types": "./dist/filter-empty.d.ts",
318
+ "default": "./dist/filter-empty.mjs"
319
+ }
320
+ },
304
321
  "./errors": {
305
322
  "import": {
306
323
  "types": "./dist/errors.d.ts",