Skip to content

Commit 0a88620

Browse files
Merge branch 'hotfix/access-no-autofill'
2 parents 4e740da + 7cc74fa commit 0a88620

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.1.14
4+
5+
* Make `access` work when not autofilled ([#399](https://github.com/SassDoc/sassdoc/issues/399))
6+
37
## 2.1.13
48

59
* Default destination is relative to CWD ([#403](https://github.com/SassDoc/sassdoc/pull/403))

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://twitter.com/pascalduez"
2222
}
2323
],
24-
"version": "2.1.13",
24+
"version": "2.1.14",
2525
"license": "MIT",
2626
"repository": {
2727
"type": "git",

src/annotation/annotations/access.js

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ export default function access(env) {
3131
return 'public';
3232
},
3333

34+
resolve(data) {
35+
data.forEach(item => {
36+
// Ensure valid access when not autofilled.
37+
if (item.access === 'auto') {
38+
item.access = 'public';
39+
}
40+
});
41+
},
42+
3443
default() {
3544
return 'auto';
3645
},

test/annotations/access.test.js

+6
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ describe('#access', function () {
3838
assert.equal(access.autofill({ context: { name: 'private'}, access: 'private'}), undefined);
3939
assert.equal(access.autofill({ context: { name: '_private-name'}, access: 'auto'}), 'private');
4040
});
41+
42+
it('should work when not autofilled', function () {
43+
var data = [{ access: 'auto' }];
44+
access.resolve(data);
45+
assert.equal(data[0].access, 'public');
46+
});
4147
});

0 commit comments

Comments
 (0)