From fe58756da23572df2030099959c4c402a416c810 Mon Sep 17 00:00:00 2001 From: Jakob Linskeseder Date: Tue, 21 Dec 2021 20:42:00 +0100 Subject: [PATCH] Fix typos This was found by running an IntellijIDE code inspection for proofreading. --- docs/compiler-api.md | 2 +- docs/decorators-api.md | 2 +- lib/handlebars/compiler/code-gen.js | 2 +- lib/handlebars/helpers/each.js | 2 +- lib/handlebars/helpers/if.js | 2 +- lib/handlebars/internal/proto-access.js | 4 ++-- spec/data.js | 4 ++-- spec/utils.js | 2 +- spec/vendor/require.js | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/compiler-api.md b/docs/compiler-api.md index 5a4c3a4d..01a1df5b 100644 --- a/docs/compiler-api.md +++ b/docs/compiler-api.md @@ -291,7 +291,7 @@ scanner.accept(ast); The current node's ancestors will be maintained in the `parents` array, with the most recent parent listed first. -The visitor may also be configured to operate in mutation mode by setting the `mutating` field to true. When in this mode, handler methods may return any valid AST node and it will replace the one they are currently operating on. Returning `false` will remove the given value (if valid) and returning `undefined` will leave the node in tact. This return structure only apply to mutation mode and non-mutation mode visitors are free to return whatever values they wish. +The visitor may also be configured to operate in mutation mode by setting the `mutating` field to true. When in this mode, handler methods may return any valid AST node and it will replace the one they are currently operating on. Returning `false` will remove the given value (if valid) and returning `undefined` will leave the node intact. This return structure only apply to mutation mode and non-mutation mode visitors are free to return whatever values they wish. Implementors that may need to support mutation mode are encouraged to utilize the `acceptKey`, `acceptRequired` and `acceptArray` helpers which provide the conditional overwrite behavior as well as implement sanity checks where pertinent. diff --git a/docs/decorators-api.md b/docs/decorators-api.md index 6c77fd99..e4a5df9a 100644 --- a/docs/decorators-api.md +++ b/docs/decorators-api.md @@ -2,7 +2,7 @@ **Decorators are deprecated, please join the discussion at [#1574](https://github.com/wycats/handlebars.js/issues/1574) to see what we can do about it.** -Decorators allow for blocks to be annotated with metadata or wrapped in functionality prior to execution of the block. This may be used to communicate with the containing helper or to setup a particular state in the system prior to running the block. +Decorators allow for blocks to be annotated with metadata or wrapped in functionality prior to execution of the block. This may be used to communicate with the containing helper or to set up a particular state in the system prior to running the block. Decorators are registered through similar methods as helpers, `registerDecorators` and `unregisterDecorators`. These can then be referenced via the friendly name in the template using the `{{* decorator}}` and `{{#* decorator}}{/decorator}}` syntaxes. These syntaxes are derivatives of the normal mustache syntax and as such have all of the same argument and whitespace behaviors. diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js index 4a174ba0..68180288 100644 --- a/lib/handlebars/compiler/code-gen.js +++ b/lib/handlebars/compiler/code-gen.js @@ -6,7 +6,7 @@ let SourceNode; try { /* istanbul ignore next */ if (typeof define !== 'function' || !define.amd) { - // We don't support this in AMD environments. For these environments, we asusme that + // We don't support this in AMD environments. For these environments, we assume that // they are running on the browser and thus have no need for the source-map library. let SourceMap = require('source-map'); SourceNode = SourceMap.SourceNode; diff --git a/lib/handlebars/helpers/each.js b/lib/handlebars/helpers/each.js index 33d19190..47482f9e 100644 --- a/lib/handlebars/helpers/each.js +++ b/lib/handlebars/helpers/each.js @@ -60,7 +60,7 @@ export default function(instance) { Object.keys(context).forEach(key => { // We're running the iterations one step out of sync so we can detect // the last iteration without have to scan the object twice and create - // an itermediate keys array. + // an intermediate keys array. if (priorKey !== undefined) { execIteration(priorKey, i - 1); } diff --git a/lib/handlebars/helpers/if.js b/lib/handlebars/helpers/if.js index db06df26..74d5dac5 100644 --- a/lib/handlebars/helpers/if.js +++ b/lib/handlebars/helpers/if.js @@ -11,7 +11,7 @@ export default function(instance) { } // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the + // The `includeZero` option may be set to treat the conditional as purely not empty based on the // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. if ((!options.hash.includeZero && !conditional) || isEmpty(conditional)) { return options.inverse(this); diff --git a/lib/handlebars/internal/proto-access.js b/lib/handlebars/internal/proto-access.js index a8c5394d..f58cab50 100644 --- a/lib/handlebars/internal/proto-access.js +++ b/lib/handlebars/internal/proto-access.js @@ -47,11 +47,11 @@ function checkWhiteList(protoAccessControlForType, propertyName) { if (protoAccessControlForType.defaultValue !== undefined) { return protoAccessControlForType.defaultValue; } - logUnexpecedPropertyAccessOnce(propertyName); + logUnexpectedPropertyAccessOnce(propertyName); return false; } -function logUnexpecedPropertyAccessOnce(propertyName) { +function logUnexpectedPropertyAccessOnce(propertyName) { if (loggedProperties[propertyName] !== true) { loggedProperties[propertyName] = true; logger.log( diff --git a/spec/data.js b/spec/data.js index bde61732..67679812 100644 --- a/spec/data.js +++ b/spec/data.js @@ -217,7 +217,7 @@ describe('data', function() { }) .withInput({ exclaim: true, zomg: 'planet' }) .withRuntimeOptions({ data: { adjective: 'happy' } }) - .withMessage('Overriden data output by helper') + .withMessage('Overridden data output by helper') .toCompileTo('sad world?'); }); @@ -232,7 +232,7 @@ describe('data', function() { }) .withInput({ exclaim: true, zomg: 'world' }) .withRuntimeOptions({ data: { adjective: 'happy' } }) - .withMessage('Overriden data output by helper') + .withMessage('Overridden data output by helper') .toCompileTo('sad world?'); }); diff --git a/spec/utils.js b/spec/utils.js index f4a4e3e4..8ce53986 100644 --- a/spec/utils.js +++ b/spec/utils.js @@ -22,7 +22,7 @@ describe('utils', function() { }); describe('#escapeExpression', function() { - it('shouhld escape html', function() { + it('should escape html', function() { equals( Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo<&"'>' diff --git a/spec/vendor/require.js b/spec/vendor/require.js index 2ce09b5e..05dc42fc 100644 --- a/spec/vendor/require.js +++ b/spec/vendor/require.js @@ -1488,7 +1488,7 @@ var requirejs, require, define; /** * Called to enable a module if it is still in the registry * awaiting enablement. A second arg, parent, the parent module, - * is passed in for context, when this method is overriden by + * is passed in for context, when this method is overridden by * the optimizer. Not shown here to keep code compact. */ enable: function (depMap) {