From 17ab2b64179ade6407cde752d61b00866e1724b2 Mon Sep 17 00:00:00 2001 From: Bishoy Boktor Date: Tue, 6 Apr 2021 22:04:34 +0000 Subject: [PATCH] [Rename] Rename upstream elastic dependency packages Rename elastic-datemath, elastic-eslint-config-kibana, and elastic-safer-lodash-set Signed-off-by: Bishoy Boktor --- .eslintignore | 3 +- packages/elastic-eslint-config-kibana/jest.js | 23 -- .../elastic-safer-lodash-set/fp/assoc.d.ts | 9 - packages/elastic-safer-lodash-set/fp/assoc.js | 8 - .../fp/assocPath.d.ts | 9 - .../elastic-safer-lodash-set/fp/assocPath.js | 8 - packages/elastic-safer-lodash-set/fp/index.js | 9 - packages/elastic-safer-lodash-set/fp/set.d.ts | 9 - packages/elastic-safer-lodash-set/fp/set.js | 13 -- .../elastic-safer-lodash-set/fp/setWith.d.ts | 9 - .../elastic-safer-lodash-set/fp/setWith.js | 13 -- packages/elastic-safer-lodash-set/index.js | 9 - packages/elastic-safer-lodash-set/set.d.ts | 9 - packages/elastic-safer-lodash-set/set.js | 8 - .../elastic-safer-lodash-set/setWith.d.ts | 9 - packages/elastic-safer-lodash-set/setWith.js | 8 - packages/elastic-safer-lodash-set/test/set.ts | 14 -- .../elastic-safer-lodash-set/test/setWith.ts | 32 --- .../.npmignore | 0 .../__tests__/index.js | 0 .../index.d.ts | 0 .../index.js | 2 +- .../package.json | 2 +- .../readme.md | 0 .../tsconfig.json | 4 +- .../.eslintrc.js | 0 .../.gitignore | 0 .../.npmignore | 0 .../README.md | 0 .../javascript.js | 49 +++-- .../jest.js | 37 ++++ .../package.json | 0 .../react.js | 35 +++- .../restricted_globals.js | 19 ++ .../typescript.js | 198 ++++++++++-------- .../.gitignore | 0 .../.npmignore | 0 .../LICENSE | 0 .../README.md | 0 .../opensearch-safer-lodash-set/fp/assoc.d.ts | 21 ++ .../opensearch-safer-lodash-set/fp/assoc.js | 20 ++ .../fp/assocPath.d.ts | 21 ++ .../fp/assocPath.js | 20 ++ .../fp/index.d.ts | 20 +- .../opensearch-safer-lodash-set/fp/index.js | 21 ++ .../opensearch-safer-lodash-set/fp/set.d.ts | 21 ++ .../opensearch-safer-lodash-set/fp/set.js | 25 +++ .../fp/setWith.d.ts | 21 ++ .../opensearch-safer-lodash-set/fp/setWith.js | 25 +++ .../index.d.ts | 20 +- packages/opensearch-safer-lodash-set/index.js | 21 ++ .../lodash/_baseSet.js | 20 +- .../lodash/set.js | 20 +- .../lodash/setWith.js | 20 +- .../package.json | 0 .../scripts/_get_lodash.sh | 0 .../scripts/license-header.txt | 0 .../scripts/patches/_baseSet.js.patch | 0 .../scripts/save_state.sh | 0 .../scripts/update.sh | 0 packages/opensearch-safer-lodash-set/set.d.ts | 21 ++ packages/opensearch-safer-lodash-set/set.js | 20 ++ .../opensearch-safer-lodash-set/setWith.d.ts | 21 ++ .../opensearch-safer-lodash-set/setWith.js | 20 ++ .../test/fp.ts | 18 +- .../test/fp_assoc.ts | 18 +- .../test/fp_assocPath.ts | 18 +- .../test/fp_patch_test.js | 18 +- .../test/fp_set.ts | 18 +- .../test/fp_setWith.ts | 18 +- .../test/index.ts | 18 +- .../test/patch_test.js | 18 +- .../opensearch-safer-lodash-set/test/set.ts | 28 +++ .../test/setWith.ts | 46 ++++ .../tsconfig.json | 0 src/dev/precommit_hook/casing_check_config.js | 2 +- 76 files changed, 811 insertions(+), 355 deletions(-) delete mode 100644 packages/elastic-eslint-config-kibana/jest.js delete mode 100644 packages/elastic-safer-lodash-set/fp/assoc.d.ts delete mode 100644 packages/elastic-safer-lodash-set/fp/assoc.js delete mode 100644 packages/elastic-safer-lodash-set/fp/assocPath.d.ts delete mode 100644 packages/elastic-safer-lodash-set/fp/assocPath.js delete mode 100644 packages/elastic-safer-lodash-set/fp/index.js delete mode 100644 packages/elastic-safer-lodash-set/fp/set.d.ts delete mode 100644 packages/elastic-safer-lodash-set/fp/set.js delete mode 100644 packages/elastic-safer-lodash-set/fp/setWith.d.ts delete mode 100644 packages/elastic-safer-lodash-set/fp/setWith.js delete mode 100644 packages/elastic-safer-lodash-set/index.js delete mode 100644 packages/elastic-safer-lodash-set/set.d.ts delete mode 100644 packages/elastic-safer-lodash-set/set.js delete mode 100644 packages/elastic-safer-lodash-set/setWith.d.ts delete mode 100644 packages/elastic-safer-lodash-set/setWith.js delete mode 100644 packages/elastic-safer-lodash-set/test/set.ts delete mode 100644 packages/elastic-safer-lodash-set/test/setWith.ts rename packages/{elastic-datemath => opensearch-datemath}/.npmignore (100%) rename packages/{elastic-datemath => opensearch-datemath}/__tests__/index.js (100%) rename packages/{elastic-datemath => opensearch-datemath}/index.d.ts (100%) rename packages/{elastic-datemath => opensearch-datemath}/index.js (98%) rename packages/{elastic-datemath => opensearch-datemath}/package.json (70%) rename packages/{elastic-datemath => opensearch-datemath}/readme.md (100%) rename packages/{elastic-datemath => opensearch-datemath}/tsconfig.json (57%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/.eslintrc.js (100%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/.gitignore (100%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/.npmignore (100%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/README.md (100%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/javascript.js (64%) create mode 100644 packages/opensearch-eslint-config-opensearch-dashboards/jest.js rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/package.json (100%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/react.js (70%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/restricted_globals.js (54%) rename packages/{elastic-eslint-config-kibana => opensearch-eslint-config-opensearch-dashboards}/typescript.js (62%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/.gitignore (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/.npmignore (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/LICENSE (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/README.md (100%) create mode 100644 packages/opensearch-safer-lodash-set/fp/assoc.d.ts create mode 100644 packages/opensearch-safer-lodash-set/fp/assoc.js create mode 100644 packages/opensearch-safer-lodash-set/fp/assocPath.d.ts create mode 100644 packages/opensearch-safer-lodash-set/fp/assocPath.js rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/fp/index.d.ts (91%) create mode 100644 packages/opensearch-safer-lodash-set/fp/index.js create mode 100644 packages/opensearch-safer-lodash-set/fp/set.d.ts create mode 100644 packages/opensearch-safer-lodash-set/fp/set.js create mode 100644 packages/opensearch-safer-lodash-set/fp/setWith.d.ts create mode 100644 packages/opensearch-safer-lodash-set/fp/setWith.js rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/index.d.ts (71%) create mode 100644 packages/opensearch-safer-lodash-set/index.js rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/lodash/_baseSet.js (66%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/lodash/set.js (55%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/lodash/setWith.js (57%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/package.json (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/scripts/_get_lodash.sh (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/scripts/license-header.txt (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/scripts/patches/_baseSet.js.patch (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/scripts/save_state.sh (100%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/scripts/update.sh (100%) create mode 100644 packages/opensearch-safer-lodash-set/set.d.ts create mode 100644 packages/opensearch-safer-lodash-set/set.js create mode 100644 packages/opensearch-safer-lodash-set/setWith.d.ts create mode 100644 packages/opensearch-safer-lodash-set/setWith.js rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp.ts (84%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp_assoc.ts (52%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp_assocPath.ts (54%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp_patch_test.js (92%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp_set.ts (52%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/fp_setWith.ts (70%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/index.ts (52%) rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/test/patch_test.js (86%) create mode 100644 packages/opensearch-safer-lodash-set/test/set.ts create mode 100644 packages/opensearch-safer-lodash-set/test/setWith.ts rename packages/{elastic-safer-lodash-set => opensearch-safer-lodash-set}/tsconfig.json (100%) diff --git a/.eslintignore b/.eslintignore index ec733bfa1f77..a495516fd869 100644 --- a/.eslintignore +++ b/.eslintignore @@ -22,7 +22,8 @@ target /src/plugins/vis_type_timeline/public/_generated_/** # package overrides -/packages/elastic-eslint-config-kibana +/packages/opensearch-eslint-config-opensearch-dashboards +/packages/opensearch-safer-lodash-set /packages/osd-interpreter/src/common/lib/grammar.js /packages/osd-plugin-generator/template /packages/osd-pm/dist diff --git a/packages/elastic-eslint-config-kibana/jest.js b/packages/elastic-eslint-config-kibana/jest.js deleted file mode 100644 index c374de7ae123..000000000000 --- a/packages/elastic-eslint-config-kibana/jest.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - overrides: [ - { - files: [ - '**/*.{test,test.mocks,mock}.{js,mjs,ts,tsx}', - '**/__mocks__/**/*.{js,mjs,ts,tsx}', - ], - plugins: [ - 'jest', - ], - - env: { - 'jest': true, - }, - - rules: { - 'jest/no-focused-tests': 'error', - 'jest/no-identical-title': 'error', - 'import/order': 'off', - }, - } - ] -}; diff --git a/packages/elastic-safer-lodash-set/fp/assoc.d.ts b/packages/elastic-safer-lodash-set/fp/assoc.d.ts deleted file mode 100644 index 57fe84d0b07f..000000000000 --- a/packages/elastic-safer-lodash-set/fp/assoc.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { assoc } from './index'; -export = assoc; diff --git a/packages/elastic-safer-lodash-set/fp/assoc.js b/packages/elastic-safer-lodash-set/fp/assoc.js deleted file mode 100644 index 851e11690ea3..000000000000 --- a/packages/elastic-safer-lodash-set/fp/assoc.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts b/packages/elastic-safer-lodash-set/fp/assocPath.d.ts deleted file mode 100644 index 76df38e98ff2..000000000000 --- a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { assocPath } from './index'; -export = assocPath; diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.js b/packages/elastic-safer-lodash-set/fp/assocPath.js deleted file mode 100644 index 851e11690ea3..000000000000 --- a/packages/elastic-safer-lodash-set/fp/assocPath.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/index.js b/packages/elastic-safer-lodash-set/fp/index.js deleted file mode 100644 index 7d9cdb099dfd..000000000000 --- a/packages/elastic-safer-lodash-set/fp/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -exports.set = exports.assoc = exports.assocPath = require('./set'); -exports.setWith = require('./setWith'); diff --git a/packages/elastic-safer-lodash-set/fp/set.d.ts b/packages/elastic-safer-lodash-set/fp/set.d.ts deleted file mode 100644 index 16bc98658bdc..000000000000 --- a/packages/elastic-safer-lodash-set/fp/set.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { set } from './index'; -export = set; diff --git a/packages/elastic-safer-lodash-set/fp/set.js b/packages/elastic-safer-lodash-set/fp/set.js deleted file mode 100644 index 0fb48694d736..000000000000 --- a/packages/elastic-safer-lodash-set/fp/set.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -/*eslint no-var:0 */ -var convert = require('lodash/fp/convert'); -var func = convert('set', require('../set')); - -func.placeholder = require('lodash/fp/placeholder'); -module.exports = func; diff --git a/packages/elastic-safer-lodash-set/fp/setWith.d.ts b/packages/elastic-safer-lodash-set/fp/setWith.d.ts deleted file mode 100644 index 556e702f59f0..000000000000 --- a/packages/elastic-safer-lodash-set/fp/setWith.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { setWith } from './index'; -export = setWith; diff --git a/packages/elastic-safer-lodash-set/fp/setWith.js b/packages/elastic-safer-lodash-set/fp/setWith.js deleted file mode 100644 index e477d4b4bc7b..000000000000 --- a/packages/elastic-safer-lodash-set/fp/setWith.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -/*eslint no-var:0 */ -var convert = require('lodash/fp/convert'); -var func = convert('setWith', require('../setWith')); - -func.placeholder = require('lodash/fp/placeholder'); -module.exports = func; diff --git a/packages/elastic-safer-lodash-set/index.js b/packages/elastic-safer-lodash-set/index.js deleted file mode 100644 index d9edb25476c1..000000000000 --- a/packages/elastic-safer-lodash-set/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -exports.set = require('./lodash/set'); -exports.setWith = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/set.d.ts b/packages/elastic-safer-lodash-set/set.d.ts deleted file mode 100644 index 16bc98658bdc..000000000000 --- a/packages/elastic-safer-lodash-set/set.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { set } from './index'; -export = set; diff --git a/packages/elastic-safer-lodash-set/set.js b/packages/elastic-safer-lodash-set/set.js deleted file mode 100644 index 697706290854..000000000000 --- a/packages/elastic-safer-lodash-set/set.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -module.exports = require('./lodash/set'); diff --git a/packages/elastic-safer-lodash-set/setWith.d.ts b/packages/elastic-safer-lodash-set/setWith.d.ts deleted file mode 100644 index 556e702f59f0..000000000000 --- a/packages/elastic-safer-lodash-set/setWith.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { setWith } from './index'; -export = setWith; diff --git a/packages/elastic-safer-lodash-set/setWith.js b/packages/elastic-safer-lodash-set/setWith.js deleted file mode 100644 index aafa8a4db4be..000000000000 --- a/packages/elastic-safer-lodash-set/setWith.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -module.exports = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/test/set.ts b/packages/elastic-safer-lodash-set/test/set.ts deleted file mode 100644 index 9829ac3f04ce..000000000000 --- a/packages/elastic-safer-lodash-set/test/set.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { expectType } from 'tsd'; -import set from '../set'; - -const someObj: object = {}; -const anyValue: any = 'any value'; - -expectType(set(someObj, 'a.b.c', anyValue)); -expectType(set(someObj, ['a.b.c'], anyValue)); -expectType(set(someObj, ['a.b.c', 2, Symbol('hep')], anyValue)); diff --git a/packages/elastic-safer-lodash-set/test/setWith.ts b/packages/elastic-safer-lodash-set/test/setWith.ts deleted file mode 100644 index b3ed93443c4f..000000000000 --- a/packages/elastic-safer-lodash-set/test/setWith.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. - */ - -import { expectType } from 'tsd'; -import setWith from '../setWith'; - -const someObj: object = {}; -const anyValue: any = 'any value'; - -expectType( - setWith(someObj, 'a.b.c', anyValue, (value, key, obj) => { - expectType(value); - expectType(key); - expectType(obj); - }) -); -expectType( - setWith(someObj, ['a.b.c'], anyValue, (value, key, obj) => { - expectType(value); - expectType(key); - expectType(obj); - }) -); -expectType( - setWith(someObj, ['a.b.c', 2, Symbol('hep')], anyValue, (value, key, obj) => { - expectType(value); - expectType(key); - expectType(obj); - }) -); diff --git a/packages/elastic-datemath/.npmignore b/packages/opensearch-datemath/.npmignore similarity index 100% rename from packages/elastic-datemath/.npmignore rename to packages/opensearch-datemath/.npmignore diff --git a/packages/elastic-datemath/__tests__/index.js b/packages/opensearch-datemath/__tests__/index.js similarity index 100% rename from packages/elastic-datemath/__tests__/index.js rename to packages/opensearch-datemath/__tests__/index.js diff --git a/packages/elastic-datemath/index.d.ts b/packages/opensearch-datemath/index.d.ts similarity index 100% rename from packages/elastic-datemath/index.d.ts rename to packages/opensearch-datemath/index.d.ts diff --git a/packages/elastic-datemath/index.js b/packages/opensearch-datemath/index.js similarity index 98% rename from packages/elastic-datemath/index.js rename to packages/opensearch-datemath/index.js index 8a69d251d057..17e86d421009 100644 --- a/packages/elastic-datemath/index.js +++ b/packages/opensearch-datemath/index.js @@ -39,7 +39,7 @@ const isDate = (d) => Object.prototype.toString.call(d) === '[object Date]'; const isValidDate = (d) => isDate(d) && !isNaN(d.valueOf()); /* - * This is a simplified version of elasticsearch's date parser. + * This is a simplified version of opensearch's date parser. * If you pass in a momentjs instance as the third parameter the calculation * will be done using this (and its locale settings) instead of the one bundled * with this library. diff --git a/packages/elastic-datemath/package.json b/packages/opensearch-datemath/package.json similarity index 70% rename from packages/elastic-datemath/package.json rename to packages/opensearch-datemath/package.json index 04bb96206e47..4a534f9e2d9b 100644 --- a/packages/elastic-datemath/package.json +++ b/packages/opensearch-datemath/package.json @@ -1,7 +1,7 @@ { "name": "@elastic/datemath", "version": "5.0.3", - "description": "elasticsearch datemath parser, used in kibana", + "description": "opensearch datemath parser, used in OpenSearch Dashboards", "license": "Apache-2.0", "main": "index.js", "typings": "index.d.ts", diff --git a/packages/elastic-datemath/readme.md b/packages/opensearch-datemath/readme.md similarity index 100% rename from packages/elastic-datemath/readme.md rename to packages/opensearch-datemath/readme.md diff --git a/packages/elastic-datemath/tsconfig.json b/packages/opensearch-datemath/tsconfig.json similarity index 57% rename from packages/elastic-datemath/tsconfig.json rename to packages/opensearch-datemath/tsconfig.json index cbfe1e804743..7a65f4550061 100644 --- a/packages/elastic-datemath/tsconfig.json +++ b/packages/opensearch-datemath/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "tsBuildInfoFile": "../../build/tsbuildinfo/packages/elastic-datemath" + "tsBuildInfoFile": "../../build/tsbuildinfo/packages/opensearch-datemath" }, "include": [ "index.d.ts" ] -} +} \ No newline at end of file diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/opensearch-eslint-config-opensearch-dashboards/.eslintrc.js similarity index 100% rename from packages/elastic-eslint-config-kibana/.eslintrc.js rename to packages/opensearch-eslint-config-opensearch-dashboards/.eslintrc.js diff --git a/packages/elastic-eslint-config-kibana/.gitignore b/packages/opensearch-eslint-config-opensearch-dashboards/.gitignore similarity index 100% rename from packages/elastic-eslint-config-kibana/.gitignore rename to packages/opensearch-eslint-config-opensearch-dashboards/.gitignore diff --git a/packages/elastic-eslint-config-kibana/.npmignore b/packages/opensearch-eslint-config-opensearch-dashboards/.npmignore similarity index 100% rename from packages/elastic-eslint-config-kibana/.npmignore rename to packages/opensearch-eslint-config-opensearch-dashboards/.npmignore diff --git a/packages/elastic-eslint-config-kibana/README.md b/packages/opensearch-eslint-config-opensearch-dashboards/README.md similarity index 100% rename from packages/elastic-eslint-config-kibana/README.md rename to packages/opensearch-eslint-config-opensearch-dashboards/README.md diff --git a/packages/elastic-eslint-config-kibana/javascript.js b/packages/opensearch-eslint-config-opensearch-dashboards/javascript.js similarity index 64% rename from packages/elastic-eslint-config-kibana/javascript.js rename to packages/opensearch-eslint-config-opensearch-dashboards/javascript.js index febd139be220..969dd35dd571 100644 --- a/packages/elastic-eslint-config-kibana/javascript.js +++ b/packages/opensearch-eslint-config-opensearch-dashboards/javascript.js @@ -1,3 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + const RESTRICTED_GLOBALS = require('./restricted_globals'); const RESTRICTED_MODULES = { paths: ['gulp-util'] }; @@ -10,13 +29,7 @@ module.exports = { files: ['**/*.js'], parser: require.resolve('babel-eslint'), - plugins: [ - 'mocha', - 'babel', - 'import', - 'no-unsanitized', - 'prefer-object-spread', - ], + plugins: ['mocha', 'babel', 'import', 'no-unsanitized', 'prefer-object-spread'], settings: { 'import/resolver': { @@ -41,12 +54,12 @@ module.exports = { rules: { 'block-scoped-var': 'error', - camelcase: [ 'error', { properties: 'never', allow: ['^UNSAFE_'] } ], + camelcase: ['error', { properties: 'never', allow: ['^UNSAFE_'] }], 'consistent-return': 'off', - 'dot-notation': [ 'error', { allowKeywords: true } ], - eqeqeq: [ 'error', 'allow-null' ], + 'dot-notation': ['error', { allowKeywords: true }], + eqeqeq: ['error', 'allow-null'], 'guard-for-in': 'error', - 'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ], + 'new-cap': ['error', { capIsNewExceptions: ['Private'] }], 'no-bitwise': 'off', 'no-caller': 'error', 'no-cond-assign': 'off', @@ -77,20 +90,20 @@ module.exports = { 'no-unsanitized/method': 'error', 'no-unsanitized/property': 'error', 'no-unused-expressions': 'off', - 'no-unused-vars': [ 'error' ], - 'no-use-before-define': [ 'error', 'nofunc' ], + 'no-unused-vars': ['error'], + 'no-use-before-define': ['error', 'nofunc'], 'no-var': 'error', 'no-with': 'error', - 'one-var': [ 'error', 'never' ], + 'one-var': ['error', 'never'], 'prefer-const': 'error', - strict: [ 'error', 'never' ], + strict: ['error', 'never'], 'valid-typeof': 'error', yoda: 'off', 'mocha/handle-done-callback': 'error', 'mocha/no-exclusive-tests': 'error', - 'import/no-unresolved': [ 'error', { 'amd': true, 'commonjs': true } ], + 'import/no-unresolved': ['error', { amd: true, commonjs: true }], 'import/named': 'error', 'import/namespace': 'error', 'import/default': 'error', @@ -101,7 +114,7 @@ module.exports = { 'import/no-dynamic-require': 'error', 'prefer-object-spread/prefer-object-spread': 'error', - } + }, }, - ] + ], }; diff --git a/packages/opensearch-eslint-config-opensearch-dashboards/jest.js b/packages/opensearch-eslint-config-opensearch-dashboards/jest.js new file mode 100644 index 000000000000..e5f0e1c48413 --- /dev/null +++ b/packages/opensearch-eslint-config-opensearch-dashboards/jest.js @@ -0,0 +1,37 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +module.exports = { + overrides: [ + { + files: ['**/*.{test,test.mocks,mock}.{js,mjs,ts,tsx}', '**/__mocks__/**/*.{js,mjs,ts,tsx}'], + plugins: ['jest'], + + env: { + jest: true, + }, + + rules: { + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + 'import/order': 'off', + }, + }, + ], +}; diff --git a/packages/elastic-eslint-config-kibana/package.json b/packages/opensearch-eslint-config-opensearch-dashboards/package.json similarity index 100% rename from packages/elastic-eslint-config-kibana/package.json rename to packages/opensearch-eslint-config-opensearch-dashboards/package.json diff --git a/packages/elastic-eslint-config-kibana/react.js b/packages/opensearch-eslint-config-opensearch-dashboards/react.js similarity index 70% rename from packages/elastic-eslint-config-kibana/react.js rename to packages/opensearch-eslint-config-opensearch-dashboards/react.js index f0e05db4d3c6..f9b4fef17b27 100644 --- a/packages/elastic-eslint-config-kibana/react.js +++ b/packages/opensearch-eslint-config-opensearch-dashboards/react.js @@ -1,17 +1,32 @@ -const semver = require('semver') -const PKG = require('../../package.json') +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +const semver = require('semver'); +const PKG = require('../../package.json'); module.exports = { - plugins: [ - 'react', - 'react-hooks', - 'jsx-a11y', - ], + plugins: ['react', 'react-hooks', 'jsx-a11y'], parserOptions: { ecmaFeatures: { - jsx: true - } + jsx: true, + }, }, settings: { @@ -66,4 +81,4 @@ module.exports = { 'react/prefer-stateless-function': ['error', { ignorePureComponents: true }], 'react/no-unescaped-entities': 'error', }, -} +}; diff --git a/packages/elastic-eslint-config-kibana/restricted_globals.js b/packages/opensearch-eslint-config-opensearch-dashboards/restricted_globals.js similarity index 54% rename from packages/elastic-eslint-config-kibana/restricted_globals.js rename to packages/opensearch-eslint-config-opensearch-dashboards/restricted_globals.js index c14534d165be..aeb1bce46e60 100644 --- a/packages/elastic-eslint-config-kibana/restricted_globals.js +++ b/packages/opensearch-eslint-config-opensearch-dashboards/restricted_globals.js @@ -1,3 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + // copied from https://github.com/facebookincubator/create-react-app/blob/2e82ebb3371731a5c4e346f310848ddb23fd0976/packages/eslint-config-react-app/index.js#L24 module.exports = [ 'addEventListener', diff --git a/packages/elastic-eslint-config-kibana/typescript.js b/packages/opensearch-eslint-config-opensearch-dashboards/typescript.js similarity index 62% rename from packages/elastic-eslint-config-kibana/typescript.js rename to packages/opensearch-eslint-config-opensearch-dashboards/typescript.js index 00f2642c1b97..1a71d1c0d9bd 100644 --- a/packages/elastic-eslint-config-kibana/typescript.js +++ b/packages/opensearch-eslint-config-opensearch-dashboards/typescript.js @@ -1,3 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + // NOTE: This is the configuration to apply the typescript eslint parser // in order to lint typescript files with eslint. // Some IDEs could not be running eslint with the correct extensions yet @@ -6,7 +25,8 @@ const semver = require('semver'); const PKG = require('../../package.json'); -const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; +const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint') + .rules; // The current implementation excluded all the variables matching the regexp. // We should remove it as soon as multiple underscores are supported by the linter. @@ -19,13 +39,7 @@ module.exports = { files: ['**/*.{ts,tsx}'], parser: '@typescript-eslint/parser', - plugins: [ - '@typescript-eslint', - 'ban', - 'import', - 'prefer-object-spread', - 'eslint-comments' - ], + plugins: ['@typescript-eslint', 'ban', 'import', 'prefer-object-spread', 'eslint-comments'], settings: { 'import/resolver': { @@ -50,7 +64,7 @@ module.exports = { ecmaVersion: 6, ecmaFeatures: { experimentalObjectRestSpread: true, - jsx: true + jsx: true, }, // NOTE: That is to avoid a known performance issue related with the `ts.Program` used by // typescript eslint. As we are not using rules that need types information, we can safely @@ -59,7 +73,7 @@ module.exports = { // https://github.com/typescript-eslint/typescript-eslint/issues/389 // https://github.com/typescript-eslint/typescript-eslint/issues/243 // https://github.com/typescript-eslint/typescript-eslint/pull/361 - project: undefined + project: undefined, }, // NOTE: we can't override the extends option here to apply @@ -69,39 +83,45 @@ module.exports = { // // For now we are using an workaround to create // those extended rules arrays - rules: Object.assign( - { + rules: { + ...{ // Most of the ports were done according // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md // // Old recommended tslint rules '@typescript-eslint/adjacent-overload-signatures': 'error', - '@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }], - '@typescript-eslint/ban-types': ['error', { - types: { - SFC: { - message: 'Use FC or FunctionComponent instead.', - fixWith: 'FC' - }, - 'React.SFC': { - message: 'Use FC or FunctionComponent instead.', - fixWith: 'React.FC' - }, - StatelessComponent: { - message: 'Use FunctionComponent instead.', - fixWith: 'FunctionComponent' - }, - 'React.StatelessComponent': { - message: 'Use FunctionComponent instead.', - fixWith: 'React.FunctionComponent' + '@typescript-eslint/array-type': [ + 'error', + { default: 'array-simple', readonly: 'array-simple' }, + ], + '@typescript-eslint/ban-types': [ + 'error', + { + types: { + SFC: { + message: 'Use FC or FunctionComponent instead.', + fixWith: 'FC', + }, + 'React.SFC': { + message: 'Use FC or FunctionComponent instead.', + fixWith: 'React.FC', + }, + StatelessComponent: { + message: 'Use FunctionComponent instead.', + fixWith: 'FunctionComponent', + }, + 'React.StatelessComponent': { + message: 'Use FunctionComponent instead.', + fixWith: 'React.FunctionComponent', + }, + // used in the codebase in the wild + '{}': false, + object: false, + Function: false, }, - // used in the codebase in the wild - '{}': false, - 'object': false, - 'Function': false, - } - }], - 'camelcase': 'off', + }, + ], + camelcase: 'off', '@typescript-eslint/naming-convention': [ 'error', { @@ -109,8 +129,8 @@ module.exports = { format: ['camelCase'], filter: { regex: allowedNameRegexp, - match: false - } + match: false, + }, }, { selector: 'variable', @@ -121,19 +141,16 @@ module.exports = { ], filter: { regex: allowedNameRegexp, - match: false - } + match: false, + }, }, { selector: 'parameter', - format: [ - 'camelCase', - 'PascalCase', - ], + format: ['camelCase', 'PascalCase'], filter: { regex: allowedNameRegexp, - match: false - } + match: false, + }, }, { selector: 'memberLike', @@ -141,23 +158,23 @@ module.exports = { 'camelCase', 'PascalCase', 'snake_case', // keys in elasticsearch requests / responses - 'UPPER_CASE' + 'UPPER_CASE', ], filter: { regex: allowedNameRegexp, - match: false - } + match: false, + }, }, { selector: 'function', format: [ 'camelCase', - 'PascalCase' // React.FunctionComponent = + 'PascalCase', // React.FunctionComponent = ], filter: { regex: allowedNameRegexp, - match: false - } + match: false, + }, }, { selector: 'typeLike', @@ -170,44 +187,50 @@ module.exports = { format: ['PascalCase', 'UPPER_CASE', 'camelCase'], }, ], - '@typescript-eslint/explicit-member-accessibility': ['error', + '@typescript-eslint/explicit-member-accessibility': [ + 'error', { accessibility: 'off', overrides: { accessors: 'explicit', constructors: 'no-public', - parameterProperties: 'explicit' - } - } + parameterProperties: 'explicit', + }, + }, ], '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], - '@typescript-eslint/member-ordering': ['error', { - 'default': ['public-static-field', 'static-field', 'instance-field'] - }], + '@typescript-eslint/member-ordering': [ + 'error', + { + default: ['public-static-field', 'static-field', 'instance-field'], + }, + ], '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-extra-non-null-assertion': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-namespace': 'error', - '@typescript-eslint/triple-slash-reference': ['error', { - path: 'never', - types: 'never', - lib: 'never' - }], + '@typescript-eslint/triple-slash-reference': [ + 'error', + { + path: 'never', + types: 'never', + lib: 'never', + }, + ], '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/unified-signatures': 'error', 'constructor-super': 'error', 'dot-notation': 'error', - 'eqeqeq': ['error', 'always', {'null': 'ignore'}], + eqeqeq: ['error', 'always', { null: 'ignore' }], 'guard-for-in': 'error', - 'import/order': ['error', { - 'groups': [ - ['external', 'builtin'], - 'internal', - ['parent', 'sibling', 'index'], - ], - }], + 'import/order': [ + 'error', + { + groups: [['external', 'builtin'], 'internal', ['parent', 'sibling', 'index']], + }, + ], 'max-classes-per-file': ['error', 1], 'no-bitwise': 'error', 'no-caller': 'error', @@ -229,30 +252,33 @@ module.exports = { 'no-unused-labels': 'error', 'no-var': 'error', 'object-shorthand': 'error', - 'one-var': [ 'error', 'never' ], + 'one-var': ['error', 'never'], 'prefer-const': 'error', 'prefer-rest-params': 'error', - 'radix': 'error', - 'spaced-comment': ["error", "always", { - "exceptions": ["/"] - }], + radix: 'error', + 'spaced-comment': [ + 'error', + 'always', + { + exceptions: ['/'], + }, + ], 'use-isnan': 'error', // Old tslint yml override or defined rules 'ban/ban': [ 2, - {'name': ['describe', 'only'], 'message': 'No exclusive suites.'}, - {'name': ['it', 'only'], 'message': 'No exclusive tests.'}, - {'name': ['test', 'only'], 'message': 'No exclusive tests.'}, - + { name: ['describe', 'only'], message: 'No exclusive suites.' }, + { name: ['it', 'only'], message: 'No exclusive tests.' }, + { name: ['test', 'only'], message: 'No exclusive tests.' }, ], 'import/no-default-export': 'error', 'eslint-comments/no-unused-disable': 'error', - 'eslint-comments/no-unused-enable': 'error' + 'eslint-comments/no-unused-enable': 'error', }, - eslintConfigPrettierTypescriptEslintRules - ) + ...eslintConfigPrettierTypescriptEslintRules, + }, }, - ] + ], }; diff --git a/packages/elastic-safer-lodash-set/.gitignore b/packages/opensearch-safer-lodash-set/.gitignore similarity index 100% rename from packages/elastic-safer-lodash-set/.gitignore rename to packages/opensearch-safer-lodash-set/.gitignore diff --git a/packages/elastic-safer-lodash-set/.npmignore b/packages/opensearch-safer-lodash-set/.npmignore similarity index 100% rename from packages/elastic-safer-lodash-set/.npmignore rename to packages/opensearch-safer-lodash-set/.npmignore diff --git a/packages/elastic-safer-lodash-set/LICENSE b/packages/opensearch-safer-lodash-set/LICENSE similarity index 100% rename from packages/elastic-safer-lodash-set/LICENSE rename to packages/opensearch-safer-lodash-set/LICENSE diff --git a/packages/elastic-safer-lodash-set/README.md b/packages/opensearch-safer-lodash-set/README.md similarity index 100% rename from packages/elastic-safer-lodash-set/README.md rename to packages/opensearch-safer-lodash-set/README.md diff --git a/packages/opensearch-safer-lodash-set/fp/assoc.d.ts b/packages/opensearch-safer-lodash-set/fp/assoc.d.ts new file mode 100644 index 000000000000..405135ac18c7 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/assoc.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { assoc } from './index'; +export = assoc; diff --git a/packages/opensearch-safer-lodash-set/fp/assoc.js b/packages/opensearch-safer-lodash-set/fp/assoc.js new file mode 100644 index 000000000000..a19b80cce276 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/assoc.js @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +module.exports = require('./set'); diff --git a/packages/opensearch-safer-lodash-set/fp/assocPath.d.ts b/packages/opensearch-safer-lodash-set/fp/assocPath.d.ts new file mode 100644 index 000000000000..641b2fab7ae3 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/assocPath.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { assocPath } from './index'; +export = assocPath; diff --git a/packages/opensearch-safer-lodash-set/fp/assocPath.js b/packages/opensearch-safer-lodash-set/fp/assocPath.js new file mode 100644 index 000000000000..a19b80cce276 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/assocPath.js @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/index.d.ts b/packages/opensearch-safer-lodash-set/fp/index.d.ts similarity index 91% rename from packages/elastic-safer-lodash-set/fp/index.d.ts rename to packages/opensearch-safer-lodash-set/fp/index.d.ts index fcd7ff01e3cc..c43a227bc11f 100644 --- a/packages/elastic-safer-lodash-set/fp/index.d.ts +++ b/packages/opensearch-safer-lodash-set/fp/index.d.ts @@ -1,8 +1,20 @@ /* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import lodash = require('lodash'); diff --git a/packages/opensearch-safer-lodash-set/fp/index.js b/packages/opensearch-safer-lodash-set/fp/index.js new file mode 100644 index 000000000000..a733adf99ff6 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/index.js @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +exports.set = exports.assoc = exports.assocPath = require('./set'); +exports.setWith = require('./setWith'); diff --git a/packages/opensearch-safer-lodash-set/fp/set.d.ts b/packages/opensearch-safer-lodash-set/fp/set.d.ts new file mode 100644 index 000000000000..195a9603a299 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/set.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { set } from './index'; +export = set; diff --git a/packages/opensearch-safer-lodash-set/fp/set.js b/packages/opensearch-safer-lodash-set/fp/set.js new file mode 100644 index 000000000000..fda28f38aeee --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/set.js @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +/*eslint no-var:0 */ +var convert = require('lodash/fp/convert'); +var func = convert('set', require('../set')); + +func.placeholder = require('lodash/fp/placeholder'); +module.exports = func; diff --git a/packages/opensearch-safer-lodash-set/fp/setWith.d.ts b/packages/opensearch-safer-lodash-set/fp/setWith.d.ts new file mode 100644 index 000000000000..d003869ec931 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/setWith.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { setWith } from './index'; +export = setWith; diff --git a/packages/opensearch-safer-lodash-set/fp/setWith.js b/packages/opensearch-safer-lodash-set/fp/setWith.js new file mode 100644 index 000000000000..f2fe56e52f46 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/fp/setWith.js @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +/*eslint no-var:0 */ +var convert = require('lodash/fp/convert'); +var func = convert('setWith', require('../setWith')); + +func.placeholder = require('lodash/fp/placeholder'); +module.exports = func; diff --git a/packages/elastic-safer-lodash-set/index.d.ts b/packages/opensearch-safer-lodash-set/index.d.ts similarity index 71% rename from packages/elastic-safer-lodash-set/index.d.ts rename to packages/opensearch-safer-lodash-set/index.d.ts index aaff01f11a7a..ba54e553de37 100644 --- a/packages/elastic-safer-lodash-set/index.d.ts +++ b/packages/opensearch-safer-lodash-set/index.d.ts @@ -1,8 +1,20 @@ /* - * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ export = SaferLodashSet; diff --git a/packages/opensearch-safer-lodash-set/index.js b/packages/opensearch-safer-lodash-set/index.js new file mode 100644 index 000000000000..caff7e2e7416 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/index.js @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +exports.set = require('./lodash/set'); +exports.setWith = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/lodash/_baseSet.js b/packages/opensearch-safer-lodash-set/lodash/_baseSet.js similarity index 66% rename from packages/elastic-safer-lodash-set/lodash/_baseSet.js rename to packages/opensearch-safer-lodash-set/lodash/_baseSet.js index 9cbf19808edd..0016534e3589 100644 --- a/packages/elastic-safer-lodash-set/lodash/_baseSet.js +++ b/packages/opensearch-safer-lodash-set/lodash/_baseSet.js @@ -1,8 +1,20 @@ /* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ /* eslint-disable */ diff --git a/packages/elastic-safer-lodash-set/lodash/set.js b/packages/opensearch-safer-lodash-set/lodash/set.js similarity index 55% rename from packages/elastic-safer-lodash-set/lodash/set.js rename to packages/opensearch-safer-lodash-set/lodash/set.js index 740f7c926ee4..45f5d26892fa 100644 --- a/packages/elastic-safer-lodash-set/lodash/set.js +++ b/packages/opensearch-safer-lodash-set/lodash/set.js @@ -1,8 +1,20 @@ /* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ /* eslint-disable */ diff --git a/packages/elastic-safer-lodash-set/lodash/setWith.js b/packages/opensearch-safer-lodash-set/lodash/setWith.js similarity index 57% rename from packages/elastic-safer-lodash-set/lodash/setWith.js rename to packages/opensearch-safer-lodash-set/lodash/setWith.js index 0ac4f4c9cf39..dfd35aecb877 100644 --- a/packages/elastic-safer-lodash-set/lodash/setWith.js +++ b/packages/opensearch-safer-lodash-set/lodash/setWith.js @@ -1,8 +1,20 @@ /* - * This file is forked from the lodash project (https://lodash.com/), - * and may include modifications made by Elasticsearch B.V. - * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ /* eslint-disable */ diff --git a/packages/elastic-safer-lodash-set/package.json b/packages/opensearch-safer-lodash-set/package.json similarity index 100% rename from packages/elastic-safer-lodash-set/package.json rename to packages/opensearch-safer-lodash-set/package.json diff --git a/packages/elastic-safer-lodash-set/scripts/_get_lodash.sh b/packages/opensearch-safer-lodash-set/scripts/_get_lodash.sh similarity index 100% rename from packages/elastic-safer-lodash-set/scripts/_get_lodash.sh rename to packages/opensearch-safer-lodash-set/scripts/_get_lodash.sh diff --git a/packages/elastic-safer-lodash-set/scripts/license-header.txt b/packages/opensearch-safer-lodash-set/scripts/license-header.txt similarity index 100% rename from packages/elastic-safer-lodash-set/scripts/license-header.txt rename to packages/opensearch-safer-lodash-set/scripts/license-header.txt diff --git a/packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch b/packages/opensearch-safer-lodash-set/scripts/patches/_baseSet.js.patch similarity index 100% rename from packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch rename to packages/opensearch-safer-lodash-set/scripts/patches/_baseSet.js.patch diff --git a/packages/elastic-safer-lodash-set/scripts/save_state.sh b/packages/opensearch-safer-lodash-set/scripts/save_state.sh similarity index 100% rename from packages/elastic-safer-lodash-set/scripts/save_state.sh rename to packages/opensearch-safer-lodash-set/scripts/save_state.sh diff --git a/packages/elastic-safer-lodash-set/scripts/update.sh b/packages/opensearch-safer-lodash-set/scripts/update.sh similarity index 100% rename from packages/elastic-safer-lodash-set/scripts/update.sh rename to packages/opensearch-safer-lodash-set/scripts/update.sh diff --git a/packages/opensearch-safer-lodash-set/set.d.ts b/packages/opensearch-safer-lodash-set/set.d.ts new file mode 100644 index 000000000000..195a9603a299 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/set.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { set } from './index'; +export = set; diff --git a/packages/opensearch-safer-lodash-set/set.js b/packages/opensearch-safer-lodash-set/set.js new file mode 100644 index 000000000000..54ccf3ffc385 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/set.js @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +module.exports = require('./lodash/set'); diff --git a/packages/opensearch-safer-lodash-set/setWith.d.ts b/packages/opensearch-safer-lodash-set/setWith.d.ts new file mode 100644 index 000000000000..d003869ec931 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/setWith.d.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { setWith } from './index'; +export = setWith; diff --git a/packages/opensearch-safer-lodash-set/setWith.js b/packages/opensearch-safer-lodash-set/setWith.js new file mode 100644 index 000000000000..c6033164e87c --- /dev/null +++ b/packages/opensearch-safer-lodash-set/setWith.js @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +module.exports = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/test/fp.ts b/packages/opensearch-safer-lodash-set/test/fp.ts similarity index 84% rename from packages/elastic-safer-lodash-set/test/fp.ts rename to packages/opensearch-safer-lodash-set/test/fp.ts index 7a1d6601b5e2..664cbc298ba8 100644 --- a/packages/elastic-safer-lodash-set/test/fp.ts +++ b/packages/opensearch-safer-lodash-set/test/fp.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assoc.ts b/packages/opensearch-safer-lodash-set/test/fp_assoc.ts similarity index 52% rename from packages/elastic-safer-lodash-set/test/fp_assoc.ts rename to packages/opensearch-safer-lodash-set/test/fp_assoc.ts index 8244458cd118..7a8ca465cde4 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assoc.ts +++ b/packages/opensearch-safer-lodash-set/test/fp_assoc.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts b/packages/opensearch-safer-lodash-set/test/fp_assocPath.ts similarity index 54% rename from packages/elastic-safer-lodash-set/test/fp_assocPath.ts rename to packages/opensearch-safer-lodash-set/test/fp_assocPath.ts index abbfa57eeb96..0ad5cfe18f6f 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts +++ b/packages/opensearch-safer-lodash-set/test/fp_assocPath.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_patch_test.js b/packages/opensearch-safer-lodash-set/test/fp_patch_test.js similarity index 92% rename from packages/elastic-safer-lodash-set/test/fp_patch_test.js rename to packages/opensearch-safer-lodash-set/test/fp_patch_test.js index 362ecf6f9d86..4a8f1a516279 100644 --- a/packages/elastic-safer-lodash-set/test/fp_patch_test.js +++ b/packages/opensearch-safer-lodash-set/test/fp_patch_test.js @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ const test = require('tape'); diff --git a/packages/elastic-safer-lodash-set/test/fp_set.ts b/packages/opensearch-safer-lodash-set/test/fp_set.ts similarity index 52% rename from packages/elastic-safer-lodash-set/test/fp_set.ts rename to packages/opensearch-safer-lodash-set/test/fp_set.ts index a5dbb24d33a0..34e2d6e6f0d4 100644 --- a/packages/elastic-safer-lodash-set/test/fp_set.ts +++ b/packages/opensearch-safer-lodash-set/test/fp_set.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_setWith.ts b/packages/opensearch-safer-lodash-set/test/fp_setWith.ts similarity index 70% rename from packages/elastic-safer-lodash-set/test/fp_setWith.ts rename to packages/opensearch-safer-lodash-set/test/fp_setWith.ts index 70a5197f7217..6386bef5ba49 100644 --- a/packages/elastic-safer-lodash-set/test/fp_setWith.ts +++ b/packages/opensearch-safer-lodash-set/test/fp_setWith.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/index.ts b/packages/opensearch-safer-lodash-set/test/index.ts similarity index 52% rename from packages/elastic-safer-lodash-set/test/index.ts rename to packages/opensearch-safer-lodash-set/test/index.ts index 2090c1adcfce..02bb54daa017 100644 --- a/packages/elastic-safer-lodash-set/test/index.ts +++ b/packages/opensearch-safer-lodash-set/test/index.ts @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/patch_test.js b/packages/opensearch-safer-lodash-set/test/patch_test.js similarity index 86% rename from packages/elastic-safer-lodash-set/test/patch_test.js rename to packages/opensearch-safer-lodash-set/test/patch_test.js index 03dfe260009e..23d3af2f94e0 100644 --- a/packages/elastic-safer-lodash-set/test/patch_test.js +++ b/packages/opensearch-safer-lodash-set/test/patch_test.js @@ -1,6 +1,20 @@ /* - * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. */ const test = require('tape'); diff --git a/packages/opensearch-safer-lodash-set/test/set.ts b/packages/opensearch-safer-lodash-set/test/set.ts new file mode 100644 index 000000000000..7e9a68b0f257 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/test/set.ts @@ -0,0 +1,28 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { expectType } from 'tsd'; +import set from '../set'; + +const someObj: object = {}; +const anyValue: any = 'any value'; + +expectType(set(someObj, 'a.b.c', anyValue)); +expectType(set(someObj, ['a.b.c'], anyValue)); +expectType(set(someObj, ['a.b.c', 2, Symbol('hep')], anyValue)); diff --git a/packages/opensearch-safer-lodash-set/test/setWith.ts b/packages/opensearch-safer-lodash-set/test/setWith.ts new file mode 100644 index 000000000000..577a9d5c8ec8 --- /dev/null +++ b/packages/opensearch-safer-lodash-set/test/setWith.ts @@ -0,0 +1,46 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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. + */ + +import { expectType } from 'tsd'; +import setWith from '../setWith'; + +const someObj: object = {}; +const anyValue: any = 'any value'; + +expectType( + setWith(someObj, 'a.b.c', anyValue, (value, key, obj) => { + expectType(value); + expectType(key); + expectType(obj); + }) +); +expectType( + setWith(someObj, ['a.b.c'], anyValue, (value, key, obj) => { + expectType(value); + expectType(key); + expectType(obj); + }) +); +expectType( + setWith(someObj, ['a.b.c', 2, Symbol('hep')], anyValue, (value, key, obj) => { + expectType(value); + expectType(key); + expectType(obj); + }) +); diff --git a/packages/elastic-safer-lodash-set/tsconfig.json b/packages/opensearch-safer-lodash-set/tsconfig.json similarity index 100% rename from packages/elastic-safer-lodash-set/tsconfig.json rename to packages/opensearch-safer-lodash-set/tsconfig.json diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index c83af34ed01e..3552caa6e195 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -56,7 +56,7 @@ export const IGNORE_FILE_GLOBS = [ 'api-documenter.json', // filename must match upstream filenames from lodash - 'packages/elastic-safer-lodash-set/**/*', + 'packages/opensearch-safer-lodash-set/**/*', // TODO fix file names in APM to remove these