Skip to content

Commit

Permalink
Merge pull request goldibex#127 from dinoboff/chore/typos
Browse files Browse the repository at this point in the history
chore: fix typos
  • Loading branch information
dinoboff authored Aug 27, 2017
2 parents c8d6553 + 699dfc1 commit 986d743
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions lib/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Database {
* Simulate a read operation.
*
* @param {string} path Path to read
* @param {nuber} [now] Operation current time stamp
* @param {number} [now] Operation current time stamp
* @return {Result}
*/
read(path, now) {
Expand All @@ -126,12 +126,12 @@ class Database {
}

/**
* Similate a patch (update) operation
* Simulate a patch (update) operation
*
* Update the database with the patch data and then test each updated
* node could be written and is valid.
*
* It similar to a serie of write operation except that all changes happens
* It similar to a series of write operation except that all changes happens
* at once.
*
* @param {string} path Path to the node to write
Expand Down Expand Up @@ -344,8 +344,8 @@ class RuleDataSnapshot {
/**
* Create a new Database.
*
* @param {Ruleset|object} rules DB's rule set
* @param {DataNode|object} data DB's data
* @param {Ruleset|object} rules Database's rule set
* @param {DataNode|object} data Database's data
* @param {number} [now] Last operation timestamp
* @return {Database}
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/database/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ exports.write = function(path, data, newDatabase, newValue) {
};

/**
* Create the result for a patch operation from w serie of write evaluation
* Create the result for a patch operation from a map of write evaluation
* result.
*
* @param {string} path Path to node to patch
* @param {Database} data Database to edit
* @param {object} patch Values to edit with
* @param {array} writeResults List of write eveluation result to merge.
* @param {array} writeResults List of write evaluation result to merge.
* @return {Result}
*/
exports.update = function(path, data, patch, writeResults) {
Expand Down
4 changes: 2 additions & 2 deletions lib/database/ruleset.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ class RulesetNode {
});

// setup children rules
const childrens = Object.keys(rules).filter(k => !k.startsWith('.') && !k.startsWith('$'));
const children = Object.keys(rules).filter(k => !k.startsWith('.') && !k.startsWith('$'));

childrens.forEach(k => {
children.forEach(k => {
this[k] = new RulesetNode(stack.concat(k), rules[k]);
});

Expand Down
8 changes: 4 additions & 4 deletions lib/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function loadSecret(options) {
* (should hold the "projectId" and "secret")
*
* @param {object|string} rules Rules to upload
* @param {{secret: {projecId: string, token: string}}} options Client options
* @param {{secret: {projectId: string, token: string}}} options Client options
* @return {Promise<void,Error>}
*/
exports.deployRules = function(rules, options) {
Expand All @@ -93,7 +93,7 @@ exports.deployRules = function(rules, options) {
* (should hold the "projectId" and "secret").
*
* @param {any} data root data to import
* @param {{secret: {projecId: string, token: string}}} options Client options
* @param {{secret: {projectId: string, token: string}}} options Client options
* @return {Promise<void,Error>}
*/
exports.deployData = function(data, options) {
Expand All @@ -117,7 +117,7 @@ exports.deployData = function(data, options) {
* (should hold the "projectId" and "secret").
*
* @param {object} users Map of name to auth object.
* @param {{secret: {projecId: string, token: string}}} options Client options
* @param {{secret: {projectId: string, token: string}}} options Client options
* @return {Promise<object,Error>}
*/
exports.tokens = function(users, options) {
Expand Down Expand Up @@ -147,7 +147,7 @@ exports.tokens = function(users, options) {
*
* @param {string} path Path to read.
* @param {string} token Legacy id token to use.
* @param {{secret: {projecId: string}}} options Client options
* @param {{secret: {projectId: string}}} options Client options
* @return {Promise<boolean,Error>}
*/
exports.canRead = function(path, token, options) {
Expand Down
4 changes: 2 additions & 2 deletions lib/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class Rule {
* throw.
*
* It will check each node in the expression tree is supported by firebase;
* some expression types are not supported or have stricker rule regarding
* some expression types are not supported or have stricter rule regarding
* types they support.
*
* Some expression allow type checking to be delayed untill runtime evaluation
* Some expression allow type checking to be delayed until runtime evaluation
* when the type cannot be inferred (snapshot value and auth properties).
*
* @param {string} rule Rule to parse
Expand Down
2 changes: 1 addition & 1 deletion lib/parser/specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class RuleSpec {
).then(deployed => {
this.isValid = deployed;

log(` valilidity: ${this.isValid}`);
log(` validity: ${this.isValid}`);

return deployed;
});
Expand Down
8 changes: 4 additions & 4 deletions lib/parser/statement/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ParseError extends Error {
* During instantiation, a node must walk each children expression and should
* attempt to infer its type.
*
* The type of its children must be valididated. If they are invalid it must
* The type of its children must be validated. If they are invalid it must
* throw an Error. Some expressions can delay type validation until runtime
* evaluation and will infer their type to 'any' or 'primitive' in this case.
*
Expand Down Expand Up @@ -89,15 +89,15 @@ class Node {
* Evaluate expression.
*
* @abstract
* @param {object} state Avalaible variables
* @param {object} state Available variables
* @return {string|number|boolean|RegExp|object}
*/
evaluate() {
throw new ParseError(this, `evaluating ${this.astNode.type} is not supported`);
}

/**
* Return the original expression unparsed by esprima.
* Return the original expression.
*
* @return {string}
*/
Expand All @@ -108,7 +108,7 @@ class Node {
/**
* Yield every evaluation and return formatted representation of the expression.
*
* @param {object} state Avalaible variables
* @param {object} state Available variables
* @param {function({original: string, detailed: string, type: string, value: any}): void} cb Evaluation accumulator
* @return {string}
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/parser/statement/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class BinaryNode extends Node {
const assertTypes = allowed => this.assertBranchTypes(lType, rType, allowed, mustComply);
const assertSameType = () => {
if (lType !== rType) {
throw new ParseError(this, `Invalid ${this.operator} expression: Left and right sides types are differents.`);
throw new ParseError(this, `Invalid ${this.operator} expression: Left and right sides types are different.`);
}
};

Expand Down Expand Up @@ -186,7 +186,7 @@ class BinaryNode extends Node {
}

if (left !== right) {
throw new ParseError(this, `Invalid ${this.operator} expression: Left and right sides types are differents.`);
throw new ParseError(this, `Invalid ${this.operator} expression: Left and right sides types are different.`);
}

}
Expand Down
4 changes: 2 additions & 2 deletions lib/parser/statement/conditional.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Node handling tertiary expressions validation and evaluation.
*
* Validate the test and the two concequences nodes.
* Validate the test and the two consequences nodes.
*
* The test inferred type must be boolean and cannot be delayed. There is no
* requirement of the tertiay inferred type; it can be anything.
* requirement of the tertiary inferred type; it can be anything.
*
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/parser/statement/expression.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Node handling root expressions validation and evaluation (delefated to its
* Node handling root expressions validation and evaluation (delegated to its
* child).
*
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/parser/statement/literal.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Node handling literal expressions validation and evaluation.
*
* The only validation concernes the RepExp flags of which on "i" is supported
* The only validation applies the RepExp flags of which on "i" is supported
* by firebase.
*
* TODO: support of ther RexExp limitations.
* TODO: support of Firebase RexExp limitations.
*
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/parser/statement/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MemberNode extends Node {
getPriority: {name: 'getPriority', args: [], returnType: 'any'},
isNumber: {name: 'isNumber', args: [], returnType: 'boolean'},
isString: {name: 'isString', args: [], returnType: 'boolean'},
isBoolean: {name: 'isoolean', args: [], returnType: 'boolean'}
isBoolean: {name: 'iBoolean', args: [], returnType: 'boolean'}
}

};
Expand Down
2 changes: 1 addition & 1 deletion lib/parser/string-methods.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* String methods.
*
* Might have a differnt behavour and have stricter type validation.
* Might have a different behaviour and have stricter type validation.
*
*/

Expand Down

0 comments on commit 986d743

Please sign in to comment.