Skip to content

Commit

Permalink
docs: restore documentation coverage
Browse files Browse the repository at this point in the history
#209 removed some
documentation coverage which causes other classes that reference the
documentation in other libraries to fail.
  • Loading branch information
kylef committed Feb 25, 2019
1 parent 4fb967e commit e2c77ee
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Minim Changelog

## Master

### Bug Fixes

- Restores documentation coverage for all elements, some was unintentionally
removed in 0.23.0.

## 0.23.0 (2019-02-22)

### Breaking
Expand Down
2 changes: 2 additions & 0 deletions lib/ObjectSlice.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const negate = require('lodash/negate');
const ArraySlice = require('./ArraySlice');

/**
*/
class ObjectSlice extends ArraySlice {
map(callback, thisArg) {
return this.elements.map(member => callback.bind(thisArg)(member.value, member.key, member));
Expand Down
10 changes: 10 additions & 0 deletions lib/primitives/ArrayElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ class ArrayElement extends Element {

// Fantasy Land

/**
* @returns {ArrayElement} An empty array element
*/
empty() {
return new this.constructor([]);
}
Expand All @@ -288,6 +291,10 @@ class ArrayElement extends Element {
return this.empty();
}

/**
* @param {ArrayElement} other
* @returns {ArrayElement}
*/
concat(other) {
return new this.constructor(this.content.concat(other.content));
}
Expand Down Expand Up @@ -355,6 +362,9 @@ class ArrayElement extends Element {
}
}

/**
* @returns {ArrayElement} An empty array element
*/
ArrayElement.empty = function empty() {
return new this();
};
Expand Down
6 changes: 4 additions & 2 deletions lib/primitives/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Element {
return copy;
}

/**
*/
toValue() {
if (this.content instanceof Element) {
return this.content.toValue();
Expand Down Expand Up @@ -280,7 +282,7 @@ class Element {
}

/**
* @type this.ObjectElement
* @type ObjectElement
*/
get meta() {
if (!this._meta) {
Expand Down Expand Up @@ -308,7 +310,7 @@ class Element {
* The attributes property defines attributes about the given instance
* of the element, as specified by the element property.
*
* @type this.ObjectElement
* @type ObjectElement
*/
get attributes() {
if (!this._attributes) {
Expand Down
8 changes: 6 additions & 2 deletions lib/primitives/NullElement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const Element = require('./Element');

module.exports = class NullElement extends Element {
/**
*/
class NullElement extends Element {
constructor(content, meta, attributes) {
super(content || null, meta, attributes);
this.element = 'null';
Expand All @@ -13,4 +15,6 @@ module.exports = class NullElement extends Element {
set() {
return new Error('Cannot set the value of null');
}
};
}

module.exports = NullElement;
4 changes: 4 additions & 0 deletions lib/primitives/ObjectElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ class ObjectElement extends ArrayElement {
return this;
}

/**
*/
keys() {
return this.content.map(item => item.key.toValue());
}

/**
*/
values() {
return this.content.map(item => item.value.toValue());
}
Expand Down

0 comments on commit e2c77ee

Please sign in to comment.