This package has been deprecated

Author message:

This package will not receive ongoing development

@ministryofjustice/fb-utils-node

0.1.8 • Public • Published

fb-utils-node

Form Builder utility methods

Installing

npm install @ministryofjustice/fb-utils-node

Usage

const FBUtils = require('@ministryofjustice/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 true:

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

Readme

Keywords

none

Package Sidebar

Install

npm i @ministryofjustice/fb-utils-node

Weekly Downloads

4

Version

0.1.8

License

MIT

Unpacked Size

18.4 kB

Total Files

20

Last publish

Collaborators

  • gregtyler
  • moj-igor
  • ma226860
  • hmpps-digital-prison-reporting
  • probation-integration-bot
  • jbrightonmoj
  • solidgoldpig
  • umaar
  • todderz
  • romidane
  • emileswarts
  • elena_vi
  • stevemarshall
  • adamsilver
  • asmega
  • sequencemedialimited
  • form-builder-team
  • form-builder-developers
  • simonwhatley
  • johnnolan
  • paulmassey