Gathering detailed insights and metrics for @joshaber/webpack-sources
Gathering detailed insights and metrics for @joshaber/webpack-sources
npm install @joshaber/webpack-sources
Typescript
Module System
72.9
Supply Chain
98.9
Quality
74.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
576
Last Day
2
Last Week
4
Last Month
12
Last Year
63
262 Stars
299 Commits
71 Forks
10 Watching
10 Branches
93 Contributors
Minified
Minified + Gzipped
Latest Version
1.3.1
Package Id
@joshaber/webpack-sources@1.3.1
Unpacked Size
29.54 kB
Size
7.93 kB
File Count
16
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
300%
4
Compared to previous week
Last month
100%
12
Compared to previous month
Last year
-47.1%
63
Compared to previous year
Contains multiple classes which represent a Source
. A Source
can be asked for source code, size, source map and hash.
Source
Base class for all sources.
All methods should be considered as expensive as they may need to do computations.
source
1Source.prototype.source() -> String | ArrayBuffer
Returns the represented source code as string.
size
1Source.prototype.size() -> Number
Returns the size in chars of the represented source code.
map
1Source.prototype.map(options: Object) -> Object | null
Returns the SourceMap of the represented source code as JSON. May return null
if no SourceMap is available.
The options
object can contain the following keys:
columns: Boolean
(default true
): If set to false the implementation may omit mappings for columns.module: Boolean
(default true
): If set to false the implementation may omit inner mappings for modules.sourceAndMap
1Source.prototype.sourceAndMap(options: Object) -> { 2 code: String, 3 map: Object 4}
Returns both, source code (like Source.prototype.source()
and SourceMap (like Source.prototype.map()
). This method could have better performance than calling source()
and map()
separately.
See map()
for options
.
updateHash
1Source.prototype.updateHash(hash: Hash) -> void
Updates the provided Hash
object with the content of the represented source code. (Hash
is an object with an update
method, which is called with string values)
node
(optional)1Source.prototype.node(options: Object) -> SourceNode
This is an optional method. It may be null
if not implemented.
Returns a SourceNode
(see source-map library) for the represented source code.
See map()
for options
.
listNode
(optional)1Source.prototype.listNode(options: Object) -> SourceNode
This is an optional method. It may be null
if not implemented.
Returns a SourceListMap
(see source-list-map library) for the represented source code.
See map()
for options
.
RawSource
Represents source code without SourceMap.
1new RawSource(sourceCode: String)
OriginalSource
Represents source code, which is a copy of the original file.
1new OriginalSource(
2 sourceCode: String,
3 name: String
4)
sourceCode
: The source code.name
: The filename of the original source code.OriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (;
, {
, }
).
SourceMapSource
Represents source code with SourceMap, optionally having an additional SourceMap for the original source.
1new SourceMapSource( 2 sourceCode: String, 3 name: String, 4 sourceMap: Object | String, 5 originalSource?: String, 6 innerSourceMap?: Object | String 7)
sourceCode
: The source code.name
: The filename of the original source code.sourceMap
: The SourceMap for the source code.originalSource
: The source code of the original file. Can be omitted if the sourceMap
already contains the original source code.innerSourceMap
: The SourceMap for the originalSource
/name
.LineToLineMappedSource
Represents source code, which is mapped line by line to the original file.
1new LineToLineMappedSource(
2 sourceCode: String,
3 name: String,
4 originalSource: String
5)
sourceCode
: The source code.name
: The filename of the original source code.originalSource
: The original source code.CachedSource
Decorates a Source
and caches returned results of map
, source
, size
and sourceAndMap
in memory. Every other operation is delegated to the wrapped Source
.
1new CachedSource(source: Source)
PrefixSource
Prefix every line of the decorated Source
with a provided string.
1new PrefixSource(
2 prefix: String,
3 source: Source
4)
ConcatSource
Concatenate mulitple Source
s or strings to a single source.
1new ConcatSource( 2 ...items?: Source | String 3)
add
1ConcatSource.prototype.add(item: Source | String)
Adds an item to the source.
ReplaceSource
Decorates a Source
with replacements and insertions of source code.
replace
1ReplaceSource.prototype.replace( 2 start: Number, 3 end: Number, 4 replacement: String 5)
Replaces chars from start
(0-indexed, inclusive) to end
(0-indexed, inclusive) with replacement
.
Locations represents locations in the original source and are not influenced by other replacements or insertions.
insert
1ReplaceSource.prototype.insert( 2 pos: Number, 3 insertion: String 4)
Inserts the insertion
before char pos
(0-indexed).
Location represents location in the original source and is not influenced by other replacements or insertions.
original
Get decorated Source
.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/10 approved changesets -- score normalized to 5
Reason
7 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
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