This is Script Util methods documents.
const scriptUtil = require("script-util");
// return true
if(scriptUtil.isNullOrUndefined(null)) { // processing }
Return true if the string is formatted with JSON.
const scriptUtil = require("script-util");
let data = '{"text" : "message"}';
// return true
if(scriptUtil.isJson(data)) { // processing }
Return the string for the standard output.
console.log(appendStdOut("result"));
// [Trace log start]
// result
// [Trace log end]
Return true if the format of the parameter is date.
if(scriptUtil.isDateFormat("2019-05-31")) { // processing }
Reshape string of date for designated format.
2nd paramter, symbol
is delimiter of year, month and date.
The delimiter is valid only for /
or -
.
console.log((scriptUtil.formatYMDWith(new Date(), "-"))
// 2019-05-31
Return true if an array has more than one element.
// return true
if(scriptUtil.hasItems([0, 1, 2])){ // processing }
Return true if an array has no null elements.
// return false
if(scriptUtil.hasNoNull([1, null, null])){ // processing }