@stackbit/utils
Advanced tools
Comparing version 0.4.25-staging.1 to 0.4.25-staging.2
@@ -85,2 +85,3 @@ import { PropertyPath } from 'lodash'; | ||
export declare function omitByUndefined<T extends Record<string, any>>(object: T): T; | ||
export declare function undefinedIfEmpty<T extends Record<string, any> | any[]>(value: T): T | undefined; | ||
export type KeyPath = (string | number)[]; | ||
@@ -87,0 +88,0 @@ /** |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asyncMapDeep = exports.deepMap = exports.omitByUndefined = exports.omitByNil = exports.rename = exports.copyIfNotSet = exports.copy = exports.concat = exports.prepend = exports.append = exports.getFirst = void 0; | ||
exports.asyncMapDeep = exports.deepMap = exports.undefinedIfEmpty = exports.omitByUndefined = exports.omitByNil = exports.rename = exports.copyIfNotSet = exports.copy = exports.concat = exports.prepend = exports.append = exports.getFirst = void 0; | ||
const lodash_1 = __importDefault(require("lodash")); | ||
@@ -148,2 +148,6 @@ /** | ||
exports.omitByUndefined = omitByUndefined; | ||
function undefinedIfEmpty(value) { | ||
return lodash_1.default.isEmpty(value) ? undefined : value; | ||
} | ||
exports.undefinedIfEmpty = undefinedIfEmpty; | ||
function deepMap(object, iteratee, options) { | ||
@@ -150,0 +154,0 @@ const context = lodash_1.default.get(options, 'context'); |
{ | ||
"name": "@stackbit/utils", | ||
"version": "0.4.25-staging.1", | ||
"version": "0.4.25-staging.2", | ||
"description": "Stackbit utilities", | ||
@@ -29,3 +29,3 @@ "main": "dist/index.js", | ||
"@iarna/toml": "^2.2.5", | ||
"@stackbit/types": "2.0.5-staging.1", | ||
"@stackbit/types": "2.0.5-staging.2", | ||
"fs-extra": "^9.1.0", | ||
@@ -41,3 +41,3 @@ "js-yaml": "^4.0.0", | ||
}, | ||
"gitHead": "427c4ee428e86c6ba83bb9e6e8ed8735c270b0d7" | ||
"gitHead": "30b71660d4542e3119807ba2b92ef7816c464c21" | ||
} |
@@ -142,2 +142,6 @@ import _, { PropertyPath } from 'lodash'; | ||
export function undefinedIfEmpty<T extends Record<string, any> | any[]>(value: T): T | undefined { | ||
return _.isEmpty(value) ? undefined : value; | ||
} | ||
export type KeyPath = (string | number)[]; | ||
@@ -144,0 +148,0 @@ |
Sorry, the diff of this file is not supported yet
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
497759
9277
+ Added@stackbit/types@2.0.5-staging.2(transitive)
- Removed@stackbit/types@2.0.5-staging.1(transitive)