@sasjs/core 7.1.5 → 7.1.6

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/.sasjslint CHANGED
@@ -30,6 +30,7 @@
30
30
  "noNestedMacros": "error",
31
31
  "noSingleAsteriskComments": "error",
32
32
  "noSpacesInFileNames": "error",
33
+ "noXcmd": "error",
33
34
  "noTabs": "error",
34
35
  "noTrailingSpaces": "error",
35
36
  "noUndeclaredMacros": "error",
package/README.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # Macro Core
2
2
 
3
- [![npm package](https://img.shields.io/npm/v/@sasjs/core.svg)](http://npmjs.org/package/@sasjs/core)
4
- [![Github Workflow](https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg)](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml)
5
- [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sasjs/core/badge)](https://scorecard.dev/viewer/?uri=github.com/sasjs/core)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sasjs/core/blob/main/LICENSE)
7
- [![npms.io](https://img.shields.io/npms-io/final-score/@sasjs/core)](https://npms.io/search?q=%40sasjs%2Fcore)
8
- ![npm](https://img.shields.io/npm/dt/@sasjs/core)
9
- ![GitHub last commit](https://img.shields.io/github/last-commit/sasjs/core)
3
+ [![npm package](https://img.shields.io/npm/v/@sasjs/core.svg)](http://npmjs.org/package/@sasjs/core) [![Github Workflow](https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg)](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sasjs/core/badge)](https://scorecard.dev/viewer/?uri=github.com/sasjs/core) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sasjs/core/blob/main/LICENSE) [![Socket Badge](https://socket.dev/api/badge/npm/package/@sasjs/core)](https://socket.dev/npm/package/@sasjs/core) ![npm](https://img.shields.io/npm/dt/@sasjs/core) ![GitHub last commit](https://img.shields.io/github/last-commit/sasjs/core)
10
4
 
11
5
 
12
6
  Much quality. Many standards. The **Macro Core** library exists to save time and development effort! Herein ye shall find a veritable host of MIT-licenced, production quality SAS macros. These are a mix of tools, utilities, functions and code generators that are useful in the context of [Application Development](https://sasapps.io) on the SAS platform (eg https://datacontroller.io). [Contributions](https://github.com/sasjs/core/blob/main/.github/CONTRIBUTING.md) are welcome.
@@ -26,25 +26,33 @@
26
26
  %macro mf_trimstr(basestr,trimstr);
27
27
  %local baselen trimlen trimval;
28
28
 
29
- /* return if basestr is shorter than trimstr (or 0) */
30
29
  %let baselen=%length(%superq(basestr));
31
30
  %let trimlen=%length(%superq(trimstr));
32
- %if &baselen < &trimlen or &baselen=0 %then %return;
33
31
 
34
- /* obtain the characters from the end of basestr */
35
- %let trimval=%qsubstr(%superq(basestr)
36
- ,%length(%superq(basestr))-&trimlen+1
37
- ,&trimlen);
32
+ /* nothing to remove from nothing */
33
+ %if &baselen=0 %then %return;
38
34
 
39
- /* compare and if matching, chop it off! */
40
- %if %superq(basestr)=%superq(trimstr) %then %do;
41
- %return;
42
- %end;
43
- %else %if %superq(trimval)=%superq(trimstr) %then %do;
44
- %qsubstr(%superq(basestr),1,%length(%superq(basestr))-&trimlen)
35
+ %if &baselen < &trimlen %then %do;
36
+ /* a value shorter than the trim string cannot end with it, so it is
37
+ returned unchanged - returning nothing here lost the value */
38
+ &basestr
45
39
  %end;
46
40
  %else %do;
47
- &basestr
41
+ /* obtain the characters from the end of basestr */
42
+ %let trimval=%qsubstr(%superq(basestr)
43
+ ,&baselen-&trimlen+1
44
+ ,&trimlen);
45
+
46
+ /* compare and if matching, chop it off! */
47
+ %if %superq(basestr)=%superq(trimstr) %then %do;
48
+ %return;
49
+ %end;
50
+ %else %if %superq(trimval)=%superq(trimstr) %then %do;
51
+ %qsubstr(%superq(basestr),1,&baselen-&trimlen)
52
+ %end;
53
+ %else %do;
54
+ &basestr
55
+ %end;
48
56
  %end;
49
57
 
50
58
  %mend mf_trimstr;
@@ -18,6 +18,7 @@
18
18
  @version 9.4
19
19
  @author Allan Bowe
20
20
 
21
+ @sasjslint {"noXcmd": false}
21
22
  **/
22
23
 
23
24
  %macro mmx_createmetafolder(loc=,user=,pass=);
@@ -19,7 +19,7 @@
19
19
  @version 9.4
20
20
  @author Allan Bowe
21
21
 
22
- @sasjslint {"maxLineLength": 123}
22
+ @sasjslint {"maxLineLength": 123, "noXcmd": false}
23
23
  **/
24
24
 
25
25
  %macro mmx_deletemetafolder(loc=,user=,pass=);
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
45
  },
46
- "version": "7.1.5"
46
+ "version": "7.1.6"
47
47
  }