[Pkg-javascript-commits] [node-is-extendable] 01/05: Import Upstream version 0.1.1
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sun Oct 16 17:49:38 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository node-is-extendable.
commit 695a0d5db0f0e912ff4838be0535266d1f298e3c
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sun Oct 16 22:30:20 2016 +0530
Import Upstream version 0.1.1
---
.editorconfig | 22 ++++++++++++++++++
.gitattributes | 10 ++++++++
.gitignore | 15 ++++++++++++
.jshintrc | 18 +++++++++++++++
.travis.yml | 11 +++++++++
.verb.md | 50 ++++++++++++++++++++++++++++++++++++++++
LICENSE | 21 +++++++++++++++++
README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index.js | 13 +++++++++++
package.json | 51 +++++++++++++++++++++++++++++++++++++++++
test.js | 34 +++++++++++++++++++++++++++
11 files changed, 317 insertions(+)
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..1ff40e6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,22 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+end_of_line = lf
+charset = utf-8
+indent_size = 2
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
+insert_final_newline = false
+
+[{,test/}{actual,fixtures}/**]
+trim_trailing_whitespace = false
+insert_final_newline = false
+
+[templates/**]
+trim_trailing_whitespace = false
+insert_final_newline = false
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..660957e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,10 @@
+# Enforce Unix newlines
+* text eol=lf
+
+# binaries
+*.ai binary
+*.psd binary
+*.jpg binary
+*.gif binary
+*.png binary
+*.jpeg binary
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..80a228c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+*.DS_Store
+*.sublime-*
+_gh_pages
+bower_components
+node_modules
+npm-debug.log
+actual
+test/actual
+temp
+tmp
+TODO.md
+vendor
+.idea
+benchmark
+coverage
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..1a2f7b9
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,18 @@
+{
+ "asi": false,
+ "boss": true,
+ "curly": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "esnext": true,
+ "immed": true,
+ "latedef": false,
+ "laxcomma": false,
+ "mocha": true,
+ "newcap": true,
+ "noarg": true,
+ "node": true,
+ "sub": true,
+ "undef": true,
+ "unused": true
+}
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..0fc9381
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+sudo: false
+language: node_js
+node_js:
+ - "0.10"
+ - "0.12"
+ - "0.13"
+ - "iojs"
+matrix:
+ fast_finish: true
+ allow_failures:
+ - node_js: "0.13"
diff --git a/.verb.md b/.verb.md
new file mode 100644
index 0000000..bac2fe5
--- /dev/null
+++ b/.verb.md
@@ -0,0 +1,50 @@
+# {%= name %} {%= badge("fury") %}
+
+> {%= description %}
+
+## Install
+{%= include("install-npm", {save: true}) %}
+
+## Usage
+
+```js
+var isExtendable = require('{%= name %}');
+```
+
+Returns true if the value is any of the following:
+
+- `array`
+- `regexp`
+- `plain object`
+- `function`
+- `date`
+- `error`
+
+## Notes
+
+All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and:
+
+- the value is not a primitive, or
+- that the object is an `object`, `function`
+
+Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`.
+
+## Related projects
+{%= related(verbiage.related.list, {remove: name}) %}
+
+## Running tests
+{%= include("tests") %}
+
+## Contributing
+{%= include("contributing") %}
+
+## Author
+{%= include("author") %}
+
+## License
+{%= copyright() %}
+{%= license() %}
+
+***
+
+{%= include("footer") %}
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..65f90ac
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, 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
+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
new file mode 100644
index 0000000..e4cfaeb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,72 @@
+# is-extendable [](http://badge.fury.io/js/is-extendable)
+
+> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i is-extendable --save
+```
+
+## Usage
+
+```js
+var isExtendable = require('is-extendable');
+```
+
+Returns true if the value is any of the following:
+
+* `array`
+* `regexp`
+* `plain object`
+* `function`
+* `date`
+* `error`
+
+## Notes
+
+All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and:
+
+* the value is not a primitive, or
+* that the object is an `object`, `function`
+
+Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`.
+
+## Related projects
+
+* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
+* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
+* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
+* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
+* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ.
+* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..4ee71a4
--- /dev/null
+++ b/index.js
@@ -0,0 +1,13 @@
+/*!
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function isExtendable(val) {
+ return typeof val !== 'undefined' && val !== null
+ && (typeof val === 'object' || typeof val === 'function');
+};
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..5dd006e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "is-extendable",
+ "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"",
+ "version": "0.1.1",
+ "homepage": "https://github.com/jonschlinkert/is-extendable",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "repository": "jonschlinkert/is-extendable",
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/is-extendable/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "keywords": [
+ "array",
+ "assign",
+ "check",
+ "date",
+ "extend",
+ "extensible",
+ "function",
+ "is",
+ "object",
+ "regex",
+ "test"
+ ],
+ "verbiage": {
+ "related": {
+ "list": [
+ "isobject",
+ "is-plain-object",
+ "kind-of",
+ "is-extendable",
+ "is-equal-shallow",
+ "extend-shallow",
+ "assign-deep"
+ ]
+ }
+ }
+}
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..c141920
--- /dev/null
+++ b/test.js
@@ -0,0 +1,34 @@
+/*!
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
+ *
+ * Copyright (c) 2015 .
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+
+/* deps: mocha */
+var assert = require('assert');
+var isExtendable = require('./');
+
+describe('isExtendable', function () {
+ it('should return true when a value is an object:', function () {
+ assert(isExtendable({}));
+ assert(isExtendable([]));
+ assert(isExtendable(function() {}));
+ assert(isExtendable(new RegExp('foo')));
+ assert(isExtendable(/foo/));
+ assert(isExtendable(new Date()));
+ assert(isExtendable(new Error()));
+ });
+
+ it('should return false when a value is not an object:', function () {
+ assert(!isExtendable('a'));
+ assert(!isExtendable(5));
+ assert(!isExtendable(null));
+ assert(!isExtendable());
+ assert(!isExtendable(undefined));
+ assert(!isExtendable(true));
+ assert(!isExtendable(false));
+ });
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-is-extendable.git
More information about the Pkg-javascript-commits
mailing list