Skip to content

Commit c9f22b7

Browse files
committed
feat: intail
0 parents  commit c9f22b7

21 files changed

+322
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
bower_components
3+
coverage
4+
npm-debug.log
5+
yarn.lock
6+
package-lock.json
7+
.DS_Store
8+
.idea
9+
.vscode
10+
11+
# vscode localhistory
12+
.history

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.idea
2+
.DS_Store
3+
**/npm-debug.log
4+
**/node_modules
5+
test
6+
__tests__
7+
src
8+
build
9+
gulpfile.js
10+
11+
.editorconfig
12+
.prettierrc
13+
Gemfile
14+
jest.config.js
15+
LICENSE.txt
16+
Rakefile
17+
express.js
18+
.vscode
19+
20+
21+
# vscode localhistory
22+
.history

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
2+
package-lock=false

.prettierrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"trailingComma": "none",
3+
"arrowParens": "always",
4+
"printWidth": 100,
5+
"bracketSpacing": true,
6+
"jsxBracketSameLine": true,
7+
"tabWidth": 2,
8+
"semi": true,
9+
"singleQuote": true,
10+
"overrides": [
11+
{
12+
"files": "*.scss",
13+
"options": {
14+
"trailingComma": "none",
15+
"tabWidth": 2,
16+
"parser": "scss"
17+
}
18+
},
19+
{
20+
"files": "*.json",
21+
"options": {
22+
"trailingComma": "none",
23+
"tabWidth": 2,
24+
"parser": "json"
25+
}
26+
},
27+
{
28+
"files": "*.md",
29+
"options": {
30+
"trailingComma": "none",
31+
"tabWidth": 2,
32+
"parser": "json"
33+
}
34+
}
35+
]
36+
}

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'fileutils'
4+
gem 'sshkit'
5+
gem 'semver'

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 afei <1290657123@qq.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# next-arrayify
2+
> Simpliy to array.
3+
4+
## installation
5+
```bash
6+
npm install -S @feizheng/next-arrayify
7+
```
8+
9+
## usage
10+
```js
11+
import '@feizheng/next-arrayify';
12+
13+
nx.arrayify(null); //[]
14+
nx.arrayify(undefined); //[]
15+
nx.arrayify([1,2,3]) //[1,2,3]
16+
```

Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
Dir["./node_modules/@feizheng/rake-*/index.rake"].each do |task|
3+
load task
4+
end

__tests__/api.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const nx = require('@feizheng/next-js-core2');
2+
require('../src/next-arrayify');
3+
4+
describe('api.basic test', () => {
5+
test('nx.arrayify met null/undefined target', function () {
6+
expect(nx.arrayify(null)).toEqual([]);
7+
expect(nx.arrayify(undefined)).toEqual([]);
8+
});
9+
10+
test('nx.arrayify met normal target', () => {
11+
expect(nx.arrayify('')).toEqual([''])
12+
expect(nx.arrayify(false)).toEqual([false])
13+
expect(nx.arrayify([1, 2, 3])).toEqual([1, 2, 3])
14+
})
15+
});

0 commit comments

Comments
 (0)