Socket
Socket
Sign inDemoInstall

initials

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

initials - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

LICENSE

4

dist/initials.js

@@ -419,4 +419,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.initials = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

function normalize (options) {
if (!options) options = {length: defaultLength}
if (typeof options === 'number') options = {length: options}
if (!options) options = { length: defaultLength }
if (typeof options === 'number') options = { length: options }

@@ -423,0 +423,0 @@ options.length = Math.max(options.length || 0, defaultLength)

@@ -415,4 +415,4 @@ module.exports = initials

function normalize (options) {
if (!options) options = {length: defaultLength}
if (typeof options === 'number') options = {length: options}
if (!options) options = { length: defaultLength }
if (typeof options === 'number') options = { length: options }

@@ -419,0 +419,0 @@ options.length = Math.max(options.length || 0, defaultLength)

@@ -43,4 +43,4 @@ {

"semantic-release": "^15.0.0",
"standard": "^11.0.0",
"tap-spec": "^4.1.0",
"standard": "^12.0.1",
"tap-spec": "^5.0.0",
"tape": "^4.2.0"

@@ -53,3 +53,3 @@ },

},
"version": "3.0.0"
"version": "3.0.1"
}

@@ -10,4 +10,3 @@ Initials. Because JD is shorter than John Doe

Installation
------------
## Installation

@@ -21,4 +20,3 @@ Install using [npm](https://npmjs.org/) for node.js:

Usage
-----
## Usage

@@ -50,4 +48,3 @@ ```js

Notes
-----
## Notes

@@ -82,4 +79,3 @@ Preffered initials can be passed in `(JD)`, e.g.

Test
----
## Test

@@ -91,8 +87,4 @@ ```

Fine Print
----------
## LICENSE
initials has been authored by [Gregor Martynus](https://github.com/gr2m),
proud member of the [Hoodie Community](http://hood.ie/).
License: MIT
[MIT](LICENSE)

@@ -113,6 +113,6 @@ var initials = require('../lib/initials')

test('initials.parse(name)', function (t) {
t.deepEqual(initials.parse('John Doe'), {name: 'John Doe', initials: 'JD'}, 'John Doe ☛ name: John Doe, initials: JD')
t.deepEqual(initials.parse('JD'), {initials: 'JD'}, 'JD ☛ initials: JD')
t.deepEqual(initials.parse('joe@example.com'), {email: 'joe@example.com', initials: 'jo'}, 'joe@example.com ☛ email: joe@example.com, initials: jo')
t.deepEqual(initials.parse('John Doe <joe@example.com>'), {name: 'John Doe', initials: 'JD', email: 'joe@example.com'}, 'joe@example.com ☛ email: joe@example.com, initials: jo')
t.deepEqual(initials.parse('John Doe'), { name: 'John Doe', initials: 'JD' }, 'John Doe ☛ name: John Doe, initials: JD')
t.deepEqual(initials.parse('JD'), { initials: 'JD' }, 'JD ☛ initials: JD')
t.deepEqual(initials.parse('joe@example.com'), { email: 'joe@example.com', initials: 'jo' }, 'joe@example.com ☛ email: joe@example.com, initials: jo')
t.deepEqual(initials.parse('John Doe <joe@example.com>'), { name: 'John Doe', initials: 'JD', email: 'joe@example.com' }, 'joe@example.com ☛ email: joe@example.com, initials: jo')

@@ -123,3 +123,3 @@ t.end()

test('initials.parse(namesArray)', function (t) {
t.deepEqual(initials.parse(['John Doe', 'Robert Roe', 'Larry Loe']), [{name: 'John Doe', initials: 'JD'}, {name: 'Robert Roe', initials: 'RR'}, {name: 'Larry Loe', initials: 'LL'}], 'John Doe, Robert Roe, Larry Loe ☛ name: John Doe, initials: JD; name: Robert Roe, initials: RR; name: Larry Loe, initials: LL')
t.deepEqual(initials.parse(['John Doe', 'Robert Roe', 'Larry Loe']), [{ name: 'John Doe', initials: 'JD' }, { name: 'Robert Roe', initials: 'RR' }, { name: 'Larry Loe', initials: 'LL' }], 'John Doe, Robert Roe, Larry Loe ☛ name: John Doe, initials: JD; name: Robert Roe, initials: RR; name: Larry Loe, initials: LL')

@@ -134,3 +134,3 @@ t.end()

}
}), {name: 'John Doe', initials: 'JoDo'}, 'respect existing initials for single name')
}), { name: 'John Doe', initials: 'JoDo' }, 'respect existing initials for single name')

@@ -141,3 +141,3 @@ t.deepEqual(initials.parse(['John Doe', 'Jane Dane'], {

}
}), [{name: 'John Doe', initials: 'JD'}, {name: 'Jane Dane', initials: 'JDa'}], 'respect existing initials for multiple names')
}), [{ name: 'John Doe', initials: 'JD' }, { name: 'Jane Dane', initials: 'JDa' }], 'respect existing initials for multiple names')

@@ -144,0 +144,0 @@ t.end()

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