Socket
Socket
Sign inDemoInstall

ccount

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ccount - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

10

index.js

@@ -5,16 +5,16 @@ 'use strict'

function ccount(value, character) {
var val = String(value)
function ccount(source, character) {
var value = String(source)
var count = 0
var index
if (typeof character !== 'string' || character.length !== 1) {
if (typeof character !== 'string') {
throw new Error('Expected character')
}
index = val.indexOf(character)
index = value.indexOf(character)
while (index !== -1) {
count++
index = val.indexOf(character, index + 1)
index = value.indexOf(character, index + character.length)
}

@@ -21,0 +21,0 @@

{
"name": "ccount",
"version": "1.0.5",
"version": "1.1.0",
"description": "Count characters",

@@ -26,13 +26,13 @@ "license": "MIT",

"devDependencies": {
"browserify": "^16.0.0",
"browserify": "^17.0.0",
"nyc": "^15.0.0",
"prettier": "^1.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.0.0",
"xo": "^0.25.0"
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"tape": "^5.0.0",
"tinyify": "^3.0.0",
"xo": "^0.34.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"build-bundle": "browserify . -s ccount -o ccount.js",

@@ -63,3 +63,6 @@ "build-mangle": "browserify . -s ccount -p tinyify -o ccount.min.js",

"ccount.js"
]
],
"rules": {
"unicorn/prefer-type-error": "off"
}
},

@@ -66,0 +69,0 @@ "nyc": {

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