Comparing version 0.1.0 to 1.0.0
@@ -621,2 +621,2 @@ { | ||
} | ||
} | ||
} |
92
index.js
@@ -1,77 +0,71 @@ | ||
'use strict'; | ||
/** | ||
* Cached methods. | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer | ||
* @license MIT | ||
* @module emoticon | ||
* @fileoverview Information regarding ASCII emoticons. | ||
*/ | ||
var has; | ||
'use strict'; | ||
has = Object.prototype.hasOwnProperty; | ||
/* eslint-env commonjs */ | ||
/** | ||
/* | ||
* Data. | ||
*/ | ||
var emoticons; | ||
var data = require('./data/emoticons.json'); | ||
emoticons = require('./data/emoticons.json'); | ||
/** | ||
* Create a dictionary to hold the emoticons by emoji. | ||
/* | ||
* Dictionaries. | ||
*/ | ||
var emoji; | ||
var emoji = {}; | ||
var text = {}; | ||
emoji = {}; | ||
var emoticons = { | ||
'unicode': emoji, | ||
'emoticon': text | ||
} | ||
/** | ||
* Create a dictionary to hold the emoticons by text | ||
* characters. | ||
* Transform an emoji. | ||
* | ||
* @param {string} emoticon - Unicode emoji to extend. | ||
*/ | ||
function enhanceEmoticon(emoticon) { | ||
var information = data[emoticon]; | ||
var index; | ||
var text; | ||
/** | ||
* Add information to `unicode` map. | ||
*/ | ||
text = {}; | ||
emoji[information.emoji] = information; | ||
/** | ||
* Transform all emoji. | ||
*/ | ||
/** | ||
* Add information to `text` map. | ||
*/ | ||
var emoticon, | ||
information, | ||
index; | ||
index = information.emoticons.length; | ||
for (emoticon in emoticons) { | ||
/* istanbul ignore else */ | ||
if (has.call(emoticons, emoticon)) { | ||
information = emoticons[emoticon]; | ||
/** | ||
* Add information to `unicode` map. | ||
*/ | ||
emoji[information.emoji] = information; | ||
/** | ||
* Add information to `text` map. | ||
*/ | ||
index = information.emoticons.length; | ||
while (index--) { | ||
text[information.emoticons[index]] = information; | ||
} | ||
while (index--) { | ||
text[information.emoticons[index]] = information; | ||
} | ||
} | ||
/** | ||
* Expose the `text` dictionary (`text`) as `emoticon`. | ||
/* | ||
* Transform all emoticons. | ||
*/ | ||
exports.emoticon = text; | ||
var emoticon; | ||
/** | ||
* Expose the `unicode` dictionary (`emoji`) as `unicode`. | ||
for (emoticon in data) { | ||
enhanceEmoticon(emoticon); | ||
} | ||
/* | ||
* Expose. | ||
*/ | ||
exports.unicode = emoji; | ||
module.exports = emoticons; |
{ | ||
"name": "emoticon", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "Information regarding ASCII emoticons", | ||
@@ -15,30 +15,42 @@ "license": "MIT", | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wooorm/emoticon.git" | ||
}, | ||
"repository": "wooorm/emoticon", | ||
"author": "Titus Wormer <tituswormer@gmail.com>", | ||
"files": [ | ||
"index.js", | ||
"data/emoticons.json" | ||
], | ||
"devDependencies": { | ||
"eslint": "^0.10.0", | ||
"gemoji": "^0.2.0", | ||
"browserify": "^11.0.0", | ||
"eslint": "^1.0.0", | ||
"esmangle": "^1.0.0", | ||
"gemoji": "^1.0.0", | ||
"istanbul": "^0.3.0", | ||
"jscs": "^1.0.0", | ||
"markdown-table": "^0.2.0", | ||
"mocha": "^2.0.0" | ||
"jscs": "^2.0.0", | ||
"jscs-jsdoc": "^1.0.0", | ||
"markdown-table": "^0.4.0", | ||
"mdast": "^1.0.0", | ||
"mdast-comment-config": "^1.0.0", | ||
"mdast-github": "^1.0.0", | ||
"mdast-lint": "^1.0.0", | ||
"mdast-slug": "^1.0.0", | ||
"mdast-validate-links": "^1.0.0", | ||
"mocha": "^2.0.0", | ||
"string-width": "^1.0.1" | ||
}, | ||
"scripts": { | ||
"test": "node_modules/.bin/_mocha --reporter spec --check-leaks -u exports test.js", | ||
"test-travis": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks -u exports test.js", | ||
"coverage": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- -- test.js", | ||
"lint-api": "node_modules/.bin/eslint index.js", | ||
"lint-test": "node_modules/.bin/eslint test.js --env mocha", | ||
"lint-script": "node_modules/.bin/eslint script/build-data.js script/build-support.js", | ||
"lint-style": "node_modules/.bin/jscs index.js script/build-data.js script/build-support.js test.js --reporter=inline", | ||
"lint": "npm run lint-api && npm run lint-test && npm run lint-style", | ||
"make": "npm run lint && npm run coverage", | ||
"test-api": "mocha --check-leaks test.js", | ||
"test-coverage": "istanbul cover _mocha -- test.js", | ||
"test-travis": "npm run test-coverage", | ||
"test": "npm run test-api", | ||
"lint-api": "eslint .", | ||
"lint-style": "jscs --reporter inline .", | ||
"lint": "npm run lint-api && npm run lint-style", | ||
"make": "npm run lint && npm run test-coverage", | ||
"build-data": "node script/build-data.js", | ||
"build-support": "node script/build-support.js", | ||
"build": "npm run build-data && npm run build-support", | ||
"prepublish": "npm run build" | ||
"postbuild-data": "node script/build-support.js", | ||
"bundle": "browserify index.js --no-builtins -s emoticon > emoticon.js", | ||
"postbundle": "esmangle emoticon.js > emoticon.min.js", | ||
"build-md": "mdast . --quiet", | ||
"build": "npm run build-data && npm run bundle && npm run build-md" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14686
6
674
1
16
80
1