Skip to content

Commit 630174d

Browse files
committed
chore: jswork scope
1 parent c9f22b7 commit 630174d

File tree

16 files changed

+90
-96
lines changed

16 files changed

+90
-96
lines changed

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ test
66
__tests__
77
src
88
build
9+
docs
910
gulpfile.js
1011

1112
.editorconfig
@@ -16,7 +17,9 @@ LICENSE.txt
1617
Rakefile
1718
express.js
1819
.vscode
20+
.release-it.json
1921

2022

2123
# vscode localhistory
2224
.history
25+
.release-it.json

.release-it.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"git": {
3+
"requireCleanWorkingDir": false
4+
},
5+
"hooks": {
6+
"after:init": [
7+
"npm run test",
8+
"t2k"
9+
],
10+
"after:bump": [
11+
"npm run build"
12+
]
13+
},
14+
"github": {
15+
"release": true
16+
}
17+
}

Gemfile

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
# next-arrayify
22
> Simpliy to array.
33
4+
[![version][version-image]][version-url]
5+
[![license][license-image]][license-url]
6+
[![size][size-image]][size-url]
7+
[![download][download-image]][download-url]
8+
49
## installation
510
```bash
6-
npm install -S @feizheng/next-arrayify
11+
npm install -S @jswork/next-arrayify
712
```
813

914
## usage
1015
```js
11-
import '@feizheng/next-arrayify';
16+
import '@jswork/next-arrayify';
1217

1318
nx.arrayify(null); //[]
1419
nx.arrayify(undefined); //[]
1520
nx.arrayify([1,2,3]) //[1,2,3]
1621
```
22+
23+
## license
24+
Code released under [the MIT license](https://github.com/afeiship/next-arrayify/blob/master/LICENSE.txt).
25+
26+
[version-image]: https://img.shields.io/npm/v/@jswork/next-arrayify
27+
[version-url]: https://npmjs.org/package/@jswork/next-arrayify
28+
29+
[license-image]: https://img.shields.io/npm/l/@jswork/next-arrayify
30+
[license-url]: https://github.com/afeiship/next-arrayify/blob/master/LICENSE.txt
31+
32+
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-arrayify
33+
[size-url]: https://github.com/afeiship/next-arrayify/blob/master/dist/next-arrayify.min.js
34+
35+
[download-image]: https://img.shields.io/npm/dm/@jswork/next-arrayify
36+
[download-url]: https://www.npmjs.com/package/@jswork/next-arrayify

Rakefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

__tests__/api.spec.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

__tests__/index.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

__tests__/index.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(function () {
2+
require('../src');
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+
});
16+
})();

build/scripts.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
const gulp = require('gulp');
55
const saveLicense = require('uglify-save-license');
66
const $ = require('gulp-load-plugins')({
7-
pattern: ['gulp-*', 'gulp.*', 'del', '@feizheng/gulp-*']
7+
pattern: ['gulp-*', 'gulp.*', 'del', '@jswork/gulp-*']
88
});
99

1010
gulp.task('scripts', function() {
1111
return gulp
1212
.src('src/*.js')
13-
.pipe($.sourcemaps.init())
14-
.pipe($.feizheng.pkgHeader())
15-
.pipe($.sourcemaps.write('.'))
13+
.pipe($.jswork.pkgHeader())
1614
.pipe(gulp.dest('dist'))
1715
.pipe($.size({ title: '[ default size ]:' }))
18-
.pipe($.ignore('*.js.map'))
1916
.pipe($.uglify({ output: { comments: saveLicense } }))
2017
.pipe($.rename({ extname: '.min.js' }))
2118
.pipe(gulp.dest('dist'))
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
/*!
2-
* name: @feizheng/next-arrayify
2+
* name: @jswork/next-arrayify
33
* description: Simpliy to array.
44
* homepage: https://github.com/afeiship/next-arrayify
55
* version: 1.0.0
6-
* date: 2020-06-04T23:09:17.373Z
6+
* date: 2020-11-21 10:16:30
77
* license: MIT
88
*/
99

1010
(function () {
1111
var global = global || this || window || Function('return this')();
12-
var nx = global.nx || require('@feizheng/next-js-core2');
12+
var nx = global.nx || require('@jswork/next');
1313

1414
nx.arrayify = function (inTarget) {
15-
if (inTarget == null) return []
15+
if (inTarget == null) return [];
1616
return Array.isArray(inTarget) ? inTarget : [inTarget];
1717
};
1818

1919
if (typeof module !== 'undefined' && module.exports) {
2020
module.exports = nx.arrayify;
2121
}
2222
})();
23-
24-
//# sourceMappingURL=next-arrayify.js.map

0 commit comments

Comments
 (0)