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

stringfy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringfy - npm Package Compare versions

Comparing version 0.0.1 to 0.0.11

3

index.js

@@ -26,2 +26,5 @@ 'use strict'

}
count () {
return this.string.match(/[\u00ff-\uffff]|\S+/g).length
}
val () {

@@ -28,0 +31,0 @@ return this.string

2

package.json
{
"name": "stringfy",
"version": "0.0.1",
"version": "0.0.11",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,2 +18,5 @@ # Stringfy

stringfy(' hello ').trim().val()
// return words count => 3, with CJK support
stringfy('呆死ki').count()
```

@@ -20,0 +23,0 @@

@@ -8,11 +8,29 @@ var stringfy = require('./index')

it('should return camelCased string getElementById', () => {
it('should return camelCased string getElementById from -', () => {
stringfy('get-element-by-id').camelCase().val().should.equal('getElementById')
})
it('should return camelCased string getElementById from _', () => {
stringfy('get_element_by_id').camelCase().val().should.equal('getElementById')
})
it('should return camelCased string getElementById from both _ and -', () => {
stringfy('get_element_by-id').camelCase().val().should.equal('getElementById')
})
})
describe('reverse', () => {
it('should return reversed string edcba', () => {
stringfy('abcde').reverse().val().should.equal('edcba')
})
})
describe('count', () => {
it('should return the words count 2 of string hello', () => {
stringfy('hello world').count().should.equal(2)
})
it('should return the words count 3 of CJK string', () => {
stringfy('呆死ki').count().should.equal(3)
})
})
})
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