SkillAgentSearch skills...

Tableize

Generate a table-friendly object by flattening and normalizing the keys

Install / Use

/learn @segment-boneyard/Tableize
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

tableize

Generate a table-friendly object by flattening and normalizing the keys.

Installation

$ npm install tableize

Example

var tableize = require('tableize');

var obj = tableize({
  user: {
    id: 123242123,

    name: {
      first: 'tobi',
      last: 'loki'
    },

    properties: {
      category: 'Buttons',
      label: 'Login'
    },

    context: {
      userAgent: 'Mozilla whatever'
    }
  }
});

console.log(obj);

yields:

{ 'user.id': 123242123,
  'name.first': 'tobi',
  'name.last': 'loki',
  'properties.category': 'Buttons',
  'properties.label': 'Login',
  'context.userAgent': 'Mozilla whatever' }

License

MIT

Related Skills

View on GitHub
GitHub Stars48
CategoryDevelopment
Updated2y ago
Forks3

Languages

JavaScript

Security Score

60/100

Audited on Aug 18, 2023

No findings