[−][src]Struct might_be_minified::Analysis
Provides an analysis of a source file
Methods
impl Analysis
[src]
pub fn space_to_code_ratio(&self) -> f32
[src]
Returns the whitespace to code ratio
This is a useful metric to decide on if a file is likely minified code or regular JavaScript code.
pub fn median_ident_length(&self) -> usize
[src]
The median identifier length
This returns the median length for an identifier (name) in the JS source code.
pub fn longest_line(&self) -> usize
[src]
The longest code line length
This returns the length of the longest line. This includes comments and other things.
pub fn shape(&self) -> f32
[src]
The "shape" of the code file
This essentially is height / width
of the file where the height is
the actual number of lines however the width is the p75 line length.
pub fn minified_probability(&self) -> f32
[src]
The proability of the file being minified
Effectively 1.0 (which is unlikely to be reached) means the file is definitely minified. Anything above 0.5 is considered likely to be minified.
pub fn is_likely_minified(&self) -> bool
[src]
Indicates that the file is likely minified
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,