Skip to content

Commit 18f1589

Browse files
committed
added few reminders and jsdoc
1 parent fc4d033 commit 18f1589

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ import parser from './parser';
1313

1414
let plugins = [localByDefault, extractImports, scope];
1515

16-
const load = (sourceString, sourcePath, trace, pathFetcher) => {
16+
/**
17+
* @param {string} sourceString The file content
18+
* @param {string} sourcePath
19+
* @param {string} trace
20+
* @param {function} pathFetcher
21+
* @return {object}
22+
*/
23+
function load(sourceString, sourcePath, trace, pathFetcher) {
24+
// @todo To think about a better way to export tokens from the plugin
1725
let exportTokens = {};
26+
1827
let result = postcss(plugins.concat(new parser({ exportTokens, pathFetcher, trace })))
1928
.process(sourceString, {from: '/' + sourcePath})
2029
.stringify();

src/parser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const importRegexp = /^:import\((.+)\)$/
77
export default plugin('parser', function (opts) {
88
opts = opts || {};
99

10+
// have to export it outside of the plugin :()
1011
let exportTokens = opts.exportTokens;
1112
let translations = {};
1213

0 commit comments

Comments
 (0)