Skip to content

Commit 13f4a24

Browse files
committed
Initial commit
0 parents  commit 13f4a24

10 files changed

+1140
-0
lines changed

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[*]
2+
root=true
3+
charset = utf-8
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
indent_size = 2
8+
indent_style = space

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

UNLICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "express-rest-utils",
3+
"version": "0.1.0",
4+
"main": "dist/cjs/index.js",
5+
"module": "dist/esm/index.js",
6+
"types": "dist/esm/index.d.ts",
7+
"scripts": {
8+
"prepublishOnly": "yarn build",
9+
"build": "rm -rf dist && yarn build:esm && yarn build:cjs",
10+
"build:esm": "tsc -p tsconfig.build.json --outDir dist/esm --module ES6",
11+
"build:cjs": "tsc -p tsconfig.build.json --outDir dist/cjs --declaration false",
12+
"test": "mocha -r ts-node/register \"test/**/*.test.ts\"",
13+
"lint": "tslint --project tsconfig.json \"src/**/*.ts\" \"test/**/*.ts\""
14+
},
15+
"dependencies": {},
16+
"devDependencies": {
17+
"@types/chai": "^4.1.7",
18+
"@types/mocha": "^5.2.7",
19+
"chai": "^4.2.0",
20+
"mocha": "^6.1.4",
21+
"ts-node": "^8.3.0",
22+
"tslint": "^5.17.0",
23+
"tslint-config-standard": "^8.0.1",
24+
"typescript": "^3.5.2"
25+
}
26+
}

src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function add (a: number, b: number) {
2+
return a + b
3+
}

test/index.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { expect } from 'chai'
2+
import { add } from '../src'
3+
4+
describe('add', () => {
5+
it('works', () => {
6+
expect(add(1, 2)).to.equal(3)
7+
})
8+
})

tsconfig.build.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": [
4+
"src"
5+
]
6+
}

tsconfig.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"strict": true,
5+
"target": "es5",
6+
"module": "commonjs",
7+
"declaration": true,
8+
"lib": [
9+
"es2015"
10+
],
11+
"moduleResolution": "node",
12+
"resolveJsonModule": true
13+
}
14+
}

tslint.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"tslint:recommended",
4+
"tslint-config-standard"
5+
]
6+
}

0 commit comments

Comments
 (0)