@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 +1 -0
- package/README.md +1 -7
- package/base/mf_trimstr.sas +21 -13
- package/metax/mmx_createmetafolder.sas +1 -0
- package/metax/mmx_deletemetafolder.sas +1 -1
- package/package.json +1 -1
package/.sasjslint
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
# Macro Core
|
|
2
2
|
|
|
3
|
-
[](http://npmjs.org/package/@sasjs/core)
|
|
4
|
-
[](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml)
|
|
5
|
-
[](https://scorecard.dev/viewer/?uri=github.com/sasjs/core)
|
|
6
|
-
[](https://github.com/sasjs/core/blob/main/LICENSE)
|
|
7
|
-
[](https://npms.io/search?q=%40sasjs%2Fcore)
|
|
8
|
-

|
|
9
|
-

|
|
3
|
+
[](http://npmjs.org/package/@sasjs/core) [](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml) [](https://scorecard.dev/viewer/?uri=github.com/sasjs/core) [](https://github.com/sasjs/core/blob/main/LICENSE) [](https://socket.dev/npm/package/@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.
|
package/base/mf_trimstr.sas
CHANGED
|
@@ -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
|
-
/*
|
|
35
|
-
%
|
|
36
|
-
,%length(%superq(basestr))-&trimlen+1
|
|
37
|
-
,&trimlen);
|
|
32
|
+
/* nothing to remove from nothing */
|
|
33
|
+
%if &baselen=0 %then %return;
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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;
|
package/package.json
CHANGED