package/package.json000777 0000001750 3560116604 011560 0ustar00000000 000000 { "name": "should-util", "version": "1.0.1", "description": "Utility functions", "main": "cjs/should-util.js", "module": "es6/should-util.js", "jsnext:main": "es6/should-util.js", "scripts": { "cjs": "rollup --format=cjs --output=cjs/should-util.js index.js", "es6": "rollup --format=es --output=es6/should-util.js index.js", "build": "npm run cjs && npm run es6", "prepublish": "npm run build", "pretest": "npm run build" }, "repository": { "type": "git", "url": "git+https://github.com/shouldjs/util.git" }, "keywords": [ "shouldjs", "util" ], "author": "Denis Bardadym ", "license": "MIT", "bugs": { "url": "https://github.com/shouldjs/util/issues" }, "homepage": "https://github.com/shouldjs/util#readme", "devDependencies": { "eslint": "^3.2.2", "eslint-config-shouldjs": "^1.0.2", "rollup": "^0.34.7" }, "files": [ "cjs/*", "es6/*", "README.md", "LICENSE" ] } package/LICENSE000777 0000002074 3560116604 010277 0ustar00000000 000000 MIT License Copyright (c) 2016 Should.js assertion library 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. package/README.md000777 0000000031 3560116604 010540 0ustar00000000 000000 # util Utility functions package/cjs/should-util.js000777 0000002177 3560116604 012664 0ustar00000000 000000 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _propertyIsEnumerable = Object.prototype.propertyIsEnumerable; function hasOwnProperty(obj, key) { return _hasOwnProperty.call(obj, key); } function propertyIsEnumerable(obj, key) { return _propertyIsEnumerable.call(obj, key); } function merge(a, b) { if (a && b) { for (var key in b) { a[key] = b[key]; } } return a; } function isIterator(obj) { if (!obj) { return false; } if (obj.__shouldIterator__) { return true; } return typeof obj.next === 'function' && typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' && typeof obj[Symbol.iterator] === 'function' && obj[Symbol.iterator]() === obj; } //TODO find better way function isGeneratorFunction(f) { return typeof f === 'function' && /^function\s*\*\s*/.test(f.toString()); } exports.hasOwnProperty = hasOwnProperty; exports.propertyIsEnumerable = propertyIsEnumerable; exports.merge = merge; exports.isIterator = isIterator; exports.isGeneratorFunction = isGeneratorFunction;package/es6/should-util.js000777 0000001700 3560116604 012571 0ustar00000000 000000 var _hasOwnProperty = Object.prototype.hasOwnProperty; var _propertyIsEnumerable = Object.prototype.propertyIsEnumerable; function hasOwnProperty(obj, key) { return _hasOwnProperty.call(obj, key); } function propertyIsEnumerable(obj, key) { return _propertyIsEnumerable.call(obj, key); } function merge(a, b) { if (a && b) { for (var key in b) { a[key] = b[key]; } } return a; } function isIterator(obj) { if (!obj) { return false; } if (obj.__shouldIterator__) { return true; } return typeof obj.next === 'function' && typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' && typeof obj[Symbol.iterator] === 'function' && obj[Symbol.iterator]() === obj; } //TODO find better way function isGeneratorFunction(f) { return typeof f === 'function' && /^function\s*\*\s*/.test(f.toString()); } export { hasOwnProperty, propertyIsEnumerable, merge, isIterator, isGeneratorFunction };