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

@8base/utils

Package Overview
Dependencies
Maintainers
3
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/utils - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

13

dist/formatters/omitDeep.js

@@ -12,6 +12,11 @@ "use strict";

const omitDeep = (omitedProps, objectForOmitting) => {
if (!objectForOmitting || !R.is(Object, objectForOmitting)) {
if (!objectForOmitting ||
!R.is(Object, objectForOmitting) ||
typeof objectForOmitting === 'number' ||
typeof objectForOmitting === 'string') {
return objectForOmitting;
}
const currentLevelOmitedObject = R.omit(omitedProps, objectForOmitting);
const currentLevelOmitedObject = Array.isArray(objectForOmitting)
? R.map(value => omitDeep(omitedProps, value), objectForOmitting)
: R.omit(omitedProps, objectForOmitting);
const omitValue = (value) => {

@@ -26,3 +31,5 @@ if (R.is(Array, value)) {

};
const fullOmitedObject = R.mapObjIndexed(omitValue, currentLevelOmitedObject);
const fullOmitedObject = Array.isArray(currentLevelOmitedObject)
? R.map(omitValue, currentLevelOmitedObject)
: R.mapObjIndexed(omitValue, currentLevelOmitedObject);
return fullOmitedObject;

@@ -29,0 +36,0 @@ };

{
"name": "@8base/utils",
"version": "1.0.0",
"version": "1.0.1",
"repository": "https://github.com/8base/sdk",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/utils#readme",

import * as R from 'ramda';
const omitDeep = (omitedProps: string[], objectForOmitting?: any) => {
if (!objectForOmitting || !R.is(Object, objectForOmitting)) {
if (
!objectForOmitting ||
!R.is(Object, objectForOmitting) ||
typeof objectForOmitting === 'number' ||
typeof objectForOmitting === 'string'
) {
return objectForOmitting;
}
const currentLevelOmitedObject = R.omit(omitedProps, objectForOmitting);
const currentLevelOmitedObject: any = Array.isArray(objectForOmitting)
? R.map(value => omitDeep(omitedProps, value), objectForOmitting)
: R.omit(omitedProps, objectForOmitting);

@@ -19,3 +26,5 @@ const omitValue = (value: any): any => {

const fullOmitedObject = R.mapObjIndexed(omitValue, currentLevelOmitedObject);
const fullOmitedObject = Array.isArray(currentLevelOmitedObject)
? R.map(omitValue, currentLevelOmitedObject)
: R.mapObjIndexed(omitValue, currentLevelOmitedObject);

@@ -22,0 +31,0 @@ return fullOmitedObject;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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