Skip to content

Commit

Permalink
Neo.ns() => indicate that create equals false inside the params #6254
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Jan 18, 2025
1 parent c6d2f77 commit a8b9b97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Neo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ Neo = globalThis.Neo = Object.assign({
*
* @memberOf module:Neo
* @param {Array|String} names The class name string containing dots or an Array of the string parts
* @param {Boolean} [create] Set create to true to create empty objects for non-existing parts
* @param {Boolean} create=false Set create to true to create empty objects for non-existing parts
* @param {Object} [scope] Set a different starting point as globalThis
* @returns {Object} reference to the toplevel namespace
*/
ns(names, create, scope) {
ns(names, create=false, scope) {
names = Array.isArray(names) ? names : names.split('.');

return names.reduce((prev, current) => {
Expand All @@ -342,11 +342,11 @@ Neo = globalThis.Neo = Object.assign({
* Extended version of Neo.ns() which supports mapping into arrays.
* @memberOf module:Neo
* @param {Array|String} names The class name string containing dots or an Array of the string parts
* @param {Boolean} [create] Set create to true to create empty objects for non-existing parts
* @param {Boolean} create=false Set create to true to create empty objects for non-existing parts
* @param {Object} [scope] Set a different starting point as globalThis
* @returns {Object} reference to the toplevel namespace
*/
nsWithArrays(names, create, scope) {
nsWithArrays(names, create=false, scope) {
names = Array.isArray(names) ? names : names.split('.');

return names.reduce((prev, current) => {
Expand Down

0 comments on commit a8b9b97

Please sign in to comment.