Gathering detailed insights and metrics for common-sequence
Gathering detailed insights and metrics for common-sequence
Gathering detailed insights and metrics for common-sequence
Gathering detailed insights and metrics for common-sequence
Returns an array containing the initial elements which both input arrays have in common.
npm install common-sequence
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17 Commits
2 Watching
1 Branches
1 Contributors
Updated on 06 Sept 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.8%
52,757
Compared to previous day
Last week
-5.3%
317,079
Compared to previous week
Last month
41.9%
1,239,482
Compared to previous month
Last year
-6.2%
10,650,448
Compared to previous year
Returns an array containing the initial elements which both input arrays have in common.
A common use-case for this is discovering common ancestors between two file paths.
1> commonSequence = require('common-sequence'); 2 3> pathA = '/Users/lloyd/Documents/75lb/dmd'.split('/'); 4> pathB = '/Users/lloyd/Documents/75lb/array-tools'.split('/'); 5 6> commonSequence(pathA, pathB).join('/'); 7'/Users/lloyd/Documents/75lb'
or a more trivial example:
1> a.commonSequence([ 1, 2, 3 ], [ 1, 2, 4 ]) 2[ 1, 2 ]
Array
⏏Returns the initial elements which both input arrays have in common
Kind: Exported function
Param | Type | Description |
---|---|---|
a | Array | first array to compare |
b | Array | second array to compare |
This library is compatible with Node.js and the Web. It can be loaded anywhere, natively without transpilation.
Node.js CommonJS:
1const commonSequence = require('common-sequence')
Node.js ECMAScript Module:
1import commonSequence from 'common-sequence'
Within an modern browser ECMAScript Module:
1import commonSequence from './node_modules/common-sequence/index.js'
© 2015-25 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More