[][src]Struct might_be_minified::Analysis

pub struct Analysis { /* fields omitted */ }

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

impl Send for Analysis

impl Sync for Analysis

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.