@basementscripts/js-utils
v1.0.8
Published
JavaScript Utilities
Downloads
2
Keywords
Readme
@basementscripts/js-utils
This package contains a series of JavaScript utilities to help manipulate data.
Getting Started
Install
Make sure your
.npmrc
file is properly configured to access the@basementscripts
scope repository.
@basementscripts:registry=https://npm.pkg.github.com:_authToken=${NPM_TOKEN}
$ yarn add @basementscripts/js-utils
Utilities
Object
stripEmptyOrNull
- strip all empty or null values from object, and return a clean object with properties containig data.
Usage
import utils from '@basementscripts/js-utils'
import { adapter } from '@data'
export const createRecord = async (data: Record<string, unknown>) => {
const sanitized = utils.Object.stripEmptyOrNull(data)
return await adapter.createRecord('tablename', sanitized)
}