particle-api-js 10.3.0 → 10.3.1

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.
@@ -1,15 +1,15 @@
1
1
 
2
2
  const fixtures = {
3
- 'libraries.json': require('./libraries.json'),
4
- 'library.json': require('./library.json'),
5
- 'libraryVersions.json': require('./libraryVersions.json')
3
+ 'libraries.json': require('./libraries.json'),
4
+ 'library.json': require('./library.json'),
5
+ 'libraryVersions.json': require('./libraryVersions.json')
6
6
  };
7
7
 
8
8
  function read(filename) {
9
- if (!fixtures[filename]) {
10
- throw new Error(`Fixture ${filename} doesn't exit`);
11
- }
12
- return fixtures[filename];
9
+ if (!fixtures[filename]) {
10
+ throw new Error(`Fixture ${filename} doesn't exit`);
11
+ }
12
+ return fixtures[filename];
13
13
  }
14
14
 
15
15
  module.exports = { read };
@@ -4,24 +4,24 @@ const fixtures = require('../fixtures');
4
4
 
5
5
 
6
6
  class FixtureHttpServer {
7
- constructor(){
8
- this.app = express();
9
- this.app.get('/:filename', (req, res) => {
10
- res.writeHead(200, { 'Content-Type': 'application/octet-stream' });
11
- res.end(fixtures.read(req.params['filename']), 'binary');
12
- });
13
- }
7
+ constructor(){
8
+ this.app = express();
9
+ this.app.get('/:filename', (req, res) => {
10
+ res.writeHead(200, { 'Content-Type': 'application/octet-stream' });
11
+ res.end(fixtures.read(req.params['filename']), 'binary');
12
+ });
13
+ }
14
14
 
15
- // Call in a before() test hook
16
- listen(){
17
- return new Promise(fulfill => {
18
- this.server = this.app.listen(0, fulfill);
19
- });
20
- }
15
+ // Call in a before() test hook
16
+ listen(){
17
+ return new Promise(fulfill => {
18
+ this.server = this.app.listen(0, fulfill);
19
+ });
20
+ }
21
21
 
22
- url(){
23
- return `http://localhost:${this.server.address().port}`;
24
- }
22
+ url(){
23
+ return `http://localhost:${this.server.address().port}`;
24
+ }
25
25
  }
26
26
 
27
27
  module.exports = FixtureHttpServer;
@@ -11,7 +11,7 @@ chai.use(chaiAsPromised);
11
11
  const expect = chai.expect;
12
12
 
13
13
  module.exports = {
14
- chai,
15
- sinon,
16
- expect
14
+ chai,
15
+ sinon,
16
+ expect
17
17
  };
package/tsconfig.json CHANGED
@@ -6,7 +6,9 @@
6
6
  "checkJs": true,
7
7
  "skipLibCheck": true,
8
8
  "esModuleInterop": true,
9
- "resolveJsonModule": true
9
+ "resolveJsonModule": true,
10
+ "strict": true,
11
+ "noImplicitAny": false
10
12
  },
11
13
  "types": ["node"],
12
14
  "include": [ "src" ],
package/webpack.config.js CHANGED
@@ -3,43 +3,43 @@ const webpack = require('webpack');
3
3
  const TerserPlugin = require('terser-webpack-plugin');
4
4
 
5
5
  module.exports = (env) => {
6
- return {
7
- mode: env.mode,
8
- target: 'web',
9
- entry: './src/Particle.js',
10
- devtool: 'source-map',
11
- output: {
12
- filename: `particle${env.mode === 'production' ? '.min' : ''}.js`,
13
- path: path.resolve(__dirname, 'dist'),
14
- clean: true,
15
- library: {
16
- name: 'Particle',
17
- type: 'var'
18
- }
19
- },
20
- optimization: {
21
- minimize: env.mode === 'production',
22
- minimizer: [new TerserPlugin({
23
- extractComments: false,
24
- terserOptions: {
25
- format: {
26
- comments: false
27
- }
28
- }
29
- })]
30
- },
31
- resolve: {
32
- fallback: {
33
- buffer: require.resolve('buffer'),
34
- events: require.resolve('events'),
35
- url: require.resolve('url')
36
- }
37
- },
38
- plugins: [
39
- new webpack.ProvidePlugin({
40
- Buffer: ['buffer', 'Buffer'],
41
- process: 'process/browser',
42
- })
43
- ]
44
- };
6
+ return {
7
+ mode: env.mode,
8
+ target: 'web',
9
+ entry: './src/Particle.js',
10
+ devtool: 'source-map',
11
+ output: {
12
+ filename: `particle${env.mode === 'production' ? '.min' : ''}.js`,
13
+ path: path.resolve(__dirname, 'dist'),
14
+ clean: true,
15
+ library: {
16
+ name: 'Particle',
17
+ type: 'var'
18
+ }
19
+ },
20
+ optimization: {
21
+ minimize: env.mode === 'production',
22
+ minimizer: [new TerserPlugin({
23
+ extractComments: false,
24
+ terserOptions: {
25
+ format: {
26
+ comments: false
27
+ }
28
+ }
29
+ })]
30
+ },
31
+ resolve: {
32
+ fallback: {
33
+ buffer: require.resolve('buffer'),
34
+ events: require.resolve('events'),
35
+ url: require.resolve('url')
36
+ }
37
+ },
38
+ plugins: [
39
+ new webpack.ProvidePlugin({
40
+ Buffer: ['buffer', 'Buffer'],
41
+ process: 'process/browser',
42
+ })
43
+ ]
44
+ };
45
45
  };