![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A modern JavaScript library which offers utility functions for objects in JavaScript
A modern JavaScript library which offers utility functions for objects in JavaScript.
Osm.js
follows functional programming paradigms such as immutability & currying.
Osm.js
methods always return a new object rather than mutating the objects passed in. This leads to consistent & predictable behavior.
Osm.js is exported as a UMD module, which means it can work on both the client & the server.
Installing Osm
via npm
npm install osm.js
Then require/import it in any module
import osm from 'osm.js';
To use Osm.js
from a browser, download lib/osm.min.js
Then, add it as a script tag to your page
<script src="osm.min.js"></script>
<script>
const scores = {
Jason: 2,
Sam: 3,
Jane: 1
};
const double = (v) => v * 2;
const dbl = osm.map(double, scores);
</script>
Or use an AMD loader such as RequireJS
require(['./osm.min.js'], (osm) => {
// your code here
});
osm.map(interatee, obj);
Returns a new object by running obj
through iteratee
.
const scores = {
Jason: 2,
Sam: 3,
Jane: 1
};
const double = (v) => v * 2;
const dbl = osm.map(double, scores);
osm.filter(predicate, obj);
Iterates over an object & returns a new object with all values predicate
returns truthy for. The predicate
is invoked with two arguments: (value, key)
const scores = {
Jason: 2,
Sam: 3,
Jane: 1
};
const predicate = score => score > 1;
const highScores = osm.filter(predicate, scores);
osm.isObject(value)
Checks if the value
is a plain object
osm.isObject({}); //true
osm.isObject(''); //false
osm.isObject(0); //false
osm.isObject(null); //false
osm.isObject(undefined); //false
osm.isObject(NaN); //false
osm.clone(obj);
Returns a new object which uses obj
as it's prototype and clones the properties.
osm.extend(objA, objB);
Returns a new object which uses own enumerable properties of source objects objA
& objB
. Sources are applied left to right and objA is not mutated in the process.
const numbers = {One: 1, Two: 2, Three: 3};
const strings = {One: 'One', Two: 'Two'};
osm.extend(numbers, strings); //{One: 'One', Two: 'Two', Three: 3};
osm.omit(obj, [keys]);
Returns a new object which doesn't contain the omitted keys
. Keys
must be array.
const scores = {
Jason: 2,
Sam: 3,
Jane: 1
};
osm.omit(scores, ['Jason', 'Sam']); //returns {Jane: 1}
FAQs
A modern JavaScript library which offers utility functions for objects in JavaScript
The npm package osm.js receives a total of 2 weekly downloads. As such, osm.js popularity was classified as not popular.
We found that osm.js 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.