diff --git a/.travis.yml b/.travis.yml index c14589a..a25e50e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,18 @@ language: node_js services: mongodb +addons: + code_climate: + repo_token: 5311945305435ff955a363abf213e2ba6b384f183cf49b5adaacb268fdf8038c node_js: - 6 cache: directories: - node_modules +script: +- yarn run coverage +after_success: +- npm install -g codeclimate-test-reporter +- codeclimate-test-reporter < coverage/lcov.info deploy: provider: npm email: ikerin@gmail.com diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..86ee2cd --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2016-2017 Enhancv + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index d82c4c3..21c3640 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ Mongoose Originals ================== +[![Build Status](https://travis-ci.org/enhancv/mongoose-originals.svg?branch=master)](https://travis-ci.org/enhancv/mongoose-originals) +[![Code Climate](https://codeclimate.com/github/enhancv/mongoose-originals/badges/gpa.svg)](https://codeclimate.com/github/enhancv/mongoose-originals) +[![Test Coverage](https://codeclimate.com/github/enhancv/mongoose-originals/badges/coverage.svg)](https://codeclimate.com/github/enhancv/mongoose-originals/coverage) A mongoose plugin to retrieve original values @@ -34,3 +37,17 @@ customer.save(); customer.name = 'new name'; console.log(customer.originals.name); ``` + +Since mongoose [has some limitations](https://github.com/Automattic/mongoose/issues/3968) originals object will not be available when you create a brand new unsaved object. To work arround that, you'll need to execute the "initOriginals" method. + +``` +var customer = new Customer({ name: 'test', email: 'example.com' }); +customer.initOriginals(); +console.log(customer.originals.name); +``` + +License +------- + +Copyright (c) 2016-2017 Enhancv +Licensed under the MIT license. diff --git a/package.json b/package.json index b62ff7e..f2b8545 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mongoose-originals", - "version": "1.0.1", + "version": "1.1.0", "description": "Get original value of mongoose fields", "main": "src/index.js", "repository": "git@github.com:enhancv/mongoose-originals.git", @@ -10,11 +10,13 @@ "mongoose": "^4.8" }, "scripts": { - "test": "node_modules/.bin/mocha --recursive" + "test": "node_modules/.bin/mocha --recursive", + "coverage": "node node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --recursive" }, "devDependencies": { - "mongoose": "^4.8", "dotenv": "^4.0.0", - "mocha": "^3.2.0" + "istanbul": "^0.4.5", + "mocha": "^3.2.0", + "mongoose": "^4.8" } } diff --git a/src/index.js b/src/index.js index a97e0a6..c374184 100644 --- a/src/index.js +++ b/src/index.js @@ -1,48 +1,54 @@ -function mongooseOriginals (schema, userOptions) { +function mongooseOriginals(schema, userOptions) { var options = Object.assign({ methods: true }, userOptions); if (!options.fields) { - throw new Error('No fields specified for mongoose originals on schema'); + throw new Error("No fields specified for mongoose originals on schema"); } - function saveOriginalNamed (item) { - + function saveOriginalNamed() { this.original = {}; options.fields.forEach(name => { - this.original[name] = item.toObject()[name]; + this.original[name] = this.toObject()[name]; }); } - schema.post('init', saveOriginalNamed); - schema.post('save', saveOriginalNamed); + function saveConditionalOriginalNamed() { + if (this.original === undefined) { + saveOriginalNamed.bind(this)(); + } + } + + schema.method("initOriginals", saveConditionalOriginalNamed); + schema.post("init", saveOriginalNamed); + schema.post("save", saveOriginalNamed); if (options.methods) { - schema.methods.collectionAdded = function collectionAdded (name) { + schema.methods.collectionAdded = function collectionAdded(name) { var _this = this; - return this[name].filter(function (item) { - return !_this.original[name].find(function (originalItem) { + return this[name].filter(function(item) { + return !_this.original[name].find(function(originalItem) { return item._id.equals(originalItem._id); }); }); }; - schema.methods.collectionRemoved = function collectionRemoved (name) { + schema.methods.collectionRemoved = function collectionRemoved(name) { var _this = this; - return this.original[name].filter(function (originalItem) { - return !_this[name].find(function (item) { + return this.original[name].filter(function(originalItem) { + return !_this[name].find(function(item) { return item._id.equals(originalItem._id); }); }); }; - schema.methods.collectionUpdated = function collectionUpdated (name) { + schema.methods.collectionUpdated = function collectionUpdated(name) { var _this = this; - return this[name].filter(function (item) { - return _this.original[name].find(function (originalItem) { + return this[name].filter(function(item) { + return _this.original[name].find(function(originalItem) { return item._id.equals(originalItem._id); }); }); @@ -50,4 +56,4 @@ function mongooseOriginals (schema, userOptions) { } } -module.exports = mongooseOriginals +module.exports = mongooseOriginals; diff --git a/test/database.js b/test/database.js index a04de24..984979b 100644 --- a/test/database.js +++ b/test/database.js @@ -1,10 +1,10 @@ -'use strict'; +"use strict"; -const path = require('path'); -const dotenv = require('dotenv'); -const mongoose = require('mongoose'); +const path = require("path"); +const dotenv = require("dotenv"); +const mongoose = require("mongoose"); -dotenv.config({ path: path.resolve(__dirname, '../.env') }); +dotenv.config({ path: path.resolve(__dirname, "../.env") }); mongoose.Promise = global.Promise; mongoose.connect(process.env.MONGO_URI); @@ -13,9 +13,8 @@ function clearModels(models) { return Promise.all(removePromises); } -function database (models, test) { - - beforeEach('Clear models', function () { +function database(models, test) { + beforeEach("Clear models", function() { return clearModels(models); }); diff --git a/test/indexTest.js b/test/indexTest.js index 46e31a9..23a6bf0 100644 --- a/test/indexTest.js +++ b/test/indexTest.js @@ -1,104 +1,122 @@ -'use strict'; +"use strict"; + +const assert = require("assert"); +const database = require("./database"); +const mongoose = require("mongoose"); +const Customer = require("./models/Customer"); +const Subscription = require("./models/Subscription"); +const originals = require("../src"); + +describe( + "Customer", + database([Customer], function() { + it("Should throw an error if no fields are defined", function() { + const Schema = mongoose.Schema; + + const TestSchema = new Schema({ + ipAddress: String, + }); -const assert = require('assert'); -const database = require('./database'); -const mongoose = require('mongoose'); -const Customer = require('./models/Customer'); -const originals = require('../src'); + assert.throws(function() { + TestSchema.plugin(originals); + }, /No fields specified for mongoose originals on schema/); + }); -describe('Customer', database([Customer], function () { + it("Should not add collection methods if specified", function() { + const Schema = mongoose.Schema; - it('Should throw an error if no fields are defined', function () { - const Schema = mongoose.Schema; + const TestSchema = new Schema({ + modes: [String], + }); + TestSchema.plugin(originals, { fields: ["modes"], methods: false }); - const TestSchema = new Schema({ - ipAddress: String, - }); + const Test = mongoose.model("Test", TestSchema); + const test = new Test({}); - assert.throws(function () { - TestSchema.plugin(originals); - }, - /No fields specified for mongoose originals on schema/ - ); - }); + assert.ok(!test.collectionAdded); + }); - it('Should not add collection methods if specified', function () { - const Schema = mongoose.Schema; + it("Should be able to save original values", function() { + const customer = new Customer({ + name: "Pesho", + email: "Pesho", + phone: "+318230132", + answers: [{ name: "I am big" }, { name: "I am strong" }], + }); - const TestSchema = new Schema({ - modes: [String], - }); - TestSchema.plugin(originals, { fields: ['modes'], methods: false }); - - const Test = mongoose.model('Test', TestSchema); - const test = new Test({}); - - assert.ok(!test.collectionAdded); - }); - - it('Should be able to save original values', function () { - const customer = new Customer({ - name: 'Pesho', - email: 'Pesho', - phone: '+318230132', - answers: [ - { name: 'I am big' }, - { name: 'I am strong' }, - ], + return customer + .save() + .then(customer => { + const oldCustomer = customer.toObject(); + + customer.name = "New name"; + customer.email = "new-email@example.com"; + customer.phone = "+111111111"; + customer.answers = [{ name: "test" }, { name: "oskar" }]; + + const expected = { + name: oldCustomer.name, + phone: oldCustomer.phone, + answers: oldCustomer.answers, + }; + + assert.deepEqual(customer.original, expected); + + return customer.save(); + }) + .then(customer => { + const newCustomer = customer.toObject(); + + const expected = { + name: newCustomer.name, + phone: newCustomer.phone, + answers: newCustomer.answers, + }; + + assert.deepEqual(customer.original, expected); + }); }); - return customer.save() - .then(customer => { - const oldCustomer = customer.toObject(); + it("Should be able to have proper a Customer", function() { + const customer = new Customer({ + name: "Pesho", + email: "Pesho", + phone: "+318230132", + answers: [{ name: "I am big" }, { name: "I am strong" }], + }); + + return customer.save().then(customer => { + const oldAnswer = customer.answers[0].toObject(); + customer.answers[1].name = "test"; + customer.answers[0].remove(); + customer.answers.push({ name: "added" }); - customer.name = 'New name'; - customer.email = 'new-email@example.com'; - customer.phone = '+111111111'; - customer.answers = [ { name: 'test' }, { name: 'oskar' } ]; + assert.deepEqual(customer.collectionAdded("answers"), [customer.answers[1]]); + assert.deepEqual(customer.collectionRemoved("answers"), [oldAnswer]); + assert.deepEqual(customer.collectionUpdated("answers"), [customer.answers[0]]); + }); + }); - const expected = { - name: oldCustomer.name, - phone: oldCustomer.phone, - answers: oldCustomer.answers, - }; + it("Should work even with unsaved models, by calling initOriginals", function() { + const subscription = new Subscription({ name: "Basic" }); - assert.deepEqual(customer.original, expected); + assert.equal(undefined, subscription.original); - return customer.save(); - }).then(customer => { - const newCustomer = customer.toObject(); + subscription.initOriginals(); - const expected = { - name: newCustomer.name, - phone: newCustomer.phone, - answers: newCustomer.answers, - }; + subscription.discounts.push(subscription.discounts.create({ amount: 20 })); - assert.deepEqual(customer.original, expected); - }); - }); - - it('Should be able to have proper a Customer', function () { - const customer = new Customer({ - name: 'Pesho', - email: 'Pesho', - phone: '+318230132', - answers: [ - { name: 'I am big' }, - { name: 'I am strong' }, - ], - }); + assert.deepEqual({ discounts: [] }, subscription.original); - return customer.save() - .then(customer => { - const oldAnswer = customer.answers[0].toObject(); - customer.answers[1].name = 'test'; - customer.answers[0].remove(); - customer.answers.push({ name: 'added' }); + subscription.initOriginals(); - assert.deepEqual(customer.collectionAdded('answers'), [customer.answers[1]]); - assert.deepEqual(customer.collectionRemoved('answers'), [oldAnswer]); - assert.deepEqual(customer.collectionUpdated('answers'), [customer.answers[0]]); - }); - }); -})); + subscription.discounts.push(subscription.discounts.create({ amount: 30 })); + + assert.deepEqual( + { discounts: [] }, + subscription.original, + "Should not change initOriginals" + ); + }); + }) +); diff --git a/test/models/Customer.js b/test/models/Customer.js index 2d75d51..e7d0405 100644 --- a/test/models/Customer.js +++ b/test/models/Customer.js @@ -1,6 +1,6 @@ -const mongoose = require('mongoose'); +const mongoose = require("mongoose"); const Schema = mongoose.Schema; -const originals = require('../../src'); +const originals = require("../../src"); const CustomerSchema = new Schema({ ipAddress: String, @@ -10,8 +10,8 @@ const CustomerSchema = new Schema({ answers: [{ name: String }], }); -CustomerSchema.plugin(originals, { fields: ['name', 'phone', 'answers'] }); +CustomerSchema.plugin(originals, { fields: ["name", "phone", "answers"] }); -const Customer = mongoose.model('Customer', CustomerSchema); +const Customer = mongoose.model("Customer", CustomerSchema); module.exports = Customer; diff --git a/test/models/Subscription.js b/test/models/Subscription.js new file mode 100644 index 0000000..b871743 --- /dev/null +++ b/test/models/Subscription.js @@ -0,0 +1,18 @@ +const mongoose = require("mongoose"); +const Schema = mongoose.Schema; +const originals = require("../../src"); + +const DiscountSchema = new Schema({ + amount: Number, +}); + +const SubscriptionSchema = new Schema({ + name: String, + discounts: [DiscountSchema], +}); + +SubscriptionSchema.plugin(originals, { fields: ["discounts"] }); + +const Subscription = mongoose.model("Subscription", SubscriptionSchema); + +module.exports = Subscription; diff --git a/yarn.lock b/yarn.lock index c5b5d8b..a56b25f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,32 @@ # yarn lockfile v1 +abbrev@1, abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +async@1.x, async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + async@2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/async/-/async-2.1.4.tgz#2d2160c7788032e4dd6cbe2502f1f9a2c8f6cde4" @@ -35,6 +61,25 @@ buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + commander@2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -55,6 +100,14 @@ debug@2.2.0: dependencies: ms "0.7.1" +decamelize@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + diff@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" @@ -71,6 +124,37 @@ escape-string-regexp@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@1.8.x: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@2.7.x, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -86,6 +170,16 @@ glob@7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -94,6 +188,16 @@ growl@1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" +handlebars@^4.0.1: + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -113,10 +217,44 @@ inherits@2, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +istanbul@^0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + +js-yaml@3.x: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + json3@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" @@ -125,6 +263,23 @@ kareem@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/kareem/-/kareem-1.2.1.tgz#acdb8c8119845834abbfa58ade1cf9dea63dc752" +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + lodash._baseassign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" @@ -176,17 +331,21 @@ lodash@^4.14.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -minimatch@^3.0.2: +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +"minimatch@2 || 3", minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" -minimist@0.0.8: +minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -mkdirp@0.5.1: +mkdirp@0.5.1, mkdirp@0.5.x: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -269,16 +428,44 @@ muri@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/muri/-/muri-1.2.1.tgz#ec7ea5ce6ca6a523eb1ab35bacda5fa816c9aa3c" -once@^1.3.0: +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +once@1.x, once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -299,6 +486,10 @@ regexp-clone@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-0.0.1.tgz#a7c2e09891fdbf38fbb10d376fb73003e68ac589" +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + require_optional@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.0.tgz#52a86137a849728eb60a55533617f8f914f59abf" @@ -310,6 +501,16 @@ resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" +resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + semver@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -322,20 +523,90 @@ sliced@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -supports-color@3.1.2: +supports-color@3.1.2, supports-color@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" dependencies: has-flag "^1.0.0" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +which@^1.1.1: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@^1.0.0, wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0"