
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
trie-pos-list
Advanced tools
get trie position list { position: keyword[] }
npm install trie-pos-list
import triePosList, { allPosMax } from 'trie-pos-list';
import equals = require('deep-eql');
let words = 'yasherhs';
/**
* @see https://github.com/bluelovers/aho-corasick
*/
let positions = {
'2': ['she'],
'3': ['h', 'he', 'her'],
'6': ['h']
};
let ret1 = triePosList(words, positions);
console.log(ret1);
/*
{ '0': [ 'ya' ],
'2': [ 's', 'she', 'sher' ],
'3': [ 'h', 'he', 'her' ],
'4': [ 'er' ],
'5': [ 'r' ],
'6': [ 'h' ],
'7': [ 's' ] }
*/
// more
let ret2 = allPosMax(words, ret1);
console.log(ret2);
/*
{ '0': [ 'y', 'ya', 'yas', 'yash', 'yashe', 'yasher', 'yasherh' ],
'1': [ 'a', 'as', 'ash', 'ashe', 'asher', 'asherh' ],
'2': [ 's', 'sh', 'she', 'sher', 'sherh' ],
'3': [ 'h', 'he', 'her', 'herh' ],
'4': [ 'e', 'er', 'erh' ],
'5': [ 'r', 'rh' ],
'6': [ 'h' ],
'7': [ 's' ] }
*/
let ret3 = allPosMax(words, positions);
console.log(ret3);
console.log(`ret2 same as ret3:`, equals(ret2, ret3));
FAQs
get trie position list { position: keyword[] }
The npm package trie-pos-list receives a total of 16 weekly downloads. As such, trie-pos-list popularity was classified as not popular.
We found that trie-pos-list 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
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.