-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,233 additions
and
1,591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.DS_Store | ||
node_modules | ||
|
||
*.log | ||
*.log | ||
dist | ||
.rpt2* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"licenser.author": "MH Rohman", | ||
"licenser.license": "MIT" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,56 +3,41 @@ | |
"description": "Convert any null value to undefined", | ||
"version": "1.0.0", | ||
"main": "dist/nullfined.js", | ||
"module": "index.js", | ||
"types": "types/index.d.ts", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Roman Masyhar", | ||
"email": "[email protected]", | ||
"url": "https://github.com/rohmanhm" | ||
}, | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"repository": "rohmanhm/nullfined", | ||
"devDependencies": { | ||
"ava": "^1.0.1", | ||
"babel-cli": "^6.24.1", | ||
"babel-eslint": "^8.0.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-latest": "^6.24.1", | ||
"babelrc-rollup": "^3.0.0", | ||
"eslint-config-airbnb-base": "^12.0.0", | ||
"eslint": "^5.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"rollup": "^0.65.0", | ||
"rollup-plugin-babel": "^3.0.0", | ||
"rollup-plugin-uglify": "^4.0.0", | ||
"xo": "^0.22.0" | ||
"ava": "^1.2.1", | ||
"lodash.camelcase": "^4.3.0", | ||
"rollup": "^1.2.3", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.1", | ||
"rollup-plugin-node-resolve": "^4.0.1", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"rollup-plugin-typescript2": "^0.19.2", | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"tslint": "^5.13.0", | ||
"tslint-config-standard": "^8.0.1", | ||
"typescript": "^3.3.3333" | ||
}, | ||
"dependencies": { | ||
"vaper": "^0.0.1" | ||
"vaper": "^1.0.1-0" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "rollup -c -w", | ||
"test": "xo && ava" | ||
}, | ||
"xo": { | ||
"extends": "airbnb-base", | ||
"plugins": [ | ||
"import" | ||
], | ||
"rules": { | ||
"unicorn/filename-case": [ | ||
"error", | ||
{ | ||
"case": "camelCase" | ||
} | ||
] | ||
} | ||
"test": "ava" | ||
}, | ||
"ava": { | ||
"verbose": true | ||
"verbose": true, | ||
"ignore": [ | ||
"rollup.config.js", | ||
"test" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import babelrc from 'babelrc-rollup'; // eslint-disable-line import/extensions | ||
import uglify from 'rollup-plugin-uglify'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import sourceMaps from 'rollup-plugin-sourcemaps'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import camelCase from 'lodash.camelcase'; | ||
import { uglify } from 'rollup-plugin-uglify'; | ||
|
||
const pkg = require('./package.json'); | ||
|
||
const external = Object.keys(pkg.dependencies); | ||
|
||
const libraryName = 'nullfined'; | ||
|
||
export default { | ||
entry: pkg.module, | ||
plugins: [ | ||
babel(babelrc()), | ||
uglify(), | ||
], | ||
external, | ||
targets: [ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
dest: pkg.main, | ||
file: pkg.main, | ||
name: camelCase(libraryName), | ||
format: 'umd', | ||
moduleName: 'Nullfined', | ||
sourceMap: true, | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
// Compile TypeScript files | ||
typescript({ useTsconfigDeclarationDir: true }), | ||
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) | ||
commonjs(), | ||
// Allow node_modules resolution, so you can use 'external' to control | ||
// which external modules to include in the bundle | ||
// https://github.com/rollup/rollup-plugin-node-resolve#usage | ||
resolve(), | ||
|
||
// Resolve source maps to the original source | ||
sourceMaps(), | ||
uglify(), | ||
], | ||
external, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) 2019 rohmanhm | ||
// | ||
// This software is released under the MIT License. | ||
// https://opensource.org/licenses/MIT | ||
|
||
import vaper from 'vaper' | ||
|
||
export default function<T = any>(data: T): T { | ||
return vaper(null, undefined)(data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "esnext", | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"baseUrl": "./src", | ||
"outDir": "dist", | ||
"noImplicitAny": true | ||
}, | ||
"exclude": ["node_modules", "dist", "types"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"defaultSeverity": "error", | ||
"extends": ["tslint:recommended", "tslint-config-standard"], | ||
"jsRules": {}, | ||
"rules": { | ||
"interface-name": false | ||
}, | ||
"rulesDirectory": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default function <T = any>(data: T): T; |
Oops, something went wrong.