|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`Rollup Plugin processes app-config 1`] = ` |
| 4 | +"var formats = {}; |
| 5 | +
|
| 6 | +(function (exports) { |
| 7 | +Object.defineProperty(exports, \\"__esModule\\", { value: true }); |
| 8 | +exports.formatNames = exports.fastFormats = exports.fullFormats = void 0; |
| 9 | +function fmtDef(validate, compare) { |
| 10 | + return { validate, compare }; |
| 11 | +} |
| 12 | +exports.fullFormats = { |
| 13 | + // date: http://tools.ietf.org/html/rfc3339#section-5.6 |
| 14 | + date: fmtDef(date, compareDate), |
| 15 | + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 |
| 16 | + time: fmtDef(time, compareTime), |
| 17 | + \\"date-time\\": fmtDef(date_time, compareDateTime), |
| 18 | + // duration: https://tools.ietf.org/html/rfc3339#appendix-A |
| 19 | + duration: /^P(?!$)((\\\\d+Y)?(\\\\d+M)?(\\\\d+D)?(T(?=\\\\d)(\\\\d+H)?(\\\\d+M)?(\\\\d+S)?)?|(\\\\d+W)?)$/, |
| 20 | + uri, |
| 21 | + \\"uri-reference\\": /^(?:[a-z][a-z0-9+\\\\-.]*:)?(?:\\\\/?\\\\/(?:(?:[a-z0-9\\\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?: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| 24 | + // For the source: https://gist.github.com/dperini/729294 |
| 25 | + // For test cases: https://mathiasbynens.be/demo/url-regex |
| 26 | + url: /^(?:https?|ftp):\\\\/\\\\/(?:\\\\S+(?::\\\\S*)?@)?(?:(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))|(?:(?:[a-z0-9\\\\u{00a1}-\\\\u{ffff}]+-)*[a-z0-9\\\\u{00a1}-\\\\u{ffff}]+)(?:\\\\.(?:[a-z0-9\\\\u{00a1}-\\\\u{ffff}]+-)*[a-z0-9\\\\u{00a1}-\\\\u{ffff}]+)*(?:\\\\.(?:[a-z\\\\u{00a1}-\\\\u{ffff}]{2,})))(?::\\\\d{2,5})?(?:\\\\/[^\\\\s]*)?$/iu, |
| 27 | + email: /^[a-z0-9!#$%&'*+/=?^_\`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, |
| 28 | + hostname: /^(?=.{1,253}\\\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\\\.?$/i, |
| 29 | + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html |
| 30 | + ipv4: /^(?:(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)\\\\.){3}(?:25[0-5]|2[0-4]\\\\d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9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))$/i, |
| 32 | + regex, |
| 33 | + // uuid: http://tools.ietf.org/html/rfc4122 |
| 34 | + uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, |
| 35 | + // JSON-pointer: https://tools.ietf.org/html/rfc6901 |
| 36 | + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A |
| 37 | + \\"json-pointer\\": /^(?:\\\\/(?:[^~/]|~0|~1)*)*$/, |
| 38 | + \\"json-pointer-uri-fragment\\": /^#(?:\\\\/(?:[a-z0-9_\\\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, |
| 39 | + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 |
| 40 | + \\"relative-json-pointer\\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\\\/(?:[^~/]|~0|~1)*)*)$/, |
| 41 | +}; |
| 42 | +exports.fastFormats = { |
| 43 | + ...exports.fullFormats, |
| 44 | + date: fmtDef(/^\\\\d\\\\d\\\\d\\\\d-[0-1]\\\\d-[0-3]\\\\d$/, compareDate), |
| 45 | + time: fmtDef(/^(?:[0-2]\\\\d:[0-5]\\\\d:[0-5]\\\\d|23:59:60)(?:\\\\.\\\\d+)?(?:z|[+-]\\\\d\\\\d(?::?\\\\d\\\\d)?)?$/i, compareTime), |
| 46 | + \\"date-time\\": fmtDef(/^\\\\d\\\\d\\\\d\\\\d-[0-1]\\\\d-[0-3]\\\\d[t\\\\s](?:[0-2]\\\\d:[0-5]\\\\d:[0-5]\\\\d|23:59:60)(?:\\\\.\\\\d+)?(?:z|[+-]\\\\d\\\\d(?::?\\\\d\\\\d)?)$/i, compareDateTime), |
| 47 | + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js |
| 48 | + uri: /^(?:[a-z][a-z0-9+\\\\-.]*:)(?:\\\\/?\\\\/)?[^\\\\s]*$/i, |
| 49 | + \\"uri-reference\\": /^(?:(?:[a-z][a-z0-9+\\\\-.]*:)?\\\\/?\\\\/)?(?:[^\\\\\\\\\\\\s#][^\\\\s#]*)?(?:#[^\\\\\\\\\\\\s]*)?$/i, |
| 50 | + // email (sources from jsen validator): |
| 51 | + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 |
| 52 | + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation') |
| 53 | + email: /^[a-z0-9.!#$%&'*+/=?^_\`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, |
| 54 | +}; |
| 55 | +exports.formatNames = Object.keys(exports.fullFormats); |
| 56 | +function isLeapYear(year) { |
| 57 | + // https://tools.ietf.org/html/rfc3339#appendix-C |
| 58 | + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); |
| 59 | +} |
| 60 | +const DATE = /^(\\\\d\\\\d\\\\d\\\\d)-(\\\\d\\\\d)-(\\\\d\\\\d)$/; |
| 61 | +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
| 62 | +function date(str) { |
| 63 | + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 |
| 64 | + const matches = DATE.exec(str); |
| 65 | + if (!matches) |
| 66 | + return false; |
| 67 | + const year = +matches[1]; |
| 68 | + const month = +matches[2]; |
| 69 | + const day = +matches[3]; |
| 70 | + return (month >= 1 && |
| 71 | + month <= 12 && |
| 72 | + day >= 1 && |
| 73 | + day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month])); |
| 74 | +} |
| 75 | +function compareDate(d1, d2) { |
| 76 | + if (!(d1 && d2)) |
| 77 | + return undefined; |
| 78 | + if (d1 > d2) |
| 79 | + return 1; |
| 80 | + if (d1 < d2) |
| 81 | + return -1; |
| 82 | + return 0; |
| 83 | +} |
| 84 | +const TIME = /^(\\\\d\\\\d):(\\\\d\\\\d):(\\\\d\\\\d)(\\\\.\\\\d+)?(z|[+-]\\\\d\\\\d(?::?\\\\d\\\\d)?)?$/i; |
| 85 | +function time(str, withTimeZone) { |
| 86 | + const matches = TIME.exec(str); |
| 87 | + if (!matches) |
| 88 | + return false; |
| 89 | + const hour = +matches[1]; |
| 90 | + const minute = +matches[2]; |
| 91 | + const second = +matches[3]; |
| 92 | + const timeZone = matches[5]; |
| 93 | + return (((hour <= 23 && minute <= 59 && second <= 59) || |
| 94 | + (hour === 23 && minute === 59 && second === 60)) && |
| 95 | + (!withTimeZone || timeZone !== \\"\\")); |
| 96 | +} |
| 97 | +function compareTime(t1, t2) { |
| 98 | + if (!(t1 && t2)) |
| 99 | + return undefined; |
| 100 | + const a1 = TIME.exec(t1); |
| 101 | + const a2 = TIME.exec(t2); |
| 102 | + if (!(a1 && a2)) |
| 103 | + return undefined; |
| 104 | + t1 = a1[1] + a1[2] + a1[3] + (a1[4] || \\"\\"); |
| 105 | + t2 = a2[1] + a2[2] + a2[3] + (a2[4] || \\"\\"); |
| 106 | + if (t1 > t2) |
| 107 | + return 1; |
| 108 | + if (t1 < t2) |
| 109 | + return -1; |
| 110 | + return 0; |
| 111 | +} |
| 112 | +const DATE_TIME_SEPARATOR = /t|\\\\s/i; |
| 113 | +function date_time(str) { |
| 114 | + // http://tools.ietf.org/html/rfc3339#section-5.6 |
| 115 | + const dateTime = str.split(DATE_TIME_SEPARATOR); |
| 116 | + return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true); |
| 117 | +} |
| 118 | +function compareDateTime(dt1, dt2) { |
| 119 | + if (!(dt1 && dt2)) |
| 120 | + return undefined; |
| 121 | + const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); |
| 122 | + const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR); |
| 123 | + const res = compareDate(d1, d2); |
| 124 | + if (res === undefined) |
| 125 | + return undefined; |
| 126 | + return res || compareTime(t1, t2); |
| 127 | +} |
| 128 | +const NOT_URI_FRAGMENT = /\\\\/|:/; |
| 129 | +const URI = /^(?:[a-z][a-z0-9+\\\\-.]*:)(?:\\\\/?\\\\/(?:(?:[a-z0-9\\\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)\\\\.){3}(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\\\.[a-z0-9\\\\-._~!$&'()*+,;=:]+)\\\\]|(?:(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)\\\\.){3}(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)|(?:[a-z0-9\\\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\\\d*)?(?:\\\\/(?:[a-z0-9\\\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\\\/(?:(?:[a-z0-9\\\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\\\/(?:[a-z0-9\\\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\\\/(?:[a-z0-9\\\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\\\?(?:[a-z0-9\\\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; |
| 130 | +function uri(str) { |
| 131 | + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \\".\\" |
| 132 | + return NOT_URI_FRAGMENT.test(str) && URI.test(str); |
| 133 | +} |
| 134 | +const Z_ANCHOR = /[^\\\\\\\\]\\\\\\\\Z/; |
| 135 | +function regex(str) { |
| 136 | + if (Z_ANCHOR.test(str)) |
| 137 | + return false; |
| 138 | + try { |
| 139 | + new RegExp(str); |
| 140 | + return true; |
| 141 | + } |
| 142 | + catch (e) { |
| 143 | + return false; |
| 144 | + } |
| 145 | +} |
| 146 | +
|
| 147 | +}(formats)); |
| 148 | +
|
| 149 | +const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {}; |
| 150 | +
|
| 151 | + const configValue = {\\"foo\\":\\"https://example.com\\",\\"bar\\":\\"baz\\"}; |
| 152 | +
|
| 153 | + // if the global was already defined, use it |
| 154 | + const config = (globalNamespace._appConfig || configValue); |
| 155 | +
|
| 156 | + // if the global is frozen then it was set by electron and we can't change it, but we'll set it if we can |
| 157 | + if ( |
| 158 | + typeof globalNamespace._appConfig === 'undefined' || |
| 159 | + !Object.isFrozen(globalNamespace._appConfig) |
| 160 | + ) { |
| 161 | + globalNamespace._appConfig = config; |
| 162 | + } |
| 163 | + var config$1 = config; |
| 164 | + const { uri: formats0 } = formats.fullFormats; |
| 165 | + |
| 166 | + function genValidateConfig(){ |
| 167 | + const validateConfigModule = {}; |
| 168 | + (function(module){module.exports = validate10; |
| 169 | +module.exports.default = validate10; |
| 170 | +
|
| 171 | +
|
| 172 | +function validate10(data, valCxt){ |
| 173 | +if(valCxt){ |
| 174 | +var dataPath = valCxt.dataPath; |
| 175 | +valCxt.parentData; |
| 176 | +valCxt.parentDataProperty; |
| 177 | +valCxt.rootData; |
| 178 | +} |
| 179 | +else { |
| 180 | +var dataPath = \\"\\"; |
| 181 | +} |
| 182 | +var vErrors = null; |
| 183 | +var errors = 0; |
| 184 | +if(data && typeof data == \\"object\\" && !Array.isArray(data)){ |
| 185 | +if(data.foo !== undefined){ |
| 186 | +var data0 = data.foo; |
| 187 | +if(typeof data0 === \\"string\\"){ |
| 188 | +if(!(formats0(data0))){ |
| 189 | +var err0 = {keyword:\\"format\\",dataPath:dataPath+\\"/foo\\",schemaPath:\\"#/properties/foo/format\\",params:{format: \\"uri\\"},message:\\"should match format \\\\\\"\\"+\\"uri\\"+\\"\\\\\\"\\"}; |
| 190 | +if(vErrors === null){ |
| 191 | +vErrors = [err0]; |
| 192 | +} |
| 193 | +else { |
| 194 | +vErrors.push(err0); |
| 195 | +} |
| 196 | +errors++; |
| 197 | +} |
| 198 | +} |
| 199 | +else { |
| 200 | +var err1 = {keyword:\\"type\\",dataPath:dataPath+\\"/foo\\",schemaPath:\\"#/properties/foo/type\\",params:{type: \\"string\\"},message:\\"should be string\\"}; |
| 201 | +if(vErrors === null){ |
| 202 | +vErrors = [err1]; |
| 203 | +} |
| 204 | +else { |
| 205 | +vErrors.push(err1); |
| 206 | +} |
| 207 | +errors++; |
| 208 | +} |
| 209 | +} |
| 210 | +} |
| 211 | +else { |
| 212 | +var err2 = {keyword:\\"type\\",dataPath:dataPath,schemaPath:\\"#/type\\",params:{type: \\"object\\"},message:\\"should be object\\"}; |
| 213 | +if(vErrors === null){ |
| 214 | +vErrors = [err2]; |
| 215 | +} |
| 216 | +else { |
| 217 | +vErrors.push(err2); |
| 218 | +} |
| 219 | +errors++; |
| 220 | +} |
| 221 | +validate10.errors = vErrors; |
| 222 | +return errors === 0; |
| 223 | +} |
| 224 | +})(validateConfigModule); |
| 225 | + return validateConfigModule.exports; |
| 226 | + } |
| 227 | +
|
| 228 | + |
| 229 | + const validateConfig = /*#__PURE__*/ genValidateConfig(); |
| 230 | +
|
| 231 | +validateConfig(config$1); |
| 232 | + console.log(config$1); |
| 233 | +" |
| 234 | +`; |
| 235 | + |
| 236 | +exports[`Rollup Plugin processes empty app-config 1`] = ` |
| 237 | +"const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {}; |
| 238 | +
|
| 239 | + const configValue = {}; |
| 240 | +
|
| 241 | + // if the global was already defined, use it |
| 242 | + const config = (globalNamespace._appConfig || configValue); |
| 243 | +
|
| 244 | + // if the global is frozen then it was set by electron and we can't change it, but we'll set it if we can |
| 245 | + if ( |
| 246 | + typeof globalNamespace._appConfig === 'undefined' || |
| 247 | + !Object.isFrozen(globalNamespace._appConfig) |
| 248 | + ) { |
| 249 | + globalNamespace._appConfig = config; |
| 250 | + } |
| 251 | + var config$1 = config; |
| 252 | +
|
| 253 | +console.log(config$1); |
| 254 | +" |
| 255 | +`; |
0 commit comments