
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
protobuf-fieldmask
Advanced tools
Library for generating and applying protobuf FieldMask
/**
* Generates field mask that includes all non-function own properties on specified object
* @param {*} object - object to generate field mask from
* @returns {string[]} - generated field mask
*/
function generateFieldMask(object)
For an example, running this function with this input:
{
f: {
a: 22,
b: {
d: 1
}
}
}
generates this output:
['f.a', 'f.b.d']
/**
* Creates a new object that copies fields present in field mask from specified source object
* @param {*} sourceObject - object to apply field mask to
* @param {string[]} fieldMask
* @returns {*} - new object created by applying field mask on source object or original entity if source is not an object
*/
function applyFieldMask(sourceObject, fieldMask)
For an example, running this function with this input:
{
f: {
a: 22,
b: {
d: 1,
x: 2
},
y: 13
},
z: 8
},
['f.a', 'f.b.d']
generates this output:
{
f: {
a: 22,
b: {
d: 1
}
}
}
FAQs
Library for generating and applying FieldMask
We found that protobuf-fieldmask demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.