[add] code
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
module.exports.sum = function sum(a, b) {
|
||||
let x = 0;
|
||||
|
||||
for(var c in [1,2,3,4]){
|
||||
x+=c;
|
||||
}
|
||||
|
||||
return a + b;
|
||||
}
|
||||
module.exports.div = function div(a, b) {
|
||||
|
120
test_src/classnames.bundle.cjs
Normal file
120
test_src/classnames.bundle.cjs
Normal file
@@ -0,0 +1,120 @@
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 485:
|
||||
/***/ ((module, exports) => {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
/* global define */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var hasOwn = {}.hasOwnProperty;
|
||||
|
||||
function classNames () {
|
||||
var classes = '';
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i];
|
||||
if (arg) {
|
||||
classes = appendClass(classes, parseValue(arg));
|
||||
}
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
function parseValue (arg) {
|
||||
if (typeof arg === 'string' || typeof arg === 'number') {
|
||||
return arg;
|
||||
}
|
||||
|
||||
if (typeof arg !== 'object') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (Array.isArray(arg)) {
|
||||
return classNames.apply(null, arg);
|
||||
}
|
||||
|
||||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
||||
return arg.toString();
|
||||
}
|
||||
|
||||
var classes = '';
|
||||
|
||||
for (var key in arg) {
|
||||
if (hasOwn.call(arg, key) && arg[key]) {
|
||||
classes = appendClass(classes, key);
|
||||
}
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
function appendClass (value, newClass) {
|
||||
if (!newClass) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
return value + ' ' + newClass;
|
||||
}
|
||||
|
||||
return value + newClass;
|
||||
}
|
||||
|
||||
if ( true && module.exports) {
|
||||
classNames.default = classNames;
|
||||
module.exports = classNames;
|
||||
} else if (true) {
|
||||
// register as 'classnames', consistent with npm package name
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
||||
return classNames;
|
||||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
} else // removed by dead control flow
|
||||
{}
|
||||
}());
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __webpack_require__(485);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
@@ -1,9 +1,10 @@
|
||||
var {existsSync,readFile} = require('node:fs');
|
||||
// const {cwd} = require('process');
|
||||
var _var = require('process');
|
||||
var {sum, div} = require('./arithmetic.cjs');
|
||||
var {sum, div} = require('../output/lodash.bundle.js');
|
||||
var {ceil} = require('./lodash.js')
|
||||
var {sum, div,sad} = require('./arithmetic.cjs');
|
||||
// var {sum, div} = require('../output/lodash.bundle.js');
|
||||
// var {ceil} = require('./lodash.js')
|
||||
var cn = require('./classnames.bundle.cjs')
|
||||
let cwd = process.cwd;
|
||||
console.log('a')
|
||||
|
||||
@@ -20,5 +21,6 @@ console.log(`Read some data`,newLocal,sum(2,34));
|
||||
console.log(`Read some data`,newLocal,
|
||||
div(7,0),
|
||||
div(32,3),
|
||||
ceil(10.24)
|
||||
// ceil(10.24),
|
||||
cn('fooo','foobar')
|
||||
);
|
Reference in New Issue
Block a user