@parcel/utils 2.0.0-nightly.895 → 2.0.0-nightly.899

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": "@parcel/utils",
3
- "version": "2.0.0-nightly.895+da998f75",
3
+ "version": "2.0.0-nightly.899+e0440dcb",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,11 +21,11 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@iarna/toml": "^2.2.0",
24
- "@parcel/codeframe": "2.0.0-nightly.895+da998f75",
25
- "@parcel/diagnostic": "2.0.0-nightly.895+da998f75",
26
- "@parcel/hash": "2.0.1-nightly.2517+da998f75",
27
- "@parcel/logger": "2.0.0-nightly.895+da998f75",
28
- "@parcel/markdown-ansi": "2.0.0-nightly.895+da998f75",
24
+ "@parcel/codeframe": "2.0.0-nightly.899+e0440dcb",
25
+ "@parcel/diagnostic": "2.0.0-nightly.899+e0440dcb",
26
+ "@parcel/hash": "2.0.1-nightly.2521+e0440dcb",
27
+ "@parcel/logger": "2.0.0-nightly.899+e0440dcb",
28
+ "@parcel/markdown-ansi": "2.0.0-nightly.899+e0440dcb",
29
29
  "@parcel/source-map": "^2.0.0",
30
30
  "ansi-html-community": "0.0.8",
31
31
  "chalk": "^4.1.0",
@@ -46,5 +46,5 @@
46
46
  "@babel/plugin-transform-flow-strip-types": "^7.2.0",
47
47
  "random-int": "^1.0.0"
48
48
  },
49
- "gitHead": "da998f7548f4624bfeb17dd8a3ef17bdd96652a0"
49
+ "gitHead": "e0440dcbe6d6e419a412c8c568d94715cdb4282a"
50
50
  }
package/src/collection.js CHANGED
@@ -6,14 +6,14 @@ export function unique<T>(array: Array<T>): Array<T> {
6
6
 
7
7
  export function objectSortedEntries(obj: {
8
8
  +[string]: mixed,
9
- ...,
9
+ ...
10
10
  }): Array<[string, mixed]> {
11
11
  return Object.entries(obj).sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
12
12
  }
13
13
 
14
14
  export function objectSortedEntriesDeep(object: {
15
15
  +[string]: mixed,
16
- ...,
16
+ ...
17
17
  }): Array<[string, mixed]> {
18
18
  let sortedEntries = objectSortedEntries(object);
19
19
  for (let i = 0; i < sortedEntries.length; i++) {
package/src/debounce.js CHANGED
@@ -6,7 +6,7 @@ export default function debounce<TArgs: Array<mixed>>(
6
6
  ): (...args: TArgs) => void {
7
7
  let timeout;
8
8
 
9
- return function(...args: TArgs) {
9
+ return function (...args: TArgs) {
10
10
  if (timeout) {
11
11
  clearTimeout(timeout);
12
12
  }
@@ -14,10 +14,7 @@ export default function getExisting(
14
14
  return {
15
15
  source,
16
16
  minified: fs.existsSync(minifiedPath)
17
- ? fs
18
- .readFileSync(minifiedPath, 'utf8')
19
- .trim()
20
- .replace(/;$/, '')
17
+ ? fs.readFileSync(minifiedPath, 'utf8').trim().replace(/;$/, '')
21
18
  : source,
22
19
  };
23
20
  }
package/src/hash.js CHANGED
@@ -16,7 +16,7 @@ export function hashStream(stream: Readable): Promise<string> {
16
16
  .on('data', chunk => {
17
17
  hash.writeBuffer(chunk);
18
18
  })
19
- .on('end', function() {
19
+ .on('end', function () {
20
20
  resolve(hash.finish());
21
21
  })
22
22
  .on('error', err => {
@@ -131,9 +131,10 @@ export async function replaceInlineReferences({
131
131
  entryBundle,
132
132
  bundleGraph,
133
133
  );
134
- let packagedContents = (packagedBundle.contents instanceof Readable
135
- ? await bufferStream(packagedBundle.contents)
136
- : packagedBundle.contents
134
+ let packagedContents = (
135
+ packagedBundle.contents instanceof Readable
136
+ ? await bufferStream(packagedBundle.contents)
137
+ : packagedBundle.contents
137
138
  ).toString();
138
139
 
139
140
  let inlineType = nullthrows(entryBundle.getMainEntry()).meta.inlineType;
package/src/schema.js CHANGED
@@ -378,7 +378,7 @@ export function fuzzySearch(
378
378
  return result.map(([v]) => v);
379
379
  }
380
380
 
381
- validateSchema.diagnostic = function(
381
+ validateSchema.diagnostic = function (
382
382
  schema: SchemaEntity,
383
383
  data: {|
384
384
  ...
package/src/sourcemap.js CHANGED
@@ -5,7 +5,8 @@ import SourceMap from '@parcel/source-map';
5
5
  import path from 'path';
6
6
  import {normalizeSeparators, isAbsolute} from './path';
7
7
 
8
- export const SOURCEMAP_RE: RegExp = /(?:\/\*|\/\/)\s*[@#]\s*sourceMappingURL\s*=\s*([^\s*]+)(?:\s*\*\/)?\s*$/;
8
+ export const SOURCEMAP_RE: RegExp =
9
+ /(?:\/\*|\/\/)\s*[@#]\s*sourceMappingURL\s*=\s*([^\s*]+)(?:\s*\*\/)?\s*$/;
9
10
  const DATA_URL_RE = /^data:[^;]+(?:;charset=[^;]+)?;base64,(.*)/;
10
11
  export const SOURCEMAP_EXTENSIONS: Set<string> = new Set<string>([
11
12
  'css',
@@ -5,10 +5,13 @@ import {DefaultMap} from '../src/DefaultMap';
5
5
 
6
6
  describe('DefaultMap', () => {
7
7
  it('constructs with entries just like Map', () => {
8
- let map = new DefaultMap(k => k, [
9
- [1, 3],
10
- [2, 27],
11
- ]);
8
+ let map = new DefaultMap(
9
+ k => k,
10
+ [
11
+ [1, 3],
12
+ [2, 27],
13
+ ],
14
+ );
12
15
  assert.equal(map.get(1), 3);
13
16
  assert.deepEqual(Array.from(map.entries()), [
14
17
  [1, 3],
@@ -34,7 +34,7 @@ describe('throttle', () => {
34
34
 
35
35
  it('preserves the `this` when throttled functions are invoked', () => {
36
36
  let result;
37
- let throttled = throttle(function() {
37
+ let throttled = throttle(function () {
38
38
  result = this.bar;
39
39
  }, 100);
40
40