@opensumi/ide-core-common 2.12.1-next-079c1930
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/application-error.d.ts +36 -0
- package/lib/application-error.d.ts.map +1 -0
- package/lib/application-error.js +64 -0
- package/lib/application-error.js.map +1 -0
- package/lib/application-props.d.ts +26 -0
- package/lib/application-props.d.ts.map +1 -0
- package/lib/application-props.js +3 -0
- package/lib/application-props.js.map +1 -0
- package/lib/arrays.d.ts +131 -0
- package/lib/arrays.d.ts.map +1 -0
- package/lib/arrays.js +533 -0
- package/lib/arrays.js.map +1 -0
- package/lib/async.d.ts +165 -0
- package/lib/async.d.ts.map +1 -0
- package/lib/async.js +417 -0
- package/lib/async.js.map +1 -0
- package/lib/browser-fs/ensure-dir.d.ts +7 -0
- package/lib/browser-fs/ensure-dir.d.ts.map +1 -0
- package/lib/browser-fs/ensure-dir.js +40 -0
- package/lib/browser-fs/ensure-dir.js.map +1 -0
- package/lib/browser-fs/util.d.ts +18 -0
- package/lib/browser-fs/util.d.ts.map +1 -0
- package/lib/browser-fs/util.js +21 -0
- package/lib/browser-fs/util.js.map +1 -0
- package/lib/cache.d.ts +12 -0
- package/lib/cache.d.ts.map +1 -0
- package/lib/cache.js +36 -0
- package/lib/cache.js.map +1 -0
- package/lib/cancellation.d.ts +23 -0
- package/lib/cancellation.d.ts.map +1 -0
- package/lib/cancellation.js +116 -0
- package/lib/cancellation.js.map +1 -0
- package/lib/charCode.d.ts +406 -0
- package/lib/charCode.d.ts.map +1 -0
- package/lib/charCode.js +8 -0
- package/lib/charCode.js.map +1 -0
- package/lib/character-classifier.d.ts +25 -0
- package/lib/character-classifier.d.ts.map +1 -0
- package/lib/character-classifier.js +58 -0
- package/lib/character-classifier.js.map +1 -0
- package/lib/command.d.ts +350 -0
- package/lib/command.d.ts.map +1 -0
- package/lib/command.js +408 -0
- package/lib/command.js.map +1 -0
- package/lib/connection.d.ts +8 -0
- package/lib/connection.d.ts.map +1 -0
- package/lib/connection.js +17 -0
- package/lib/connection.js.map +1 -0
- package/lib/const/application.d.ts +3 -0
- package/lib/const/application.d.ts.map +1 -0
- package/lib/const/application.js +6 -0
- package/lib/const/application.js.map +1 -0
- package/lib/const/encodings.d.ts +10 -0
- package/lib/const/encodings.d.ts.map +1 -0
- package/lib/const/encodings.js +244 -0
- package/lib/const/encodings.js.map +1 -0
- package/lib/const/index.d.ts +2 -0
- package/lib/const/index.d.ts.map +1 -0
- package/lib/const/index.js +5 -0
- package/lib/const/index.js.map +1 -0
- package/lib/contribution-provider.d.ts +38 -0
- package/lib/contribution-provider.d.ts.map +1 -0
- package/lib/contribution-provider.js +60 -0
- package/lib/contribution-provider.js.map +1 -0
- package/lib/credential.d.ts +21 -0
- package/lib/credential.d.ts.map +1 -0
- package/lib/credential.js +6 -0
- package/lib/credential.js.map +1 -0
- package/lib/cryptr.d.ts +7 -0
- package/lib/cryptr.d.ts.map +1 -0
- package/lib/cryptr.js +6 -0
- package/lib/cryptr.js.map +1 -0
- package/lib/date.d.ts +2 -0
- package/lib/date.d.ts.map +1 -0
- package/lib/date.js +16 -0
- package/lib/date.js.map +1 -0
- package/lib/declare.d.ts +3 -0
- package/lib/declare.d.ts.map +1 -0
- package/lib/declare.js +3 -0
- package/lib/declare.js.map +1 -0
- package/lib/di-helper/domain-helper.d.ts +14 -0
- package/lib/di-helper/domain-helper.d.ts.map +1 -0
- package/lib/di-helper/domain-helper.js +48 -0
- package/lib/di-helper/domain-helper.js.map +1 -0
- package/lib/di-helper/index.d.ts +2 -0
- package/lib/di-helper/index.d.ts.map +1 -0
- package/lib/di-helper/index.js +5 -0
- package/lib/di-helper/index.js.map +1 -0
- package/lib/disposable.d.ts +88 -0
- package/lib/disposable.d.ts.map +1 -0
- package/lib/disposable.js +309 -0
- package/lib/disposable.js.map +1 -0
- package/lib/electron.d.ts +118 -0
- package/lib/electron.d.ts.map +1 -0
- package/lib/electron.js +7 -0
- package/lib/electron.js.map +1 -0
- package/lib/encoding/index.d.ts +34 -0
- package/lib/encoding/index.d.ts.map +1 -0
- package/lib/encoding/index.js +219 -0
- package/lib/encoding/index.js.map +1 -0
- package/lib/env.d.ts +2 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +5 -0
- package/lib/env.js.map +1 -0
- package/lib/errors.d.ts +60 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +148 -0
- package/lib/errors.js.map +1 -0
- package/lib/event-bus/basic-event.d.ts +5 -0
- package/lib/event-bus/basic-event.d.ts.map +1 -0
- package/lib/event-bus/basic-event.js +10 -0
- package/lib/event-bus/basic-event.js.map +1 -0
- package/lib/event-bus/event-bus-types.d.ts +66 -0
- package/lib/event-bus/event-bus-types.d.ts.map +1 -0
- package/lib/event-bus/event-bus-types.js +5 -0
- package/lib/event-bus/event-bus-types.js.map +1 -0
- package/lib/event-bus/event-bus.d.ts +13 -0
- package/lib/event-bus/event-bus.d.ts.map +1 -0
- package/lib/event-bus/event-bus.js +55 -0
- package/lib/event-bus/event-bus.js.map +1 -0
- package/lib/event-bus/event-decorator.d.ts +10 -0
- package/lib/event-bus/event-decorator.d.ts.map +1 -0
- package/lib/event-bus/event-decorator.js +34 -0
- package/lib/event-bus/event-decorator.js.map +1 -0
- package/lib/event-bus/index.d.ts +5 -0
- package/lib/event-bus/index.d.ts.map +1 -0
- package/lib/event-bus/index.js +8 -0
- package/lib/event-bus/index.js.map +1 -0
- package/lib/event.d.ts +270 -0
- package/lib/event.d.ts.map +1 -0
- package/lib/event.js +810 -0
- package/lib/event.js.map +1 -0
- package/lib/filters.d.ts +51 -0
- package/lib/filters.d.ts.map +1 -0
- package/lib/filters.js +688 -0
- package/lib/filters.js.map +1 -0
- package/lib/functional.d.ts +4 -0
- package/lib/functional.d.ts.map +1 -0
- package/lib/functional.js +45 -0
- package/lib/functional.js.map +1 -0
- package/lib/hash-calculate/WASMInterface.d.ts +61 -0
- package/lib/hash-calculate/WASMInterface.d.ts.map +1 -0
- package/lib/hash-calculate/WASMInterface.js +180 -0
- package/lib/hash-calculate/WASMInterface.js.map +1 -0
- package/lib/hash-calculate/hash-calculate.d.ts +13 -0
- package/lib/hash-calculate/hash-calculate.d.ts.map +1 -0
- package/lib/hash-calculate/hash-calculate.js +41 -0
- package/lib/hash-calculate/hash-calculate.js.map +1 -0
- package/lib/hash-calculate/lockedCreate.d.ts +4 -0
- package/lib/hash-calculate/lockedCreate.d.ts.map +1 -0
- package/lib/hash-calculate/lockedCreate.js +17 -0
- package/lib/hash-calculate/lockedCreate.js.map +1 -0
- package/lib/hash-calculate/md5.wasm.json +1 -0
- package/lib/hash-calculate/mutex.d.ts +6 -0
- package/lib/hash-calculate/mutex.d.ts.map +1 -0
- package/lib/hash-calculate/mutex.js +32 -0
- package/lib/hash-calculate/mutex.js.map +1 -0
- package/lib/hash-calculate/util.d.ts +12 -0
- package/lib/hash-calculate/util.d.ts.map +1 -0
- package/lib/hash-calculate/util.js +166 -0
- package/lib/hash-calculate/util.js.map +1 -0
- package/lib/id-generator.d.ts +8 -0
- package/lib/id-generator.d.ts.map +1 -0
- package/lib/id-generator.js +15 -0
- package/lib/id-generator.js.map +1 -0
- package/lib/index.d.ts +47 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +50 -0
- package/lib/index.js.map +1 -0
- package/lib/iterator.d.ts +14 -0
- package/lib/iterator.d.ts.map +1 -0
- package/lib/iterator.js +9 -0
- package/lib/iterator.js.map +1 -0
- package/lib/json-schema.d.ts +65 -0
- package/lib/json-schema.d.ts.map +1 -0
- package/lib/json-schema.js +3 -0
- package/lib/json-schema.js.map +1 -0
- package/lib/keyboard/index.d.ts +3 -0
- package/lib/keyboard/index.d.ts.map +1 -0
- package/lib/keyboard/index.js +6 -0
- package/lib/keyboard/index.js.map +1 -0
- package/lib/keyboard/keyboard-layout-provider.d.ts +38 -0
- package/lib/keyboard/keyboard-layout-provider.d.ts.map +1 -0
- package/lib/keyboard/keyboard-layout-provider.js +23 -0
- package/lib/keyboard/keyboard-layout-provider.js.map +1 -0
- package/lib/keyboard/keymap.d.ts +71 -0
- package/lib/keyboard/keymap.d.ts.map +1 -0
- package/lib/keyboard/keymap.js +128 -0
- package/lib/keyboard/keymap.js.map +1 -0
- package/lib/lifecycle.d.ts +17 -0
- package/lib/lifecycle.d.ts.map +1 -0
- package/lib/lifecycle.js +37 -0
- package/lib/lifecycle.js.map +1 -0
- package/lib/line-text.d.ts +17 -0
- package/lib/line-text.d.ts.map +1 -0
- package/lib/line-text.js +72 -0
- package/lib/line-text.js.map +1 -0
- package/lib/linked-list.d.ts +18 -0
- package/lib/linked-list.d.ts.map +1 -0
- package/lib/linked-list.js +138 -0
- package/lib/linked-list.js.map +1 -0
- package/lib/linkedText.d.ts +13 -0
- package/lib/linkedText.d.ts.map +1 -0
- package/lib/linkedText.js +50 -0
- package/lib/linkedText.js.map +1 -0
- package/lib/localize.d.ts +52 -0
- package/lib/localize.d.ts.map +1 -0
- package/lib/localize.js +128 -0
- package/lib/localize.js.map +1 -0
- package/lib/log.d.ts +181 -0
- package/lib/log.d.ts.map +1 -0
- package/lib/log.js +163 -0
- package/lib/log.js.map +1 -0
- package/lib/map.d.ts +124 -0
- package/lib/map.d.ts.map +1 -0
- package/lib/map.js +819 -0
- package/lib/map.js.map +1 -0
- package/lib/menu.d.ts +27 -0
- package/lib/menu.d.ts.map +1 -0
- package/lib/menu.js +5 -0
- package/lib/menu.js.map +1 -0
- package/lib/mocks/electron/browserMock.d.ts +2 -0
- package/lib/mocks/electron/browserMock.d.ts.map +1 -0
- package/lib/mocks/electron/browserMock.js +15 -0
- package/lib/mocks/electron/browserMock.js.map +1 -0
- package/lib/mocks/electron/ipcRenderer.d.ts +13 -0
- package/lib/mocks/electron/ipcRenderer.d.ts.map +1 -0
- package/lib/mocks/electron/ipcRenderer.js +32 -0
- package/lib/mocks/electron/ipcRenderer.js.map +1 -0
- package/lib/module.d.ts +23 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +22 -0
- package/lib/module.js.map +1 -0
- package/lib/network.d.ts +33 -0
- package/lib/network.d.ts.map +1 -0
- package/lib/network.js +37 -0
- package/lib/network.js.map +1 -0
- package/lib/node/port.d.ts +14 -0
- package/lib/node/port.d.ts.map +1 -0
- package/lib/node/port.js +124 -0
- package/lib/node/port.js.map +1 -0
- package/lib/path.d.ts +92 -0
- package/lib/path.d.ts.map +1 -0
- package/lib/path.js +1711 -0
- package/lib/path.js.map +1 -0
- package/lib/platform.d.ts +48 -0
- package/lib/platform.d.ts.map +1 -0
- package/lib/platform.js +143 -0
- package/lib/platform.js.map +1 -0
- package/lib/preferences/index.d.ts +3 -0
- package/lib/preferences/index.d.ts.map +1 -0
- package/lib/preferences/index.js +6 -0
- package/lib/preferences/index.js.map +1 -0
- package/lib/preferences/preference-schema.d.ts +76 -0
- package/lib/preferences/preference-schema.d.ts.map +1 -0
- package/lib/preferences/preference-schema.js +59 -0
- package/lib/preferences/preference-schema.js.map +1 -0
- package/lib/preferences/preference-scope.d.ts +15 -0
- package/lib/preferences/preference-scope.d.ts.map +1 -0
- package/lib/preferences/preference-scope.js +54 -0
- package/lib/preferences/preference-scope.js.map +1 -0
- package/lib/problem-matcher.d.ts +111 -0
- package/lib/problem-matcher.d.ts.map +1 -0
- package/lib/problem-matcher.js +294 -0
- package/lib/problem-matcher.js.map +1 -0
- package/lib/problem-pattern.d.ts +193 -0
- package/lib/problem-pattern.d.ts.map +1 -0
- package/lib/problem-pattern.js +416 -0
- package/lib/problem-pattern.js.map +1 -0
- package/lib/process.d.ts +5 -0
- package/lib/process.d.ts.map +1 -0
- package/lib/process.js +15 -0
- package/lib/process.js.map +1 -0
- package/lib/progress.d.ts +56 -0
- package/lib/progress.d.ts.map +1 -0
- package/lib/progress.js +25 -0
- package/lib/progress.js.map +1 -0
- package/lib/range.d.ts +7 -0
- package/lib/range.d.ts.map +1 -0
- package/lib/range.js +28 -0
- package/lib/range.js.map +1 -0
- package/lib/reference.d.ts +35 -0
- package/lib/reference.d.ts.map +1 -0
- package/lib/reference.js +122 -0
- package/lib/reference.js.map +1 -0
- package/lib/reporter.d.ts +16 -0
- package/lib/reporter.d.ts.map +1 -0
- package/lib/reporter.js +66 -0
- package/lib/reporter.js.map +1 -0
- package/lib/sequence.d.ts +20 -0
- package/lib/sequence.d.ts.map +1 -0
- package/lib/sequence.js +17 -0
- package/lib/sequence.js.map +1 -0
- package/lib/storage.d.ts +64 -0
- package/lib/storage.d.ts.map +1 -0
- package/lib/storage.js +70 -0
- package/lib/storage.js.map +1 -0
- package/lib/task-definition.d.ts +45 -0
- package/lib/task-definition.d.ts.map +1 -0
- package/lib/task-definition.js +130 -0
- package/lib/task-definition.js.map +1 -0
- package/lib/theme.d.ts +5 -0
- package/lib/theme.d.ts.map +1 -0
- package/lib/theme.js +8 -0
- package/lib/theme.js.map +1 -0
- package/lib/types/accessibility.d.ts +5 -0
- package/lib/types/accessibility.d.ts.map +1 -0
- package/lib/types/accessibility.js +3 -0
- package/lib/types/accessibility.js.map +1 -0
- package/lib/types/application.d.ts +13 -0
- package/lib/types/application.d.ts.map +1 -0
- package/lib/types/application.js +5 -0
- package/lib/types/application.js.map +1 -0
- package/lib/types/authentication.d.ts +90 -0
- package/lib/types/authentication.d.ts.map +1 -0
- package/lib/types/authentication.js +8 -0
- package/lib/types/authentication.js.map +1 -0
- package/lib/types/common.d.ts +10 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/common.js +6 -0
- package/lib/types/common.js.map +1 -0
- package/lib/types/dnd.d.ts +8 -0
- package/lib/types/dnd.d.ts.map +1 -0
- package/lib/types/dnd.js +9 -0
- package/lib/types/dnd.js.map +1 -0
- package/lib/types/editor.d.ts +157 -0
- package/lib/types/editor.d.ts.map +1 -0
- package/lib/types/editor.js +148 -0
- package/lib/types/editor.js.map +1 -0
- package/lib/types/extension.d.ts +73 -0
- package/lib/types/extension.d.ts.map +1 -0
- package/lib/types/extension.js +28 -0
- package/lib/types/extension.js.map +1 -0
- package/lib/types/file-watch.d.ts +70 -0
- package/lib/types/file-watch.d.ts.map +1 -0
- package/lib/types/file-watch.js +72 -0
- package/lib/types/file-watch.js.map +1 -0
- package/lib/types/file.d.ts +219 -0
- package/lib/types/file.d.ts.map +1 -0
- package/lib/types/file.js +51 -0
- package/lib/types/file.js.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +16 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/markers/index.d.ts +3 -0
- package/lib/types/markers/index.d.ts.map +1 -0
- package/lib/types/markers/index.js +6 -0
- package/lib/types/markers/index.js.map +1 -0
- package/lib/types/markers/markers-manager.d.ts +120 -0
- package/lib/types/markers/markers-manager.d.ts.map +1 -0
- package/lib/types/markers/markers-manager.js +307 -0
- package/lib/types/markers/markers-manager.js.map +1 -0
- package/lib/types/markers/markers.d.ts +76 -0
- package/lib/types/markers/markers.d.ts.map +1 -0
- package/lib/types/markers/markers.js +76 -0
- package/lib/types/markers/markers.js.map +1 -0
- package/lib/types/message.d.ts +7 -0
- package/lib/types/message.d.ts.map +1 -0
- package/lib/types/message.js +11 -0
- package/lib/types/message.js.map +1 -0
- package/lib/types/reporter.d.ts +83 -0
- package/lib/types/reporter.d.ts.map +1 -0
- package/lib/types/reporter.js +63 -0
- package/lib/types/reporter.js.map +1 -0
- package/lib/types/string.d.ts +4 -0
- package/lib/types/string.d.ts.map +1 -0
- package/lib/types/string.js +3 -0
- package/lib/types/string.js.map +1 -0
- package/lib/uint.d.ts +32 -0
- package/lib/uint.d.ts.map +1 -0
- package/lib/uint.js +28 -0
- package/lib/uint.js.map +1 -0
- package/lib/uri.d.ts +94 -0
- package/lib/uri.d.ts.map +1 -0
- package/lib/uri.js +226 -0
- package/lib/uri.js.map +1 -0
- package/lib/utils/ansi.d.ts +5 -0
- package/lib/utils/ansi.d.ts.map +1 -0
- package/lib/utils/ansi.js +16 -0
- package/lib/utils/ansi.js.map +1 -0
- package/lib/utils/arrays.d.ts +62 -0
- package/lib/utils/arrays.d.ts.map +1 -0
- package/lib/utils/arrays.js +254 -0
- package/lib/utils/arrays.js.map +1 -0
- package/lib/utils/buffer.d.ts +36 -0
- package/lib/utils/buffer.d.ts.map +1 -0
- package/lib/utils/buffer.js +178 -0
- package/lib/utils/buffer.js.map +1 -0
- package/lib/utils/comparers.d.ts +7 -0
- package/lib/utils/comparers.d.ts.map +1 -0
- package/lib/utils/comparers.js +135 -0
- package/lib/utils/comparers.js.map +1 -0
- package/lib/utils/decorators.d.ts +13 -0
- package/lib/utils/decorators.d.ts.map +1 -0
- package/lib/utils/decorators.js +150 -0
- package/lib/utils/decorators.js.map +1 -0
- package/lib/utils/file-uri.d.ts +30 -0
- package/lib/utils/file-uri.d.ts.map +1 -0
- package/lib/utils/file-uri.js +62 -0
- package/lib/utils/file-uri.js.map +1 -0
- package/lib/utils/glob.d.ts +46 -0
- package/lib/utils/glob.d.ts.map +1 -0
- package/lib/utils/glob.js +546 -0
- package/lib/utils/glob.js.map +1 -0
- package/lib/utils/index.d.ts +14 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +17 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/ipc.d.ts +2 -0
- package/lib/utils/ipc.d.ts.map +1 -0
- package/lib/utils/ipc.js +21 -0
- package/lib/utils/ipc.js.map +1 -0
- package/lib/utils/json.d.ts +78 -0
- package/lib/utils/json.d.ts.map +1 -0
- package/lib/utils/json.js +190 -0
- package/lib/utils/json.js.map +1 -0
- package/lib/utils/marshalling.d.ts +7 -0
- package/lib/utils/marshalling.d.ts.map +1 -0
- package/lib/utils/marshalling.js +57 -0
- package/lib/utils/marshalling.js.map +1 -0
- package/lib/utils/objects.d.ts +6 -0
- package/lib/utils/objects.d.ts.map +1 -0
- package/lib/utils/objects.js +103 -0
- package/lib/utils/objects.js.map +1 -0
- package/lib/utils/os.d.ts +42 -0
- package/lib/utils/os.d.ts.map +1 -0
- package/lib/utils/os.js +94 -0
- package/lib/utils/os.js.map +1 -0
- package/lib/utils/paths.d.ts +35 -0
- package/lib/utils/paths.d.ts.map +1 -0
- package/lib/utils/paths.js +318 -0
- package/lib/utils/paths.js.map +1 -0
- package/lib/utils/promise-util.d.ts +10 -0
- package/lib/utils/promise-util.d.ts.map +1 -0
- package/lib/utils/promise-util.js +17 -0
- package/lib/utils/promise-util.js.map +1 -0
- package/lib/utils/strings.d.ts +177 -0
- package/lib/utils/strings.d.ts.map +1 -0
- package/lib/utils/strings.js +837 -0
- package/lib/utils/strings.js.map +1 -0
- package/lib/utils/types.d.ts +65 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +194 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/uuid.d.ts +2 -0
- package/lib/uuid.d.ts.map +1 -0
- package/lib/uuid.js +10 -0
- package/lib/uuid.js.map +1 -0
- package/package.json +30 -0
package/lib/arrays.js
ADDED
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
// Some code copued and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/base/common/arrays.ts
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.asArray = exports.mapArrayOrNot = exports.find = exports.pushToEnd = exports.pushToStart = exports.shuffle = exports.arrayInsert = exports.insert = exports.index = exports.fill = exports.range = exports.flatten = exports.commonPrefixLength = exports.first = exports.firstIndex = exports.lastIndex = exports.uniqueFilter = exports.distinctES6 = exports.distinct = exports.isNonEmptyArray = exports.isFalsyOrEmpty = exports.move = exports.coalesceInPlace = exports.coalesce = exports.topAsync = exports.top = exports.delta = exports.sortedDiff = exports.groupBy = exports.mergeSort = exports.findFirstInSorted = exports.binarySearch = exports.equals = exports.tail2 = exports.tail = void 0;
|
|
9
|
+
const errors_1 = require("./errors");
|
|
10
|
+
/**
|
|
11
|
+
* Returns the last element of an array.
|
|
12
|
+
* @param array The array.
|
|
13
|
+
* @param n Which element from the end (default is zero).
|
|
14
|
+
*/
|
|
15
|
+
function tail(array, n = 0) {
|
|
16
|
+
return array[array.length - (1 + n)];
|
|
17
|
+
}
|
|
18
|
+
exports.tail = tail;
|
|
19
|
+
function tail2(arr) {
|
|
20
|
+
if (arr.length === 0) {
|
|
21
|
+
throw new Error('Invalid tail call');
|
|
22
|
+
}
|
|
23
|
+
return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];
|
|
24
|
+
}
|
|
25
|
+
exports.tail2 = tail2;
|
|
26
|
+
function equals(one, other, itemEquals = (a, b) => a === b) {
|
|
27
|
+
if (one === other) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (!one || !other) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (one.length !== other.length) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
for (let i = 0, len = one.length; i < len; i++) {
|
|
37
|
+
if (!itemEquals(one[i], other[i])) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
exports.equals = equals;
|
|
44
|
+
function binarySearch(array, key, comparator) {
|
|
45
|
+
let low = 0, high = array.length - 1;
|
|
46
|
+
while (low <= high) {
|
|
47
|
+
const mid = ((low + high) / 2) | 0;
|
|
48
|
+
const comp = comparator(array[mid], key);
|
|
49
|
+
if (comp < 0) {
|
|
50
|
+
low = mid + 1;
|
|
51
|
+
}
|
|
52
|
+
else if (comp > 0) {
|
|
53
|
+
high = mid - 1;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return mid;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return -(low + 1);
|
|
60
|
+
}
|
|
61
|
+
exports.binarySearch = binarySearch;
|
|
62
|
+
/**
|
|
63
|
+
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
|
|
64
|
+
* are located before all elements where p(x) is true.
|
|
65
|
+
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
|
|
66
|
+
*/
|
|
67
|
+
function findFirstInSorted(array, p) {
|
|
68
|
+
let low = 0, high = array.length;
|
|
69
|
+
if (high === 0) {
|
|
70
|
+
return 0; // no children
|
|
71
|
+
}
|
|
72
|
+
while (low < high) {
|
|
73
|
+
const mid = Math.floor((low + high) / 2);
|
|
74
|
+
if (p(array[mid])) {
|
|
75
|
+
high = mid;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
low = mid + 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return low;
|
|
82
|
+
}
|
|
83
|
+
exports.findFirstInSorted = findFirstInSorted;
|
|
84
|
+
/**
|
|
85
|
+
* Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`
|
|
86
|
+
* so only use this when actually needing stable sort.
|
|
87
|
+
*/
|
|
88
|
+
function mergeSort(data, compare) {
|
|
89
|
+
_sort(data, compare, 0, data.length - 1, []);
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
92
|
+
exports.mergeSort = mergeSort;
|
|
93
|
+
function _merge(a, compare, lo, mid, hi, aux) {
|
|
94
|
+
let leftIdx = lo, rightIdx = mid + 1;
|
|
95
|
+
for (let i = lo; i <= hi; i++) {
|
|
96
|
+
aux[i] = a[i];
|
|
97
|
+
}
|
|
98
|
+
for (let i = lo; i <= hi; i++) {
|
|
99
|
+
if (leftIdx > mid) {
|
|
100
|
+
// left side consumed
|
|
101
|
+
a[i] = aux[rightIdx++];
|
|
102
|
+
}
|
|
103
|
+
else if (rightIdx > hi) {
|
|
104
|
+
// right side consumed
|
|
105
|
+
a[i] = aux[leftIdx++];
|
|
106
|
+
}
|
|
107
|
+
else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {
|
|
108
|
+
// right element is less -> comes first
|
|
109
|
+
a[i] = aux[rightIdx++];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// left element comes first (less or equal)
|
|
113
|
+
a[i] = aux[leftIdx++];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function _sort(a, compare, lo, hi, aux) {
|
|
118
|
+
if (hi <= lo) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const mid = lo + ((hi - lo) / 2) | 0;
|
|
122
|
+
_sort(a, compare, lo, mid, aux);
|
|
123
|
+
_sort(a, compare, mid + 1, hi, aux);
|
|
124
|
+
if (compare(a[mid], a[mid + 1]) <= 0) {
|
|
125
|
+
// left and right are sorted and if the last-left element is less
|
|
126
|
+
// or equals than the first-right element there is nothing else
|
|
127
|
+
// to do
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
_merge(a, compare, lo, mid, hi, aux);
|
|
131
|
+
}
|
|
132
|
+
function groupBy(data, compare) {
|
|
133
|
+
const result = [];
|
|
134
|
+
let currentGroup = undefined;
|
|
135
|
+
for (const element of mergeSort(data.slice(0), compare)) {
|
|
136
|
+
if (!currentGroup || compare(currentGroup[0], element) !== 0) {
|
|
137
|
+
currentGroup = [element];
|
|
138
|
+
result.push(currentGroup);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
currentGroup.push(element);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
exports.groupBy = groupBy;
|
|
147
|
+
/**
|
|
148
|
+
* Diffs two *sorted* arrays and computes the splices which apply the diff.
|
|
149
|
+
*/
|
|
150
|
+
function sortedDiff(before, after, compare) {
|
|
151
|
+
const result = [];
|
|
152
|
+
function pushSplice(start, deleteCount, toInsert) {
|
|
153
|
+
if (deleteCount === 0 && toInsert.length === 0) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const latest = result[result.length - 1];
|
|
157
|
+
if (latest && latest.start + latest.deleteCount === start) {
|
|
158
|
+
latest.deleteCount += deleteCount;
|
|
159
|
+
latest.toInsert.push(...toInsert);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
result.push({ start, deleteCount, toInsert });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
let beforeIdx = 0;
|
|
166
|
+
let afterIdx = 0;
|
|
167
|
+
while (true) {
|
|
168
|
+
if (beforeIdx === before.length) {
|
|
169
|
+
pushSplice(beforeIdx, 0, after.slice(afterIdx));
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
if (afterIdx === after.length) {
|
|
173
|
+
pushSplice(beforeIdx, before.length - beforeIdx, []);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
const beforeElement = before[beforeIdx];
|
|
177
|
+
const afterElement = after[afterIdx];
|
|
178
|
+
const n = compare(beforeElement, afterElement);
|
|
179
|
+
if (n === 0) {
|
|
180
|
+
// equal
|
|
181
|
+
beforeIdx += 1;
|
|
182
|
+
afterIdx += 1;
|
|
183
|
+
}
|
|
184
|
+
else if (n < 0) {
|
|
185
|
+
// beforeElement is smaller -> before element removed
|
|
186
|
+
pushSplice(beforeIdx, 1, []);
|
|
187
|
+
beforeIdx += 1;
|
|
188
|
+
}
|
|
189
|
+
else if (n > 0) {
|
|
190
|
+
// beforeElement is greater -> after element added
|
|
191
|
+
pushSplice(beforeIdx, 0, [afterElement]);
|
|
192
|
+
afterIdx += 1;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
exports.sortedDiff = sortedDiff;
|
|
198
|
+
/**
|
|
199
|
+
* Takes two *sorted* arrays and computes their delta (removed, added elements).
|
|
200
|
+
* Finishes in `Math.min(before.length, after.length)` steps.
|
|
201
|
+
*/
|
|
202
|
+
function delta(before, after, compare) {
|
|
203
|
+
const splices = sortedDiff(before, after, compare);
|
|
204
|
+
const removed = [];
|
|
205
|
+
const added = [];
|
|
206
|
+
for (const splice of splices) {
|
|
207
|
+
removed.push(...before.slice(splice.start, splice.start + splice.deleteCount));
|
|
208
|
+
added.push(...splice.toInsert);
|
|
209
|
+
}
|
|
210
|
+
return { removed, added };
|
|
211
|
+
}
|
|
212
|
+
exports.delta = delta;
|
|
213
|
+
/**
|
|
214
|
+
* Returns the top N elements from the array.
|
|
215
|
+
*
|
|
216
|
+
* Faster than sorting the entire array when the array is a lot larger than N.
|
|
217
|
+
*
|
|
218
|
+
* @param array The unsorted array.
|
|
219
|
+
* @param compare A sort function for the elements.
|
|
220
|
+
* @param n The number of elements to return.
|
|
221
|
+
* @return The first n elemnts from array when sorted with compare.
|
|
222
|
+
*/
|
|
223
|
+
function top(array, compare, n) {
|
|
224
|
+
if (n === 0) {
|
|
225
|
+
return [];
|
|
226
|
+
}
|
|
227
|
+
const result = array.slice(0, n).sort(compare);
|
|
228
|
+
topStep(array, compare, result, n, array.length);
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
exports.top = top;
|
|
232
|
+
/**
|
|
233
|
+
* Asynchronous variant of `top()` allowing for splitting up work in batches between which the event loop can run.
|
|
234
|
+
*
|
|
235
|
+
* Returns the top N elements from the array.
|
|
236
|
+
*
|
|
237
|
+
* Faster than sorting the entire array when the array is a lot larger than N.
|
|
238
|
+
*
|
|
239
|
+
* @param array The unsorted array.
|
|
240
|
+
* @param compare A sort function for the elements.
|
|
241
|
+
* @param n The number of elements to return.
|
|
242
|
+
* @param batch The number of elements to examine before yielding to the event loop.
|
|
243
|
+
* @return The first n elemnts from array when sorted with compare.
|
|
244
|
+
*/
|
|
245
|
+
function topAsync(array, compare, n, batch, token) {
|
|
246
|
+
if (n === 0) {
|
|
247
|
+
return Promise.resolve([]);
|
|
248
|
+
}
|
|
249
|
+
return new Promise((resolve, reject) => {
|
|
250
|
+
(async () => {
|
|
251
|
+
const o = array.length;
|
|
252
|
+
const result = array.slice(0, n).sort(compare);
|
|
253
|
+
for (let i = n, m = Math.min(n + batch, o); i < o; i = m, m = Math.min(m + batch, o)) {
|
|
254
|
+
if (i > n) {
|
|
255
|
+
await new Promise(resolve => setTimeout(resolve)); // nextTick() would starve I/O.
|
|
256
|
+
}
|
|
257
|
+
if (token && token.isCancellationRequested) {
|
|
258
|
+
throw (0, errors_1.canceled)();
|
|
259
|
+
}
|
|
260
|
+
topStep(array, compare, result, i, m);
|
|
261
|
+
}
|
|
262
|
+
return result;
|
|
263
|
+
})()
|
|
264
|
+
.then(resolve, reject);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
exports.topAsync = topAsync;
|
|
268
|
+
function topStep(array, compare, result, i, m) {
|
|
269
|
+
for (const n = result.length; i < m; i++) {
|
|
270
|
+
const element = array[i];
|
|
271
|
+
if (compare(element, result[n - 1]) < 0) {
|
|
272
|
+
result.pop();
|
|
273
|
+
const j = findFirstInSorted(result, e => compare(element, e) < 0);
|
|
274
|
+
result.splice(j, 0, element);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @returns a new array with all falsy values removed. The original array IS NOT modified.
|
|
280
|
+
*/
|
|
281
|
+
function coalesce(array) {
|
|
282
|
+
if (!array) {
|
|
283
|
+
return array;
|
|
284
|
+
}
|
|
285
|
+
return array.filter(e => !!e);
|
|
286
|
+
}
|
|
287
|
+
exports.coalesce = coalesce;
|
|
288
|
+
/**
|
|
289
|
+
* Remove all falsey values from `array`. The original array IS modified.
|
|
290
|
+
*/
|
|
291
|
+
function coalesceInPlace(array) {
|
|
292
|
+
if (!array) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
let to = 0;
|
|
296
|
+
for (let i = 0; i < array.length; i++) {
|
|
297
|
+
if (!!array[i]) {
|
|
298
|
+
array[to] = array[i];
|
|
299
|
+
to += 1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
array.length = to;
|
|
303
|
+
}
|
|
304
|
+
exports.coalesceInPlace = coalesceInPlace;
|
|
305
|
+
/**
|
|
306
|
+
* Moves the element in the array for the provided positions.
|
|
307
|
+
*/
|
|
308
|
+
function move(array, from, to) {
|
|
309
|
+
array.splice(to, 0, array.splice(from, 1)[0]);
|
|
310
|
+
}
|
|
311
|
+
exports.move = move;
|
|
312
|
+
/**
|
|
313
|
+
* @returns false if the provided object is an array and not empty.
|
|
314
|
+
*/
|
|
315
|
+
function isFalsyOrEmpty(obj) {
|
|
316
|
+
return !Array.isArray(obj) || obj.length === 0;
|
|
317
|
+
}
|
|
318
|
+
exports.isFalsyOrEmpty = isFalsyOrEmpty;
|
|
319
|
+
function isNonEmptyArray(obj) {
|
|
320
|
+
return Array.isArray(obj) && obj.length > 0;
|
|
321
|
+
}
|
|
322
|
+
exports.isNonEmptyArray = isNonEmptyArray;
|
|
323
|
+
/**
|
|
324
|
+
* Removes duplicates from the given array. The optional keyFn allows to specify
|
|
325
|
+
* how elements are checked for equalness by returning a unique string for each.
|
|
326
|
+
*/
|
|
327
|
+
function distinct(array, keyFn) {
|
|
328
|
+
if (!keyFn) {
|
|
329
|
+
return array.filter((element, position) => {
|
|
330
|
+
return array.indexOf(element) === position;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
const seen = Object.create(null);
|
|
334
|
+
return array.filter((elem) => {
|
|
335
|
+
const key = keyFn(elem);
|
|
336
|
+
if (seen[key]) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
seen[key] = true;
|
|
340
|
+
return true;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
exports.distinct = distinct;
|
|
344
|
+
function distinctES6(array) {
|
|
345
|
+
const seen = new Set();
|
|
346
|
+
return array.filter(element => {
|
|
347
|
+
if (seen.has(element)) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
seen.add(element);
|
|
351
|
+
return true;
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
exports.distinctES6 = distinctES6;
|
|
355
|
+
function uniqueFilter(keyFn) {
|
|
356
|
+
const seen = Object.create(null);
|
|
357
|
+
return element => {
|
|
358
|
+
const key = keyFn(element);
|
|
359
|
+
if (seen[key]) {
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
seen[key] = true;
|
|
363
|
+
return true;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
exports.uniqueFilter = uniqueFilter;
|
|
367
|
+
function lastIndex(array, fn) {
|
|
368
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
369
|
+
const element = array[i];
|
|
370
|
+
if (fn(element)) {
|
|
371
|
+
return i;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return -1;
|
|
375
|
+
}
|
|
376
|
+
exports.lastIndex = lastIndex;
|
|
377
|
+
function firstIndex(array, fn) {
|
|
378
|
+
for (let i = 0; i < array.length; i++) {
|
|
379
|
+
const element = array[i];
|
|
380
|
+
if (fn(element)) {
|
|
381
|
+
return i;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return -1;
|
|
385
|
+
}
|
|
386
|
+
exports.firstIndex = firstIndex;
|
|
387
|
+
function first(array, fn, notFoundValue = undefined) {
|
|
388
|
+
const index = firstIndex(array, fn);
|
|
389
|
+
return index < 0 ? notFoundValue : array[index];
|
|
390
|
+
}
|
|
391
|
+
exports.first = first;
|
|
392
|
+
function commonPrefixLength(one, other, equals = (a, b) => a === b) {
|
|
393
|
+
let result = 0;
|
|
394
|
+
for (let i = 0, len = Math.min(one.length, other.length); i < len && equals(one[i], other[i]); i++) {
|
|
395
|
+
result++;
|
|
396
|
+
}
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
exports.commonPrefixLength = commonPrefixLength;
|
|
400
|
+
function flatten(arr) {
|
|
401
|
+
return [].concat(...arr);
|
|
402
|
+
}
|
|
403
|
+
exports.flatten = flatten;
|
|
404
|
+
function range(arg, to) {
|
|
405
|
+
let from = typeof to === 'number' ? arg : 0;
|
|
406
|
+
if (typeof to === 'number') {
|
|
407
|
+
from = arg;
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
from = 0;
|
|
411
|
+
to = arg;
|
|
412
|
+
}
|
|
413
|
+
const result = [];
|
|
414
|
+
if (from <= to) {
|
|
415
|
+
for (let i = from; i < to; i++) {
|
|
416
|
+
result.push(i);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
for (let i = from; i > to; i--) {
|
|
421
|
+
result.push(i);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return result;
|
|
425
|
+
}
|
|
426
|
+
exports.range = range;
|
|
427
|
+
function fill(num, value, arr = []) {
|
|
428
|
+
for (let i = 0; i < num; i++) {
|
|
429
|
+
arr[i] = value;
|
|
430
|
+
}
|
|
431
|
+
return arr;
|
|
432
|
+
}
|
|
433
|
+
exports.fill = fill;
|
|
434
|
+
function index(array, indexer, merger = t => t) {
|
|
435
|
+
return array.reduce((r, t) => {
|
|
436
|
+
const key = indexer(t);
|
|
437
|
+
r[key] = merger(t, r[key]);
|
|
438
|
+
return r;
|
|
439
|
+
}, Object.create(null));
|
|
440
|
+
}
|
|
441
|
+
exports.index = index;
|
|
442
|
+
/**
|
|
443
|
+
* Inserts an element into an array. Returns a function which, when
|
|
444
|
+
* called, will remove that element from the array.
|
|
445
|
+
*/
|
|
446
|
+
function insert(array, element) {
|
|
447
|
+
array.push(element);
|
|
448
|
+
return () => {
|
|
449
|
+
const index = array.indexOf(element);
|
|
450
|
+
if (index > -1) {
|
|
451
|
+
array.splice(index, 1);
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
exports.insert = insert;
|
|
456
|
+
/**
|
|
457
|
+
* Insert `insertArr` inside `target` at `insertIndex`.
|
|
458
|
+
* Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array
|
|
459
|
+
*/
|
|
460
|
+
function arrayInsert(target, insertIndex, insertArr) {
|
|
461
|
+
const before = target.slice(0, insertIndex);
|
|
462
|
+
const after = target.slice(insertIndex);
|
|
463
|
+
return before.concat(insertArr, after);
|
|
464
|
+
}
|
|
465
|
+
exports.arrayInsert = arrayInsert;
|
|
466
|
+
/**
|
|
467
|
+
* Uses Fisher-Yates shuffle to shuffle the given array
|
|
468
|
+
*/
|
|
469
|
+
function shuffle(array, _seed) {
|
|
470
|
+
let rand;
|
|
471
|
+
if (typeof _seed === 'number') {
|
|
472
|
+
let seed = _seed;
|
|
473
|
+
// Seeded random number generator in JS. Modified from:
|
|
474
|
+
// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript
|
|
475
|
+
rand = () => {
|
|
476
|
+
const x = Math.sin(seed++) * 179426549; // throw away most significant digits and reduce any potential bias
|
|
477
|
+
return x - Math.floor(x);
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
rand = Math.random;
|
|
482
|
+
}
|
|
483
|
+
for (let i = array.length - 1; i > 0; i -= 1) {
|
|
484
|
+
const j = Math.floor(rand() * (i + 1));
|
|
485
|
+
const temp = array[i];
|
|
486
|
+
array[i] = array[j];
|
|
487
|
+
array[j] = temp;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
exports.shuffle = shuffle;
|
|
491
|
+
/**
|
|
492
|
+
* Pushes an element to the start of the array, if found.
|
|
493
|
+
*/
|
|
494
|
+
function pushToStart(arr, value) {
|
|
495
|
+
const index = arr.indexOf(value);
|
|
496
|
+
if (index > -1) {
|
|
497
|
+
arr.splice(index, 1);
|
|
498
|
+
arr.unshift(value);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
exports.pushToStart = pushToStart;
|
|
502
|
+
/**
|
|
503
|
+
* Pushes an element to the end of the array, if found.
|
|
504
|
+
*/
|
|
505
|
+
function pushToEnd(arr, value) {
|
|
506
|
+
const index = arr.indexOf(value);
|
|
507
|
+
if (index > -1) {
|
|
508
|
+
arr.splice(index, 1);
|
|
509
|
+
arr.push(value);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
exports.pushToEnd = pushToEnd;
|
|
513
|
+
function find(arr, predicate) {
|
|
514
|
+
for (let i = 0; i < arr.length; i++) {
|
|
515
|
+
const element = arr[i];
|
|
516
|
+
if (predicate(element, i, arr)) {
|
|
517
|
+
return element;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
522
|
+
exports.find = find;
|
|
523
|
+
function mapArrayOrNot(items, fn) {
|
|
524
|
+
return Array.isArray(items) ?
|
|
525
|
+
items.map(fn) :
|
|
526
|
+
fn(items);
|
|
527
|
+
}
|
|
528
|
+
exports.mapArrayOrNot = mapArrayOrNot;
|
|
529
|
+
function asArray(x) {
|
|
530
|
+
return Array.isArray(x) ? x : [x];
|
|
531
|
+
}
|
|
532
|
+
exports.asArray = asArray;
|
|
533
|
+
//# sourceMappingURL=arrays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../src/arrays.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,kHAAkH;;;AAGlH,qCAAoC;AAGpC;;;;GAIG;AACH,SAAgB,IAAI,CAAI,KAAmB,EAAE,IAAY,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAFD,oBAEC;AAED,SAAgB,KAAK,CAAI,GAAQ;IAChC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACrC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAND,sBAMC;AAED,SAAgB,MAAM,CAAI,GAAiC,EAAE,KAAmC,EAAE,aAAsC,C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