From b3ab5fa315dc3c312472cc9786a778f44dbc799a Mon Sep 17 00:00:00 2001 From: tamtakoe Date: Tue, 17 May 2016 11:28:34 +0300 Subject: [PATCH 1/3] Added build --- README.md | 9 +++ dist/mapper.js | 191 +++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 12 ++-- 3 files changed, 208 insertions(+), 4 deletions(-) create mode 100644 dist/mapper.js diff --git a/README.md b/README.md index 80c1a74..5f404c6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ npm install mapper.js ## Usage +You can use mapper.js by `require('mapper.js')` in node.js or in browser with require.js. Also we can get it in browser as `window.mapper`. + There are two ways to use module: ### 1. mapper(data, schema) @@ -157,6 +159,13 @@ const userSchema = { const result = mapper(user, userSchema); // or mapper(userSchema)(user) ``` +## Build + +```sh +npm install +npm run build +``` + ## Tests ```sh diff --git a/dist/mapper.js b/dist/mapper.js new file mode 100644 index 0000000..01384db --- /dev/null +++ b/dist/mapper.js @@ -0,0 +1,191 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mapper = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Date: Tue, 17 May 2016 12:30:00 +0300 Subject: [PATCH 2/3] Added minify --- README.md | 5 ++++- dist/mapper.min.js | 1 + package.json | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 dist/mapper.min.js diff --git a/README.md b/README.md index 5f404c6..b07a64e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,10 @@ npm install mapper.js ## Usage -You can use mapper.js by `require('mapper.js')` in node.js or in browser with require.js. Also we can get it in browser as `window.mapper`. +Use `require('mapper.js')` in node.js. + +Use `