Socket
Socket
Sign inDemoInstall

nemo-locatex

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nemo-locatex - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

51

index.js
/*───────────────────────────────────────────────────────────────────────────*\
│ Copyright (C) 2014 eBay Software Foundation │
│ │
│ │
│ Licensed under the Apache License, Version 2.0 (the 'License'); you may │
│ not use this file except in compliance with the License. You may obtain │
│ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 │
│ │
│ Unless required by applicable law or agreed to in writing, software │
│ distributed under the License is distributed on an 'AS IS' BASIS, │
│ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │
│ See the License for the specific language governing permissions and │
│ limitations under the License. │
\*───────────────────────────────────────────────────────────────────────────*/
│ Copyright (C) 2014 eBay Software Foundation │
│ │
│ │
│ Licensed under the Apache License, Version 2.0 (the 'License'); you may │
│ not use this file except in compliance with the License. You may obtain │
│ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 │
│ │
│ Unless required by applicable law or agreed to in writing, software │
│ distributed under the License is distributed on an 'AS IS' BASIS, │
│ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │
│ See the License for the specific language governing permissions and │
│ limitations under the License. │
\*───────────────────────────────────────────────────────────────────────────*/
/* global module: true */
'use strict';
module.exports = {
'setup': function (config, result, callback) {
var returnObj = result;
returnObj.locatex = function locatex(_locator) {
var locale = (result.props && result.props.locale) ? result.props.locale : 'default',
locatr = this.locator;
_locator.split('.').forEach(function (level) {
locatr = locatr[level];
});
return locatr[locale] || locatr['default'] || locatr;
'setup': function (config, nemo, callback) {
nemo.locatex = function locatex(_locator) {
var locale = (nemo.props && nemo.props.locale) ? nemo.props.locale : 'default',
args = Array.prototype.slice.call(arguments),
locatorArray = (args.length > 1) ? args : arguments[0].split('.'),
locatr = nemo.locator;
locatorArray.forEach(function (level) {
locatr = locatr[level];
});
return locatr[locale] || locatr['default'] || locatr;
}.bind(result);
callback(null, config, returnObj);
}
};
callback(null, config, nemo);
}
};
{
"name": "nemo-locatex",
"version": "0.4.0",
"version": "0.4.1",
"description": "Add Locale behavior to Nemo locators",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc