@lowdefy/operators-moment 4.0.0-alpha.29 → 4.0.0-alpha.31
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/dist/operators/shared/moment.js +62 -0
- package/dist/operatorsClient.js +15 -0
- package/dist/operatorsServer.js +15 -0
- package/dist/types.js +22 -0
- package/package.json +3 -3
|
@@ -0,0 +1,62 @@
|
|
|
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 moment from 'moment';
|
|
16
|
+
import { runClass } from '@lowdefy/operators';
|
|
17
|
+
function format(on, locale = 'en', format1) {
|
|
18
|
+
return moment(on).locale(locale).format(format1);
|
|
19
|
+
}
|
|
20
|
+
function humanizeDuration(on, locale = 'en', withSuffix = false, thresholds) {
|
|
21
|
+
return moment.duration(on).locale(locale).humanize(withSuffix, thresholds);
|
|
22
|
+
}
|
|
23
|
+
const meta = {
|
|
24
|
+
format: {
|
|
25
|
+
namedArgs: [
|
|
26
|
+
'on',
|
|
27
|
+
'locale',
|
|
28
|
+
'format'
|
|
29
|
+
],
|
|
30
|
+
validTypes: [
|
|
31
|
+
'array',
|
|
32
|
+
'object'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
humanizeDuration: {
|
|
36
|
+
namedArgs: [
|
|
37
|
+
'on',
|
|
38
|
+
'locale',
|
|
39
|
+
'withSuffix',
|
|
40
|
+
'thresholds'
|
|
41
|
+
],
|
|
42
|
+
validTypes: [
|
|
43
|
+
'array',
|
|
44
|
+
'object'
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const functions = {
|
|
49
|
+
format,
|
|
50
|
+
humanizeDuration
|
|
51
|
+
};
|
|
52
|
+
function _moment({ params , location , methodName }) {
|
|
53
|
+
return runClass({
|
|
54
|
+
functions,
|
|
55
|
+
location,
|
|
56
|
+
meta,
|
|
57
|
+
methodName,
|
|
58
|
+
operator: '_moment',
|
|
59
|
+
params
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export default _moment;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
*/ export { default as _moment } from './operators/shared/moment.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
*/ export { default as _moment } from './operators/shared/moment.js';
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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 client from './operatorsClient.js';
|
|
16
|
+
import * as server from './operatorsServer.js';
|
|
17
|
+
export default {
|
|
18
|
+
operators: {
|
|
19
|
+
client: Object.keys(client),
|
|
20
|
+
server: Object.keys(server)
|
|
21
|
+
}
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators-moment",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.31",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test": "TZ=UTC jest --coverage"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@lowdefy/operators": "4.0.0-alpha.
|
|
49
|
+
"@lowdefy/operators": "4.0.0-alpha.31",
|
|
50
50
|
"moment": "2.29.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "96ef86d4ce4849f8f11110662efbbaede1bcd5a5"
|
|
63
63
|
}
|