@sasjs/utils 3.7.1 → 3.7.3

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.
@@ -1 +1,8 @@
1
+ /**
2
+ * The line ending to join formatted rows with.
3
+ *
4
+ * process may not exist - the formatter runs in browsers, to build request
5
+ * bodies - so the platform is read defensively and a browser gets the unix
6
+ * ending.
7
+ */
1
8
  export declare const newLine: () => "\\r\\n" | "\\n";
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
- // FIXME: if isWindows is used, it breaks cli.spec.ts because Logger is undefined
3
- // import { isWindows } from '../'
4
- // export const newLine = () => (isWindows() ? '\\r\\n' : '\\n')
2
+ // Kept self-contained rather than importing isWindows from '../': that module
3
+ // imports path and is loaded from the package root, which pulls Logger into
4
+ // this module and breaks cli.spec.ts with an undefined Logger.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.newLine = void 0;
7
- const newLine = () => (process.platform === 'win32' ? '\\r\\n' : '\\n');
7
+ /**
8
+ * The line ending to join formatted rows with.
9
+ *
10
+ * process may not exist - the formatter runs in browsers, to build request
11
+ * bodies - so the platform is read defensively and a browser gets the unix
12
+ * ending.
13
+ */
14
+ const newLine = () => typeof process !== 'undefined' && process.platform === 'win32'
15
+ ? '\\r\\n'
16
+ : '\\n';
8
17
  exports.newLine = newLine;
9
18
  //# sourceMappingURL=regexp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../src/formatter/regexp.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,kCAAkC;AAClC,gEAAgE;;;AAEzD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAAjE,QAAA,OAAO,WAA0D"}
1
+ {"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../src/formatter/regexp.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,+DAA+D;;;AAE/D;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,GAAG,EAAE,CAC1B,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC5D,CAAC,CAAC,QAAQ;IACV,CAAC,CAAC,KAAK,CAAA;AAHE,QAAA,OAAO,WAGT"}
package/package.json CHANGED
@@ -95,5 +95,5 @@
95
95
  "jwt-decode": "4.0.0",
96
96
  "prompts": "2.4.2"
97
97
  },
98
- "version": "3.7.1"
98
+ "version": "3.7.3"
99
99
  }
package/utils/utils.d.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  export declare function asyncForEach(array: any[], callback: (item: any, index: number, originalArray: any[]) => any): Promise<void>;
2
2
  export declare const uuidv4: () => string;
3
3
  export declare const uniqArray: (data: any[]) => any[];
4
+ /**
5
+ * Whether the host is Windows. process may not exist - these helpers are
6
+ * exported from the package root and called from browser code - so the
7
+ * platform is read defensively and a browser answers false.
8
+ */
4
9
  export declare const isWindows: () => boolean;
5
10
  export declare const isLinux: () => boolean;
6
11
  /**
package/utils/utils.js CHANGED
@@ -29,9 +29,14 @@ const uuidv4 = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c)
29
29
  exports.uuidv4 = uuidv4;
30
30
  const uniqArray = (data) => Array.from(new Set(data));
31
31
  exports.uniqArray = uniqArray;
32
- const isWindows = () => process.platform === 'win32';
32
+ /**
33
+ * Whether the host is Windows. process may not exist - these helpers are
34
+ * exported from the package root and called from browser code - so the
35
+ * platform is read defensively and a browser answers false.
36
+ */
37
+ const isWindows = () => typeof process !== 'undefined' && process.platform === 'win32';
33
38
  exports.isWindows = isWindows;
34
- const isLinux = () => process.platform === 'linux';
39
+ const isLinux = () => typeof process !== 'undefined' && process.platform === 'linux';
35
40
  exports.isLinux = isLinux;
36
41
  /**
37
42
  * replace single backslash with double backslash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