Skip to content
This repository has been archived by the owner on Apr 28, 2018. It is now read-only.

Commit

Permalink
App written
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleloscozzese committed Apr 28, 2017
1 parent 47b98b4 commit 5b17371
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets":["flow", "env"]
}
Empty file added .flowconfig
Empty file.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src
README.md
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Formal
<q>being in accordance with the usual requirements, customs, etc</q>
1 change: 1 addition & 0 deletions flow-typed/jack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare function preventSubmission(submission: Event, callback?: () => void): void;
14 changes: 14 additions & 0 deletions lib/jack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.preventSubmission = preventSubmission;
function preventSubmission(submission, callback) {
submission.preventDefault();
if (callback) {
callback();
} else {
return;
}
}
10 changes: 10 additions & 0 deletions lib/jack.js.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @flow

export function preventSubmission(submission: Event, callback?: () => void): void {
submission.preventDefault();
if (callback) {
callback();
} else {
return;
}
}
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "customary",
"version": "1.0.0",
"description": "Prevents form submission after native validation has taken place.",
"main": "lib/jack.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"flow": "flow",
"build:transpile": "babel src --out-dir lib",
"build:type": "flow-copy-source -v src lib",
"build": "npm run build:transpile && npm run build:type",
"prepublish": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DanArthurGallagher/formal.git"
},
"keywords": [
"front-end"
],
"author": "Daniel Arthur Gallagher",
"license": "MIT",
"bugs": {
"url": "https://github.com/DanArthurGallagher/formal/issues"
},
"homepage": "https://github.com/DanArthurGallagher/formal#readme",
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.4.0",
"babel-preset-flow": "^6.23.0",
"flow-bin": "^0.45.0",
"flow-copy-source": "^1.1.0"
},
"browserslist": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 1 Safari version",
"last 1 iOS version",
"last 1 Samsung version",
"last 1 Edge version"
]
}
10 changes: 10 additions & 0 deletions src/jack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @flow

export function preventSubmission(submission: Event, callback?: () => void): void {
submission.preventDefault();
if (callback) {
callback();
} else {
return;
}
}

0 comments on commit 5b17371

Please sign in to comment.