JSPM

@mindzgroup/utilities

0.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42
  • Score
    100M100P100Q65518F
  • License ISC

A collection of commonly used utility function.

Package Exports

  • @mindzgroup/utilities
  • @mindzgroup/utilities/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mindzgroup/utilities) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Productivity Utility Functions for JavaScript / TypeScript

A collection of commonly used utility function.

List of Functions

GetNestedPropertyValue

Signature

GetNestedPropertyValue: <T>(obj: any, propPath: string, returnUndefined?: boolean) => T;

Sample Usage: TypeScript

import { GetNestedPropertyValue } from '@mindzgroup/utilities';

let dataObject = { ... };

let value = GetNestedPropertyValue(dataObject, 'path.to.property');

SetNestedPropertyValue

Note: this function modifies the target object and overwrites the existing value at the given path by default. In case your requirement want the values to be merged at destination please use mergeValue = true as the function parameter.

Signature

SetNestedPropertyValue: (target: any, path: string, value: any, mergeValue?: boolean): boolean;

Sample Usage: TypeScript

import { SetNestedPropertyValue } from '@mindzgroup/utilities';

let dataObject = { ... };
let value: string = 'value';

// without merge
SetNestedPropertyValue(dataObject, 'path.to.property', value);

// with merge
SetNestedPropertyValue(dataObject, 'path.to.property', value, true);