jis 1.0.33 → 1.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,22 @@
1
- "use strict";
2
- exports.__esModule = true;
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define("jis", [], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["jis"] = factory();
8
+ else
9
+ root["jis"] = factory();
10
+ })(this, function() {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 138:
16
+ /***/ ((__unused_webpack_module, exports) => {
17
+
18
+
19
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3
20
  var Is = /** @class */ (function () {
4
21
  function Is() {
5
22
  }
@@ -92,4 +109,52 @@ var Is = /** @class */ (function () {
92
109
  };
93
110
  return Is;
94
111
  }());
95
- exports["default"] = Is;
112
+ exports.default = Is;
113
+
114
+
115
+ /***/ })
116
+
117
+ /******/ });
118
+ /************************************************************************/
119
+ /******/ // The module cache
120
+ /******/ var __webpack_module_cache__ = {};
121
+ /******/
122
+ /******/ // The require function
123
+ /******/ function __webpack_require__(moduleId) {
124
+ /******/ // Check if module is in cache
125
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
126
+ /******/ if (cachedModule !== undefined) {
127
+ /******/ return cachedModule.exports;
128
+ /******/ }
129
+ /******/ // Create a new module (and put it into the cache)
130
+ /******/ var module = __webpack_module_cache__[moduleId] = {
131
+ /******/ // no module.id needed
132
+ /******/ // no module.loaded needed
133
+ /******/ exports: {}
134
+ /******/ };
135
+ /******/
136
+ /******/ // Execute the module function
137
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
138
+ /******/
139
+ /******/ // Return the exports of the module
140
+ /******/ return module.exports;
141
+ /******/ }
142
+ /******/
143
+ /************************************************************************/
144
+ var __webpack_exports__ = {};
145
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
146
+ (() => {
147
+ var exports = __webpack_exports__;
148
+ var __webpack_unused_export__;
149
+
150
+ __webpack_unused_export__ = ({ value: true });
151
+ var Is_1 = __webpack_require__(138);
152
+ exports.default = Is_1.default;
153
+
154
+ })();
155
+
156
+ __webpack_exports__ = __webpack_exports__.default;
157
+ /******/ return __webpack_exports__;
158
+ /******/ })()
159
+ ;
160
+ });
@@ -0,0 +1 @@
1
+ !function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("jis",[],t):"object"==typeof exports?exports.jis=t():n.jis=t()}(this,function(){return(()=>{"use strict";var e={138:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=(i.callToString=function(n){return Object.prototype.toString.call(n)},i.$string=function(n){return"[object String]"===i.callToString(n)},i.is=function(n,t){return i.$function(t)?n instanceof t:i.$string(t)?i.callToString(n)==="[object "+t+"]":n===t},i.$array=function(n){return i.is(n,"Array")},i.$null=function(n){return i.is(n,"Null")},i.$number=function(n){return i.is(n,"Number")},i.$object=function(n){return i.is(n,"Object")},i.$undefined=function(n){return i.is(n,"Undefined")},i.$boolean=function(n){return i.is(n,"Boolean")},i.$function=function(n){return"[object Function]"===i.callToString(n)},i.objectIsValid=function(r,o){if(!i.$object(r))throw new Error("The data parameter must be an Object");if(!i.$object(o))throw new Error("The rules parameter must be an Object");var u=!0;return Object.getOwnPropertyNames(o).forEach(function(t){var n=o[t];if(i.$array(n)){if(n.length<1)return;var e=!1;return n.forEach(function(n){e=e||i.is(r[t],n)}),u=u&&e}u=u&&i.is(r[t],n)}),u},i.$numeric=function(n){if(i.$number(n))return!0;n=String(n||"");return/^[-+]?(([0-9]+)|([0-9]*(\.[0-9]+))|([0-9]+\.))([Ee]([-+]?[0-9]+))?$/g.test(n)},i.$primitive=function(t){return[i.$undefined,i.$null,i.$boolean,i.$number,i.$string,function(n){return i.is(n,"Symbol")}].some(function(n){return n(t)})},i.$empty=function(t){return[i.$undefined,i.$null,function(n){return i.$boolean(n)&&!n},function(n){return i.$number(n)&&0===n},function(n){return(i.$array(n)||i.$string(n))&&("0"===n||0===n.length)}].some(function(n){return n(t)})},i);function i(){}t.default=e}},r={};function o(n){var t=r[n];if(void 0!==t)return t.exports;t=r[n]={exports:{}};return e[n](t,t.exports,o),t.exports}var n,t,u={};return n=u,t=o(138),n.default=t.default,u.default})()});
package/index.html ADDED
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Title</title>
6
+ </head>
7
+ <body>
8
+ <script src="dist/jis.min.js"></script>
9
+ </body>
10
+ </html>
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "jis",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "When you need validate the variable data type",
5
- "main": "index.js",
5
+ "main": "dist/jis.js",
6
6
  "types": "types/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "mocha test.js",
