UNPKG

@rails/webpacker

Version:

Use webpack to manage app-like JavaScript modules in Rails

10 lines (7 loc) 278 B
/* global test expect */ const objectify = require('../objectify') test('Get object from a string path', () => { const object = { foo: { bar: { x: 1 } } } expect(objectify('foo.bar', object)).toEqual({ x: 1 }) expect(objectify('some.bar', object)).toEqual(undefined) })