UNPKG

utils-properties-parse

Version:

Attempts to parse an input string according to the .properties specification.

30 lines (21 loc) 506 B
'use strict'; // MODULES // var properties = require( 'properties' ); // PARSE // /** * FUNCTION: parse( value[, options] ) * Attempts to parse a value as .properties. * * @param {*} value - value to parse * @param {Object} [options] - function options * @returns {Object|Error} parsed value or an error */ function parse( value, options ) { try { return properties.parse( value, options ); } catch ( error ) { return error; } } // end FUNCTION parse() // EXPORTS // module.exports = parse;