9
- "build": "tsc src/*.ts --outDir build/"
9
+ "build": "webpack"
10
10
  },
11
11
  "keywords": [
12
12
  "Is",
@@ -27,8 +27,13 @@
27
27
  "devDependencies": {
28
28
  "chai": "^4.2.0",
29
29
  "mocha": "^8.2.1",
30
+ "ts-loader": "^9.2.2",
30
31
  "tsc": "^1.20150623.0",
31
- "typescript": "^4.0.5"
32
+ "typescript": "^4.0.5",
33
+ "webpack-cli": "^4.7.0"
32
34
  },
33
- "dependencies": {}
35
+ "dependencies": {
36
+ "uglifyjs-webpack-plugin": "^2.2.0",
37
+ "webpack": "^5.37.1"
38
+ }
34
39
  }
package/src/main.ts ADDED
@@ -0,0 +1,3 @@
1
+ import Is from './Is';
2
+
3
+ export default Is;
package/test.js CHANGED
@@ -2,9 +2,6 @@ require('mocha');
2
2
  let assert = require('chai').assert;
3
3
  let jis = require('./')
4
4
 
5
- let { $empty } = jis
6
- console.log($empty([12]))
7
-
8
5
  describe('Jis types test', () => {
9
6
 
10
7
  it('$array method', () => {
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "sourceMap": false,
4
+ "module": "commonjs",
5
+ "target": "es5",
6
+ "lib": [ "es2015", "dom" ],
7
+ "outDir": "build"
8
+ },
9
+ "exclude": [
10
+ "node_modules"
11
+ ],
12
+ "include": [
13
+ "src/*.ts"
14
+ ]
15
+ }
@@ -0,0 +1,45 @@
1
+ const path = require('path')
2
+ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
3
+
4
+ module.exports = {
5
+ mode: 'production',
6
+ entry: {
7
+ 'jis': './src/main.ts',
8
+ 'jis.min': './src/main.ts'
9
+ },
10
+ output: {
11
+ path: path.resolve(__dirname, 'dist'),
12
+ filename: '[name].js',
13
+ libraryTarget: 'umd',
14
+ library: {
15
+ name: 'jis',
16
+ type: 'global'
17
+ },
18
+ umdNamedDefine: true,
19
+ globalObject: "this",
20
+ libraryExport: "default"
21
+ },
22
+ resolve: {
23
+ extensions: ['.ts', '.tsx', '.js']
24
+ },
25
+ // devtool: 'source-map',
26
+ module: {
27
+ rules: [{
28
+ test: /\.tsx?$/,
29
+ loader: 'ts-loader',
30
+ exclude: /node_modules/
31
+ }]
32
+ },
33
+ optimization: {
34
+ minimizer: [
35
+ new UglifyJsPlugin({
36
+ include: /\.min\.js$/,
37
+ uglifyOptions: {
38
+ output: {
39
+ comments: false
40
+ }
41
+ }
42
+ })
43
+ ]
44
+ }
45
+ }
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./build/Is').default;