0.1.7 • Published 3 years ago

@solidgoldpig/fb-utils-node v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

fb-utils-node

Form Builder utility methods

Installing

npm install @solidgoldpig/fb-utils-node

Usage

const FBUtils = require('@solidgoldpig/fb-utils-node')

Methods

logger

FBUtils.logger(...args)

clone

Returns a shallow copy of any object

const clonedObj = FBUtils.clone(obj)

Objects can be of any type.

By default, the object copy is shallow.

To create a deep copy, pass

const deeplyClonedObj = FBUtils.clone(obj, true)

FBError

Base class for errors

class MyError extends FBError {}

throw new MyError('An error occurred', {
  data: additionalData
})

Testing

npm test
# Test output is in [TAP](https://testanything.org/) format

Run unit tests only

npm run test:unit

Run linting only

npm run lint