From f60b928c1149fa0f440f26c4377a127c2f1a4b80 Mon Sep 17 00:00:00 2001 From: sttk Date: Mon, 21 Sep 2020 16:49:16 +0900 Subject: [PATCH 1/5] Build: Update versions of dependencies --- index.js | 2 +- package.json | 16 ++++---- test/copy-props-proc.js | 2 +- test/web/copy-props-proc.js | 2 +- web/copy-props.js | 82 +++++++++++++++++++++++++++---------- web/copy-props.min.js | 2 +- web/copy-props.min.js.map | 2 +- 7 files changed, 74 insertions(+), 34 deletions(-) diff --git a/index.js b/index.js index 633c8fb..37bdfdc 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ 'use strict'; var eachProps = require('each-props'); -var isPlainObject = require('is-plain-object'); +var isPlainObject = require('is-plain-object').isPlainObject; module.exports = function(src, dst, fromto, converter, reverse) { diff --git a/package.json b/package.json index db327c8..1811e44 100644 --- a/package.json +++ b/package.json @@ -35,16 +35,16 @@ }, "homepage": "https://github.com/sttk/copy-props#readme", "dependencies": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" }, "devDependencies": { - "browserify": "^16.2.2", + "browserify": "^16.5.2", "chai": "^3.5.0", - "coveralls": "^3.0.1", - "eslint": "^4.19.1", - "mocha": "^3.2.0", - "nyc": "^11.7.2", - "uglify-js": "^3.3.24" + "coveralls": "^3.1.0", + "eslint": "^7.9.0", + "mocha": "^3.5.3", + "nyc": "^15.1.0", + "uglify-js": "^3.10.4" } } diff --git a/test/copy-props-proc.js b/test/copy-props-proc.js index 0763a14..039dc2e 100644 --- a/test/copy-props-proc.js +++ b/test/copy-props-proc.js @@ -4,7 +4,7 @@ var copyProps = require('..'); var chai = require('chai'); var expect = chai.expect; -/* eslint max-statements: "off", branch-style: "off" */ +/* eslint max-statements: "off" */ describe('Processing', function() { diff --git a/test/web/copy-props-proc.js b/test/web/copy-props-proc.js index 0f06128..40d4585 100644 --- a/test/web/copy-props-proc.js +++ b/test/web/copy-props-proc.js @@ -4,7 +4,7 @@ var expect = chai.expect; -/* eslint max-statements: "off", branch-style: "off" */ +/* eslint max-statements: "off" */ describe('Processing', function() { diff --git a/web/copy-props.js b/web/copy-props.js index 19d7948..9dd95df 100644 --- a/web/copy-props.js +++ b/web/copy-props.js @@ -2,7 +2,7 @@ 'use strict'; var eachProps = require('each-props'); -var isPlainObject = require('is-plain-object'); +var isPlainObject = require('is-plain-object').isPlainObject; module.exports = function(src, dst, fromto, converter, reverse) { @@ -226,7 +226,7 @@ function isObject(v) { return Object.prototype.toString.call(v) === '[object Object]'; } -},{"each-props":4,"is-plain-object":7}],2:[function(require,module,exports){ +},{"each-props":4,"is-plain-object":8}],2:[function(require,module,exports){ /*! * array-each * @@ -368,7 +368,46 @@ function isObject(v) { } -},{"is-plain-object":7,"object.defaults/immutable":9}],5:[function(require,module,exports){ +},{"is-plain-object":5,"object.defaults/immutable":10}],5:[function(require,module,exports){ +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); + +function isObjectObject(o) { + return isObject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +module.exports = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; + +},{"isobject":9}],6:[function(require,module,exports){ /*! * for-in * @@ -386,7 +425,7 @@ module.exports = function forIn(obj, fn, thisArg) { } }; -},{}],6:[function(require,module,exports){ +},{}],7:[function(require,module,exports){ /*! * for-own * @@ -407,7 +446,11 @@ module.exports = function forOwn(obj, fn, thisArg) { }); }; -},{"for-in":5}],7:[function(require,module,exports){ +},{"for-in":6}],8:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + /*! * is-plain-object * @@ -415,27 +458,22 @@ module.exports = function forOwn(obj, fn, thisArg) { * Released under the MIT License. */ -'use strict'; - -var isObject = require('isobject'); - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; } -module.exports = function isPlainObject(o) { +function isPlainObject(o) { var ctor,prot; - if (isObjectObject(o) === false) return false; + if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; - if (typeof ctor !== 'function') return false; + if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; + if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { @@ -444,9 +482,11 @@ module.exports = function isPlainObject(o) { // Most likely a plain Object return true; -}; +} -},{"isobject":8}],8:[function(require,module,exports){ +exports.isPlainObject = isPlainObject; + +},{}],9:[function(require,module,exports){ /*! * isobject * @@ -460,7 +500,7 @@ module.exports = function isObject(val) { return val != null && typeof val === 'object' && Array.isArray(val) === false; }; -},{}],9:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ 'use strict'; var slice = require('array-slice'); @@ -482,7 +522,7 @@ module.exports = function immutableDefaults() { return defaults.apply(null, [{}].concat(args)); }; -},{"./mutable":10,"array-slice":3}],10:[function(require,module,exports){ +},{"./mutable":11,"array-slice":3}],11:[function(require,module,exports){ 'use strict'; var each = require('array-each'); @@ -519,5 +559,5 @@ module.exports = function defaults(target, objects) { return target; }; -},{"array-each":2,"array-slice":3,"for-own":6,"isobject":8}]},{},[1])(1) +},{"array-each":2,"array-slice":3,"for-own":7,"isobject":9}]},{},[1])(1) }); diff --git a/web/copy-props.min.js b/web/copy-props.min.js index ecc3950..26b2781 100644 --- a/web/copy-props.min.js +++ b/web/copy-props.min.js @@ -1,2 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).copyProps=t()}}(function(){return function i(f,u,a){function c(r,t){if(!u[r]){if(!f[r]){var n="function"==typeof require&&require;if(!t&&n)return n(r,!0);if(s)return s(r,!0);var e=new Error("Cannot find module '"+r+"'");throw e.code="MODULE_NOT_FOUND",e}var o=u[r]={exports:{}};f[r][0].call(o.exports,function(t){return c(f[r][1][t]||t)},o,o.exports,i,f,u,a)}return u[r].exports}for(var s="function"==typeof require&&require,t=0;t Date: Mon, 21 Sep 2020 17:00:52 +0900 Subject: [PATCH 2/5] Doc: Update license years --- LICENSE | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 39223b4..a7ba00b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016 Takayuki Sato +Copyright (c) 2016-2020 Takayuki Sato Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8fe18d3..2da482d 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ If *converter* is given, it is able to convert the terminal values. ## License -Copyright (C) 2016-2018 Takayuki Sato +Copyright (C) 2016-2020 Takayuki Sato This program is free software under [MIT][mit-url] License. See the file LICENSE in this distribution for more details. From 063e534355fea084b76cdd6263404325b473ed0a Mon Sep 17 00:00:00 2001 From: sttk Date: Mon, 21 Sep 2020 17:10:57 +0900 Subject: [PATCH 3/5] Test: Add nodejs v11-v14 into ci test versions --- .travis.yml | 4 ++++ appveyor.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2c24b7d..ee8c098 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ sudo: false language: node_js node_js: + - '14' + - '13' + - '12' + - '11' - '10' - '9' - '8' diff --git a/appveyor.yml b/appveyor.yml index c7b5123..fa320b2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,10 @@ environment: matrix: # node.js + - nodejs_version: "14" + - nodejs_version: "13" + - nodejs_version: "12" + - nodejs_version: "11" - nodejs_version: "10" - nodejs_version: "9" - nodejs_version: "8" From e97032201379584978088078f74b4729944961f8 Mon Sep 17 00:00:00 2001 From: sttk Date: Mon, 21 Sep 2020 17:14:38 +0900 Subject: [PATCH 4/5] Test: Run coveralls when nodejs >= 6 because of its supports --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee8c098..eaa1c0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,10 @@ node_js: - '0.12' - '0.10' -after_success: 'npm run coveralls' +after_success: + - if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -ge 6 ]; then + npm run coveralls; + fi os: - linux From e89907f94efe2e81d8a0aa21475340ceffddbc2e Mon Sep 17 00:00:00 2001 From: sttk Date: Mon, 21 Sep 2020 18:03:44 +0900 Subject: [PATCH 5/5] Test: Update npm to v4 when nodejs is v5 because of npm install error. --- .travis.yml | 5 +++++ appveyor.yml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eaa1c0f..d2ba1bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,11 @@ node_js: - '0.12' - '0.10' +before_install: + - if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -eq 5 ]; then + npm i -g npm@4; + fi + after_success: - if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -ge 6 ]; then npm run coveralls; diff --git a/appveyor.yml b/appveyor.yml index fa320b2..95737c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,8 @@ environment: install: - ps: Install-Product node $env:nodejs_version - - npm install + - ps: if ($env:nodejs_version -eq '5') { npm i -g npm@4 } + - cmd: npm install test_script: - node --version