File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
lib/node_modules/@stdlib/math/base/special/heaviside/lib Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @license Apache-2.0
3+ *
4+ * Copyright (c) 2025 The Stdlib Authors.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ 'use strict' ;
20+
21+ // MODULES //
22+
23+ var enumeration = require ( './enum.js' ) ;
24+
25+
26+ // VARIABLES //
27+
28+ var ENUM = enumeration ( ) ;
29+
30+
31+ // MAIN //
32+
33+ /**
34+ * Returns the enumeration constant associated with a function continuity type string.
35+ *
36+ * @private
37+ * @param {string } ctype - function continuity type string
38+ * @returns {(integer|null) } integer value or null
39+ *
40+ * @example
41+ * var v = str2enum( 'left-continuous' );
42+ * // returns <number>
43+ */
44+ function str2enum ( ctype ) {
45+ var v = ENUM [ ctype ] ;
46+ return ( typeof v === 'number' ) ? v : null ; // note: we include this guard to prevent walking the prototype chain
47+ }
48+
49+
50+ // EXPORTS //
51+
52+ module . exports = str2enum ;
You can’t perform that action at this time.
0 commit comments