Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/coriolis/src/Coriolis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class Coriolis extends PostMessageChannel {
initialContent: string,
) {
if (!(target instanceof HTMLElement)) {
throw new TypeError('Excepted to have a HTMLElement object');
throw new TypeError('Expected to have a HTMLElement object');
}

let url;
Expand Down
12 changes: 6 additions & 6 deletions packages/coriolis/src/DataSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import {SerializerBase} from './SerializerBase';
/**
* A class that handles the stringification and parsing of the data that will be sent through PostMessage.
* This has two main differences with JSON.parse/JSON.stringify.
* - It allows loading custom domain serializer that could be loaded dynamically
* - It allows loading custom domain serializers that could be loaded dynamically
* - It excludes from serialization all the property of objects which start with an "_" (underscore)
* This allows having more than javascript primitive to be serialized and also to keep some property to be
* This allows having more than JavaScript primitives to be serialized and also to keep some property to be
* transferred because they shouldn't or they technically can't be transferred. For example, a security
* token might not be transferred or an HTMLElement reference couldn't be technically transferred. In that
* case, it could still be interesting to use it in a store but you never want them to be transferred.
*/
export class DataSerializer {
/**
* Internal array to save all custom serializer we have register
* Internal array to save all custom serializers we have registered
* @type {Map}
*/
private _serializers = new Map<string, SerializerBase>();
Expand Down Expand Up @@ -66,7 +66,7 @@ export class DataSerializer {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const myThis = this; // can't use closure since we need the JSON.stringify this
return JSON.stringify(obj, function (k, v) {
// typeof => eject number and things that doesn't have match function
// typeof => reject number and things that don't have match function
if (k !== '_serializerKey' && typeof k === 'string' && k.match(/^_/)) {
return undefined;
}
Expand All @@ -77,7 +77,7 @@ export class DataSerializer {
}

/**
* Call all custom serializer
* Call all custom serializers
* @param {Object} obj Object to serialize
* @param {any} [fallback] Default value if we can't find a dataSerializer for it
* @return {Object|any} The value after the custom serializer or fallback
Expand Down Expand Up @@ -112,7 +112,7 @@ export class DataSerializer {
}

/**
* Call all custom serializer
* Call all custom serializers
* @param {any} obj The current parse value
* @return {any} The value after the custom parse or the input obj
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/coriolis/src/ModuleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ModuleLoader
/**
* Add a module
* @param {string} name The name of the module
* @param {Class} Module A module class to instanciate
* @param {Class} Module A module class to instantiate
* @param {Object} config The configuration to pass to the module
* @param {Boolean} alias If the module is directly available in postMessage class
* @return {boolean} return if the module is correctly added
Expand Down
4 changes: 2 additions & 2 deletions packages/coriolis/src/module/LoaderUtilModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {ModuleBase} from '../ModuleBase';
*/
export class LoaderUtilModule extends ModuleBase {
/**
* Internal array to save all custom serializer we have register
* Internal array to save all custom serializers we have registered
* @type {Map}
*/
private _remoteModule = new Set<string>();
Expand Down Expand Up @@ -88,7 +88,7 @@ export class LoaderUtilModule extends ModuleBase {

if (!this._moduleAreSame()) {
console.error(
'Module are not in sync between the two frames.',
'Modules are not in sync between the two frames.',
this.loaded(),
);
}
Expand Down
14 changes: 7 additions & 7 deletions packages/coriolis/src/module/PluginModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class PluginModule extends ModuleBase {
}

/**
* Register a set of plugin and solve the dependancy
* Register a set of plugin and solve the dependency
* @param {Object<Class>} plugins Class of each plugins with their respective names in keys
* @return {void}
*/
Expand All @@ -64,8 +64,8 @@ export class PluginModule extends ModuleBase {
/**
* Add one plugin with his name and his class
* @param {String} name The plugin name/key
* @param {CLass} plugin Class of the plugin to instanciate
* @return {Boolean} If the plugin was added and instanciate or false if it's already present
* @param {Class} plugin Class of the plugin to instantiate
* @return {Boolean} If the plugin was added and instantiated or false if it's already present
*/
add(name: string, plugin: Object) {
if (this._plugins.has(name)) {
Expand All @@ -77,7 +77,7 @@ export class PluginModule extends ModuleBase {
}

/**
* Get the in stance of a plugin
* Get the instance of a plugin
* @param {String} name The name of the plugin to get
* @return {Object} The instance of the plugin
*/
Expand All @@ -95,9 +95,9 @@ export class PluginModule extends ModuleBase {
}

/**
* Instanciate the plugin (with custom plugin factory if it was registered)
* @param {String} name Plugin name/key to instanciate
* @return {Boolean} If the plugin was instanciate
* Instantiate the plugin (with custom plugin factory if it was registered)
* @param {String} name Plugin name/key to instantiate
* @return {Boolean} If the plugin was instantiated
*/
private _init(name: string) {
const plugin = this._plugins.get(name);
Expand Down