From d3d9027f9c9235be8e7a650d0e33d4d55287e0e2 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 20 Aug 2019 04:10:24 +0300 Subject: [PATCH] docs: fix typos (#194) --- index.js | 6 +++--- test/tokenize-arg-string.js | 2 +- test/yargs-parser.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 7f00f363..cf7872c5 100644 --- a/index.js +++ b/index.js @@ -166,7 +166,7 @@ function parse (args, opts) { key = arg.match(negatedBoolean)[1] setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false) - // -- seperated by space. + // -- separated by space. } else if (arg.match(/^--.+/) || ( !configuration['short-option-groups'] && arg.match(/^-[^-]+/) )) { @@ -196,12 +196,12 @@ function parse (args, opts) { } } - // dot-notation flag seperated by '='. + // dot-notation flag separated by '='. } else if (arg.match(/^-.\..+=/)) { m = arg.match(/^-([^=]+)=([\s\S]*)$/) setArg(m[1], m[2]) - // dot-notation flag seperated by space. + // dot-notation flag separated by space. } else if (arg.match(/^-.\..+/)) { next = args[i + 1] key = arg.match(/^-(.\..+)/)[1] diff --git a/test/tokenize-arg-string.js b/test/tokenize-arg-string.js index 6795e1d2..8575de65 100644 --- a/test/tokenize-arg-string.js +++ b/test/tokenize-arg-string.js @@ -52,7 +52,7 @@ describe('TokenizeArgString', function () { args[2].should.equal('--bar=""') }) - it('handles quoted string with embeded quotes', function () { + it('handles quoted string with embedded quotes', function () { var args = tokenizeArgString('--foo "hello \'world\'" --bar=\'foo "bar"\'') args[0].should.equal('--foo') args[1].should.equal('"hello \'world\'"') diff --git a/test/yargs-parser.js b/test/yargs-parser.js index e51bb3dc..cb1342cf 100644 --- a/test/yargs-parser.js +++ b/test/yargs-parser.js @@ -83,7 +83,7 @@ describe('yargs-parser', function () { parse.should.have.property('_').with.length(0) }) - it('should explicitly set a boolean option to false if preceeded by "--no-"', function () { + it('should explicitly set a boolean option to false if preceded by "--no-"', function () { var parse = parser(['--no-moo']) parse.should.have.property('moo', false) parse.should.have.property('_').with.length(0) @@ -894,12 +894,12 @@ describe('yargs-parser', function () { argv.foo.bar.cool.should.eql(11) }) - it("should allow flags to use dot notation, when seperated by '='", function () { + it("should allow flags to use dot notation, when separated by '='", function () { var argv = parser(['-f.foo=99']) argv.f.foo.should.eql(99) }) - it("should allow flags to use dot notation, when seperated by ' '", function () { + it("should allow flags to use dot notation, when separated by ' '", function () { var argv = parser(['-f.foo', '99']) argv.f.foo.should.eql(99) })