Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tfk-dsf-unwrap-parents

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tfk-dsf-unwrap-parents

Unwraps parents information from dsf result

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Build Status Coverage Status Code Climate js-standard-style

tfk-dsf-unwrap-parents

Unwrap parents from dsf results

Installation

From npm

$ npm install tfk-dsf-unwrap-parents

From GitHub

$ git clone git@github.com:telemark/tfk-dsf-unwrap-parents.git

cd into directory and install dependencies

$ npm i

Usage

const unwrapParents = require('tfk-dsf-unwrap-parents')
const data = {
  'RESULT': {
    'HOV': {
      'FODT': '261186',
      'PERS': '12345',
      'INR': '26118612345',
      'FODTAR': '1986',
      'STAT-KD': '1',
      'STAT': 'BOSATT',
      'NAVN-S': 'GRÅ',
      'NAVN-F': 'GEORG',
      'NAVN-M': 'GAFFEL',
      'NAVN': 'GRÅ GEORG GAFFEL',
      'NAVN-D': '19861212',
      'ADR': 'SNIPPETSTADSTREDET 24',
      'POSTN': '1732',
      'POSTS': 'HØTTEN',
      'ADRTYPE': 'O',
      'SPES-KD': '0',
      'SPES': 'VANLIG BOSATT'
    },
    'FOR': [
      {
        'FODT': '090457',
        'PERS': '54321',
        'INR': '09045754321',
        'FODTAR': '1957',
        'STAT-KD': '1',
        'STAT': 'BOSATT',
        'NAVN-S': 'GRÅ',
        'NAVN-F': 'GUNHILD',
        'NAVN-M': {},
        'NAVN': 'GRÅ GUNHILD',
        'NAVN-D': '19831020',
        'ADRR': '19850812',
        'ADRF': '19850801',
        'ADR': 'SNIPPETSTADSTREDET 24',
        'POSTN': '1732',
        'POSTS': 'HØTTEN',
        'ADRTYPE': 'O',
        'SPES-KD': '0',
        'SPES': 'VANLIG BOSATT',
        'Barn': [
          {
            'BAR-FODT': '261186',
            'BAR-PERS': '12345',
            'BAR-INR': '26118612345',
            'BAR-KJO': 'M'
          }
        ]
      },
      {
        'FODT': '230457',
        'PERS': '67890',
        'INR': '23045767890',
        'FODTAR': '1957',
        'STAT-KD': '1',
        'STAT': 'BOSATT',
        'NAVN-S': 'GRÅ',
        'NAVN-F': 'GANDALF',
        'NAVN-M': {},
        'NAVN': 'GRÅ GANDALF',
        'NAVN-D': {},
        'ADR': 'SNIPPETSTADSTREDET 24',
        'POSTN': '1732',
        'POSTS': 'HØTTEN',
        'ADRTYPE': 'O',
        'SPES-KD': '0',
        'SPES': 'VANLIG BOSATT',
        'Barn': [
          {
            'BAR-FODT': '261186',
            'BAR-PERS': '12345',
            'BAR-INR': '26118612345',
            'BAR-KJO': 'M'
          }
        ]
      }
    ]
  }
}

console.log(JSON.stringify(unwrapParents(data), null, 2))

returns

[
  {
    "FODT": "090457",
    "PERS": "54321",
    "INR": "09045754321",
    "FODTAR": "1957",
    "NAVN-S": "GRÅ",
    "NAVN-F": "GUNHILD",
    "NAVN-M": {},
    "NAVN": "GRÅ GUNHILD",
    "ADR": "SNIPPETSTADSTREDET 24",
    "POSTN": "1732",
    "POSTS": "HØTTEN",
    "SPES-KD": "0",
    "SPES": "VANLIG BOSATT"
  },
  {
    "FODT": "230457",
    "PERS": "67890",
    "INR": "23045767890",
    "FODTAR": "1957",
    "NAVN-S": "GRÅ",
    "NAVN-F": "GANDALF",
    "NAVN-M": {},
    "NAVN": "GRÅ GANDALF",
    "ADR": "SNIPPETSTADSTREDET 24",
    "POSTN": "1732",
    "POSTS": "HØTTEN",
    "SPES-KD": "0",
    "SPES": "VANLIG BOSATT"
  }
]

License

MIT

Keywords

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc