Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@agile-ts/utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agile-ts/utils - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

18

CHANGELOG.md
# @agile-ts/utils
## 0.0.7
### Patch Changes
- 2f2724f: #### :bug: Bug Fix
- `core`
- [#176](https://github.com/agile-ts/agile/pull/176) Fix persisting dynamically added items ([@bennodev19](https://github.com/bennodev19))
#### :nail_care: Polish
- `api`, `core`, `event`, `logger`, `multieditor`, `react`, `utils`
- [#177](https://github.com/agile-ts/agile/pull/177) Optimize default configurations ([@bennodev19](https://github.com/bennodev19))
#### Committers: 1
- BennoDev ([@bennodev19](https://github.com/bennodev19))
## 0.0.6

@@ -4,0 +22,0 @@

@@ -52,2 +52,10 @@ /**

* @internal
* Merges default values/properties into config object
* @param config - Config object that receives default values
* @param defaults - Default values object that gets merged into config object
* @param overwriteUndefinedProperties - If undefined Properties in config gets overwritten by the default value
*/
export declare function defineConfig<ConfigInterface = Object>(config: ConfigInterface, defaults: Object, overwriteUndefinedProperties?: boolean): ConfigInterface;
/**
* @internal
* @param addNewProperties - Adds new properties to source Object

@@ -54,0 +62,0 @@ */

23

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeProperties = exports.clone = exports.createArrayFromObject = exports.generateId = exports.notEqual = exports.equal = exports.flatMerge = exports.isJsonString = exports.isAsyncFunction = exports.isFunction = exports.normalizeArray = exports.includesArray = exports.isValidObject = exports.copy = void 0;
exports.removeProperties = exports.clone = exports.createArrayFromObject = exports.generateId = exports.notEqual = exports.equal = exports.flatMerge = exports.defineConfig = exports.isJsonString = exports.isAsyncFunction = exports.isFunction = exports.normalizeArray = exports.includesArray = exports.isValidObject = exports.copy = void 0;
function copy(value) {

@@ -42,3 +42,5 @@ if (value == null || typeof value !== 'object')

function normalizeArray(items, config = {}) {
config = Object.assign({ createUndefinedArray: false }, config);
config = defineConfig(config, {
createUndefinedArray: false,
});
if (items == null && !config.createUndefinedArray)

@@ -72,4 +74,19 @@ return [];

exports.isJsonString = isJsonString;
function defineConfig(config, defaults, overwriteUndefinedProperties) {
if (overwriteUndefinedProperties === undefined)
overwriteUndefinedProperties = true;
const shallowCopiedConfig = Object.assign({}, config);
for (const defaultKey in defaults) {
if (!Object.prototype.hasOwnProperty.call(shallowCopiedConfig, defaultKey) ||
(overwriteUndefinedProperties &&
shallowCopiedConfig[defaultKey] === undefined))
shallowCopiedConfig[defaultKey] = defaults[defaultKey];
}
return shallowCopiedConfig;
}
exports.defineConfig = defineConfig;
function flatMerge(source, changes, config = {}) {
config = Object.assign({ addNewProperties: true }, config);
config = defineConfig(config, {
addNewProperties: true,
});
const _source = copy(source);

@@ -76,0 +93,0 @@ if (_source == null)

2

package.json
{
"name": "@agile-ts/utils",
"version": "0.0.6",
"version": "0.0.7",
"author": "BennoDev",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc