PageSourceSearch

https://www.openpolicyagent.org/assets/js/6d0a5431.47ced621.js

js openpolicyagent.org collected 2026-09-24 08:31:07 UTC 3,802 bytes, 1 lines download raw bytes

1(self.webpackChunkopa_website=self.webpackChunkopa_website||[]).push([[26211],{18653:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"policy-reference/builtins/semver","title":"Semantic Version Built-ins","description":"","source":"@site/docs/policy-reference/builtins/semver.mdx","sourceDirName":"policy-reference/builtins","slug":"/policy-reference/builtins/semver","permalink":"/docs/policy-reference/builtins/semver","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Semantic Version Built-ins","sidebar_label":"Semantic Version"},"sidebar":"docsSidebar","previous":{"title":"Rego","permalink":"/docs/policy-reference/builtins/rego"},"next":{"title":"Sets","permalink":"/docs/policy-reference/builtins/sets"}}');var i=n(74848),s=n(28453);const o={title:"Semantic Version Built-ins",sidebar_label:"Semantic Version"},c=void 0,a={},l=[];function d(e){const{BuiltinTable:t,PlaygroundExample:r}={...(0,s.R)(),...e.components};return t||p("BuiltinTable",!0),r||p("PlaygroundExample",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{category:"semver"}),"\n",(0,i.jsx)(r,{dir:n(79091)})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}function p(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},22997:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r='package semverisvalid\n\nleadingV := semver.is_valid("v1.1.12-rc1+foo")\n\nvalid := semver.is_valid("1.1.12-rc1+foo")\n'},28453:(e,t,n)=>{"use strict";n.d(t,{R:()=>o,x:()=>c});var r=n(96540);const i={},s=r.createContext(i);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(s.Provider,{value:t},e.children)}},40308:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r="Example of semver.is_valid\n"},40697:e=>{"use strict";e.exports=JSON.parse('{"leadingV":true,"valid":true}')},76162:e=>{"use strict";e.exports=JSON.parse('{"showInput":false,"showData":false,"showTitles":false,"titleSize":5,"command":"data.semverisvalid"}')},79091:(e,t,n)=>{var r={"./config":76162,"./config.json":76162,"./intro.md":96165,"./output":40697,"./output.json":40697,"./policy.rego":22997,"./title.txt":40308};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=79091},96165:(e,t,n)=>{"use strict";n.r(t),n.d(t,{contentTitle:()=>o,default:()=>l,frontMatter:()=>s,toc:()=>c});var r=n(74848),i=n(28453);const s={},o=void 0,c=[];function a(e){const t={admonition:"admonition",code:"code",p:"p",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"result := semver.is_valid(vsn)"})," function checks to see if a version\nstring is of the form: ",(0,r.jsx)(t.code,{children:"MAJOR.MINOR.PATCH[-PRERELEASE][+METADATA]"}),", where\nitems in square braces are optional elements."]}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsxs)(t.p,{children:["When working with Go-style semantic versions, remember to remove the\nleading ",(0,r.jsx)(t.code,{children:"v"})," character, or the semver string will be marked as invalid!"]})})]})}function l(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.