@lowdefy/operators-js 4.0.0-alpha.26 → 4.0.0-alpha.29

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.
Files changed (59) hide show
  1. package/package.json +6 -7
  2. package/dist/index.js +0 -17
  3. package/dist/operators/build/env.js +0 -25
  4. package/dist/operators/client/_index.js +0 -25
  5. package/dist/operators/client/actions.js +0 -25
  6. package/dist/operators/client/base64.js +0 -50
  7. package/dist/operators/client/event.js +0 -25
  8. package/dist/operators/client/event_log.js +0 -25
  9. package/dist/operators/client/global.js +0 -25
  10. package/dist/operators/client/input.js +0 -25
  11. package/dist/operators/client/location.js +0 -60
  12. package/dist/operators/client/media.js +0 -62
  13. package/dist/operators/client/menu.js +0 -25
  14. package/dist/operators/client/request.js +0 -34
  15. package/dist/operators/client/request_details.js +0 -25
  16. package/dist/operators/client/state.js +0 -25
  17. package/dist/operators/client/url_query.js +0 -30
  18. package/dist/operators/server/base64.js +0 -52
  19. package/dist/operators/server/hash.js +0 -84
  20. package/dist/operators/server/payload.js +0 -24
  21. package/dist/operators/server/secret.js +0 -32
  22. package/dist/operators/shared/and.js +0 -22
  23. package/dist/operators/shared/args.js +0 -25
  24. package/dist/operators/shared/array.js +0 -263
  25. package/dist/operators/shared/date.js +0 -54
  26. package/dist/operators/shared/divide.js +0 -31
  27. package/dist/operators/shared/eq.js +0 -25
  28. package/dist/operators/shared/function.js +0 -32
  29. package/dist/operators/shared/get.js +0 -36
  30. package/dist/operators/shared/gt.js +0 -25
  31. package/dist/operators/shared/gte.js +0 -25
  32. package/dist/operators/shared/if.js +0 -24
  33. package/dist/operators/shared/if_none.js +0 -28
  34. package/dist/operators/shared/intl.js +0 -107
  35. package/dist/operators/shared/json.js +0 -60
  36. package/dist/operators/shared/log.js +0 -20
  37. package/dist/operators/shared/lt.js +0 -25
  38. package/dist/operators/shared/lte.js +0 -25
  39. package/dist/operators/shared/math.js +0 -271
  40. package/dist/operators/shared/ne.js +0 -25
  41. package/dist/operators/shared/not.js +0 -18
  42. package/dist/operators/shared/number.js +0 -146
  43. package/dist/operators/shared/object.js +0 -129
  44. package/dist/operators/shared/operator.js +0 -38
  45. package/dist/operators/shared/or.js +0 -22
  46. package/dist/operators/shared/product.js +0 -27
  47. package/dist/operators/shared/random.js +0 -97
  48. package/dist/operators/shared/regex.js +0 -42
  49. package/dist/operators/shared/string.js +0 -286
  50. package/dist/operators/shared/subtract.js +0 -28
  51. package/dist/operators/shared/sum.js +0 -27
  52. package/dist/operators/shared/switch.js +0 -30
  53. package/dist/operators/shared/type.js +0 -51
  54. package/dist/operators/shared/uri.js +0 -50
  55. package/dist/operators/shared/user.js +0 -25
  56. package/dist/operatorsBuild.js +0 -88
  57. package/dist/operatorsClient.js +0 -62
  58. package/dist/operatorsServer.js +0 -52
  59. package/dist/types.js +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators-js",
3
- "version": "4.0.0-alpha.26",
3
+ "version": "4.0.0-alpha.29",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -42,15 +42,14 @@
42
42
  "dist/*"
43
43
  ],
44
44
  "scripts": {
45
- "build": "yarn swc",
45
+ "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
46
46
  "clean": "rm -rf dist",
47
- "prepare": "yarn build",
48
- "swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
47
+ "prepublishOnly": "pnpm build",
49
48
  "test": "jest --coverage"
50
49
  },
51
50
  "dependencies": {
52
- "@lowdefy/helpers": "4.0.0-alpha.26",
53
- "@lowdefy/operators": "4.0.0-alpha.26"
51
+ "@lowdefy/helpers": "4.0.0-alpha.29",
52
+ "@lowdefy/operators": "4.0.0-alpha.29"
54
53
  },
