@stackbit/utils
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -44,3 +44,3 @@ import { PropertyPath } from 'lodash'; | ||
*/ | ||
export declare function copy(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform: (value: any) => any): void; | ||
export declare function copy(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform?: (value: any) => any): void; | ||
/** | ||
@@ -61,3 +61,3 @@ * Copies the value from the `sourceObject` at the specified `sourcePath` to | ||
*/ | ||
export declare function copyIfNotSet(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform: (value: any) => any): void; | ||
export declare function copyIfNotSet(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform?: (value: any) => any): void; | ||
/** | ||
@@ -64,0 +64,0 @@ * Renames `oldPath` to a `newPath`. |
{ | ||
"name": "@stackbit/utils", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Stackbit utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -62,3 +62,3 @@ import _, { PropertyPath } from 'lodash'; | ||
*/ | ||
export function copy(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform: (value: any) => any) { | ||
export function copy(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform?: (value: any) => any) { | ||
if (_.has(sourceObject, sourcePath)) { | ||
@@ -88,3 +88,3 @@ let value = _.get(sourceObject, sourcePath); | ||
*/ | ||
export function copyIfNotSet(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform: (value: any) => any) { | ||
export function copyIfNotSet(sourceObject: any, sourcePath: PropertyPath, targetObject: any, targetPath: PropertyPath, transform?: (value: any) => any) { | ||
if (!_.has(targetObject, targetPath)) { | ||
@@ -91,0 +91,0 @@ copy(sourceObject, sourcePath, targetObject, targetPath, transform); |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
74913
0