Skip to content

Commit b773c17

Browse files
authored
docs(src/cache): update JSDoc comments (#846)
1 parent a92949a commit b773c17

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/cache.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const makeDir = require("make-dir");
3030
*
3131
* @async
3232
* @params {String} filename
33+
* @params {Boolean} compress
3334
*/
3435
const read = async function(filename, compress) {
3536
const data = await readFile(filename + (compress ? ".gz" : ""));
@@ -43,6 +44,7 @@ const read = async function(filename, compress) {
4344
*
4445
* @async
4546
* @params {String} filename
47+
* @params {Boolean} compress
4648
* @params {String} result
4749
*/
4850
const write = async function(filename, compress, result) {
@@ -130,31 +132,23 @@ const handleCache = async function(directory, params) {
130132
*
131133
* @async
132134
* @param {Object} params
133-
* @param {String} params.directory Directory to store cached files
134-
* @param {String} params.identifier Unique identifier to bust cache
135+
* @param {String} params.cacheDirectory Directory to store cached files
136+
* @param {String} params.cacheIdentifier Unique identifier to bust cache
137+
* @param {Boolean} params.cacheCompression Whether compressing cached files
135138
* @param {String} params.source Original contents of the file to be cached
136139
* @param {Object} params.options Options to be given to the transform fn
137-
* @param {Function} params.transform Function that will transform the
138-
* original file and whose result will be
139-
* cached
140140
*
141141
* @example
142142
*
143-
* cache({
144-
* directory: '.tmp/cache',
145-
* identifier: 'babel-loader-cachefile',
143+
* const result = await cache({
144+
* cacheDirectory: '.tmp/cache',
145+
* cacheIdentifier: 'babel-loader-cachefile',
146146
* cacheCompression: false,
147147
* source: *source code from file*,
148148
* options: {
149149
* experimental: true,
150150
* runtime: true
151151
* },
152-
* transform: function(source, options) {
153-
* var content = *do what you need with the source*
154-
* return content;
155-
* }
156-
* }, function(err, result) {
157-
*
158152
* });
159153
*/
160154

0 commit comments

Comments
 (0)