critical 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e4709c48052096f8a8798a4f23c6bdf73761e87
4
- data.tar.gz: 47f5ffd7e9dc874fa681dc04f2432156f1820f7d
3
+ metadata.gz: c30a74253e51c9450875733e884fa0bf6005fbed
4
+ data.tar.gz: 678187b87a47ac5e7819a93f741b542d6d31fde6
5
5
  SHA512:
6
- metadata.gz: 7307737f5af74af9ad2731cab0e1a5ddef11a87f4ba7c02cb872edb80b5788c36871aab233524bdec78a77892f6fe426d4c36df84ad7378b795b48d67bbb634f
7
- data.tar.gz: 3fb4b98cfe0dacda16d38ca704ece392bb817cd71dd2454b6d4dfc52aec9535149fad4a29c2f01e8b6842fc58a7c725735e1dcf7768c29c3f4b443affaabb8da
6
+ metadata.gz: d953d366319e15823601b13741873d44c4446b4963b42f01e91b9efbfab3f3467323599522bed5eede0d6f4834614335cf012d81675792b7d202915b1e996573
7
+ data.tar.gz: 35f5094bfded328f5bc76a8a4f6b5e36062c93f74e1375eefacf1b40d5b936290879ae0ad2ddf68609535eb76373c4b6379c767a3556dfedef995ee3ac025d8b
@@ -4,7 +4,22 @@ const fs = require('fs');
4
4
  const STDOUT_FD = 1;
5
5
  const STDERR_FD = 2;
6
6
 
7
- const options = JSON.parse(process.argv[2]);
7
+ function hydrateRegexps(opts) {
8
+ if (Array.isArray(opts)) {
9
+ return opts.map(hydrateRegexps);
10
+ } else if (typeof opts === 'object') {
11
+ const keys = Object.keys(opts);
12
+ if (keys.length === 1 && keys[0] === 'RegExp') {
13
+ return new RegExp(opts[keys[0]]);
14
+ }
15
+ keys.forEach(function(key) {
16
+ opts[key] = hydrateRegexps(opts[key]);
17
+ });
18
+ }
19
+ return opts;
20
+ }
21
+
22
+ const options = hydrateRegexps(JSON.parse(process.argv[2]));
8
23
 
9
24
  critical.generate(options).then(function(criticalCss) {
10
25
  if (!options.dest) {
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Critical
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  CRITICAL_VERSION = '0.8.4'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: critical
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-04 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler