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

typographic-currency

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typographic-currency - npm Package Compare versions

Comparing version 0.1.7 to 1.1.0

.babelrc

29

index.es5.js
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = typographicCurrency;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _typographicCurrencyDb = require('typographic-currency-db');

@@ -13,19 +12,13 @@

exports['default'] = function (input) {
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var text = null;
var pattern = function pattern(key) {
return new RegExp('([^a-z]|\\b)(' + key + ')\\b', 'gi');
};
for (var key in _typographicCurrencyDb2['default']) {
var currentKey = _typographicCurrencyDb2['default'][key];
// use global and ignore letter case
var pattern = new RegExp('([^a-z]|\\b)(' + key + ')\\b', 'gi');
var textInput = text ? text : input;
text = textInput.replace(pattern, '$1' + currentKey);
}
return text;
function typographicCurrency(input) {
if (!input) return;
return Object.keys(_typographicCurrencyDb2.default).reduce(function (state, key) {
return state.replace(pattern(key), '$1' + _typographicCurrencyDb2.default[key]);
}, input);
};
module.exports = exports['default'];

@@ -1,17 +0,10 @@

import currencyDB from 'typographic-currency-db';
import db from 'typographic-currency-db';
export default (input) => {
const pattern = key => new RegExp(`([^a-z]|\\b)(${key})\\b`, 'gi');
let text = null;
for (var key in currencyDB) {
const currentKey = currencyDB[key];
// use global and ignore letter case
const pattern = new RegExp(`([^a-z]|\\b)(${key})\\b`, 'gi');
let textInput = (text) ? text : input;
text = textInput.replace(pattern, `$1${currentKey}`);
}
return text;
export default function typographicCurrency(input) {
if (!input) return;
return Object.keys(db).reduce((state, key) => {
return state.replace(pattern(key), `$1${db[key]}`);
}, input);
};
{
"name": "typographic-currency",
"version": "0.1.7",
"version": "1.1.0",
"description": "Use the correct symbol of currency",
"main": "index.es5.js",
"scripts": {
"coverage": "isparta cover _mocha index.js -- --require babel/register",
"watch": "npm run transpile -- --watch",
"coverage": "babel-node ./node_modules/.bin/isparta cover _mocha index.js -- --compilers js:babel-core/register",
"precoveralls": "npm run coverage",
"coveralls": "coveralls < coverage/lcov.info",
"test": "mocha --require babel/register",
"test": "mocha --require babel-core/register",
"tdd": "npm test -- --watch",
"transpile": "babel index.js > index.es5.js",
"transpile": "babel index.js --out-file index.es5.js",
"prepublish": "npm run transpile",
"clean": "trash index.es5.js",
"clean": "rimraf index.es5.js",
"push": "git push --follow-tags",

@@ -28,2 +29,6 @@ "postpublish": "npm-run-all clean push"

"author": "talgautb <gtalk.kz@gmail.com> (http://gtalk.kz)",
"maintainers": [
"talgautb <gtalk.kz@gmail.com> (http://gtalk.kz)",
"Vladimir Starkov <iamstarkov@gmail.com> (https://iamstarkov.com/)"
],
"license": "MIT",

@@ -36,8 +41,10 @@ "bugs": {

"assert": "*",
"babel": "*",
"babel-cli": "^6.2.0",
"babel-core": "^6.2.1",
"babel-preset-es2015": "^6.1.18",
"coveralls": "*",
"isparta": "*",
"isparta": "^4.0.0",
"mocha": "*",
"npm-run-all": "*",
"trash": "*"
"rimraf": "*"
},

@@ -44,0 +51,0 @@ "dependencies": {

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