Socket
Socket
Sign inDemoInstall

tfk-dsf-normalize-contact

Package Overview
Dependencies
2
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tfk-dsf-normalize-contact

Transforms contact information from dsf to something useful


Version published
Weekly downloads
10
decreased by-9.09%
Maintainers
4
Install size
24.7 kB
Created
Weekly downloads
 

Readme

Source

Build Status Coverage Status Code Climate js-standard-style

tfk-dsf-normalize-contact

Maps contact information from dsf to something more useful

Installation

From npm

$ npm install tfk-dsf-normalize-contact

From GitHub

$ git clone 

cd into directory and run setup

$ npm install

Usage

const normalizeContact = require('tfk-dsf-normalize-contact')
const dsf = {
  'FODT': '181171',
  'PERS': '12345',
  'INR': '18117108976',
  'FODTAR': '1971',
  'STAT-KD': '1',
  'STAT': 'BOSATT',
  'NAVN-S': 'GRÅ',
  'NAVN-F': 'GANDALF',
  'NAVN-M': 'GEORG',
  'NAVN': 'GRÅ GANDALF GEORG',
  'ADR': 'FYLKESBAKKEN 10',
  'POSTN': '3715',
  'POSTS': 'SKIEN',
  'SPES-KD': '0',
  'SPES': 'VANLIG BOSATT',
  'KJONN': 'M',
  'STAT': 'BOSATT',
  'MOR-FODT': '010166',
  'MOR-PERS': '33333',
  'FAR-FODT': '020265',
  'FAR-PERS': '11111',
  'Barn': [
        {
          'BAR-FODT': '020280',
          'BAR-PERS': '99999',
          'BAR-INR': '02028099999',
          'BAR-KJO': 'M'
        },
        {
          'BAR-FODT': '040481',
          'BAR-PERS': '88888',
          'BAR-INR': '04048166666',
          'BAR-KJO': 'K'
        }
      ],
}

console.log(normalizeContact(dsf))

Returns

{
  'personalIdNumber': '24069844444',
  'birthDate': '1998-06-24',
  'firstName': 'Gandalf',
  'middleName': 'Georg',
  'lastName': 'Grå',
  'fullName': 'Gandalf Georg Grå',
  'address': 'Oppfunnet Gate 30',
  'zip': '3717',
  'city': 'Skien',
  'gender': 'Male',
  'alive': true,
  'motherIdNumber': '01016633333',
  'fatherIdNumber': '02026511111',
  'spouseIdNumber': '',
  'children':
  [
    { 'childIdNumber': '02028099999' },
    { 'childIdNumber': '04048188888' }
  ]
}

License

MIT

Keywords

FAQs

Last updated on 03 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc