![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.
datamap-interface
Advanced tools
A simple interface for a map.
npm:
$ npm install datamap-interface
$ component install wooorm/datamap-interface
$ bower install datamap-interface
Duo:
var DatamapInterface = require('wooorm/datamap-interface');
var DatamapInterface = require('datamap-interface');
var animals = new DatamapInterface({
'shark' : 'fish',
'tuna' : 'fish',
'colugo' : 'mammal',
'human' : 'mammal'
});
animals.get('human'); // 'mammal'
animals.get('unicorn'); // null
animals.add('unicorn', 'mammal').get('unicorn'); // 'mammal'
animals.remove('unicorn').has('unicorn'); // false
datamap-interface exports a constructor, which can be passed an object.
var DatamapInterface = require('datamap-interface');
var animals = new DatamapInterface({
'unicorn' : 'mystical creature',
'shark' : 'fish',
'tuna' : 'fish',
'colugo' : 'mammal',
'human' : 'mammal'
});
Alias:
DatamapInterface#is()
animals.has('unicorn'); // true
animals.has('rainbow'); // false
Returns whether (true
) or not (false
) a key
is in the map.
animals.get('unicorn'); // 'mystical creature'
animals.get('rainbow'); // null
Get the value for key
in map, or null
.
animals.add('giant grouper', 'fish');
animals.add({
'dragon' : 'mystical creature'
});
DatamapInterface#add(key, value)
: Add value
as key
to map;DatamapInterface#add(values)
: Add every item in values
to map.Returns self.
animals.remove(['giant grouper', 'human']);
animals.remove('dragon');
DatamapInterface#remove(key)
: Remove key
from map;DatamapInterface#remove(keys)
: Remove every key in keys
from map.Returns self. No error is thrown when non-existent values are removed.
animals.keys(); // ['shark', 'tuna', 'colugo', 'unicorn']
Return the map as an Object
.
Alias:
DatamapInterface#valueOf()
,DatamapInterface#toJSON()
animals.all();
/**
* {
* 'shark' : 'fish',
* 'tuna' : 'fish',
* 'colugo' : 'mammal',
* 'unicorn' : 'mystical creature'
* }
*/
Return the map as an Object
.
FAQs
Legacy package (use `Map`)
We found that datamap-interface 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.