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 2.1.5 to 3.0.0

12

dist/initials.js

@@ -1,2 +0,5 @@

(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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(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){
module.exports = require('./lib/initials')
},{"./lib/initials":2}],2:[function(require,module,exports){
module.exports = initials

@@ -18,6 +21,6 @@

var uppercaseLettersOnlyPattern = /^[A-Z]+$/
var initialsInNamePattern = /\(([^\)]+)\)/
var initialsInNamePattern = /\(([^)]+)\)/
var nameIsEmailPattern = /^[^\s]+@[^\s]+$/
var findDomainInEmailPattern = /@[^\s]+/
var findEmailPattern = /[\w\._-]+@[\w\.-]+[\w]/g
var findEmailPattern = /[\w._-]+@[\w.-]+[\w]/g

@@ -282,3 +285,2 @@ // match everything that is a "non letter" (see above)

function format (parts) {
// neither name nor email: return initials

@@ -429,2 +431,2 @@ if (!parts.name && !parts.email) return parts.initials

},{}]},{},[1])(1)
});
});

@@ -17,6 +17,6 @@ module.exports = initials

var uppercaseLettersOnlyPattern = /^[A-Z]+$/
var initialsInNamePattern = /\(([^\)]+)\)/
var initialsInNamePattern = /\(([^)]+)\)/
var nameIsEmailPattern = /^[^\s]+@[^\s]+$/
var findDomainInEmailPattern = /@[^\s]+/
var findEmailPattern = /[\w\._-]+@[\w\.-]+[\w]/g
var findEmailPattern = /[\w._-]+@[\w.-]+[\w]/g

@@ -281,3 +281,2 @@ // match everything that is a "non letter" (see above)

function format (parts) {
// neither name nor email: return initials

@@ -284,0 +283,0 @@ if (!parts.name && !parts.email) return parts.initials

@@ -7,12 +7,13 @@ {

"prebuild": "rimraf dist && mkdirp dist",
"build": "browserify lib/initials.js -s initials -o dist/initials.js",
"build:demo": "browserify lib/initials.js -s initials -o demo/initials.js",
"build": "browserify index.js -s initials -o dist/initials.js",
"build:demo": "browserify index.js -s initials -o demo/initials.js",
"deploy": "npm run build:demo && npm run deploydocs",
"predeploydocs": "./bin/authorize-push.js",
"deploydocs": "gh-pages-deploy",
"test": "standard lib/initials.js test/initials-test.js && npm run -s test:node | tap-spec",
"pretest": "standard",
"test": "npm run -s test:node | tap-spec",
"test:coverage": "istanbul cover test/initials-test.js",
"test:node": "node test/initials-test.js",
"presemantic-release": "npm run build",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"semantic-release": "semantic-release",
"postsemantic-release": "npm run test:coverage && istanbul-coveralls"

@@ -36,15 +37,19 @@ },

"beefy": "^2.1.5",
"browserify": "^11.2.0",
"bootstrap-editable-table": "github:gr2m/bootstrap-editable-table#gh-pages",
"gh-pages-deploy": "^0.3.0",
"istanbul": "^0.3.5",
"browserify": "^16.0.0",
"gh-pages-deploy": "^0.5.0",
"istanbul": "^0.4.0",
"istanbul-coveralls": "^1.0.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.4.3",
"semantic-release": "^6.0.3",
"standard": "^3.11.1",
"tap-spec": "^3.0.0",
"semantic-release": "^15.0.0",
"standard": "^11.0.0",
"tap-spec": "^4.1.0",
"tape": "^4.2.0"
},
"version": "2.1.5"
}
"standard": {
"ignore": [
"demo"
]
},
"version": "3.0.0"
}

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

[![Coverage Status](https://coveralls.io/repos/gr2m/initials/badge.svg?branch=master)](https://coveralls.io/r/gr2m/initials?branch=master)
[![Dependency Status](https://david-dm.org/gr2m/initials.svg)](https://david-dm.org/gr2m/initials)
[![devDependency Status](https://david-dm.org/gr2m/initials/dev-status.svg)](https://david-dm.org/gr2m/initials#info=devDependencies)
[![Greenkeeper badge](https://badges.greenkeeper.io/gr2m/initials.svg)](https://greenkeeper.io/)

@@ -92,5 +91,5 @@ Installation

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

@@ -56,13 +56,12 @@ var initials = require('../lib/initials')

t.equal(initials('John Doe', {
existing: {
'John Doe': 'JoDo'
}
}), 'JoDo', 'respect existing initials'
)
existing: {
'John Doe': 'JoDo'
}
}), 'JoDo', 'respect existing initials')
t.deepEqual(initials(['John Doe', 'Jane Dane'], {
existing: {
'John Doe': 'JD'
}
}), ['JD', 'JDa'], 'respect existing initials')
existing: {
'John Doe': 'JD'
}
}), ['JD', 'JDa'], 'respect existing initials')

@@ -131,15 +130,14 @@ t.end()

t.deepEqual(initials.parse('John Doe', {
existing: {
'John Doe': 'JoDo'
}
}), {name: 'John Doe', initials: 'JoDo'}, 'respect existing initials for single name')
existing: {
'John Doe': 'JoDo'
}
}), {name: 'John Doe', initials: 'JoDo'}, 'respect existing initials for single name')
t.deepEqual(initials.parse(['John Doe', 'Jane Dane'], {
existing: {
'John Doe': 'JD'
}
}), [{name: 'John Doe', initials: 'JD'}, {name: 'Jane Dane', initials: 'JDa'}], 'respect existing initials for multiple names')
existing: {
'John Doe': 'JD'
}
}), [{name: 'John Doe', initials: 'JD'}, {name: 'Jane Dane', initials: 'JDa'}], 'respect existing initials for multiple names')
t.end()
})

@@ -146,0 +144,0 @@

Sorry, the diff of this file is not supported yet

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