@procore/hammer-test-jest 0.5.0 → 0.7.0

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.
@@ -5,12 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
8
  var __copyProps = (to, from, except, desc) => {
15
9
  if (from && typeof from === "object" || typeof from === "function") {
16
10
  for (let key of __getOwnPropNames(from))
@@ -28,102 +22,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
22
  mod
29
23
  ));
30
24
 
31
- // ../../node_modules/tsup/assets/cjs_shims.js
32
- var init_cjs_shims = __esm({
33
- "../../node_modules/tsup/assets/cjs_shims.js"() {
34
- "use strict";
35
- }
36
- });
37
-
38
- // ../../node_modules/camelcase/index.js
39
- var require_camelcase = __commonJS({
40
- "../../node_modules/camelcase/index.js"(exports2, module2) {
41
- "use strict";
42
- init_cjs_shims();
43
- var preserveCamelCase = (string) => {
44
- let isLastCharLower = false;
45
- let isLastCharUpper = false;
46
- let isLastLastCharUpper = false;
47
- for (let i = 0; i < string.length; i++) {
48
- const character = string[i];
49
- if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
50
- string = string.slice(0, i) + "-" + string.slice(i);
51
- isLastCharLower = false;
52
- isLastLastCharUpper = isLastCharUpper;
53
- isLastCharUpper = true;
54
- i++;
55
- } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
56
- string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
57
- isLastLastCharUpper = isLastCharUpper;
58
- isLastCharUpper = false;
59
- isLastCharLower = true;
60
- } else {
61
- isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
62
- isLastLastCharUpper = isLastCharUpper;
63
- isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
64
- }
65
- }
66
- return string;
67
- };
68
- var camelCase = (input, options) => {
69
- if (!(typeof input === "string" || Array.isArray(input))) {
70
- throw new TypeError("Expected the input to be `string | string[]`");
71
- }
72
- options = Object.assign({
73
- pascalCase: false
74
- }, options);
75
- const postProcess = (x) => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
76
- if (Array.isArray(input)) {
77
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
78
- } else {
79
- input = input.trim();
80
- }
81
- if (input.length === 0) {
82
- return "";
83
- }
84
- if (input.length === 1) {
85
- return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
86
- }
87
- const hasUpperCase = input !== input.toLowerCase();
88
- if (hasUpperCase) {
89
- input = preserveCamelCase(input);
90
- }
91
- input = input.replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()).replace(/\d+(\w|$)/g, (m) => m.toUpperCase());
92
- return postProcess(input);
93
- };
94
- module2.exports = camelCase;
95
- module2.exports.default = camelCase;
96
- }
97
- });
98
-
99
25
  // src/transforms/reactSvg.ts
100
- init_cjs_shims();
101
26
  var import_path = __toESM(require("path"));
102
- var import_camelcase = __toESM(require_camelcase());
27
+ var import_change_case = require("change-case");
103
28
  module.exports = {
104
29
  process(_src, filename) {
105
30
  const assetFilename = JSON.stringify(import_path.default.basename(filename));
106
- const pascalCaseFileName = (0, import_camelcase.default)(import_path.default.parse(filename).name, {
107
- pascalCase: true
108
- });
31
+ const pascalCaseFileName = (0, import_change_case.pascalCase)(import_path.default.parse(filename).name);
109
32
  const componentName = `Svg${pascalCaseFileName}`;
110
- return `
111
- const React = require('react');
112
- module.exports = {
113
- __esModule: true,
114
- default: ${assetFilename},
115
- ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
116
- return {
117
- $$typeof: Symbol.for('react.element'),
118
- type: 'svg',
119
- ref: ref,
120
- key: null,
121
- props: Object.assign({}, props, {
122
- children: ${assetFilename}
123
- })
33
+ return {
34
+ code: `
35
+ const React = require('react');
36
+ module.exports = {
37
+ __esModule: true,
38
+ default: ${assetFilename},
39
+ ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
40
+ return {
41
+ $$typeof: Symbol.for('react.element'),
42
+ type: 'svg',
43
+ ref: ref,
44
+ key: null,
45
+ props: Object.assign({}, props, {
46
+ children: ${assetFilename}
47
+ })
48
+ };
49
+ }),
124
50
  };
125
- }),
126
- };
127
- `;
51
+ `
52
+ };
128
53
  }
129
54
  };
@@ -1,131 +1,49 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
2
  var __esm = (fn, res) => function __init() {
8
3
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
4
  };
