Comparing version 0.2.2 to 1.0.0
62
index.js
@@ -1,26 +0,29 @@ | ||
'use strict'; | ||
/* | ||
* Data. | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer | ||
* @license MIT | ||
* @module gemoji | ||
* @fileoverview GitHub emoji: gemoji. | ||
*/ | ||
var gemoji; | ||
'use strict'; | ||
gemoji = require('./data/gemoji.json'); | ||
/* eslint-env commonjs */ | ||
/* | ||
* Cached methods. | ||
* Data. | ||
*/ | ||
var has; | ||
var data = require('./data/gemoji.json'); | ||
has = Object.prototype.hasOwnProperty; | ||
/* | ||
* Create a dictionary to hold the emoji by name. | ||
* Dictionaries. | ||
*/ | ||
var named; | ||
var named = {}; | ||
named = {}; | ||
var gemoji = { | ||
'unicode': data, | ||
'name': named | ||
}; | ||
@@ -33,10 +36,7 @@ /** | ||
function enhanceEmoji(character) { | ||
var information, | ||
names, | ||
index, | ||
length; | ||
var information = data[character]; | ||
var names = information.names; | ||
var index = 0; // first must be skipped. | ||
var length = names.length; | ||
information = gemoji[character]; | ||
names = information.names; | ||
/* | ||
@@ -62,8 +62,5 @@ * Add the main `name`. | ||
* If the emoji is known by other names, | ||
* add those too to the map. | ||
* add those to the map too. | ||
*/ | ||
index = 0; | ||
length = names.length; | ||
while (++index < length) { | ||
@@ -80,19 +77,10 @@ named[names[index]] = information; | ||
for (emoji in gemoji) { | ||
/* istanbul ignore else */ | ||
if (has.call(gemoji, emoji)) { | ||
enhanceEmoji(emoji); | ||
} | ||
for (emoji in data) { | ||
enhanceEmoji(emoji); | ||
} | ||
/* | ||
* Expose the extended data (`gemoji`) as `unicode`. | ||
* Expose. | ||
*/ | ||
exports.unicode = gemoji; | ||
/* | ||
* Expose the name-to-unicode dictionary (`named`) as `name`. | ||
*/ | ||
exports.name = named; | ||
module.exports = gemoji; |
{ | ||
"name": "gemoji", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"description": "GitHub emoji: gemoji", | ||
@@ -16,30 +16,42 @@ "license": "MIT", | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wooorm/gemoji.git" | ||
}, | ||
"repository": "wooorm/gemoji", | ||
"author": "Titus Wormer <tituswormer@gmail.com>", | ||
"files": [ | ||
"index.js", | ||
"data/gemoji.json" | ||
], | ||
"devDependencies": { | ||
"eslint": "^0.11.0", | ||
"browserify": "^11.0.0", | ||
"eslint": "^1.0.0", | ||
"esmangle": "^1.0.0", | ||
"istanbul": "^0.3.0", | ||
"jscs": "^1.0.0", | ||
"jscs-jsdoc": "^0.4.0", | ||
"markdown-table": "0.3.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": "_mocha --check-leaks test.js", | ||
"test-travis": "istanbul cover _mocha --report lcovonly -- --check-leaks test.js", | ||
"coverage": "istanbul cover _mocha -- -- test.js", | ||
"lint-api": "eslint index.js", | ||
"lint-test": "eslint --env mocha test.js", | ||
"lint-script": "eslint script/build-data.js script/build-support.js", | ||
"lint-style": "jscs --reporter inline index.js test.js script/build-data.js script/build-support.js", | ||
"lint": "npm run lint-api && npm run lint-test && npm run lint-script && npm run lint-style", | ||
"make": "npm run lint && npm run coverage", | ||
"prebuild": "curl --connect-timeout 5 --max-time 10 -H 'Accept: application/vnd.github.v3.raw' -L https://api.github.com/repos/github/gemoji/contents/db/emoji.json -o data/emoji.json || exit 0", | ||
"build": "node script/build-data.js", | ||
"postbuild": "node script/build-support.js", | ||
"prepublish": "npm run build" | ||
"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", | ||
"prebuild-data": "curl --connect-timeout 5 --max-time 10 -H 'Accept: application/vnd.github.v3.raw' -L https://api.github.com/repos/github/gemoji/contents/db/emoji.json -o data/emoji.json || exit 0", | ||
"build-data": "node script/build-data.js", | ||
"postbuild-data": "node script/build-support.js", | ||
"bundle": "browserify index.js --no-builtins -s gemoji > gemoji.js", | ||
"postbundle": "esmangle gemoji.js > gemoji.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 too big to display
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
110916
6
1
15
6821
91
1