@valkyriestudios/utils 12.2.1 → 12.3.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.
package/array/mapFn.js CHANGED
@@ -4,11 +4,7 @@ function mapFn(arr, fn, opts) {
4
4
  if ((!Array.isArray(arr) || !arr.length) ||
5
5
  typeof fn !== 'function')
6
6
  return {};
7
- let MERGE = false;
8
- if (opts && Object.prototype.toString.call(opts) === '[object Object]') {
9
- if (opts.merge === true)
10
- MERGE = true;
11
- }
7
+ const MERGE = opts && Object.prototype.toString.call(opts) === '[object Object]' && opts.merge === true;
12
8
  const map = {};
13
9
  let hash = false;
14
10
  for (const el of arr) {
package/array/mapKey.js CHANGED
@@ -7,11 +7,7 @@ function mapKey(arr, key, opts) {
7
7
  const key_s = key.trim();
8
8
  if (!key_s.length)
9
9
  return {};
10
- let MERGE = false;
11
- if (opts && Object.prototype.toString.call(opts) === '[object Object]') {
12
- if (opts.merge === true)
13
- MERGE = true;
14
- }
10
+ const MERGE = opts && Object.prototype.toString.call(opts) === '[object Object]' && opts.merge === true;
15
11
  const map = {};
16
12
  for (const el of arr) {
17
13
  if (Object.prototype.toString.call(el) !== '[object Object]' ||
package/function/is.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @returns Whether or not the value is a Function
7
7
  */
8
- export default function isFunction(val: unknown): val is Function;
8
+ export default function isFunction(val: unknown): val is (...args: unknown[]) => unknown;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @returns Whether or not the value is an async function
7
7
  */
8
- export default function isAsyncFunction(val: unknown): val is Function;
8
+ export default function isAsyncFunction(val: unknown): val is (...args: unknown[]) => Promise<unknown>;
package/index.d.ts CHANGED
@@ -18,10 +18,10 @@ declare module "date/is" {
18
18
  export default function isDate(val: unknown): val is Date;
19
19
  }
20
20
  declare module "function/is" {
21
- export default function isFunction(val: unknown): val is Function;
21
+ export default function isFunction(val: unknown): val is (...args: unknown[]) => unknown;
22
22
  }
23
23
  declare module "function/isAsync" {
24
- export default function isAsyncFunction(val: unknown): val is Function;
24
+ export default function isAsyncFunction(val: unknown): val is (...args: unknown[]) => Promise<unknown>;
25
25
  }
26
26
  declare module "number/is" {
27
27
  export default function isNumber(val: unknown): val is number;
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@valkyriestudios/utils", "version": "12.2.1", "description": "A collection of single-function utilities for common tasks", "author": { "name": "Peter Vermeulen", "email": "contact@valkyriestudios.be", "url": "www.valkyriestudios.be" }, "keywords": [ "utility", "library", "javascript", "js", "node", "bun" ], "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/ValkyrieStudios/utils.git" }, "bugs": { "url": "https://github.com/ValkyrieStudios/utils/issues" }, "homepage": "https://github.com/ValkyrieStudios/utils#readme", "types": "index.d.ts" }
1
+ { "name": "@valkyriestudios/utils", "version": "12.3.0", "description": "A collection of single-function utilities for common tasks", "author": { "name": "Peter Vermeulen", "email": "contact@valkyriestudios.be", "url": "www.valkyriestudios.be" }, "keywords": [ "utility", "library", "javascript", "js", "node", "bun" ], "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/ValkyrieStudios/utils.git" }, "bugs": { "url": "https://github.com/ValkyrieStudios/utils/issues" }, "homepage": "https://github.com/ValkyrieStudios/utils#readme", "types": "index.d.ts" }