@bjmrq/utils
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -5,1 +5,2 @@ /// <reference types="ts-toolbelt" /> | ||
export declare const sanitizeObject: import("Function/Curry").Curry<(head: string[], head: Record<string, any>) => Pick<Record<string, any>, never>>; | ||
export declare const readOnly: <M = Record<string, unknown>>(object: M) => Readonly<M>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sanitizeObject = exports.idOf = exports.nameOf = void 0; | ||
exports.readOnly = exports.sanitizeObject = exports.idOf = exports.nameOf = void 0; | ||
const ramda_1 = require("ramda"); | ||
@@ -8,2 +8,9 @@ exports.nameOf = ramda_1.propOr("No name", "name"); | ||
exports.sanitizeObject = ramda_1.curryN(2, (keysToSanitize, object) => ramda_1.omit(keysToSanitize, object)); | ||
exports.readOnly = (object) => { | ||
Object.values(object).forEach((value) => { | ||
if (value && typeof value === "object") | ||
exports.readOnly(value); | ||
}); | ||
return Object.freeze(object); | ||
}; | ||
//# sourceMappingURL=object.js.map |
{ | ||
"name": "@bjmrq/utils", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "A toolkit of little utilities", | ||
@@ -5,0 +5,0 @@ "author": "Benjamin Marquis", |
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
12671
154