
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
A trie data structure for arrays instead of strings. There are already many of these on npm, but this is the first one that operates on arrays instead of strings. Inputs can also be specified as 1D ndarrays.
var createTrie = require("array-trie")
var trie = createTrie()
trie.set([1,2,3], 1)
trie.set([1,2], 2)
trie.set([2,5,6], 3)
console.log(trie.get([1,2,3]))
console.log(trie.get([2,5,6]))
console.log(trie.get([1,1,1]))
//Also works if inputs are 1D ndarrays
var ndarray = require("ndarray")
trie.set(ndarray([1,2,3,4]), 5)
console.log(trie.get(ndarray([1,2])))
npm install array-trie
var createTrie = require("array-trie")
var trie = createTrie()
Creates an empty trie data structure
Returns A new trie
trie.set(string, value)
Inserts string
into trie
with value of value
, or updates the value of string if already set.
string
is the string to insertvalue
is the value to assign to the stringReturns value
trie.get(string)
Retrieves the value of string
in the trie
string
is an array of primitive types to searchReturns The value of the string in the trie
trie.symbols
An array of all labels for the children of the trie in sorted order
trie.children
An array of all children for the trie node
trie.value
The value associated with this node in the trie
(c) 2013 Mikola Lysenko. MIT License
FAQs
A trie data structure for arrays
The npm package array-trie receives a total of 65 weekly downloads. As such, array-trie popularity was classified as not popular.
We found that array-trie 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.