frgen 0.1.7 → 0.1.9
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.
- package/lib/utils.js +1 -1
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./_virtual/_rollupPluginBabelHelpers.js"),r=require("path"),t=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){var n,a=arguments;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:"public",e.prev=1,e.next=4,t.schema.withSchema(n).raw("SELECT 1");case 4:console.log("connection success"),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),console.error("Gagal terhubung ke database:",e.t0),process.exit(1);case 11:case"end":return e.stop()}}),r,null,[[1,7]])})));return function(e){return r.apply(this,arguments)}}(),n=function(){var t=e.asyncToGenerator(e.regeneratorRuntime().mark((function t(){var n,a,o,s,
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./_virtual/_rollupPluginBabelHelpers.js"),r=require("path"),t=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){var n,a=arguments;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:"public",e.prev=1,e.next=4,t.schema.withSchema(n).raw("SELECT 1");case 4:console.log("connection success"),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),console.error("Gagal terhubung ke database:",e.t0),process.exit(1);case 11:case"end":return e.stop()}}),r,null,[[1,7]])})));return function(e){return r.apply(this,arguments)}}(),n=function(){var t=e.asyncToGenerator(e.regeneratorRuntime().mark((function t(){var n,a,o,s,u=arguments;return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:"",e.prev=1,a=process.cwd(),o=r.resolve(a,"knexfile.js"),e.next=6,import(o);case 6:if(s=e.sent,"development"!=n){e.next=9;break}return e.abrupt("return",s.default[n]);case 9:return e.abrupt("return",s.default);case 12:e.prev=12,e.t0=e.catch(1),console.log(e.t0);case 15:case"end":return e.stop()}}),t,null,[[1,12]])})));return function(){return t.apply(this,arguments)}}();exports.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},exports.checkDatabaseConnection=t,exports.loadConfig=n,exports.removePluralSuffix=function(e){if("ss"===e.toLowerCase().substring(e.length-2))return e;for(var r=0,t=["s","es","ies"];r<t.length;r++){var n=t[r];if(e.endsWith(n))return e.slice(0,-n.length)}return e},exports.toCamelCase=function(e){return e.replace(/_([a-z])/g,(function(e,r){return r.toUpperCase()}))},exports.toKebabCase=function(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()};
|