-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs.map
1 lines (1 loc) · 5.25 KB
/
index.mjs.map
1
{"version":3,"file":"index.mjs","sources":["../ctor/lib/main.js","../to-string/lib/main.js","../lib/index.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a Function object.\n*\n* @name Function\n* @constructor\n* @type {Function}\n* @param {...*} [argNames] - parameters names\n* @param {string} body - function body\n* @returns {Function} function\n*\n* @example\n* var add = new Fcn( 'x', 'y', 'return x + y' );\n*\n* var v = add( 1, 2 );\n* // returns 3\n*/\nvar Fcn = Function; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Fcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\n// Using `Function#toString` bypasses a value's own `toString` method to provide an extra, but not security proof, precaution to prevent a provided function from impersonating a native function:\nvar fcn2str = Function.prototype.toString;\n\n\n// MAIN //\n\n/**\n* Returns a string representing the source code of a provided function.\n*\n* ## Notes\n*\n* - If called on built-in functions, functions created by `Function.prototype.bind()`, or other non-JavaScript functions, the function returns a \"native\" function string similar to the following:\n*\n* ```text\n* \"function foo() { [native code] }\"\n* ```\n*\n* For intrinsic object methods and functions, `foo` is the initial name of the function.\n*\n* - If called on a function created by the `Function` constructor, the function returns the source code of a synthesized function declaration having the name \"anonymous\" and using the provided parameters and function body.\n*\n* - Starting in ES2018, the ECMAScript specification requires that the returned string contain the exact same source code as it was declared, including any whitespace and/or comments. If the host is unable to access the source code, the specification requires that the returned string be the native function string.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} string representing function source code\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var str = function2string( add );\n* // e.g., returns 'function add( x, y ) {\\n return x + y;\\n}'\n*/\nfunction function2string( fcn ) {\n\treturn fcn2str.call( fcn );\n}\n\n\n// EXPORTS //\n\nexport default function2string;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name Function\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/function/ctor}\n*/\nimport Function from './../ctor';\nsetReadOnly( ns, 'Function', Function );\n\n/**\n* @name function2string\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/function/to-string}\n*/\nimport function2string from './../to-string';\nsetReadOnly( ns, 'function2string', function2string );\n\n\n// EXPORTS //\n\nexport default ns;\n"],"names":["Fcn","Function","fcn2str","prototype","toString","function2string","fcn","call","ns","setReadOnly"],"mappings":";;0GAsCG,IAACA,EAAMC,SCfNC,EAAUD,SAASE,UAAUC,SAkCjC,SAASC,EAAiBC,GACzB,OAAOJ,EAAQK,KAAMD,EACtB,CCvBA,IAAAE,EAAA,CAAA,EAUAC,EAAAD,EAAA,WAAAP,GAUAQ,EAAAD,EAAA,kBAAAH"}