@awesomeness-js/utils 1.0.1 → 1.0.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.
package/build.js CHANGED
@@ -2,5 +2,5 @@ import build from './src/build.js';
2
2
 
3
3
  build({
4
4
  src: './src',
5
- dest: ['./', 'index.js']
5
+ dest: './index.js'
6
6
  });
package/index.js CHANGED
@@ -6,13 +6,13 @@
6
6
  import _build from './src/build.js';
7
7
 
8
8
  export default {
9
- /**
10
- * Generates a output file that consolidates all src functions.
11
- *
12
- * @param {Object} [options] - The options for generating the output file.
13
- * @param {string} [options.src='./src'] - The source directory.
14
- * @param {array} [options.dest=['./', 'index.js']] - The destination file.
15
- * @returns {bool} - Returns true if the output file is generated successfully.
9
+ /**
10
+ * Generates a output file that consolidates all src functions.
11
+ *
12
+ * @param {Object} [options] - The options for generating the output file.
13
+ * @param {string} [options.src='./src'] - The source directory.
14
+ * @param {array} [options.dest=['./', 'index.js']] - The destination file.
15
+ * @returns {bool} - Returns true if the output file is generated successfully.
16
16
  */
17
17
  build: _build
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomeness-js/utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Awesomeness - Utils",
5
5
  "repository": {
6
6
  "type": "git",
package/src/build.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { readdirSync, statSync, writeFileSync, readFileSync } from 'fs';
2
- import { dirname, join, sep } from 'path';
3
- import { fileURLToPath } from 'url';
2
+ import { join, sep } from 'path';
4
3
 
5
4
  /**
6
5
  * Generates a output file that consolidates all src functions.
@@ -11,13 +10,6 @@ import { fileURLToPath } from 'url';
11
10
  * @returns {bool} - Returns true if the output file is generated successfully.
12
11
  */
13
12
 
14
- // Resolve __dirname equivalent for ES Modules
15
- const __filename = fileURLToPath(import.meta.url);
16
- const __dirname = dirname(__filename);
17
-
18
- function resolvePath(relativePath) {
19
- return join(__dirname, relativePath);
20
- }
21
13
 
22
14
  function getAllFiles(base, dir, files = []) {
23
15
  const directory = join(base, dir);
@@ -127,10 +119,10 @@ function generateExports(src) {
127
119
 
128
120
  async function build({
129
121
  src = './src',
130
- dest = ['./', 'index.js']
122
+ dest = './index.js'
131
123
  } = {}) {
132
124
  const indexContent = generateExports(src);
133
- writeFileSync(join(...dest), indexContent);
125
+ writeFileSync(dest, indexContent);
134
126
  return true;
135
127
  }
136
128