pax_global_header00006660000000000000000000000064125460615100014512gustar00rootroot0000000000000052 comment=c356b9febdcb5d8b752bb8377f37968222298334 is-extendable-0.1.1/000077500000000000000000000000001254606151000142355ustar00rootroot00000000000000is-extendable-0.1.1/.editorconfig000066400000000000000000000006371254606151000167200ustar00rootroot00000000000000# 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 is-extendable-0.1.1/.gitattributes000066400000000000000000000002001254606151000171200ustar00rootroot00000000000000# Enforce Unix newlines * text eol=lf # binaries *.ai binary *.psd binary *.jpg binary *.gif binary *.png binary *.jpeg binary is-extendable-0.1.1/.gitignore000066400000000000000000000002211254606151000162200ustar00rootroot00000000000000*.DS_Store *.sublime-* _gh_pages bower_components node_modules npm-debug.log actual test/actual temp tmp TODO.md vendor .idea benchmark coverage is-extendable-0.1.1/.jshintrc000066400000000000000000000004321254606151000160610ustar00rootroot00000000000000{ "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 } is-extendable-0.1.1/.travis.yml000066400000000000000000000002271254606151000163470ustar00rootroot00000000000000sudo: false language: node_js node_js: - "0.10" - "0.12" - "0.13" - "iojs" matrix: fast_finish: true allow_failures: - node_js: "0.13" is-extendable-0.1.1/.verb.md000066400000000000000000000021351254606151000155740ustar00rootroot00000000000000# {%= 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") %} is-extendable-0.1.1/LICENSE000066400000000000000000000020731254606151000152440ustar00rootroot00000000000000The 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. is-extendable-0.1.1/README.md000066400000000000000000000047621254606151000155250ustar00rootroot00000000000000# is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](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._is-extendable-0.1.1/index.js000066400000000000000000000005131254606151000157010ustar00rootroot00000000000000/*! * 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'); }; is-extendable-0.1.1/package.json000066400000000000000000000021531254606151000165240ustar00rootroot00000000000000{ "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" ] } } } is-extendable-0.1.1/test.js000066400000000000000000000016271254606151000155600ustar00rootroot00000000000000/*! * 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)); }); });