Skip to content

Commit

Permalink
remove non-gzipped size in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpolletvillard committed Jun 22, 2018
1 parent 9749b3a commit 69ed4c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions build/update-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ const pkg = require('../package.json');

function updateIndex(html){
const libPath = "./dist/object-model.min.js"
const minSize = fs.statSync(libPath).size;
const gzipSize = getGzipSize(fs.readFileSync(libPath, 'utf8'));

console.info(`${pkg.name} v${pkg.version}: ${filesize(minSize)} minified, ${filesize(gzipSize)} gzipped`)
console.info(`${pkg.name} v${pkg.version}: ${filesize(gzipSize)} minified and gzipped`)

return html
.replace(/(<strong class="size-min">)([^<]+)(<\/strong>)/g, `$1${ filesize(minSize) }$3`)
.replace(/(<strong class="size-gzip">)([^<]+)(<\/strong>)/g, `$1${ filesize(gzipSize) }$3`)
.replace(/(<span class="version">)([^<]+)(<\/span>)/g, `$1${ pkg.version }$3`)
.replace(/(<a class="link-zip")([^<]+)(<\/a>)/g,
Expand Down
9 changes: 3 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ <h2>What's inside the box ?</h2>
<li>Constants and private properties based on name conventions</li>
<li>Explicit error messages</li>
<li>Customizable error handlers</li>
<li>all in
<strong class="size-min">9.96 KB</strong> minified,
<strong class="size-gzip">3.94 KB</strong> gzipped,
<li>all in <strong class="size-gzip">3.97 KB</strong> minified and gzipped,
even less when using tree-shaking
</li>
</ul>
Expand All @@ -136,8 +134,7 @@ <h3>Current version: v<span class="version">3.5.1</span></h3>
<code>npm install objectmodel</code>
</li>
<li>From CDN: <a href="https://unpkg.com/objectmodel">unpkg.com/objectmodel</a></li>
<li>Minified bundle (<strong class="size-min">9.96 KB</strong>,
<strong class="size-gzip">3.94 KB</strong> gzipped) :
<li>Minified bundle (<strong class="size-gzip">3.97 KB</strong> gzipped) :
<a href="dist/object-model.min.js">object-model.min.js</a>
</li>
<li>Source files :
Expand Down Expand Up @@ -714,7 +711,7 @@ <h2>Array models</h2>
const Cards = new ArrayModel([Number, "J","Q","K"]);

// Hand is an array of 2 Numbers, J, Q, or K
const Hand = Cards.assert(a => a.length === 2, "should have two cards");</code></pre>
const Hand = Cards.extend().assert(a => a.length === 2, "should have two cards");</code></pre>
</div>

<div class="panel panel2">
Expand Down

0 comments on commit 69ed4c5

Please sign in to comment.