1.0.3 • Published 6 years ago
fixedstr v1.0.3
fixedstr
Transforms fixed string to object and vice versa
var transformer = new fixedstr([
fixedstr.str('foo', 2),
fixedstr.str('bar', 5),
fixedstr.number('baz', 3)
]);
transformer.objectify('F Bar 012'); // {foo: 'F', bar: 'Bar', baz: 12}
transformer.stringify({foo: 'F', bar: 'Bar', baz: 12}); // 'F Bar 012'