@lowdefy/docs-content 0.0.0-experimental-20260710073520
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/LICENSE +201 -0
- package/README.md +20 -0
- package/content/actions/callapi.md +66 -0
- package/content/actions/callmethod.md +41 -0
- package/content/actions/copytoclipboard.md +32 -0
- package/content/actions/displaymessage.md +53 -0
- package/content/actions/downloadcsv.md +89 -0
- package/content/actions/fetch.md +50 -0
- package/content/actions/geolocationcurrentposition.md +56 -0
- package/content/actions/link.md +104 -0
- package/content/actions/login.md +85 -0
- package/content/actions/logout.md +56 -0
- package/content/actions/pdfmake.md +304 -0
- package/content/actions/request.md +67 -0
- package/content/actions/reset.md +27 -0
- package/content/actions/resetvalidation.md +85 -0
- package/content/actions/scrollto.md +85 -0
- package/content/actions/setdarkmode.md +62 -0
- package/content/actions/setfocus.md +33 -0
- package/content/actions/setglobal.md +63 -0
- package/content/actions/setlocale.md +69 -0
- package/content/actions/setstate.md +70 -0
- package/content/actions/throw.md +72 -0
- package/content/actions/validate.md +87 -0
- package/content/actions/wait.md +24 -0
- package/content/agents/agent-endpoint-tools.md +190 -0
- package/content/agents/agent-mcp-tools.md +124 -0
- package/content/agents/agent-multi-agent.md +136 -0
- package/content/agents/agent-properties.md +174 -0
- package/content/agents/agent-server-hooks.md +336 -0
- package/content/agents/agentchat.md +515 -0
- package/content/agents/agentconversations.md +148 -0
- package/content/concepts/ai-agent-docs.md +190 -0
- package/content/concepts/cli.md +213 -0
- package/content/concepts/connections-and-requests.md +7 -0
- package/content/concepts/custom-html.md +3 -0
- package/content/concepts/custom-styling.md +161 -0
- package/content/concepts/events-and-actions.md +271 -0
- package/content/concepts/hosting-files.md +18 -0
- package/content/concepts/i18n.md +320 -0
- package/content/concepts/keyboard-shortcuts.md +218 -0
- package/content/concepts/layout-overview.md +478 -0
- package/content/concepts/lists.md +144 -0
- package/content/concepts/logger.md +43 -0
- package/content/concepts/lowdefy-schema.md +365 -0
- package/content/concepts/menus.md +144 -0
- package/content/concepts/module-authoring.md +564 -0
- package/content/concepts/modules.md +338 -0
- package/content/concepts/operators.md +45 -0
- package/content/concepts/overview.md +19 -0
- package/content/concepts/references-and-templates.md +207 -0
- package/content/concepts/secrets.md +24 -0
- package/content/concepts/selectors.md +143 -0
- package/content/connections/amazonredshift.md +176 -0
- package/content/connections/anthropic.md +232 -0
- package/content/connections/awss3.md +313 -0
- package/content/connections/azureblobstorage.md +133 -0
- package/content/connections/elasticsearch.md +371 -0
- package/content/connections/google.md +228 -0
- package/content/connections/googlecloudstorage.md +139 -0
- package/content/connections/googlesheet.md +313 -0
- package/content/connections/knex.md +206 -0
- package/content/connections/mariadb.md +177 -0
- package/content/connections/mcp.md +134 -0
- package/content/connections/mongodb.md +739 -0
- package/content/connections/mssql.md +191 -0
- package/content/connections/mysql.md +192 -0
- package/content/connections/openai-connection.md +228 -0
- package/content/connections/postgresql.md +200 -0
- package/content/connections/redis.md +116 -0
- package/content/connections/sendgridmail.md +94 -0
- package/content/connections/smtp.md +149 -0
- package/content/connections/sqlite.md +187 -0
- package/content/connections/stripe.md +115 -0
- package/content/container-blocks/affix.md +413 -0
- package/content/container-blocks/alert.md +937 -0
- package/content/container-blocks/badge.md +1222 -0
- package/content/container-blocks/box.md +1453 -0
- package/content/container-blocks/card.md +1200 -0
- package/content/container-blocks/carousel.md +2247 -0
- package/content/container-blocks/collapse.md +1335 -0
- package/content/container-blocks/configprovider.md +1070 -0
- package/content/container-blocks/confirmmodal.md +1159 -0
- package/content/container-blocks/content.md +597 -0
- package/content/container-blocks/descriptions.md +870 -0
- package/content/container-blocks/drawer.md +1379 -0
- package/content/container-blocks/dropdownmenu.md +643 -0
- package/content/container-blocks/flex.md +1510 -0
- package/content/container-blocks/footer.md +380 -0
- package/content/container-blocks/googlemaps.md +546 -0
- package/content/container-blocks/googlemapsheatmap.md +607 -0
- package/content/container-blocks/googlemapsscript.md +61 -0
- package/content/container-blocks/header.md +302 -0
- package/content/container-blocks/label.md +739 -0
- package/content/container-blocks/layout.md +604 -0
- package/content/container-blocks/masonry.md +1090 -0
- package/content/container-blocks/mobilemenu.md +1244 -0
- package/content/container-blocks/modal.md +1180 -0
- package/content/container-blocks/pageheadermenu.md +614 -0
- package/content/container-blocks/pagesidebarlayout.md +438 -0
- package/content/container-blocks/pagesidermenu.md +651 -0
- package/content/container-blocks/popover.md +1421 -0
- package/content/container-blocks/result.md +972 -0
- package/content/container-blocks/sider.md +1064 -0
- package/content/container-blocks/span.md +747 -0
- package/content/container-blocks/spinner.md +267 -0
- package/content/container-blocks/splitter.md +1735 -0
- package/content/container-blocks/tabs.md +1718 -0
- package/content/container-blocks/tooltip.md +1274 -0
- package/content/container-blocks/watermark.md +515 -0
- package/content/controls/for.md +103 -0
- package/content/controls/if.md +107 -0
- package/content/controls/log.md +50 -0
- package/content/controls/parallel.md +71 -0
- package/content/controls/parallel_for.md +36 -0
- package/content/controls/reject.md +56 -0
- package/content/controls/return.md +66 -0
- package/content/controls/set_state.md +98 -0
- package/content/controls/switch.md +90 -0
- package/content/controls/throw.md +79 -0
- package/content/controls/try.md +88 -0
- package/content/deployment/docker.md +149 -0
- package/content/deployment/node-server.md +27 -0
- package/content/deployment/vercel.md +101 -0
- package/content/display-blocks/aggrid.md +1459 -0
- package/content/display-blocks/anchor.md +336 -0
- package/content/display-blocks/avatar.md +1154 -0
- package/content/display-blocks/breadcrumb.md +517 -0
- package/content/display-blocks/button.md +758 -0
- package/content/display-blocks/calendar.md +156 -0
- package/content/display-blocks/dangeroushtml.md +314 -0
- package/content/display-blocks/dangerousmarkdown.md +423 -0
- package/content/display-blocks/diffgit.md +44 -0
- package/content/display-blocks/difflist.md +225 -0
- package/content/display-blocks/diffsidebyside.md +56 -0
- package/content/display-blocks/difftimeline.md +94 -0
- package/content/display-blocks/divider.md +406 -0
- package/content/display-blocks/download.md +60 -0
- package/content/display-blocks/dropdownbutton.md +661 -0
- package/content/display-blocks/echart.md +418 -0
- package/content/display-blocks/floatbutton.md +545 -0
- package/content/display-blocks/html.md +311 -0
- package/content/display-blocks/icon.md +717 -0
- package/content/display-blocks/img.md +479 -0
- package/content/display-blocks/markdown.md +520 -0
- package/content/display-blocks/markdownwithcode.md +730 -0
- package/content/display-blocks/menu.md +1123 -0
- package/content/display-blocks/message.md +941 -0
- package/content/display-blocks/notification.md +1410 -0
- package/content/display-blocks/paragraph.md +643 -0
- package/content/display-blocks/progress.md +818 -0
- package/content/display-blocks/qrcode.md +519 -0
- package/content/display-blocks/s3download.md +240 -0
- package/content/display-blocks/search.md +360 -0
- package/content/display-blocks/skeleton.md +272 -0
- package/content/display-blocks/skeletonavatar.md +222 -0
- package/content/display-blocks/skeletonbutton.md +245 -0
- package/content/display-blocks/skeletoninput.md +223 -0
- package/content/display-blocks/skeletonparagraph.md +201 -0
- package/content/display-blocks/statistic.md +485 -0
- package/content/display-blocks/steps.md +585 -0
- package/content/display-blocks/tag.md +620 -0
- package/content/display-blocks/title.md +654 -0
- package/content/display-blocks/tour.md +2359 -0
- package/content/input-blocks/autocomplete.md +786 -0
- package/content/input-blocks/buttonselector.md +964 -0
- package/content/input-blocks/checkboxselector.md +765 -0
- package/content/input-blocks/checkboxswitch.md +497 -0
- package/content/input-blocks/colorselector.md +884 -0
- package/content/input-blocks/daterangeselector.md +777 -0
- package/content/input-blocks/dateselector.md +693 -0
- package/content/input-blocks/datetimeselector.md +791 -0
- package/content/input-blocks/inputgallery.md +528 -0
- package/content/input-blocks/monthselector.md +717 -0
- package/content/input-blocks/multipleselector.md +1337 -0
- package/content/input-blocks/numberinput.md +855 -0
- package/content/input-blocks/pagination.md +679 -0
- package/content/input-blocks/paragraphinput.md +1664 -0
- package/content/input-blocks/passwordinput.md +480 -0
- package/content/input-blocks/phonenumberinput.md +688 -0
- package/content/input-blocks/radioselector.md +820 -0
- package/content/input-blocks/ratingslider.md +684 -0
- package/content/input-blocks/s3uploadbutton.md +384 -0
- package/content/input-blocks/s3uploaddragger.md +305 -0
- package/content/input-blocks/s3uploadphoto.md +288 -0
- package/content/input-blocks/segmentedselector.md +782 -0
- package/content/input-blocks/selector.md +1162 -0
- package/content/input-blocks/switch.md +552 -0
- package/content/input-blocks/textarea.md +714 -0
- package/content/input-blocks/textinput.md +639 -0
- package/content/input-blocks/tiptapinput.md +226 -0
- package/content/input-blocks/tiptapmentioninput.md +471 -0
- package/content/input-blocks/titleinput.md +1094 -0
- package/content/input-blocks/treeinput.md +144 -0
- package/content/input-blocks/treemultipleselector.md +162 -0
- package/content/input-blocks/treeselector.md +185 -0
- package/content/input-blocks/upload.md +149 -0
- package/content/input-blocks/uploaddragger.md +85 -0
- package/content/input-blocks/uploadphoto.md +84 -0
- package/content/input-blocks/weekselector.md +630 -0
- package/content/list-blocks/controlledlist.md +498 -0
- package/content/list-blocks/list.md +529 -0
- package/content/list-blocks/listselector.md +301 -0
- package/content/list-blocks/masonrylist.md +230 -0
- package/content/migration/upgrade-guide.md +106 -0
- package/content/migration/v4-to-v5.md +589 -0
- package/content/migration/v5-to-v6.md +36 -0
- package/content/operators/_actions.md +58 -0
- package/content/operators/_and.md +76 -0
- package/content/operators/_api.md +254 -0
- package/content/operators/_app.md +114 -0
- package/content/operators/_args.md +65 -0
- package/content/operators/_array.md +331 -0
- package/content/operators/_base64.md +49 -0
- package/content/operators/_boolean.md +33 -0
- package/content/operators/_build.md +166 -0
- package/content/operators/_change_case.md +357 -0
- package/content/operators/_date.md +415 -0
- package/content/operators/_dayjs.md +128 -0
- package/content/operators/_diff.md +61 -0
- package/content/operators/_divide.md +32 -0
- package/content/operators/_eq.md +52 -0
- package/content/operators/_event.md +86 -0
- package/content/operators/_function.md +52 -0
- package/content/operators/_get.md +92 -0
- package/content/operators/_global.md +86 -0
- package/content/operators/_gt.md +50 -0
- package/content/operators/_gte.md +50 -0
- package/content/operators/_hash.md +112 -0
- package/content/operators/_if.md +30 -0
- package/content/operators/_if_none.md +47 -0
- package/content/operators/_index.md +48 -0
- package/content/operators/_input.md +86 -0
- package/content/operators/_intl.md +135 -0
- package/content/operators/_item.md +166 -0
- package/content/operators/_js.md +113 -0
- package/content/operators/_json.md +120 -0
- package/content/operators/_jsonata.md +152 -0
- package/content/operators/_locale.md +65 -0
- package/content/operators/_location.md +40 -0
- package/content/operators/_log.md +22 -0
- package/content/operators/_lt.md +50 -0
- package/content/operators/_lte.md +50 -0
- package/content/operators/_math.md +407 -0
- package/content/operators/_media.md +83 -0
- package/content/operators/_menu.md +62 -0
- package/content/operators/_module.md +340 -0
- package/content/operators/_mql.md +95 -0
- package/content/operators/_ne.md +62 -0
- package/content/operators/_not.md +33 -0
- package/content/operators/_number.md +159 -0
- package/content/operators/_nunjucks.md +117 -0
- package/content/operators/_object.md +253 -0
- package/content/operators/_operator.md +33 -0
- package/content/operators/_or.md +67 -0
- package/content/operators/_product.md +45 -0
- package/content/operators/_random.md +90 -0
- package/content/operators/_ref.md +80 -0
- package/content/operators/_regex.md +69 -0
- package/content/operators/_request.md +35 -0
- package/content/operators/_request_details.md +29 -0
- package/content/operators/_secret.md +56 -0
- package/content/operators/_state.md +134 -0
- package/content/operators/_step.md +98 -0
- package/content/operators/_string.md +327 -0
- package/content/operators/_subtract.md +24 -0
- package/content/operators/_sum.md +45 -0
- package/content/operators/_switch.md +37 -0
- package/content/operators/_t.md +96 -0
- package/content/operators/_theme.md +65 -0
- package/content/operators/_type.md +78 -0
- package/content/operators/_uri.md +49 -0
- package/content/operators/_url_query.md +92 -0
- package/content/operators/_user.md +154 -0
- package/content/operators/_uuid.md +118 -0
- package/content/operators/_var.md +88 -0
- package/content/operators/_yaml.md +96 -0
- package/content/other/introduction.md +39 -0
- package/content/other/next-auth-providers.md +3 -0
- package/content/other/updatesession.md +26 -0
- package/content/plugins/plugins-actions.md +80 -0
- package/content/plugins/plugins-connections.md +98 -0
- package/content/plugins/plugins-dev.md +138 -0
- package/content/plugins/plugins-introduction.md +29 -0
- package/content/plugins/plugins-operators.md +71 -0
- package/content/testing/e2e-auth.md +108 -0
- package/content/testing/e2e-configuration.md +107 -0
- package/content/testing/e2e-getting-started.md +96 -0
- package/content/testing/e2e-introduction.md +53 -0
- package/content/testing/e2e-mocking.md +155 -0
- package/content/testing/e2e-writing-tests.md +214 -0
- package/content/tutorial/tutorial-actions-operators.md +222 -0
- package/content/tutorial/tutorial-add-blocks.md +86 -0
- package/content/tutorial/tutorial-create-page.md +57 -0
- package/content/tutorial/tutorial-display-data-page.md +181 -0
- package/content/tutorial/tutorial-next-steps.md +53 -0
- package/content/tutorial/tutorial-requests-sql.md +22 -0
- package/content/tutorial/tutorial-start.md +71 -0
- package/content/user-authentication/auth-providers.md +15 -0
- package/content/user-authentication/login-and-logout.md +122 -0
- package/content/user-authentication/users-introduction.md +31 -0
- package/index.json +2281 -0
- package/package.json +34 -0
- package/scripts/extractAgentDocs.js +130 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# _date
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(dateString: string): date
|
|
5
|
+
(unixTimestamp: number): date
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
The `_date` operator returns a date object representing a single moment in time. It can take a string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, or a number that is the number of milliseconds since 1 January 1970 UTC (the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time)).
|
|
9
|
+
|
|
10
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
11
|
+
|
|
12
|
+
#### Arguments
|
|
13
|
+
|
|
14
|
+
###### string
|
|
15
|
+
An string in ISO 8601 format representing a date and time.
|
|
16
|
+
|
|
17
|
+
###### number
|
|
18
|
+
The number of milliseconds since 1 January 1970 UTC.
|
|
19
|
+
|
|
20
|
+
#### Examples
|
|
21
|
+
|
|
22
|
+
###### Timestamp:
|
|
23
|
+
```yaml
|
|
24
|
+
_date: 1611837509802
|
|
25
|
+
```
|
|
26
|
+
Returns: Thu Jan 28 2021 12:38:29 GMT+0000
|
|
27
|
+
|
|
28
|
+
###### ISO 8601 string, only date:
|
|
29
|
+
```yaml
|
|
30
|
+
_date: 2021-01-28
|
|
31
|
+
```
|
|
32
|
+
Returns: Thu Jan 28 2021 00:00:00 GMT+0000
|
|
33
|
+
|
|
34
|
+
###### ISO 8601 string, date and time:
|
|
35
|
+
```yaml
|
|
36
|
+
_date: 2021-01-28T12:36:03.957Z
|
|
37
|
+
```
|
|
38
|
+
Returns: Thu Jan 28 2021 12:38:29 GMT+0000
|
|
39
|
+
|
|
40
|
+
# Operator methods:
|
|
41
|
+
|
|
42
|
+
## _date.getDate
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
(value: date): number
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `_date.getDate` method returns the [day of the month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate) of a date.
|
|
49
|
+
|
|
50
|
+
## _date.getDay
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
(value: date): number
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The `_date.getDay` method returns the [day of the week](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay) of a date.
|
|
57
|
+
|
|
58
|
+
## _date.getFullYear
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
(value: date): number
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The `_date.getFullYear` method returns the [year](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear) of a date.
|
|
65
|
+
|
|
66
|
+
## _date.getHours
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
(value: date): number
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The `_date.getHours` method returns the [hour](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours) of a date.
|
|
73
|
+
|
|
74
|
+
## _date.getMilliseconds
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
(value: date): number
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The `_date.getMilliseconds` method returns the [milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds) of a date.
|
|
81
|
+
|
|
82
|
+
## _date.getMinutes
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
(value: date): number
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The `_date.getMinutes` method returns the [minutes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes) of a date.
|
|
89
|
+
|
|
90
|
+
## _date.getMonth
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
(value: date): number
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The `_date.getMonth` method returns the [month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth) of a date.
|
|
97
|
+
|
|
98
|
+
## _date.getSeconds
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
(value: date): number
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The `_date.getSeconds` method returns the [seconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds) of a date.
|
|
105
|
+
|
|
106
|
+
## _date.getTime
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
(value: date): number
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The `_date.getTime` method returns the number of [milliseconds since the epoch](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime), which is defined as the midnight at the beginning of January 1, 1970, UTC.
|
|
113
|
+
|
|
114
|
+
## _date.getTimezoneOffset
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
(value: date): number
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The `_date.getTimezoneOffset` method returns the [difference, in minutes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset), between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone.
|
|
121
|
+
|
|
122
|
+
## _date.getUTCDate
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
(value: date): number
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The `_date.getUTCDate` method returns the [day of the month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate) of a date according to universal time.
|
|
129
|
+
|
|
130
|
+
## _date.getUTCDay
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
(value: date): number
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The `_date.getUTCDay` method returns the [day of the week](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay) of a date according to universal time.
|
|
137
|
+
|
|
138
|
+
## _date.getUTCFullYear
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
(value: date): number
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The `_date.getUTCFullYear` method returns the [year](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear) of a date according to universal time.
|
|
145
|
+
|
|
146
|
+
## _date.getUTCHours
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
(value: date): number
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The `_date.getUTCHours` method returns the [hour](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours) of a date according to universal time.
|
|
153
|
+
|
|
154
|
+
## _date.getUTCMilliseconds
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
(value: date): number
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The `_date.getUTCMilliseconds` method returns the [milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds) of a date according to universal time.
|
|
161
|
+
|
|
162
|
+
## _date.getUTCMinutes
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
(value: date): number
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The `_date.getUTCMinutes` method returns the [minutes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes) of a date according to universal time.
|
|
169
|
+
|
|
170
|
+
## _date.getUTCMonth
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
(value: date): number
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The `_date.getUTCMonth` method returns the [month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth) of a date according to universal time.
|
|
177
|
+
|
|
178
|
+
## _date.getUTCSeconds
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
(value: date): number
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The `_date.getUTCSeconds` method returns the [seconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds) of a date according to universal time.
|
|
185
|
+
|
|
186
|
+
## _date.now
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
(void): date
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The `_date.now` method returns a date object representing the moment in time it was called. The method can also be used as `_date: now`
|
|
193
|
+
|
|
194
|
+
#### Arguments
|
|
195
|
+
|
|
196
|
+
The `_date.now` method does not take any arguments.
|
|
197
|
+
|
|
198
|
+
#### Examples
|
|
199
|
+
|
|
200
|
+
###### Get the current date and time:
|
|
201
|
+
```yaml
|
|
202
|
+
_date.now: null
|
|
203
|
+
```
|
|
204
|
+
```yaml
|
|
205
|
+
_date: now
|
|
206
|
+
```
|
|
207
|
+
Returns: The current date and time.
|
|
208
|
+
|
|
209
|
+
## _date.parse
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
(value: date): string
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The `_date.parse` method parses a string representation of a date, and returns the number of [milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse) since January 1, 1970, 00:00:00 UTC.
|
|
216
|
+
|
|
217
|
+
## _date.setDate
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
(arguments: {on: date, dayOfMonth: number}): number
|
|
221
|
+
(arguments: [on: date, dayOfMonth: number]): number
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The `_date.setDate` method changes the [day of the month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate) of a date.
|
|
225
|
+
|
|
226
|
+
## _date.setFullYear
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
(arguments: {on: date, year: number}): number
|
|
230
|
+
(arguments: [on: date, year: number]): number
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The `_date.setFullYear` method sets the [full year](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear) of a date.
|
|
234
|
+
|
|
235
|
+
## _date.setHours
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
(arguments: {on: date, hours: number}): number
|
|
239
|
+
(arguments: [on: date, hours: number]): number
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
The `_date.setHours` method sets the [hours](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours) of a date.
|
|
243
|
+
|
|
244
|
+
## _date.setMilliseconds
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
(arguments: {on: date, milliseconds: number}): number
|
|
248
|
+
(arguments: [on: date, milliseconds: number]): number
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The `_date.setMilliseconds` method sets the [milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds) of a date.
|
|
252
|
+
|
|
253
|
+
## _date.setMinutes
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
(arguments: {on: date, minutes: number}): number
|
|
257
|
+
(arguments: [on: date, minutes: number]): number
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The `_date.setMinutes` method sets the [minutes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes) of a date.
|
|
261
|
+
|
|
262
|
+
## _date.setMonth
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
(arguments: {on: date, month: number}): number
|
|
266
|
+
(arguments: [on: date, month: number]): number
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The `_date.setMonth` method sets the [month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth) of a date.
|
|
270
|
+
|
|
271
|
+
## _date.setSeconds
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
(arguments: {on: date, seconds: number}): number
|
|
275
|
+
(arguments: [on: date, seconds: number]): number
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
The `_date.setSeconds` method sets the [seconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds) of a date.
|
|
279
|
+
|
|
280
|
+
## _date.setTime
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
(arguments: {on: date, time: number}): number
|
|
284
|
+
(arguments: [on: date, time: number]): number
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
The `_date.setTime` method sets the [time](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime) represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC.
|
|
288
|
+
|
|
289
|
+
## _date.setUTCDate
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
(arguments: {on: date, dayOfMonth: number}): number
|
|
293
|
+
(arguments: [on: date, dayOfMonth: number]): number
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The `_date.setUTCDate` method changes the [day of the month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate) of a date, based on UTC time.
|
|
297
|
+
|
|
298
|
+
## _date.setFullYear
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
(arguments: {on: date, year: number}): number
|
|
302
|
+
(arguments: [on: date, year: number]): number
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
The `_date.setUTCFullYear` method sets the [full year](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear) of a date, based on UTC time.
|
|
306
|
+
|
|
307
|
+
## _date.setUTCHours
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
(arguments: {on: date, hours: number}): number
|
|
311
|
+
(arguments: [on: date, hours: number]): number
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
The `_date.setUTCHours` method sets the [hours](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours) of a date, based on UTC time.
|
|
315
|
+
|
|
316
|
+
## _date.setUTCMilliseconds
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
(arguments: {on: date, milliseconds: number}): number
|
|
320
|
+
(arguments: [on: date, milliseconds: number]): number
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
The `_date.setUTCMilliseconds` method sets the [milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds) of a date, based on UTC time.
|
|
324
|
+
|
|
325
|
+
## _date.setUTCMinutes
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
(arguments: {on: date, minutes: number}): number
|
|
329
|
+
(arguments: [on: date, minutes: number]): number
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The `_date.setUTCMinutes` method sets the [minutes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes) of a date, based on UTC time.
|
|
333
|
+
|
|
334
|
+
## _date.setUTCMonth
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
(arguments: {on: date, month: number}): number
|
|
338
|
+
(arguments: [on: date, month: number]): number
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
The `_date.setUTCMonth` method sets the [month](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth) of a date, based on UTC time.
|
|
342
|
+
|
|
343
|
+
## _date.setUTCSeconds
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
(arguments: {on: date, seconds: number}): number
|
|
347
|
+
(arguments: [on: date, seconds: number]): number
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
The `_date.setUTCSeconds` method sets the [seconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds) of a date, based on UTC time.
|
|
351
|
+
|
|
352
|
+
## _date.toDateString
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
(value: date): string
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
The `_date.toDateString` method returns the [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) as a string.
|
|
359
|
+
|
|
360
|
+
## _date.toISOString
|
|
361
|
+
|
|
362
|
+
```
|
|
363
|
+
(value: date): string
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
The `_date.toISOString` method returns the [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) as a string in ISO format.
|
|
367
|
+
|
|
368
|
+
## _date.toJSON
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
(value: date): string
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
The `_date.toJSON` method returns the [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) as a string in ISO format.
|
|
375
|
+
|
|
376
|
+
## _date.toString
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
(value: date): string
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
The `_date.toString` method returns the [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) as a string.
|
|
383
|
+
|
|
384
|
+
## _date.toTimeString
|
|
385
|
+
|
|
386
|
+
```
|
|
387
|
+
(value: date): string
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
The `_date.toTimeString` method returns the [time](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) of a date as a string.
|
|
391
|
+
|
|
392
|
+
## _date.toUTCString
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
(value: date): string
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
The `_date.toUTCString` method returns the [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString) as a string in UTC time.
|
|
399
|
+
|
|
400
|
+
## _date.UTC
|
|
401
|
+
|
|
402
|
+
```
|
|
403
|
+
(arguments: {year: number, month: number, day: number, hours: number, minutes: number, seconds: number}): number
|
|
404
|
+
(arguments: [year: number, month: number, day: number, hours: number, minutes: number, seconds: number]): number
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
The `_date.UTC` method accepts [year, month, day, hours, minutes, seconds parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC) of a date but treats them as UTC.
|
|
408
|
+
|
|
409
|
+
## _date.valueOf
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
(value: date): number
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
The `_date.valueOf` method returns the [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf) of a date.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# _dayjs
|
|
2
|
+
|
|
3
|
+
The `_dayjs` operator provides date manipulation and formatting using the [Day.js](https://day.js.org/) library.
|
|
4
|
+
|
|
5
|
+
It supports two modes:
|
|
6
|
+
- **Method mode**: Call a specific method like `_dayjs.format` or `_dayjs.humanizeDuration`.
|
|
7
|
+
- **Chain mode**: Chain multiple Day.js operations together using an array.
|
|
8
|
+
|
|
9
|
+
#### Chain mode
|
|
10
|
+
|
|
11
|
+
Pass an array where the first element is the input date (or `"now"`), followed by method calls:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
_dayjs:
|
|
15
|
+
- "now"
|
|
16
|
+
- subtract:
|
|
17
|
+
- 3
|
|
18
|
+
- days
|
|
19
|
+
- fromNow
|
|
20
|
+
```
|
|
21
|
+
Returns: `"3 days ago"`
|
|
22
|
+
|
|
23
|
+
Each step is either a string (method called with no arguments) or an object (key is the method name, value is the arguments).
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
# Format a specific date
|
|
27
|
+
_dayjs:
|
|
28
|
+
- "2024-03-15"
|
|
29
|
+
- format: "YYYY-MM-DD"
|
|
30
|
+
```
|
|
31
|
+
Returns: `"2024-03-15"`
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
# Add 1 month and format
|
|
35
|
+
_dayjs:
|
|
36
|
+
- "2024-01-01"
|
|
37
|
+
- add:
|
|
38
|
+
- 1
|
|
39
|
+
- month
|
|
40
|
+
- format: "D MMM YYYY"
|
|
41
|
+
```
|
|
42
|
+
Returns: `"1 Feb 2024"`
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
# Get start of month
|
|
46
|
+
_dayjs:
|
|
47
|
+
- "2024-03-15"
|
|
48
|
+
- startOf: month
|
|
49
|
+
- format: "YYYY-MM-DD"
|
|
50
|
+
```
|
|
51
|
+
Returns: `"2024-03-01"`
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
# Calculate difference in days
|
|
55
|
+
_dayjs:
|
|
56
|
+
- "2024-03-15"
|
|
57
|
+
- diff:
|
|
58
|
+
- "2024-03-10"
|
|
59
|
+
- days
|
|
60
|
+
```
|
|
61
|
+
Returns: `5`
|
|
62
|
+
|
|
63
|
+
**Supported chain methods:** `add`, `subtract`, `startOf`, `endOf`, `set`, `utc`, `local`, `locale`, `isBefore`, `isAfter`, `isSame`, `format`, `fromNow`, `from`, `toNow`, `to`, `diff`, `valueOf`, `unix`, `toISOString`, `toJSON`, `toString`, `daysInMonth`, `year`, `month`, `date`, `day`, `hour`, `minute`, `second`, `millisecond`, `week`.
|
|
64
|
+
|
|
65
|
+
> Migrating from v4? The `_moment` operator was renamed to `_dayjs` in v5. See the [v4 to v5 migration guide](/v4-to-v5) for details.
|
|
66
|
+
|
|
67
|
+
# Operator methods:
|
|
68
|
+
|
|
69
|
+
## _dayjs.format
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
(arguments: {
|
|
73
|
+
on: date | string,
|
|
74
|
+
locale?: string,
|
|
75
|
+
format?: string
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The `_dayjs.format` formats dates using the [Day.js](https://day.js.org/docs/en/display/format) library.
|
|
80
|
+
|
|
81
|
+
#### Arguments
|
|
82
|
+
|
|
83
|
+
###### object
|
|
84
|
+
- `on: date | string`: The date to format.
|
|
85
|
+
- `locale: string`: A string with a locale name.
|
|
86
|
+
- `format: string`: A date [format string](https://day.js.org/docs/en/display/format).
|
|
87
|
+
|
|
88
|
+
#### Examples
|
|
89
|
+
|
|
90
|
+
###### Format a date:
|
|
91
|
+
```yaml
|
|
92
|
+
_dayjs.format:
|
|
93
|
+
on:
|
|
94
|
+
_date: 2019-06-04
|
|
95
|
+
format: 'D MMM YYYY'
|
|
96
|
+
```
|
|
97
|
+
Returns: `"4 Jun 2019"`.
|
|
98
|
+
|
|
99
|
+
## _dayjs.humanizeDuration
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
(arguments: {
|
|
103
|
+
on: number,
|
|
104
|
+
locale?: string,
|
|
105
|
+
withSuffix?: boolean
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `_dayjs.humanizeDuration` formats durations in milliseconds using [Day.js](https://day.js.org/docs/en/plugin/duration).
|
|
110
|
+
|
|
111
|
+
#### Arguments
|
|
112
|
+
|
|
113
|
+
###### object
|
|
114
|
+
- `on: number`: The duration in milliseconds to format.
|
|
115
|
+
- `locale: string`: A string with a locale name. Locale names are auto-normalized (e.g. `en-US` becomes `en`).
|
|
116
|
+
- `withSuffix: boolean`: By default, the return string is describing a duration `a month` (suffix-less). If you want an oriented duration `in a month`, `a month ago` (with suffix), pass in true.
|
|
117
|
+
|
|
118
|
+
> **Note:** The `thresholds` parameter from v4 is accepted but ignored in v5. Day.js uses fixed thresholds internally.
|
|
119
|
+
|
|
120
|
+
#### Examples
|
|
121
|
+
|
|
122
|
+
###### Format a duration:
|
|
123
|
+
```yaml
|
|
124
|
+
_dayjs.humanizeDuration:
|
|
125
|
+
on: 245923000
|
|
126
|
+
withSuffix: true
|
|
127
|
+
```
|
|
128
|
+
Returns: `"in 3 days"`.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# _diff
|
|
2
|
+
|
|
3
|
+
# Operator methods:
|
|
4
|
+
|
|
5
|
+
## _diff.deep
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
(arguments: {lhs: any, rhs: any}): object[]
|
|
9
|
+
([lhs: any, rhs: any]): object[]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The `_diff.deep` method compares two objects and returns an object that describes the structural differences between the two objects.
|
|
13
|
+
|
|
14
|
+
#### Arguments
|
|
15
|
+
|
|
16
|
+
###### string
|
|
17
|
+
The string to decode.
|
|
18
|
+
|
|
19
|
+
#### Examples
|
|
20
|
+
|
|
21
|
+
###### Compare two objects using named args:
|
|
22
|
+
```yaml
|
|
23
|
+
_diff.deep:
|
|
24
|
+
lhs:
|
|
25
|
+
deleted: To be deleted
|
|
26
|
+
edited: Edit me
|
|
27
|
+
array: [1]
|
|
28
|
+
rhs:
|
|
29
|
+
new: New value
|
|
30
|
+
edited: Edited
|
|
31
|
+
array: [1, 2]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
_diff.deep:
|
|
36
|
+
- deleted: To be deleted
|
|
37
|
+
edited: Edit me
|
|
38
|
+
array: [1]
|
|
39
|
+
- new: New value
|
|
40
|
+
edited: Edited
|
|
41
|
+
array: [1, 2]
|
|
42
|
+
```
|
|
43
|
+
Both return:
|
|
44
|
+
```yaml
|
|
45
|
+
- kind: D
|
|
46
|
+
path: [deleted]
|
|
47
|
+
lhs: To be deleted
|
|
48
|
+
- kind: E
|
|
49
|
+
path: [edited]
|
|
50
|
+
lhs: Edit me
|
|
51
|
+
rhs: Edited
|
|
52
|
+
- kind: A
|
|
53
|
+
path: ['array']
|
|
54
|
+
index: 1
|
|
55
|
+
item:
|
|
56
|
+
kind: N
|
|
57
|
+
rhs: 2
|
|
58
|
+
- kind: N
|
|
59
|
+
path: [new]
|
|
60
|
+
rhs: New value
|
|
61
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# _divide
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
([numerator: number, denominator: number]): number
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `_divide` operator divides two numbers. It takes an array of two numbers as input and returns the first number divided by the second. Dividing by zero will throw an error.
|
|
8
|
+
|
|
9
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
10
|
+
|
|
11
|
+
#### Arguments
|
|
12
|
+
|
|
13
|
+
###### array
|
|
14
|
+
An array of two numbers.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Divide two numbers:
|
|
19
|
+
```yaml
|
|
20
|
+
_divide:
|
|
21
|
+
- 12
|
|
22
|
+
- 4
|
|
23
|
+
```
|
|
24
|
+
Returns: `3`
|
|
25
|
+
|
|
26
|
+
###### Cannot divide by zero:
|
|
27
|
+
```yaml
|
|
28
|
+
_divide:
|
|
29
|
+
- 1
|
|
30
|
+
- 0
|
|
31
|
+
```
|
|
32
|
+
Returns: `null` and throws a operator error.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# _eq
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
([value1: any, value2: any]): boolean
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `_eq` operator tests if two values are equal. It takes an array of two values to test.
|
|
8
|
+
|
|
9
|
+
> The `_eq` operator tests for strict equality, and won't do a deep comparison.
|
|
10
|
+
|
|
11
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
12
|
+
|
|
13
|
+
#### Arguments
|
|
14
|
+
|
|
15
|
+
###### array
|
|
16
|
+
An array of two values to compare.
|
|
17
|
+
|
|
18
|
+
#### Examples
|
|
19
|
+
|
|
20
|
+
###### Two strings:
|
|
21
|
+
```yaml
|
|
22
|
+
_eq:
|
|
23
|
+
- "Hello"
|
|
24
|
+
- "Hello"
|
|
25
|
+
```
|
|
26
|
+
Returns: `true`
|
|
27
|
+
|
|
28
|
+
###### Two numbers:
|
|
29
|
+
```yaml
|
|
30
|
+
_eq:
|
|
31
|
+
- _sum:
|
|
32
|
+
- 3
|
|
33
|
+
- 4
|
|
34
|
+
- 8
|
|
35
|
+
```
|
|
36
|
+
Returns: `false`
|
|
37
|
+
|
|
38
|
+
###### Arrays are not compared deeply:
|
|
39
|
+
```yaml
|
|
40
|
+
_eq:
|
|
41
|
+
- [1,2,3]
|
|
42
|
+
- [1,2,3]
|
|
43
|
+
```
|
|
44
|
+
Returns: `false`
|
|
45
|
+
|
|
46
|
+
###### Values from "getter" operators are copies and not equal:
|
|
47
|
+
```yaml
|
|
48
|
+
_eq:
|
|
49
|
+
- _state: my_object
|
|
50
|
+
- _state: my_object
|
|
51
|
+
```
|
|
52
|
+
Returns: `false`
|