Skip to content

cfpb-atomic-component 0.17.9

Install from the command line:
Learn more about npm packages
$ npm install @cfpb/cfpb-atomic-component@0.17.9
Install via package.json:
"@cfpb/cfpb-atomic-component": "0.17.9"

About this version

@cfpb/atomic-component Build Status npm

Design System atomic component micro-framework

This component can be used by itself, but it was made for Design System, a front end framework developed at the Consumer Financial Protection Bureau.

How to use this component

Detailed instructions can be found at the Design System documentation site.

Utility descriptions

object-assign

Utility used to copy Javascript object properties from one or more source objects to a target object

Example

var assert = require( 'assert' );
import { assign } from '../utilities/object-assign.js';
var testObjectA = {
    str:  'test',
    func: function() { return 'testStr'; },
    num:  1
 };
 var testObjectB = {
    obj:   { test: 2 },
    arr:   [ 3 ],
   	_null: null
 };
 assign( testObjectA, testObjectB );
 assert( testObjectA.hasOwnProperty( 'obj' ), true ) ;
 assert( testObjectA.hasOwnProperty( 'arr' ) );
 assert( testObjectA.hasOwnProperty( '_null' ), true );

Type Checkers

Utility functions for checking Javascript types and primitives.

Example

var assert = require( 'assert' );
import typeCheckers from '../utilities/type-checkers.js';

var UNDEFINED;

var date = new Date( 2011, 7, 21 );

function func() {
  return true;
}

var object = {
  a: '1',
  b: '2',
  c: '3'
};

assert.equal( typeCheckers.isUndefined( UNDEFINED ), true );
assert.equal( typeCheckers.isObject( object ), true );
assert.equal( typeCheckers.isFunction( func ), true );
assert.equal( typeCheckers.isDate( date ), true );

Getting involved

We welcome your feedback and contributions.


Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy

Details


Assets

  • cfpb-atomic-component-0.17.9.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all