Skip to content

Commit

Permalink
Remove strict
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreisnz committed Oct 27, 2023
1 parent 8dc0b08 commit 802e830
Show file tree
Hide file tree
Showing 20 changed files with 5 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,4 @@ See the [Changelog](CHANGELOG.md) for more information.
## License
(MIT License)

Copyright 2015-2020, Adam Reis, Co-founder at [Hello Club](https://helloclub.com/?source=npm)
Copyright 2015-2023, Adam Reis, Co-founder at [Hello Club](https://helloclub.com/?source=npm) and [Frello](https://getfrello.com/?source=npm)
4 changes: 0 additions & 4 deletions bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/usr/bin/env node
'use strict';

/**
* Dependencies
*/
const {argv} = require('yargs');
const replace = require('../lib/replace-in-file');
const loadConfig = require('../lib/helpers/load-config');
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/combine-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const parseConfig = require('./parse-config');

/**
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/error-handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

/**
* Error handler
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/get-paths-async.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const globAsync = require('./glob-async');

/**
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/get-paths-sync.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const glob = require('glob');

/**
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/glob-async.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const glob = require('glob');

/**
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/load-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const path = require('path');

/**
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/make-replacements.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

/**
* Get replacement helper
Expand Down
5 changes: 2 additions & 3 deletions lib/helpers/parse-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

/**
* Defaults
Expand Down Expand Up @@ -33,12 +32,12 @@ module.exports = function parseConfig(config) {
//Extract data
const {files, from, to, processor, ignore, encoding} = config;


if (typeof processor !== 'undefined') {
if (typeof processor !== 'function' && !Array.isArray(processor)) {
throw new Error('Processor should be either a function or an array of functions');
}
} else {
}
else {
//Validate values
if (typeof files === 'undefined') {
throw new Error('Must specify file or files');
Expand Down
6 changes: 1 addition & 5 deletions lib/helpers/process-async.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const fs = require('fs');
const runProcessors = require('./run-processors');

Expand All @@ -24,7 +20,7 @@ module.exports = function processAsync(file, processor, config) {

//Make replacements
const [result, newContents] = runProcessors(
contents, processor, file,
contents, processor, file
);

//Not changed or dry run?
Expand Down
6 changes: 1 addition & 5 deletions lib/helpers/process-sync.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const fs = require('fs');
const runProcessors = require('./run-processors');

Expand All @@ -17,7 +13,7 @@ module.exports = function processSync(file, processor, config) {

//Process contents and check if anything changed
const [result, newContents] = runProcessors(
contents, processor, file,
contents, processor, file
);

//Contents changed and not a dry run? Write to file
Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/replace-async.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const fs = require('fs');
const makeReplacements = require('./make-replacements');

Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/replace-sync.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const fs = require('fs');
const makeReplacements = require('./make-replacements');

Expand Down
4 changes: 0 additions & 4 deletions lib/helpers/success-handler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const chalk = require('chalk');

/**
Expand Down
4 changes: 0 additions & 4 deletions lib/process-file.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const chalk = require('chalk');
const parseConfig = require('./helpers/parse-config');
const getPathsSync = require('./helpers/get-paths-sync');
Expand Down
4 changes: 0 additions & 4 deletions lib/process-file.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
import transform, {sync, processFile, processFileSync} from './process-file';
const fs = require('fs');
const writeFile = Promise.promisify(fs.writeFile);
Expand Down
4 changes: 0 additions & 4 deletions lib/replace-in-file.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
const chalk = require('chalk');
const parseConfig = require('./helpers/parse-config');
const getPathsSync = require('./helpers/get-paths-sync');
Expand Down
4 changes: 0 additions & 4 deletions lib/replace-in-file.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'use strict';

/**
* Dependencies
*/
import replace, {sync, replaceInFile, replaceInFileSync} from './replace-in-file';
const fs = require('fs');
const writeFile = Promise.promisify(fs.writeFile);
Expand Down
1 change: 0 additions & 1 deletion test/helpers/setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

//Load dependencies
const Promise = require('bluebird');
Expand Down

0 comments on commit 802e830

Please sign in to comment.