Comparing version 0.5.3 to 0.5.4
@@ -40,2 +40,3 @@ | ||
name: this._name, | ||
camelName: this.getCamelName(), | ||
options: this._options, | ||
@@ -69,3 +70,7 @@ fields: helper.values(this._fields, helper.toTemplateObject), | ||
MessageDescriptor.prototype.getCamelName = function () { | ||
return helper.toLowerCaseFirstLetter(this._name) | ||
} | ||
MessageDescriptor.prototype.addField = function (field) { | ||
@@ -72,0 +77,0 @@ this._fields[field.getTag()] = field |
@@ -95,2 +95,12 @@ | ||
/** | ||
* Lowercases the first letter of a string. | ||
* @param {string} str | ||
* @return {string} | ||
*/ | ||
exports.toLowerCaseFirstLetter = function(str) { | ||
return str.charAt(0).toLowerCase() + str.slice(1); | ||
} | ||
/** | ||
* Returns item.toTemplateObject, intended to be a convenient helper for Array.map() | ||
@@ -97,0 +107,0 @@ * @param {Descriptor} item |
{ | ||
"name": "pbnj", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"keywords": ["protocol", "buffer", "proto", "protobuf", "parser", "codegen"], | ||
@@ -5,0 +5,0 @@ "description": "JavaScript protocol buffer schema parser and template based code generator", |
@@ -18,2 +18,5 @@ | ||
test.equal('Casing', msg.getName()) | ||
test.equal('casing', msg.getCamelName()) | ||
test.ok(msg.getField('normal_case')) | ||
@@ -20,0 +23,0 @@ test.equal('normal_case', msg.getField('normal_case').toTemplateObject().name) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
97700
1724
1