Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flipjs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flipjs - npm Package Compare versions

Comparing version 1.0.5 to 2.0.0

.npmignore

12

package.json
{
"name": "flipjs",
"version": "1.0.5",
"version": "2.0.0",
"description": "flipjs javascript utility library",

@@ -8,3 +8,5 @@ "main": "src/index.js",

"commit": "git-cz",
"test": "mocha",
"test": "istanbul cover -x *.test.js _mocha -- -R spec ./test/index.test.js",
"check-coverage": "istanbul check-coverage --statements 90 --branches 90 --functions 90 --lines 90",
"report-coverage": "cat ./coverage/lcov.info | codecov",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"

@@ -24,4 +26,7 @@ },

"chai": "3.5.0",
"codecov.io": "0.1.6",
"commitizen": "2.7.3",
"cz-conventional-changelog": "1.1.5",
"ghooks": "1.0.3",
"istanbul": "0.4.2",
"mocha": "2.4.5",

@@ -33,4 +38,7 @@ "semantic-release": "^4.3.5"

"path": "node_modules/cz-conventional-changelog"
},
"ghooks": {
"pre-commit": "npm run test && npm run check-coverage"
}
}
}
# flipjs javascript utility library
[![travis build](https://img.shields.io/travis/flipjs/flipjs.svg?style=flat-square)](https://travis-ci.org/flipjs/flipjs)
[![Codecov](https://img.shields.io/codecov/c/github/flipjs/flipjs.svg?style=flat-square)](https://codecov.io/github/flipjs/flipjs)
[![version](https://img.shields.io/npm/v/flipjs.svg?style=flat-square)](http://npm.im/flipjs)
[![downloads](https://img.shields.io/npm/dm/flipjs.svg?style=flat-square)](http://npm-stat.com/charts.html?package=flipjs&from=2016-03-16)
[![MIT License](https://img.shields.io/npm/l/flipjs.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)

7

src/index.js
module.exports = {
openLink: openLink,
isEmpty: isEmpty,

@@ -8,6 +7,2 @@ capitalize: capitalize,

function openLink (link) {
window.open(link, '_blank', 'toolbar=0,status=0,width=1024,height=768')
}
function isEmpty (obj) {

@@ -25,3 +20,3 @@ if (obj == null) return true

function capitalize (string) {
if (!string) return ''
if (!string || typeof string !== 'string') return string
return string.charAt(0).toUpperCase() + string.slice(1)

@@ -28,0 +23,0 @@ }

@@ -10,4 +10,6 @@ var expect = require('chai').expect

expect(flipjs.isEmpty('')).to.be.true
expect(flipjs.isEmpty(null)).to.be.true
})
it('should return false when not empty', function () {
expect(flipjs.isEmpty({not: ''})).to.be.false
expect(flipjs.isEmpty({not: 'empty'})).to.be.false

@@ -23,10 +25,22 @@ expect(flipjs.isEmpty(['not empty'])).to.be.false

it(
'should return an empty string when no params passed to it',
'should return undefined when no params passed to it',
function () {
expect(flipjs.capitalize()).to.be.equal('')
expect(flipjs.capitalize()).to.be.equal(undefined)
}
)
it(
'should return undefined when undefined is passed to it',
function () {
expect(flipjs.capitalize(undefined)).to.be.equal(undefined)
}
)
it(
'should return null when null is passed to it',
function () {
expect(flipjs.capitalize(null)).to.be.equal(null)
}
)
})
describe('isFound', function () {
var hello = {foo: 'bar', fizz: 'buzz'}
var hello = {foo: 'bar', fizz: 'buzz', empty: ''}
it('should return true if string is found inside the object',

@@ -33,0 +47,0 @@ function () {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc