Skip to content

Commit 2d413a7

Browse files
chore: improve codebase
chore: improve codebase
2 parents 91cb902 + 5ef7588 commit 2d413a7

14 files changed

+5179
-962
lines changed

.editorconfig

-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ insert_final_newline = true
77
trim_trailing_whitespace = true
88
indent_style = space
99
indent_size = 2
10-
11-
[*.js]
12-
indent_size = 4

.gitignore

+132
Original file line numberDiff line numberDiff line change
@@ -1 +1,133 @@
1+
# Include your project-specific ignores in this file
2+
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3+
# Useful .gitignore templates: https://github.com/github/gitignore
4+
5+
# Git files
6+
*.diff
7+
*.orig
8+
*.rej
9+
10+
# Numerous always-ignore extensions
11+
pids
12+
*.pid
13+
*.seed
14+
*.lock
15+
*.err
16+
*.tmp
17+
*.log*
18+
19+
# Vim
20+
[._]*.s[a-w][a-z]
21+
[._]s[a-w][a-z]
22+
*.un~
23+
Session.vim
24+
.netrwhist
25+
*~
26+
27+
# Text Editors
28+
.swo
29+
*.swp
30+
*.vi
31+
32+
# Numerous always-ignore directories
33+
logs
34+
tmp
35+
36+
# Windows files and directories
37+
Thumbs.db
38+
ehthumbs.db
39+
ehthumbs_vista.db
40+
Image.db
41+
Video.db
42+
TVThumb.db
43+
musicThumbs.db
44+
thumbcache_*.db
45+
46+
# Mac files and directories
47+
.DS_Store
48+
.AppleDouble
49+
.LSOverride
50+
.Spotlight-V100
51+
.Trashes
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk
57+
58+
# Thumbnails
59+
._*
60+
61+
# IntelliJ IDEA and other products
62+
*.iml
63+
.idea
64+
release
65+
66+
# VSCode metadata
67+
.vscode
68+
69+
# Sublime
70+
*.sublime-project
71+
*.sublime-workspace
72+
.sublimelinterrc
73+
74+
# Eclipse
75+
.project
76+
.classpath
77+
.settings
78+
79+
# gitkeep
80+
!.gitkeep
81+
82+
# Directory for instrumented libs generated by `jscoverage/JSCover`
83+
lib-cov
84+
85+
# Coverage directory used by tools like `istanbul`, `phpunit/php-code-coverage` and etc.
86+
coverage
87+
88+
# nyc test coverage
89+
.nyc_output
90+
91+
# node-waf configuration
92+
.lock-wscript
93+
94+
# Compiled binary addons (http://nodejs.org/api/addons.html)
95+
build/Release
96+
97+
# Dependency directories
98+
bower_components
99+
.bower-cache
100+
.bower-registry
101+
.bower-tmp
1102
node_modules
103+
jspm_packages
104+
105+
# Optional npm cache directory
106+
.npm
107+
108+
# Optional REPL history
109+
.node_repl_history
110+
111+
# Ignore minified files
112+
*.min.*
113+
114+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
115+
.grunt
116+
117+
# Python
118+
*.pyc
119+
120+
# Caches
121+
.cache
122+
.cache-loader
123+
.eslintcache
124+
.eclintercache
125+
.stylelintcache
126+
.sass-cache
127+
.phpcscache
128+
129+
# npm
130+
npm-shrinkwrap.json
131+
!package-lock.json
132+
133+

.travis.yml

+32-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1+
sudo: false
2+
3+
git:
4+
depth: 10
5+
6+
branches:
7+
only:
8+
- master
9+
110
language: node_js
2-
node_js:
3-
- 'stable'
4-
- '0.12'
11+
12+
# cache node modules
13+
cache:
14+
directories:
15+
- $HOME/.npm
16+
- node_modules
17+
18+
matrix:
19+
fast_finish: true
20+
include:
21+
- node_js: '10'
22+
script: npm run pretest
23+
- node_js: '10'
24+
script: npm run test
25+
- node_js: '8'
26+
script: npm run test
27+
- node_js: '6'
28+
script: npm run test
29+
30+
before_install:
31+
- npm install -g npm@latest
32+
- node --version
33+
- npm --version

lib/index.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
var parse = require('./parse');
2-
var walk = require('./walk');
3-
var stringify = require('./stringify');
1+
var parse = require("./parse");
2+
var walk = require("./walk");
3+
var stringify = require("./stringify");
44

55
function ValueParser(value) {
6-
if (this instanceof ValueParser) {
7-
this.nodes = parse(value);
8-
return this;
9-
}
10-
return new ValueParser(value);
6+
if (this instanceof ValueParser) {
7+
this.nodes = parse(value);
8+
return this;
9+
}
10+
return new ValueParser(value);
1111
}
1212

13-
ValueParser.prototype.toString = function () {
14-
return Array.isArray(this.nodes) ? stringify(this.nodes) : '';
13+
ValueParser.prototype.toString = function() {
14+
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
1515
};
1616

17-
ValueParser.prototype.walk = function (cb, bubble) {
18-
walk(this.nodes, cb, bubble);
19-
return this;
17+
ValueParser.prototype.walk = function(cb, bubble) {
18+
walk(this.nodes, cb, bubble);
19+
return this;
2020
};
2121

22-
ValueParser.unit = require('./unit');
22+
ValueParser.unit = require("./unit");
2323

2424
ValueParser.walk = walk;
2525

0 commit comments

Comments
 (0)