[Pkg-javascript-commits] [node-class-utils] 01/08: New upstream version 0.3.5
Jérémy Lal
kapouer at moszumanska.debian.org
Fri Dec 29 18:08:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
kapouer pushed a commit to branch master
in repository node-class-utils.
commit 32d066f34b552547e14bae3c691566784b54cbe3
Author: Jérémy Lal <kapouer at melix.org>
Date: Fri Dec 29 18:51:31 2017 +0100
New upstream version 0.3.5
---
.editorconfig | 13 ++---------
.eslintrc => .eslintrc.json | 7 ++----
.gitignore | 28 ++++++++++++++++-------
.travis.yml | 16 +++++++++-----
LICENSE | 2 +-
README.md | 54 +++++++++++++++++++++++----------------------
example.js | 43 +++++++++++++++++++++++++++++++-----
package.json | 11 ++++++---
8 files changed, 109 insertions(+), 65 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 991900b..818e072 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,3 @@
-# http://editorconfig.org
root = true
[*]
@@ -9,14 +8,6 @@ indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
-[*.md]
+[{**/{actual,fixtures,expected,templates}/**,*.md}]
trim_trailing_whitespace = false
-insert_final_newline = false
-
-[test/**]
-trim_trailing_whitespace = false
-insert_final_newline = false
-
-[templates/**]
-trim_trailing_whitespace = false
-insert_final_newline = false
+insert_final_newline = false
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc.json
similarity index 95%
rename from .eslintrc
rename to .eslintrc.json
index 7b5d047..948dbdb 100644
--- a/.eslintrc
+++ b/.eslintrc.json
@@ -34,6 +34,7 @@
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+ "keyword-spacing": [2, { "before": true, "after": true }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
@@ -49,7 +50,6 @@
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
- "no-empty-label": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
@@ -71,7 +71,7 @@
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
- "no-native-reassign": 2,
+ "no-native-reassign": 0,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-func": 2,
@@ -108,13 +108,10 @@
"radix": 2,
"semi": [2, "always"],
"semi-spacing": [2, { "before": false, "after": true }],
- "space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
- "space-before-keywords": [2, "always"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
- "space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
"use-isnan": 2,
diff --git a/.gitignore b/.gitignore
index 80a228c..0a16ee9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,27 @@
+# always ignore files
*.DS_Store
*.sublime-*
-_gh_pages
-bower_components
+
+# test related, or directories generated by tests
+test/actual
+actual
+coverage
+.nyc*
+
+# npm
node_modules
npm-debug.log
-actual
-test/actual
+
+# yarn
+yarn.lock
+yarn-error.log
+
+# misc
+_gh_pages
+_draft
+_drafts
+bower_components
+vendor
temp
tmp
TODO.md
-vendor
-.idea
-benchmark
-coverage
diff --git a/.travis.yml b/.travis.yml
index d6e658e..2b92202 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,16 @@
sudo: false
+os:
+ - linux
+ - osx
language: node_js
node_js:
- - "stable"
- - "0.12"
- - "0.10"
+ - node
+ - '6'
+ - '4'
+ - '0.12'
+ - '0.10'
matrix:
- fast_finish: true
allow_failures:
- - node_js: "0.10"
+ - node_js: '4'
+ - node_js: '0.12'
+ - node_js: '0.10'
diff --git a/LICENSE b/LICENSE
index 65f90ac..ec85897 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015, Jon Schlinkert.
+Copyright (c) 2015, 2017, Jon Schlinkert
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 41b72f6..9b9966e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# class-utils [![NPM version](https://img.shields.io/npm/v/class-utils.svg?style=flat)](https://www.npmjs.com/package/class-utils) [![NPM downloads](https://img.shields.io/npm/dm/class-utils.svg?style=flat)](https://npmjs.org/package/class-utils) [![Build Status](https://img.shields.io/travis/jonschlinkert/class-utils.svg?style=flat)](https://travis-ci.org/jonschlinkert/class-utils)
+# class-utils [![NPM version](https://img.shields.io/npm/v/class-utils.svg?style=flat)](https://www.npmjs.com/package/class-utils) [![NPM monthly downloads](https://img.shields.io/npm/dm/class-utils.svg?style=flat)](https://npmjs.org/package/class-utils) [![NPM total downloads](https://img.shields.io/npm/dt/class-utils.svg?style=flat)](https://npmjs.org/package/class-utils) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/class-utils.svg?style=flat&label=Travis)](https [...]
> Utils for working with JavaScript classes and prototype methods.
@@ -7,7 +7,7 @@
Install with [npm](https://www.npmjs.com/):
```sh
-$ npm install class-utils --save
+$ npm install --save class-utils
```
## Usage
@@ -232,54 +232,56 @@ Bubble up events emitted from static methods on the Parent ctor.
* `Parent` **{Object}**
* `events` **{Array}**: Event names to bubble up
-## Related projects
+## About
-You might also be interested in these projects:
+### Related projects
* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property)
-* [delegate-properties](https://www.npmjs.com/package/delegate-properties): Deep-clone properties from one object to another and make them non-enumerable, or make existing properties… [more](https://www.npmjs.com/package/delegate-properties) | [homepage](https://github.com/jonschlinkert/delegate-properties)
-* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor)
+* [delegate-properties](https://www.npmjs.com/package/delegate-properties): Deep-clone properties from one object to another and make them non-enumerable, or make existing properties… [more](https://github.com/jonschlinkert/delegate-properties) | [homepage](https://github.com/jonschlinkert/delegate-properties)
+* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor)
-## Contributing
+### Contributing
-Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/class-utils/issues/new).
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
-## Building docs
+### Contributors
-Generate readme and API documentation with [verb](https://github.com/verbose/verb):
+| **Commits** | **Contributor** |
+| --- | --- |
+| 32 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 8 | [doowb](https://github.com/doowb) |
+| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
-```sh
-$ npm install verb && npm run docs
-```
+### Building docs
-Or, if [verb](https://github.com/verbose/verb) is installed globally:
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
```sh
-$ verb
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
-## Running tests
+### Running tests
-Install dev dependencies:
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
-$ npm install -d && npm test
+$ npm install && npm test
```
-## Author
+### Author
**Jon Schlinkert**
-Follow me on GitHub or Twitter for updates about class-utils and my other libraries:
-
* [github/jonschlinkert](https://github.com/jonschlinkert)
-* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
-## License
+### License
-Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
-Released under the [MIT license](https://github.com/jonschlinkert/class-utils/blob/master/LICENSE).
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
***
-_This file was generated by [verb](https://github.com/verbose/verb), v, on April 05, 2016._
\ No newline at end of file
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._
\ No newline at end of file
diff --git a/example.js b/example.js
index 654dd00..35c2b02 100644
--- a/example.js
+++ b/example.js
@@ -1,9 +1,40 @@
var cu = require('./');
-function App() {}
-Object.defineProperty(App.prototype, 'count', {
- get: function () {
- return Object.keys(this).length;
+// function App() {}
+// Object.defineProperty(App.prototype, 'count', {
+// get: function () {
+// return Object.keys(this).length;
+// }
+// });
+// console.log(cu.getDescriptor(App.prototype, 'count'));
+
+function defineProp (obj, name, fn) {
+ Object.defineProperty(obj, name, {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+ return fn();
+ }
+ });
+}
+
+function fn() {
+ console.log('hey!');
+ return function (msg) {
+ return 'foo ' + msg;
+ };
+}
+
+var one = {
+ bar: function (msg) {
+ return 'bar ' + msg;
}
-});
-console.log(cu.getDescriptor(App.prototype, 'count'));
+};
+var two = {};
+defineProp(one, 'foo', fn);
+
+cu.copyDescriptor(two, one, 'foo');
+cu.copyDescriptor(two, one, 'bar');
+
+console.log(two.foo('a'))
+console.log(two.bar('b'))
diff --git a/package.json b/package.json
index 4dd995f..964f662 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,14 @@
{
"name": "class-utils",
"description": "Utils for working with JavaScript classes and prototype methods.",
- "version": "0.3.4",
+ "version": "0.3.5",
"homepage": "https://github.com/jonschlinkert/class-utils",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "contributors": [
+ "<wtgtybhertgeghgtwtg at gmail.com> (https://github.com/wtgtybhertgeghgtwtg)",
+ "Brian Woodward <brian.woodward at gmail.com> (https://github.com/doowb)",
+ "Jon Schlinkert <jon.schlinkert at sellside.com> (http://twitter.com/jonschlinkert)"
+ ],
"repository": "jonschlinkert/class-utils",
"bugs": {
"url": "https://github.com/jonschlinkert/class-utils/issues"
@@ -23,8 +28,8 @@
"dependencies": {
"arr-union": "^3.1.0",
"define-property": "^0.2.5",
- "isobject": "^2.0.0",
- "lazy-cache": "^1.0.3",
+ "isobject": "^3.0.0",
+ "lazy-cache": "^2.0.2",
"static-extend": "^0.1.1"
},
"devDependencies": {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-class-utils.git
More information about the Pkg-javascript-commits
mailing list