55
54
  "devDependencies": {
56
55
  "@swc/cli": "0.1.57",
@@ -62,5 +61,5 @@
62
61
  "publishConfig": {
63
62
  "access": "public"
64
63
  },
65
- "gitHead": "ef60e34f87b95204d103db4a65e4ba3c54a5a1b5"
64
+ "gitHead": "621a191ebc0a1569ee6669dc74c12f8be5a8c7f3"
66
65
  }
package/dist/index.js DELETED
@@ -1,17 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import * as operatorsClient from './operatorsClient.js';
16
- import * as operatorsServer from './operatorsServer.js';
17
- export { operatorsClient, operatorsServer };
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _env({ arrayIndices , env , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: env,
21
- operator: '_env',
22
- params
23
- });
24
- }
25
- export default _env;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _index({ arrayIndices , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: arrayIndices,
21
- operator: '_index',
22
- params
23
- });
24
- }
25
- export default _index;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _actions({ actions , arrayIndices , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: actions,
21
- operator: '_actions',
22
- params
23
- });
24
- }
25
- export default _actions;
@@ -1,50 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { runClass } from '@lowdefy/operators';
16
- function decode(input) {
17
- return atob(input);
18
- }
19
- function encode(input) {
20
- return btoa(input);
21
- }
22
- const functions = {
23
- encode,
24
- decode
25
- };
26
- const meta = {
27
- encode: {
28
- singleArg: true,
29
- validTypes: [
30
- 'string'
31
- ]
32
- },
33
- decode: {
34
- singleArg: true,
35
- validTypes: [
36
- 'string'
37
- ]
38
- }
39
- };
40
- function _base64({ params , location , methodName }) {
41
- return runClass({
42
- functions,
43
- location,
44
- meta,
45
- methodName,
46
- operator: '_base64',
47
- params
48
- });
49
- }
50
- export default _base64;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _event({ arrayIndices , event , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: event,
21
- operator: '_event',
22
- params
23
- });
24
- }
25
- export default _event;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _event_log({ arrayIndices , eventLog , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: eventLog,
21
- operator: '_event_log',
22
- params
23
- });
24
- }
25
- export default _event_log;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _global({ arrayIndices , location , lowdefyGlobal , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: lowdefyGlobal,
21
- operator: '_global',
22
- params
23
- });
24
- }
25
- export default _global;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _input({ arrayIndices , input , location , params }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: input,
21
- operator: '_input',
22
- params
23
- });
24
- }
25
- export default _input;
@@ -1,60 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- const validProperties = [
17
- 'basePath',
18
- 'hash',
19
- 'homePageId',
20
- 'host',
21
- 'hostname',
22
- 'href',
23
- 'origin',
24
- 'pageId',
25
- 'pathname',
26
- 'port',
27
- 'protocol',
28
- 'search',
29
- ];
30
- function _location({ arrayIndices , basePath , home , location , pageId , params , globals }) {
31
- const { window } = globals;
32
- if (!window?.location) {
33
- throw new Error(`Operator Error: Browser window.location not available for _location. Received: ${JSON.stringify(params)} at ${location}.`);
34
- }
35
- if (!validProperties.includes(params)) {
36
- throw new Error(`Operator Error: _location only returns values for ${validProperties.join(', ')}. Received: ${JSON.stringify(params)} at ${location}.`);
37
- }
38
- const windowLocation = {
39
- basePath,
40
- hash: window.location.hash,
41
- homePageId: home.pageId,
42
- host: window.location.host,
43
- hostname: window.location.hostname,
44
- href: window.location.href,
45
- origin: window.location.origin,
46
- pageId,
47
- pathname: window.location.pathname,
48
- port: window.location.port,
49
- protocol: window.location.protocol,
50
- search: window.location.search
51
- };
52
- return getFromObject({
53
- arrayIndices,
54
- location,
55
- object: windowLocation,
56
- operator: '_location',
57
- params
58
- });
59
- }
60
- export default _location;
@@ -1,62 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- const breakpoints = {
17
- xs: 576,
18
- sm: 768,
19
- md: 992,
20
- lg: 1200,
21
- xl: 1600
22
- };
23
- function _media({ arrayIndices , location , params , globals }) {
24
- const { window } = globals;
25
- if (!window?.innerWidth) {
26
- throw new Error(`Operator Error: device window width not available for _media. Received: ${JSON.stringify(params)} at ${location}.`);
27
- }
28
- let size;
29
- switch(true){
30
- case window.innerWidth < breakpoints.xs:
31
- size = 'xs';
32
- break;
33
- case window.innerWidth < breakpoints.sm:
34
- size = 'sm';
35
- break;
36
- case window.innerWidth < breakpoints.md:
37
- size = 'md';
38
- break;
39
- case window.innerWidth < breakpoints.lg:
40
- size = 'lg';
41
- break;
42
- case window.innerWidth < breakpoints.xl:
43
- size = 'xl';
44
- break;
45
- default:
46
- size = 'xxl';
47
- break;
48
- }
49
- const media = {
50
- size,
51
- width: window.innerWidth,
52
- height: window.innerHeight
53
- };
54
- return getFromObject({
55
- arrayIndices,
56
- location,
57
- object: media,
58
- operator: '_media',
59
- params
60
- });
61
- }
62
- export default _media;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromArray } from '@lowdefy/operators';
16
- function _menu({ params , menus , location }) {
17
- return getFromArray({
18
- params,
19
- array: menus,
20
- key: 'menuId',
21
- operator: '_menu',
22
- location
23
- });
24
- }
25
- export default _menu;
@@ -1,34 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { applyArrayIndices, get, serializer, type } from '@lowdefy/helpers';
16
- function _request({ arrayIndices , params , requests , location }) {
17
- if (!type.isString(params)) {
18
- throw new Error(`Operator Error: _request accepts a string value. Received: ${JSON.stringify(params)} at ${location}.`);
19
- }
20
- const splitKey = params.split('.');
21
- const [requestId, ...keyParts] = splitKey;
22
- if (requestId in requests && !requests[requestId][0].loading) {
23
- if (splitKey.length === 1) {
24
- return serializer.copy(requests[requestId][0].response);
25
- }
26
- const key = keyParts.reduce((acc, value)=>acc === '' ? value : acc.concat('.', value), '');
27
- return get(requests[requestId][0].response, applyArrayIndices(arrayIndices, key), {
28
- copy: true,
29
- default: null
30
- });
31
- }
32
- return null;
33
- }
34
- export default _request;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _request_details({ params , requests , arrayIndices , location }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: requests,
21
- operator: '_request_details',
22
- params
23
- });
24
- }
25
- export default _request_details;
@@ -1,25 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- function _state({ arrayIndices , location , params , state }) {
17
- return getFromObject({
18
- arrayIndices,
19
- location,
20
- object: state,
21
- operator: '_state',
22
- params
23
- });
24
- }
25
- export default _state;
@@ -1,30 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { getFromObject } from '@lowdefy/operators';
16
- import { urlQuery } from '@lowdefy/helpers';
17
- function _url_query({ arrayIndices , globals , location , params }) {
18
- const { window } = globals;
19
- if (!window?.location) {
20
- throw new Error(`Operator Error: Browser window.location not available for _url_query. Received: ${JSON.stringify(params)} at ${location}.`);
21
- }
22
- return getFromObject({
23
- arrayIndices,
24
- location,
25
- object: urlQuery.parse(window.location.search.slice(1)),
26
- operator: '_url_query',
27
- params
28
- });
29
- }
30
- export default _url_query;
@@ -1,52 +0,0 @@
1
- /*
2
- Copyright 2020-2022 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import { runClass } from '@lowdefy/operators';
16
- function decode(input) {
17
- const buff = Buffer.from(input, 'base64');
18
- return buff.toString('utf8');
19
- }
20
- function encode(input) {
21
- const buff = Buffer.from(input, 'utf8');
22
- return buff.toString('base64');
23
- }
24
- const functions = {
25
- encode,
26
- decode
27
- };
28
- const meta = {
29
- encode: {
30
- singleArg: true,
31
- validTypes: [
32
- 'string'
33
- ]
34
- },
35
- decode: {
36
- singleArg: true,
37
- validTypes: [
38
- 'string'
39
- ]
40
- }
41
- };
42
- function _base64({ params , location , methodName }) {
43
- return runClass({
44
- functions,
45
- location,
46
- meta,
47
- methodName,
48
- operator: '_base64',
49
- params
50
- });
51
- }
52
- export default _base64;