Skip to content

Commit 86c3e0f

Browse files
authored
Merge pull request #3 from soluml/v0.2.0
NPM Audit. Fixed dependencies and updated dependency files.
2 parents dd2fe78 + 698c324 commit 86c3e0f

File tree

10 files changed

+7102
-745
lines changed

10 files changed

+7102
-745
lines changed

.eslintrc

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
{
2-
"rules": {
3-
"indent": [
4-
1,
5-
4,
6-
{
7-
"SwitchCase": 1,
8-
"VariableDeclarator": {"var": 1, "let": 1, "const": 1}
9-
}
10-
],
11-
"quotes": 0,
12-
"no-console": 0,
13-
"semi": [
14-
2,
15-
"always"
16-
]
17-
},
18-
"globals": {
19-
},
20-
"env": {
21-
"es6": true,
22-
"browser": true,
23-
"commonjs": true,
24-
"mocha": true
25-
},
26-
"extends": "eslint:recommended",
27-
"ecmaFeatures": {
28-
"experimentalObjectRestSpread": true
29-
},
30-
"plugins": []
31-
}
2+
"rules": {
3+
"indent": [
4+
1,
5+
2,
6+
{
7+
"SwitchCase": 1,
8+
"VariableDeclarator": { "var": 1, "let": 1, "const": 1 }
9+
}
10+
],
11+
"quotes": 0,
12+
"no-console": 0,
13+
"semi": [2, "always"]
14+
},
15+
"globals": {},
16+
"env": {
17+
"es6": true,
18+
"browser": true,
19+
"commonjs": true,
20+
"mocha": true
21+
},
22+
"extends": "eslint:recommended",
23+
"ecmaFeatures": {
24+
"experimentalObjectRestSpread": true
25+
},
26+
"plugins": []
27+
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules
22
npm-debug.log
33
*.map
4-
browser/sweatmap.js

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
1-
#SweatMap
1+
# SweatMap
2+
23
[![npm version](https://badge.fury.io/js/sweatmap.svg)](http://badge.fury.io/js/sweatmap)
34
[![Build Status](https://travis-ci.org/soluml/SweatMap.svg?branch=master)](https://travis-ci.org/soluml/SweatMap)
45

56
Take in a series of UTF-8 strings and map them to UTF-8 strings that are as small as possible while still being unique.
67

7-
###Why?
8+
### Why?
9+
810
The motivation behind SweatMap was to take semantic CSS Identifiers (e.g. for selectors) and make them as small as possible at build time. With new tools that can take advantage of CSS Modules all we needed was something to map our current class names to something smaller.
911

10-
##Installation
12+
## Installation
13+
1114
`npm install sweatmap --save`
1215

13-
##How to use
14-
*SweatMap uses a few ES6 features that may not be present in your Node/Browser depending on the version.*
16+
## How to use
17+
18+
_SweatMap uses a few ES6 features that may not be present in your Node/Browser depending on the version._
1519
These include: `Array.fill`, `Object.assign`, `Object.freeze`, and `Object.keys`
1620

17-
* **Constructor(obj):**
18-
19-
*Takes in an object with up to three optional properties:*
20-
* *cssSafe [default `false`]:* `true` disallows characters that aren't safe for [CSS Identifiers](https://www.w3.org/TR/CSS2/syndata.html#characters).
21-
* *additional_ranges [[`object`](https://github.com/soluml/SweatMap/blob/master/node/sweatmap.js#L27)]:* An object where the key is a "range name" and the value is an object with a start character point and an end character point. You can set null to either start or end to remove a character range.
22-
* *existing_strings [default `{}`]:* Pass in an object of strings that you don't want changed. Key is the original name, value is the name that should be used.
23-
24-
* **bytes(string):** Returns a byte count of the string passed in.
25-
* **size():** Returns number of entries in the map.
26-
* **cssSafeString(string):** Determines if the string is a safe [CSS Identifier](https://www.w3.org/TR/CSS2/syndata.html#characters).
27-
* **set(string):** Returns an obfuscated UTF-8 string that's unique to all strings in the map.
28-
* **delete(key):** Removes the string from the map.
29-
* **clear():** Empties the map.
30-
* **clear():** Empties the map.
31-
* **entries():** Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.
32-
* **get(key):** Returns the value for a given key.
33-
* **get_obfuscated(value):** Returns the key for a given value.
34-
* **has(key):** Returns true/false if a key exists in the map.
35-
* **has_obfuscated(value):** Returns true/false if a value exists in the map.
21+
- **Constructor(obj):**
22+
23+
_Takes in an object with up to three optional properties:_
24+
25+
- _cssSafe [default `false`]:_ `true` disallows characters that aren't safe for [CSS Identifiers](https://www.w3.org/TR/CSS2/syndata.html#characters).
26+
- _additional_ranges [[`object`](https://github.com/soluml/SweatMap/blob/master/node/sweatmap.js#L27)]:_ An object where the key is a "range name" and the value is an object with a start character point and an end character point. You can set null to either start or end to remove a character range.
27+
- _existing_strings [default `{}`]:_ Pass in an object of strings that you don't want changed. Key is the original name, value is the name that should be used.
28+
29+
- **bytes(string):** Returns a byte count of the string passed in.
30+
- **size():** Returns number of entries in the map.
31+
- **cssSafeString(string):** Determines if the string is a safe [CSS Identifier](https://www.w3.org/TR/CSS2/syndata.html#characters).
32+
- **set(string):** Returns an obfuscated UTF-8 string that's unique to all strings in the map.
33+
- **delete(key):** Removes the string from the map.
34+
- **clear():** Empties the map.
35+
- **clear():** Empties the map.
36+
- **entries():** Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.
37+
- **get(key):** Returns the value for a given key.
38+
- **get_obfuscated(value):** Returns the key for a given value.
39+
- **has(key):** Returns true/false if a key exists in the map.
40+
- **has_obfuscated(value):** Returns true/false if a value exists in the map.

browser/sweatmap-0.0.5.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

browser/sweatmap-0.2.0.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)