10
5
  var __commonJS = (cb, mod) => function __require() {
11
6
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
7
  };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
8
 
30
- // ../../node_modules/tsup/assets/esm_shims.js
9
+ // ../../node_modules/.store/tsup-virtual-c87351f6b5/package/assets/esm_shims.js
31
10
  var init_esm_shims = __esm({
32
- "../../node_modules/tsup/assets/esm_shims.js"() {
33
- "use strict";
34
- }
35
- });
36
-
37
- // ../../node_modules/camelcase/index.js
38
- var require_camelcase = __commonJS({
39
- "../../node_modules/camelcase/index.js"(exports, module) {
11
+ "../../node_modules/.store/tsup-virtual-c87351f6b5/package/assets/esm_shims.js"() {
40
12
  "use strict";
41
- init_esm_shims();
42
- var preserveCamelCase = (string) => {
43
- let isLastCharLower = false;
44
- let isLastCharUpper = false;
45
- let isLastLastCharUpper = false;
46
- for (let i = 0; i < string.length; i++) {
47
- const character = string[i];
48
- if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
49
- string = string.slice(0, i) + "-" + string.slice(i);
50
- isLastCharLower = false;
51
- isLastLastCharUpper = isLastCharUpper;
52
- isLastCharUpper = true;
53
- i++;
54
- } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
55
- string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
56
- isLastLastCharUpper = isLastCharUpper;
57
- isLastCharUpper = false;
58
- isLastCharLower = true;
59
- } else {
60
- isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
61
- isLastLastCharUpper = isLastCharUpper;
62
- isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
63
- }
64
- }
65
- return string;
66
- };
67
- var camelCase = (input, options) => {
68
- if (!(typeof input === "string" || Array.isArray(input))) {
69
- throw new TypeError("Expected the input to be `string | string[]`");
70
- }
71
- options = Object.assign({
72
- pascalCase: false
73
- }, options);
74
- const postProcess = (x) => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
75
- if (Array.isArray(input)) {
76
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
77
- } else {
78
- input = input.trim();
79
- }
80
- if (input.length === 0) {
81
- return "";
82
- }
83
- if (input.length === 1) {
84
- return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
85
- }
86
- const hasUpperCase = input !== input.toLowerCase();
87
- if (hasUpperCase) {
88
- input = preserveCamelCase(input);
89
- }
90
- input = input.replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()).replace(/\d+(\w|$)/g, (m) => m.toUpperCase());
91
- return postProcess(input);
92
- };
93
- module.exports = camelCase;
94
- module.exports.default = camelCase;
95
13
  }
96
14
  });
97
15
 
98
16
  // src/transforms/reactSvg.ts
99
17
  import path from "path";
18
+ import { pascalCase } from "change-case";
100
19
  var require_reactSvg = __commonJS({
101
20
  "src/transforms/reactSvg.ts"(exports, module) {
102
21
  init_esm_shims();
103
- var import_camelcase = __toESM(require_camelcase());
104
22
  module.exports = {
105
23
  process(_src, filename) {
106
24
  const assetFilename = JSON.stringify(path.basename(filename));
107
- const pascalCaseFileName = (0, import_camelcase.default)(path.parse(filename).name, {
108
- pascalCase: true
109
- });
25
+ const pascalCaseFileName = pascalCase(path.parse(filename).name);
110
26
  const componentName = `Svg${pascalCaseFileName}`;
111
- return `
112
- const React = require('react');
113
- module.exports = {
114
- __esModule: true,
115
- default: ${assetFilename},
116
- ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
117
- return {
118
- $$typeof: Symbol.for('react.element'),
119
- type: 'svg',
120
- ref: ref,
121
- key: null,
122
- props: Object.assign({}, props, {
123
- children: ${assetFilename}
124
- })
27
+ return {
28
+ code: `
29
+ const React = require('react');
30
+ module.exports = {
31
+ __esModule: true,
32
+ default: ${assetFilename},
33
+ ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
34
+ return {
35
+ $$typeof: Symbol.for('react.element'),
36
+ type: 'svg',
37
+ ref: ref,
38
+ key: null,
39
+ props: Object.assign({}, props, {
40
+ children: ${assetFilename}
41
+ })
42
+ };
43
+ }),
125
44
  };
126
- }),
127
- };
128
- `;
45
+ `
46
+ };
129
47
  }
130
48
  };
131
49
  }